[E2E] Setup: Playwright + Test Infrastructure #6

Open
opened 2026-09-08 04:46:39 +00:00 by rock · 0 comments
Owner

Parent

Ref: #5

Objective

Bootstrap Playwright test infrastructure for CI-driven E2E testing.

Tasks

  • Install @playwright/test + browser deps
  • Create playwright.config.ts with projects: Chromium, Firefox, WebKit, Mobile Chrome, Mobile Safari, iPad
  • Add npm scripts: test:e2e, test:e2e:headed, test:e2e:debug
  • Create test directory structure:
tests/
├── e2e/
│   └── fixtures/
│       └── test-data.ts        # Shared selectors, viewports, timeouts
├── playwright.config.ts
└── ci/
    ├── Dockerfile.e2e          # Node + Playwright browsers image
    └── e2e-docker-compose.yml  # Spin up app + test runner
  • Create Dockerfile.e2e based on mcr.microsoft.com/playwright image
  • Create e2e-docker-compose.yml with:
    • App service: build from project Dockerfile, expose 3000
    • Test runner service: Dockerfile.e2e, depends_on app, runs pnpm test:e2e
  • Add .gitignore entries: test-results/, playwright-report/, blob-report/
  • Verify local pnpm test:e2e runs (even with 0 test files)

Acceptance

  • pnpm test:e2e runs without errors
  • docker compose -f tests/ci/e2e-docker-compose.yml up spawns app + test runner
  • Config supports 6 browser projects
  • Test fixtures file exports shared constants

Notes

  • webServer in playwright config should start pnpm run dev for local, but CI uses pre-built container
  • BASE_URL env var for CI override (http://app:3000)
## Parent Ref: #5 ## Objective Bootstrap Playwright test infrastructure for CI-driven E2E testing. ## Tasks - [ ] Install `@playwright/test` + browser deps - [ ] Create `playwright.config.ts` with projects: Chromium, Firefox, WebKit, Mobile Chrome, Mobile Safari, iPad - [ ] Add npm scripts: `test:e2e`, `test:e2e:headed`, `test:e2e:debug` - [ ] Create test directory structure: ``` tests/ ├── e2e/ │ └── fixtures/ │ └── test-data.ts # Shared selectors, viewports, timeouts ├── playwright.config.ts └── ci/ ├── Dockerfile.e2e # Node + Playwright browsers image └── e2e-docker-compose.yml # Spin up app + test runner ``` - [ ] Create `Dockerfile.e2e` based on `mcr.microsoft.com/playwright` image - [ ] Create `e2e-docker-compose.yml` with: - App service: build from project Dockerfile, expose 3000 - Test runner service: Dockerfile.e2e, depends_on app, runs `pnpm test:e2e` - [ ] Add `.gitignore` entries: `test-results/`, `playwright-report/`, `blob-report/` - [ ] Verify local `pnpm test:e2e` runs (even with 0 test files) ## Acceptance - `pnpm test:e2e` runs without errors - `docker compose -f tests/ci/e2e-docker-compose.yml up` spawns app + test runner - Config supports 6 browser projects - Test fixtures file exports shared constants ## Notes - `webServer` in playwright config should start `pnpm run dev` for local, but CI uses pre-built container - `BASE_URL` env var for CI override (`http://app:3000`)
rock added this to the Functional Testing milestone 2026-09-08 04:55:46 +00:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rock/riotpiao.com#6