1 # l10n Screenshots Test
4 We are using [`screengrab`](https://docs.fastlane.tools/getting-started/android/screenshots/) which works with fastlane to automate the process of capturing screenshots.
5 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`)
7 ### Run tests locally from Android Studio
8 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.
10 By running them manually you can check whether the test works or not but screenshots will not be saved.
12 ### Run tests locally from command line
14 `sudo gem install screengrab`
16 2. From command line run:
17 `fastlane screengrab --test_instrumentation_runner "androidx.test.runner.AndroidJUnitRunner"`
19 The package configuration, apk paths as well as the locales are set in [Screengrab file](https://github.com/mozilla-mobile/fenix/blob/073fd8939067bc7a367d8db497bcf53fbd24cdd2/fastlane/Screengrabfile#L5).
20 In case there is a change there the file has to be modified accordingly.
21 Before launching that command, there has to be an emulator running.
23 Once the build and tests finsish, screenshots will be saved in the root directory: `fastlane/metadata/android`
24 If there is a failure and screenshots are not saved, it may be necessary to create these folders manually first.
27 Currently there is a cron job scheduled weekly to run these tests on Monday.
28 It is set [here](https://github.com/mozilla-mobile/fenix/blob/5a8a7f549946fc8ad6ccf31f8c9c6bc2180aaed2/.cron.yml#L27). And the test results can be seen in [treeherder](https://treeherder.mozilla.org/jobs?repo=fenix&fromchange=67fb033f1bc8b772b64a1fda410632dd7e59450e&selectedTaskRun=NngGd-kXTtGGDpI9sMl2Bw.0), see previous link as an example.
31 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.
32 See how it is done on [iOS](https://github.com/mozilla-mobile/firefox-ios/wiki/Screenshots-for-Localization) 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.
34 For any doubt or comment about these tests, please contact [Mobile Test Engineering](https://mana.mozilla.org/wiki/display/MTE/Mobile+Test+Engineering) team, slack: [#mobile-testeng](https://mozilla.slack.com/archives/C02KDDS9QM9)