Skip to content

Latest commit

 

History

History
 
 

README.md

Testing

This directory contains system-level tests of the Beacons service. For isolated testing of the components of the Beacons system, see the ../webapp/, ../service/ and ../backoffice/ directories.

End-to-end testing

Automated end-to-end tests use Cypress and are run in GitHub Actions against the publish images before deploying to the dev and staging environments.

To run end-to-end tests locally:

  • Copy tests/.env.example as tests/.env and populate it with the contents of the "Beacons Webapp Local .env.local config" secure note in 1Password for the corresponding environment variables.
$ docker compose -f docker-compose.e2e.yml up
$ npm run test:e2e

Occasional Failures

  • Automated end-to-end tests require the SESSION_TOKEN, and may fail unexpectedly, due to rotating session tokens. To resolve this, log into local/dev/staging webapp using the test account. Locate the session token in dev tools: Application -> cookies -> __Secure-next-auth.session-token -> value.
  • Copy this value and update the corresponding secret in the GitHub repository.

Smoke testing

The smoke tests are currently manual. We are looking to automate these.

  • Pre-release testing scenarios must be performed:
    • before drafting a release, against the dev environment.
    • after drafting a release, against the staging environment, before publishing the release.
  • Post-release testing scenarios must be performed immediately after a published release has been deployed to production.