Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Latest commit

 

History

History
57 lines (35 loc) · 1.5 KB

File metadata and controls

57 lines (35 loc) · 1.5 KB

DfE - Get Into Teaching Automated Cypress Tests

Integration tests using Cypress; ensures the GiT systems are all working together correctly on our test environment.

Setup

  1. Install the latest version of node
  2. Install all the node dependencies:
npm install
  1. Copy .env.example to .env and fill in the credentials.

Running

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(...)

Automation

The Cypress tests are ran on every deploy for the Get into Teaching website, Get an Adviser service and GiT API.

Docker

Building on Docker

docker build . -t <tagname>

Running on Docker with default settings

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

With Different environments

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