mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(site): add remote playwright support and script (#10445)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user