Files
magnus919_agent-skills/playwright/templates/playwright.config.ts
T
Magnus HedemarkGitHubfactory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
ac1beb117d feat(skill): add Playwright skill (E2E testing + scraping + headless browsing) (#264)
Add ONE tool skill for Playwright: SKILL.md covering E2E test authoring,
selector robustness, network interception/mocking, parallel workers, CI
integration, scraping/headless patterns, accessibility snapshot checks, and
headed debugging; scripts/pwrun (agent-first smoke harness with --json,
fixture-tested); templates/ test-suite scaffold; eight dated references; a
schema-valid evals/evals.json (6 cases); a human-facing README; reverse
routing from qa-methodology and frontend-engineering; top-level README index
entry; and regenerated catalogs (llms.txt, marketplace, codex).

Closes #244.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-08-03 17:59:38 -04:00

41 lines
1.4 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test';
/**
* Test-suite scaffold for Playwright.
*
* Copy this file (plus example.spec.ts and accessibility.spec.ts) into your
* project root, adjust the [fill: ...] markers, and run:
*
* npm i -D @playwright/test
* npx playwright install
* npx playwright test
*/
export default defineConfig({
testDir: './e2e', // [fill: directory that holds your spec files]
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0, // retry flaky tests on CI only
workers: process.env.CI ? 4 : undefined, // [fill: CI worker count for your runner]
reporter: [
['list'],
['html', { open: 'never' }],
['json', { outputFile: 'test-results/test-results.json' }], // triage with scripts/pwrun report
],
use: {
baseURL: process.env.BASE_URL ?? 'http://localhost:3000', // [fill: app URL]
trace: 'on-first-retry', // capture a trace when a test fails on retry
screenshot: 'only-on-failure',
video: 'retain-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'mobile-chromium', use: { ...devices['Pixel 7'] } }, // [fill: devices you support]
],
webServer: {
command: 'npm run dev', // [fill: your app's dev/preview command]
url: 'http://localhost:3000', // [fill: readiness URL the server must answer]
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
});