Skip to content

Latest commit

 

History

History
83 lines (56 loc) · 2.65 KB

getting-started.md

File metadata and controls

83 lines (56 loc) · 2.65 KB

Getting started

This guide takes you from a fresh clone to a passing test run.

Prerequisites

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 --version

1. Install dependencies

bun install

This also activates the Husky pre-commit hook through the prepare script.

2. Install a browser

The framework uses Playwright's bundled Chromium. Install it once per machine:

bunx playwright install chromium

On Linux CI images, add --with-deps to install system libraries as well.

3. Configure your environment

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.

4. Run your first tests

bun run test:smoke

A 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:monocart

5. Run one file or one test

bunx 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.

Next steps