2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-03 23:15:31 +00:00

[fenix] No bug - Update l10nScreenshotsTests doc

This commit is contained in:
isabelrios 2021-12-20 11:47:13 +01:00 committed by mergify[bot]
parent e88bda15df
commit b19c5eda0b

View File

@ -2,14 +2,30 @@
We are using [`screengrab`](https://docs.fastlane.tools/getting-started/android/screenshots/) 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`)
### Steps to Run / Build
### 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"`
Screenshots will be saved in the root directory: `fastlane/metadata/android`
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).
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.
Currently screenshots are uploaded to [`gcloud`](https://storage.googleapis.com/l10n-fenix/2019-06-21/screenshots.html) once they are generated manually by running the previous command line.
In the future this process will be automated too and documented here.
## Run tests on CI
Currently there is a cron job scheduled weekly to run these tests on Monday.
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.
So far only test 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.
For any doubt or comment about these tests, please contact Mobile Test Engineering team, slack: #mobile-testeng