|
1 | | -# Relay e2e Test Suite |
| 1 | +# Relay e2e Test Suites |
2 | 2 |
|
3 | 3 | --- |
4 | 4 |
|
@@ -53,13 +53,37 @@ The premium account needs to have a chosen subdomain for the premium tests to pa |
53 | 53 |
|
54 | 54 | ### 6. Run Tests |
55 | 55 |
|
| 56 | +#### Running the full suite |
| 57 | + |
| 58 | +``` |
| 59 | +npm run test:e2e # Runs on stage (default) |
| 60 | +npm run test:full:stage # Explicit full suite on stage |
| 61 | +npm run test:full:prod # Full suite on production |
| 62 | +``` |
| 63 | + |
| 64 | +By default, `npm run test:e2e` will run all tests on https://relay.allizom.org/. |
| 65 | + |
| 66 | +#### Running the relay-only suite |
| 67 | + |
| 68 | +The relay-only suite excludes tests that depend on Mozilla Monitor, SubPlat payment flows, or third-party sites like developmentthatpays.com. |
| 69 | + |
56 | 70 | ``` |
57 | | -npm run test:e2e |
| 71 | +npm run test:relay-only # Runs on stage (default) |
| 72 | +npm run test:relay-only:stage # Relay-only on stage |
| 73 | +npm run test:relay-only:prod # Relay-only on production |
58 | 74 | ``` |
59 | 75 |
|
60 | | -By default, `npm run test:e2e` will run the tests on https://relay.allizom.org/. |
| 76 | +**Test suites:** |
61 | 77 |
|
62 | | -You can also run tests locally, on our dev server (https://relay-dev.allizom.org/), and in production (https://relay.firefox.com/). You can find the commands [here](https://github.com/mozilla/fx-private-relay/blob/main/package.json#L26-L31), or you can run `E2E_TEST_ENV=<env (prod, dev, stage)> npx playwright test`. |
| 78 | +- **Relay-only**: Landing page, free user functionality, premium functionality, upgrade flow |
| 79 | +- **Full**: All relay-only tests plus Monitor integration, subscription flows, tracker tests |
| 80 | + |
| 81 | +**External dependencies:** |
| 82 | + |
| 83 | +- Relay-only requires: Relay deployment, FXA, Restmail.net |
| 84 | +- Full suite additionally requires: Mozilla Monitor, SubPlat, developmentthatpays.com |
| 85 | + |
| 86 | +You can also run tests locally or on our dev server. See all commands [here](https://github.com/mozilla/fx-private-relay/blob/main/package.json), or use `E2E_TEST_ENV=<env (prod, dev, stage, local)> npx playwright test`. |
63 | 87 |
|
64 | 88 | To view the tests live in the browser, you can add `--headed` to the end of the command: |
65 | 89 |
|
@@ -87,13 +111,22 @@ Error: A snapshot doesn't exist at example.spec.ts-snapshots/example-test-1-chro |
87 | 111 |
|
88 | 112 | This is because playwright needs to create an image initially. On the following runs, it will compare that a screenshot of the respective element matches the one added initially. Do not push your local images into the repo, the only ones that are needed for CI end in `linux`. |
89 | 113 |
|
90 | | -### 8. Health check |
| 114 | +### 8. Relay-Only Suite |
91 | 115 |
|
92 | | -Our  runs a subset of the entire e2e test suite everyday. This subset of tests focuses on critical tests for free and premium users for the overall health of the relay application. To add a test into the healthcheck CI, add `@health_check` into the title of your test or test group. See the following as an example, |
| 116 | +The [Relay e2e tests workflow](https://github.com/mozilla/fx-private-relay/actions/workflows/playwright.yml) runs the relay-only test suite daily at 8 AM UTC. This suite focuses on core Relay functionality without dependencies on external services like Monitor or payment processors. |
93 | 117 |
|
94 | | -`test.describe("Subscription flows @health_check", ...)` |
| 118 | +The relay-only suite runs automatically on a schedule, but you can also trigger it manually: |
95 | 119 |
|
96 | | -To run the health check manually, go to , click run workflow, and check off "enable health check" before clicking "run workflow". |
| 120 | +1. Go to [Relay e2e tests](https://github.com/mozilla/fx-private-relay/actions/workflows/playwright.yml) |
| 121 | +2. Click "Run workflow" |
| 122 | +3. Select "relay-only" from the suite dropdown |
| 123 | +4. Click "Run workflow" |
| 124 | + |
| 125 | +To run the relay-only suite locally: |
| 126 | + |
| 127 | +```bash |
| 128 | +npm run test:relay-only:stage |
| 129 | +``` |
97 | 130 |
|
98 | 131 | ### 9. Diagnosing Test Failures |
99 | 132 |
|
|
0 commit comments