This document tries to describe the state of the test automation on Lockwise iOS
Automated tests are running on BuddyBuild as part of each PR and when there is a new commit on master. There are three schemes containing the different test types.
- Lockbox scheme for unit tests
- uispecs scheme for XCUITests checking the app at User Interface level
- L10nSnapshotsTests for XCUITests in charge of generating the screenshots
For new PRs or new commits on master lockbox and uispecs tests are running. XCUITests are running on both iPhone (8) and iPad (Air2) simulator since they test the UI of the app, closer to what a real user would do, and there are differences that need to be checked depending on the device.
For the Delete feature, before running the test is necessary to add a login via script. These would be the steps needed:
# Check if python is installed
python3 --version
cd scripts/
# Install cryptography
pip3 install PyFxA syncclient cryptography
# Run script to upload a new login (or more by changing the #)
python3 upload_fake_passwordsBB.py 1
These steps run as part as the buddybuild_prebuild.sh
script so that before running the tests in CI the environment is ready and the tests will work as expected.
L10nSnapshots tests will be run in the future as part of the CI but is not defined yet how/how often. While the process is added to the CI, screenshots can be generated locally. The environment is set up once the repo is cloned and built so only these steps will be needed:
- From command line run:
fastlane snapshot
- Screenshots will be saved in
fastlane/screenshots/
folder
If screenshots are not saved, it may be necessary to create that folder locally.
Current locales are defined in fastlane/Snapfile
as well as the scheme to test. This file can be modified to add/remove locales while generating the screenshots.
Once screenshots for each locale are generated, they are stored in drive
. This may change in the future but for now, they live there.