Integration tests using Cypress; ensures the GiT systems are all working together correctly on our test environment.
- Install the latest version of node
- Install all the node dependencies:
npm install
- Copy
.env.example
to.env
and fill in the credentials.
The commands are built into the test command within the package.json.
By default the tests will run in a headerless browser and output results to the terminal.
npm run specs
You can run with a headed browser and only certain tests by passing arguments to the command:
npm run specs -- --headed --spec ./cypress/integration/mailing_list.js
If you want to run a single test you can isolate it with it.only(...)
The Cypress tests are ran on every deploy for the Get into Teaching website, Get an Adviser service and GiT API.
docker build . -t <tagname>
Note: Shared Memory size may need to be increased depending on the number of tests
docker run -i -v $PWD:/test --shm-size=1g -e CYPRESS_HTTPAUTH_PASSWORD -e CYPRESS_HTTPAUTH_USERNAME -w /test cypress/included:4.2.0
docker run -i -v $PWD:/test --shm-size=1g -e CYPRESS_HTTPAUTH_PASSWORD -e CYPRESS_HTTPAUTH_USERNAME -w /test cypress/included:4.2.0 --config-file cypress-qa.json