chore(site): add remote playwright support and script (#10445)

This commit is contained in:
Mathias Fredriksson
2023-11-09 13:26:26 +02:00
committed by GitHub
parent ed7e43b54c
commit e71c53d4d0
3 changed files with 113 additions and 3 deletions
+17
View File
@@ -217,6 +217,23 @@ to test if the page is being rendered correctly, you should consider using the
> ℹ️ For scenarios where you need to be authenticated, you can use
> `test.use({ storageState: getStatePath("authState") })`.
For ease of debugging, it's possible to run a Playwright test in headful mode
running a Playwright server on your local machine, and executing the test inside
your workspace.
You can either run `scripts/remote_playwright.sh` from `coder/coder` on your
local machine, or execute the following command if you don't have the repo
available:
```bash
bash <(curl -sSL https://raw.githubusercontent.com/coder/coder/main/scripts/remote_playwright.sh) [workspace]
```
The `scripts/remote_playwright.sh` script will start a Playwright server on your
local machine and forward the necessary ports to your workspace. At the end of
the script, you will land _inside_ your workspace with environment variables set
so you can simply execute the test (`pnpm run playwright:test`).
### Integration
Test user interactions like "Click in a button shows a dialog", "Submit the form