Skip to content

Commit 4b4dcfc

Browse files
committed
docs(web-host): add Test section about e2e tests
1 parent 922188a commit 4b4dcfc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,27 @@ Will do the same as the dev command, small changes:
280280

281281
You can then run `npm run web-host:preview` to preview the build.
282282

283+
#### Test
284+
285+
The project is configured to run e2e tests on the `web-host` using [playwright](./packages/web-host/playwright.config.ts), the test files are in [`packages/web-host/tests`](./packages/web-host/tests).
286+
287+
To run the tests against your local dev server (launched with `npm run dev`)
288+
289+
- `npm run test:e2e:all`: will run all the tests in headless mode
290+
- `npm run test:e2e:ui`: will open the playwright ui to run the tests
291+
292+
To run the tests against a preview server (build with `npm run build` and launched with `npm run preview`):
293+
294+
- `npm run test:e2e:all:preview`: will run all the tests in headless mode
295+
- `npm run test:e2e:ui:preview`: will open the playwright ui to run the tests
296+
297+
Specific to github actions:
298+
299+
In [`.github/workflows/web-host.yml`](./.github/workflows/web-host.yml), after the build step, the tests are run against the preview server.
300+
301+
To be sure that the preview server is up and running before running the tests, we use the [`webServer.command` option](https://playwright.dev/docs/test-webserver) of [playwright.config.ts](./packages/web-host/playwright.config.ts) to run `WAIT_FOR_SERVER_AT_URL=http://localhost:4173/webassembly-component-model-experiments/ npm run test:e2e:all:preview`
302+
303+
283304
### plugins (TypeScript)
284305

285306
You can write plugins in rust in [`crates/plugin-*`](./crates), you can also write plugins in TypeScript in [`packages/plugin-*`](./packages), thanks to `jco componentize` (based on [componentize-js](https://github.com/bytecodealliance/componentize-js)).

0 commit comments

Comments
 (0)