Files
coder/site/e2e
Mathias Fredriksson f46692531f fix(site/e2e): increase webServer timeout to 120s (#22731)
The Playwright e2e `webServer` starts the Coder server via
`go run -tags embed`, which must compile before serving. The default 60s
timeout leaves no margin when the CI runner is slow.

Failed run:
https://github.com/coder/coder/actions/runs/22782592241/job/66091950715

Successful run:
https://github.com/coder/coder/actions/runs/22782107623/job/66090828826

The server started and printed its banner, but with only ~4s left on the
clock the health check (`/api/v2/deployment/config`) could not complete
before the timeout fired. The same ~2x slowdown shows in the
`make site/e2e/bin/coder` step (45s vs 67s), confirming this is runner
performance variability.

Increase timeout to 120s.

Refs #22727
2026-03-09 19:06:45 +00:00
..

e2e

The structure of the end-to-end tests is optimized for speed and reliability. Not all tests require setting up a new PostgreSQL instance or using the Terraform provisioner. Deciding when to trade time for robustness rests with the developers; the framework's role is to facilitate this process.

Take a look at prior art in tests/ for inspiration. To run a test:

cd site
# Build the frontend assets. If you are actively changing
# the site to debug an issue, add `--watch`.
pnpm build
# Alternatively, build with debug info and source maps:
NODE_ENV=development pnpm vite build --mode=development
# Install the browsers to `~/.cache/ms-playwright`.
pnpm playwright:install
# Run E2E tests. You can see the configuration of the server
# in `playwright.config.ts`. This uses `go run -tags embed ...`.
pnpm playwright:test
# Run a specific test (`-g` stands for grep. It accepts regex).
pnpm playwright:test -g '<your test here>'

Using nix

If this breaks, it is likely because the flake chromium version and playwright are no longer compatible. To fix this, update the flake to get the latest chromium version, and adjust the playwright version in the package.json.

You can see the playwright version here: https://search.nixos.org/packages?channel=unstable&show=playwright-driver&from=0&size=50&sort=relevance&type=packages&query=playwright-driver

# Optionally add '--command zsh' to choose your shell.
nix develop
cd site
pnpm install
pnpm build
pnpm playwright:test

To run the playwright debugger from VSCode, just launch VSCode from the nix environment and have the extension installed.

# Optionally add '--command zsh' to choose your shell.
nix develop
code .

Enterprise tests

Enterprise tests require a license key to run.

export CODER_E2E_LICENSE=<license key>

Debugging tests

To debug a test, it is more helpful to run it in ui mode.

pnpm playwright:test-ui