Skip to content

Automated Testing

Ryan Rondeau edited this page Oct 8, 2024 · 11 revisions

Jest Unit Tests

Jest unit tests are maintained for the backend.

npm test

Cypress Automated e2e Tests

This project incorporates Cypress tests into the pipeline. If you want to run the tests locally, you can use this command.

npx cypress run --browser chromium --config baseUrl=http://localhost:3000

To run a specific test, use --spec

npx cypress run --browser chromium --config baseUrl=http://localhost:3000 --spec {path to spec file}

Make sure the CYPRESS_KEYCLOAK_USER and CYPRESS_KEYCLOAK_PASSWORD environment vars are set to the appropriate test credentials, as there's a specific test account that is used in the pipeline (username ENCETST1).

Use Cypress to View Test Runs

  1. cd frontend
  2. npm run cypress:open
  3. Select "e2e Testing"
  4. Select your browser of choice
  5. Select your tester
image