We run integration tests for both the NodeJS and React Native reference implementation using Cypress. You can find the set up and source code for these tests in ./test/e2e/run.sh. In principle, we start Ory Kratos with some configuration and an in-memory database in the background
DSN=memory hydra serve -c ./path/to/config/kratos.yml --dev > "kratos.e2e.log" 2>&1 &
as well as our application in the background as well. Then, we start the Cypress test runner which executes the different e2e tests. This works really well to test compliance and integration of Ory Kratos.
If you run Ory Kratos and your app on separate domains or ports you might want to add
cypress.json config file.
Testing React Native on Web with Cypress
If you want to test React Native (rendered as a web application) in Cypress, you need to disable security features preventing
browser from executing self-service API flows. To do this, set the environment variable
hydra serve -c ./path/to/config/kratos.yml --dev > "kratos.e2e.log" 2>&1 &)