fenix/docs/l10nScreenshotsTests.md

2.6 KiB

Screenshtos Tests

We are using screengrab which works with fastlane to automate the process of capturing screenshots. All the l10n screenshots are generated through the ui tests. These particular tests run as part of the screenshots package (app/src/androidTest/mozilla/fenix/ui/screenshots)

Run tests locally from Android Studio

Navigate to app/src/androidTest/mozilla/fenix/ui/screenshots, once in that directory, run the full test suite or a specific test by clicking on the > button.

By running them manually you can check whether the test works or not but screenshots will not be saved.

Run tests locally from command line

  1. Install the gem: sudo gem install screengrab

  2. From command line run: fastlane screengrab --test_instrumentation_runner "androidx.test.runner.AndroidJUnitRunner"

The package configuration, apk paths as well as the locales are set in Screengrab file. In case there is a change there the file has to be modified accordingly. Before launching that command, there has to be an emulator running.

Once the build and tests finsish, screenshots will be saved in the root directory: fastlane/metadata/android If there is a failure and screenshots are not saved, it may be necessary to create these folders manually first.

Run tests on CI

Currently there is a cron job scheduled weekly to run these tests on Monday. It is set here. And the test results can be seen in treeherder, see previous link as an example.

TBD

So far, the tests run and the results are checked to be sure these tests work but the screenshots are not taken/saved on CI. That could be done in the future if there is a request from l10n team or any team interested in that. See how it is done on iOS which integrates Taskcluster as job/task orchestrator, Bitrise to run the tests to take the screenshots and Taskcluster again to store and publicly share the screenshots.

For any doubt or comment about these tests, please contact Mobile Test Engineering team, slack: #mobile-testeng