E2E Testing
We use the Detox library for end-to-end testing.
The tests are located in the e2e directory and additionally to this we mock some app files. The mocked files
have the .e2e.js
extension and the metro builder loads them in tests when started with:
To run the tests one need first to build the app for testing:
The available configs can be found in the package.json
file under detox.configuration
.
The detox configs in package.json
specify the emulators that the test expects to run on, but one can provide
a different emulator by specifying the -n EmulatorName
flag on the command line.
The develop configs communicates with a local relay server and chain started with the following repo: https://github.com/trustlines-protocol/end2end/
You need to run the relay server and chain with the following command:
our developConfig in src/shared/config/index.e2e.js specifies the relay host with localhost. This works fine on the iOS simulator, but on the Android Emulator you'll have to do port forwarding in order for your emulator to see your host. You can do:
For more detox options refer to the detox-cli docs: https://github.com/wix/Detox/blob/master/docs/APIRef.DetoxCLI.md
#
CircleCICircleCI is configured to run our end to end tests on every commit.
If you want to configure your own CircleCI instance you need to provide the following environment variables:
Our CircleCI config generates the keystore files out of the base64 environment variables with the following command:
Prefer the base64 command over openssl as for some reason openssl ads a newline in the output and then decoding the base64 text on CircleCI doesn't work.
#
ArtifactsWe record logs, screenshots on before and after test as well as videos on failing tests. Those can be found in the artifacts directory.