Skip to main content

E2E tests

End-to-end tests are used to test the entire application from the user's perspective. They are run in a real browser environment are used to test the entire application flow.

Our tests are run with Playwright.

Writing tests

E2E tests are located in pwa/apps/carrots-frontend/__tests__ and should be named *.spec.ts.

Follow the Playwright docs for more information on how to write tests.

Running tests

To run all e2e tests, run:

pnpm test:e2e --filter=@overdose/carrots-frontend

Follow the Playwright docs for more information on how to run tests.

CI

E2E tests are run in Bitbucket Pipelines on every pull request and push to the main branch. The logs can be viewed in the Bitbucket Pipelines UI.

Lighthouse tests

A Lighthouse test is run to measure accessibility, SEO, pwa, and best practices. Performance is not currently measured as the Pipelines environment does not accurately reflect a real user experience.

Any lighthouse score below 100 will fail the test. The results on the test can downloaded in the Bitbucket Pipelines UI under the "Artifacts" tab.