Quickly test your app with Firebase Test Lab using the Firebase console.
In this article:
Firebase Test Lab for Android lets you run the following types of tests:
- Espresso, Robotium or UI Automator 2.0 instrumentation tests written specifically to exercise your app.
- Robo test, which analyzes the structure of your app's user interface and then explores it automatically by simulating user activities.
Before you get started, you need to enable billing for your project. If you don't have an active billing account, add oneand then connect your project to that billing account. You will need ownership or edit permissions in your project.
To run an instrumentation test
- On the Firebase console navigation bar, click Test Lab, and then click Get Started -> Run an Instrumentation test.
- Click Browse, and then browse to your app APK and test APK before clicking Continue.
- Define your test matrix by selecting which devices, Android API levels, screen orientations and locales you want to test your app against. You can select only those device and Android API level combinations that you want to target for testing.
- (Optional) Click Show advanced options to change the Test timeout that determines the maximum duration of each test execution.
- Click Start <N> Tests, where <N> is the number of valid test configurations from the test matrix that you define on this screen. Each pending test is shown with a blue clock icon while it is waiting to run, and that icon changes to a green check icon when the test has completed.
- After each test has run, click the device listed in the Test Execution column to see test results, including test cases, logs, screenshots and videos.
To run a Robo test
- On the Firebase console navigation bar, click Test Lab, and then click Get Started -> Run a Robo test.
- Click Browse, browse to your app APK, and then click Continue.
- Define your test matrix by selecting which devices, Android API levels, screen orientations and locales you want to test your app against.
- (Optional) Click Show advanced options to change the following options:
- Test timeout determines the maximum duration of each test execution.
- Test account credentials is used to provide credentials for a test account. Note: This feature should never be used with real user accounts.
- Additional fields is used to provide text input for other text fields in your app.
Note: To learn more about Test account credentials and additional fields, see Test account sign-in and predefined text.
- Click Start <N> Tests, where <N> is the number of valid test configurations from the test matrix that you define on this screen. Each pending test is shown with a blue clock icon while it is waiting to run, and that icon changes to a green check when the test has completed.
- After each test has run, click the device listed in the Test Execution column to see test results, including test cases, logs, screenshots and videos.
Create a script to guide Robo test
- Open Android Studio.
- In the main menu, select Tools > Firebase.
- Select Test Lab, and click Record Robo Script and use it to Guide Robo Test.
- Follow the rest of the tutorial steps in the Android Studio.