90f4e0b746
Signed-off-by: dab246 <tdvu@linagora.com>
1.4 KiB
1.4 KiB
53. Patrol integration test
Date: 2024-04-10
Status
Accepted
Context
- A need for integration testing for Twake Mail mobile arised.
- The testing tool must be able to handle native UI and webview.
Decision
- Patrol was chosen to write and test Twake Mail.
Consequences
- Developers are now able to integration test Twake Mail
- Set up:
- Run
dart pub global activate patrol_clito enable Patrol CLI - Install ngrok and jq
- Open docker and Android emulator/connect Android device
- Remember to use
dart-defineneccessary for each test command - Test individual test locally by edit
scripts/patrol-local-integration-test-with-docker.sh- Replace
patrol test -vwithpatrol test -v -t path/to/test/file - Run the
scripts/patrol-local-integration-test-with-docker.sh
- Replace
- Test every tests locally by running
scripts/patrol-local-integration-test-with-docker.shscript - Read more about Patrol in Patrol homepage
- Run
Limitations
- Backend docker container is initiated before Patrol tests run, and close after all tests have run. This lead to no data isolation between tests
- Patrol gives no way of accessing Docker from system, due to when it runs, it bundle all tests into a single apk, and apk cannot access the system's terminal
- Tried https://github.com/testcontainers/testcontainers-java but also failed, with the same reason as Patrol.