We are using Maestro for testing. Maestro is a tool for running tests on real devices.
You need to install Maestro CLI following the instructions here.
Run maestro studio
in the terminal. This will open the Maestro studio in your browser. You can use the studio to write your tests in a more interactive and visual way.
You can write your tests in the Maestro studio or in a YAML file. See the Maestro documentation for more info on the commands you can use.
Note 1: Some components do not support testID as a prop. In this case you can use the label to identify it. For example, for the Logout test, an Alert element does not support testID on its buttons, so we use the label 'I am sure' to identify it. Try to avoid this as much as possible as if the label changes, the test will fail.
Note 2: If your screen has two elements with the same id or label you are using as a selector, it will fail. Try to use a more specific selector or make sure your labels are unique.
You can run tests in the terminal with the following command:
maestro test ./tests/YOUR_TEST_FILE.yml
You can also run the entire test suite with the following command:
maestro test ./tests/
Make sure to properly the config.yml
file, which is where we define the suite of tests to run.