This guide takes you from a fresh clone to a passing test run.
| Tool | Version | Why |
|---|---|---|
| Bun | 1.1 or later | installs dependencies and runs scripts |
| Node.js | 20 or later | Playwright runs on Node, even when Bun starts it |
| Git | any recent version | source control and the pre-commit hook |
Check your versions:
bun --version
node --versionbun installThis also activates the Husky pre-commit hook through the prepare script.
The framework uses Playwright's bundled Chromium. Install it once per machine:
bunx playwright install chromiumOn Linux CI images, add --with-deps to install system libraries as well.
Copy the template and fill in the values:
cp .env.example .env # Windows PowerShell: copy .env.example .env| Variable | Required | Purpose |
|---|---|---|
TEST_ENV |
no (default dev) |
which environment to test: dev, qa, staging, or production |
E2E_USERNAME |
for authenticated tests | account used by the setup project |
E2E_PASSWORD |
for authenticated tests | password for that account |
BASE_URL |
no | overrides the base URL from config/environments/<env>.json |
HEADED |
no | true shows the browser window |
Never commit .env. It is git-ignored, and the .env.example template contains no values.
bun run test:smokeA passing run shows the setup test and the smoke tests as passed. The run also writes reports to reports/.
Open the Monocart report:
bun run report:monocartbunx playwright test tests/auth/login.spec.js
bunx playwright test -g "Verify invalid credentials"-g matches the test title. Use it when you know part of the name.
- Environments to test a different environment
- Tagging to understand what each tag means
- Writing tests to add your first test