The App Testing agent is a test case generation, management, and execution agent powered by Gemini in Firebase . You define test goals in natural language, and the agent uses AI to understand and navigate your app, simulate user interactions, and provide detailed test results.
How App Testing agent uses your data
App Testing agent is provided by Gemini in Firebase and is governed under the same terms. See How Gemini in Firebase uses your data for more information about how Gemini in Firebase uses your data.
Before you begin
If you haven't already, register your app with Firebase .
If you aren't using any other Firebase products, you only have to create a project and register your app. You don't need to add any SDKs to your app. However, if you decide to use additional products in the future, be sure to complete all of the steps in Add Firebase using the Firebase console .
When you're ready to distribute a pre-release version of your app to testers, build your APK or AAB, using your normal process, and upload it to App Distribution in the Firebase console . You must sign the APK with your debug key or app signing key.
Create a test case
To run AI-guided tests, the App Testing agent uses your natural language test cases to execute tests against your app.
Each test case is broken down into steps, which will be executed in sequence. Steps allow you to break up your test case into phases, each with their own success criteria. The agent may take many actions during any one step.
To create a test case, open the App Distribution page of the Firebase console and take the following steps:
- On the Test Casestab, click New test case. If you don't want to create your own test case, you can modify or use the provided example test case .
- In the Add test casedialog, give the test case a name. This is used to identify the test, but is ignored by the agent.
- Consider breaking your test into multiple steps, by clicking the Add another stepbutton.
- Give each step a Goalthat describes what the App Testing agent should do during that step.
- (Optional) Add a Hintto provide additional information to help the App Testing agent understand and navigate your app during that step.
- (Optional) Add Success Criteriato help the App Testing agent determine when the step has been successfully completed.
- Click Saveonce you're done customizing your test.
Example test case
The following is an example of how to create a test case using the App Testing agent:
Testing the home page | |
---|---|
Test title |
Home page loads |
Goal |
Load the home page |
Hint |
Navigate past any onboarding screens. Dismiss any popups. Don't sign in. |
Success Criteria |
The main app home page is visible on screen, all images have loaded, and no errors are displayed. |
Run a test
The App Testing agent lets you run AI-guided testsin the console by clicking the Run testsbutton from either the Releases or Test Cases page. This opens the App Testing agent customization screen, where you can choose one or more of your existing test cases for the agent to execute. You can also choose the devices you want to test against, and whether to provide any login credentials.
You can also choose to run a Random crawl testby changing the test type. Random crawl tests use the Automated Tester feature.
You can view the results of your tests from the Releasespage in the App Testing agenttab of a release. The View detailsbutton will open the Test Results dialog and show you any issues, screenshots of the app, and the actions that Gemini took during the test.
Automatically test your builds
To automatically run App Testing agent tests on your new builds, for example from CI/CD pipelines, you can distribute your builds to the agent using App Distribution 's Gradle or fastlane plugins, or the Firebase CLI.
Automatically test your builds with the Firebase CLI
You must specify at least one test device and one test case ID to use the App Testing agent feature. Test case IDs can be found and downloaded on the Test Cases page of the Firebase console. For more information on getting started with the Firebase CLI and different ways to configure your distribution, see Distribute Android apps to testers using the Firebase CLI .
Run the appdistribution:distribute
command to upload your app,
and use the following parameters to configure your distribution to the App
Testing agent feature:
appdistribution:distribute options | |
---|---|
--test-devices
or --test-devices-file
|
The test devices you want to distribute builds to the App Testing agent feature. You can specify the test devices as a semicolon-separated list of test devices: --test-devices: "model=shiba, version=34, locale=en, orientation=portrait;model=b0q, version=33, locale=en, orientation=portrait"
Or, you can specify the path to a plain text file containing a semicolon-separated list of test devices: --test-devices-file: "/path/to/test-devices.txt"
|
--test-username
|
The username for automatic login to be used during tests. |
--test-password
or --test-password-file
|
The password for automatic login to be used during tests. Or, you can specify the path to a plain text file containing a password: --test-password-file: "/path/to/test-password.txt"
|
--test-non-blocking
|
Run tests asynchronously. Visit the Firebase console for the automatic test results. |
--test-case-ids
or --test-case-ids-file
|
A comma-separated list of test case IDs for running AI-powered automated tests: --test-case-ids: "load-app,play-the-first-level"
Or, you can specify the path to a plain text file containing a comma or newline separated list of test case IDs: --test-case-ids-file: "/path/to/test-case-ids.txt"
|