Skip to main content

Running tests

This page covers the most common ways to run the PACE e2e suite: the full run, a single file, filtering by test name, and controlling the environment.

Run the full suite

pnpm run test

This runs every spec in tests/e2e/ against the environment named in the TEST_ENV variable (default: dev2). Each test has a 120-second timeout. There are no retries locally — if a test fails it stops immediately, which makes it easier to read the error. (CI uses 2 retries and a single worker to keep results deterministic.)

Run a single file

pnpm exec playwright test tests/e2e/login.spec.ts

Replace tests/e2e/login.spec.ts with any path under tests/e2e/. Useful when you are working on one area and do not want to wait for the full suite.

Filter by test title

pnpm exec playwright test -g "create estimate"

The -g flag accepts a substring or regular expression that is matched against the test title (the string passed to test()). Every test whose title contains the match string is included; the rest are skipped.

Run headed (watch the browser)

HEADLESS=false pnpm run test

Setting HEADLESS=false opens a real browser window so you can watch each step as the test executes. Combine it with a filter (-g) to focus on a single flow.

Pick a different environment

TEST_ENV=qa2 pnpm run test

TEST_ENV controls which environment the tests point to. Valid values match the files in tests/data/env/ (for example dev2, qa2). If you omit TEST_ENV the suite defaults to dev2.

You can combine variables:

TEST_ENV=qa2 HEADLESS=false pnpm exec playwright test -g "create estimate"

Timeouts and retries recap

SettingLocal defaultCI default
Per-test timeout120 s120 s
Retries on failure02
Workers(Playwright default)1