Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 2.08 KB

File metadata and controls

40 lines (25 loc) · 2.08 KB

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 Cypress test 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.

Integration testing

As part of our integration tests, a test user "test@test.com" is created in the Azure TEST tenancy. As a part of these tests, this user should be automatically deleted. In the event that the test user is not deleted, the integration tests can fail:

  • "Another object with the same value for property proxyAddresses already exists."

In order to remediate this failure, the "test@test.com" user will need to be deleted from the test tenancy. The tests should then succeed.

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.