agentleFS
stevemarksavastevemarksava/superteam/skills/playwright/SKILL.md

playwright

Skill1 starsChanged 2 months agoMITView on GitHub

Run Playwright browser tests as part of Vera's QA sign-off. Detects setup, installs if absent, writes smoke tests from the actual app structure if none exist, runs them, reports results. Called by Vera before every sign-off on any web application — not optional.

  • Installs packages

94 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use develop-web-game, msw and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • hebertzhuSkill

    develop-web-game

    Use when building or iterating on a web game and you need a tight implement-test-observe loop; prefer the bundled Playwright client, inspect screenshots and text state, and validate every meaningful change before moving on.

    Also in 4 projects that use this

  • thongdn-itSkill

    msw

    MSW (Mock Service Worker) best practices for API mocking in tests (formerly test-msw). This skill should be used when setting up MSW, writing request handlers, or mocking HTTP APIs. This skill does NOT cover general testing patterns (use test-vitest or test-tdd skills) or test methodology.

    Also in 3 projects that use this

  • SupabaseSkill

    react-hook-form

    Correct React Hook Form usage anywhere in the monorepo — data flow, subscriptions,

    Also in 3 projects that use this

  • thongdn-itSkill

    tailwind

    Tailwind CSS v4 performance optimization and best practices guidelines (formerly tailwindcss-v4-style). This skill should be used when writing, reviewing, or refactoring Tailwind CSS v4 code to ensure optimal build performance, minimal CSS output, and correct usage of v4 features. Triggers on tasks involving Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.

    Also in 5 projects that use this

  • VercelSkill

    react

    React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.

    Also in 6 projects that use this

  • OpenAISkill

    web-perf

    Analyzes web performance using Chrome DevTools MCP. Measures Core Web Vitals (FCP, LCP, TBT, CLS, Speed Index), identifies render-blocking resources, network dependency chains, layout shifts, caching issues, and accessibility gaps. Use when asked to audit, profile, debug, or optimize page load performance, Lighthouse scores, or site speed. Biases towards retrieval from current documentation over pre-trained knowledge.

    Also in 5 projects that use this

  • +1 more from thongdn-it

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 81 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Check whether the dev server is running:

    line 17
  2. Very specific:

    If not running: start it in background (npm run dev / pnpm dev / pnpm dev:ui), wait for the port to respond, then continue.

    line 23
  3. Very specific:

    If no playwright.config.js exists,: create it — use the fde-demos-worlds pattern exactly:

    line 41
  4. Very specific:

    If tests/ has no .spec.js or .spec.ts files, read the actual app source and generate tests/smoke.spec.js.

    line 68
  5. Distinctive:

    If tests fail due to timing on first run, retry once:

    line 125
  6. Distinctive:

    Do not retry more than once.

    line 130
  7. Distinctive:

    Check the browser console — zero errors (F12 → Console)

    line 142
  8. Distinctive:

    Check the Network tab — zero failed requests (red rows)

    line 143
  9. Distinctive:

    Document each item: what you did, what you saw.

    line 146
  10. Very specific:

    Write tests from the actual source: Read the router and components before writing smoke.spec.js.

    line 182
  11. Very specific:

    After reporting to Vera, write .squad/playwright-results.md with this format:

    line 191

“Common” is measured: kept by at least 6 in 10 of the 81 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/playwright — Browser Test Runner

You are running browser tests on behalf of Vera. The code review is already done. This step is the proof — the running application in a real browser, exercising real flows, catching what code reading never will.

Reference implementation: fde-demos-worlds — playwright.config.js + tests/shell.spec.js. When in doubt, follow that pattern.


Step 1 — Confirm Live Server

Check whether the dev server is running:

curl -s -o /dev/null -w "%{http_code}" http://localhost:5173/ 2>/dev/null
# or whichever port this project uses (3000, 4321, etc.)

If not running: start it in background (npm run dev / pnpm dev / pnpm dev:ui), wait for the port to respond, then continue. Do not proceed without a live server — a 000 or connection refused means every test will fail silently.


Step 2 — Check Playwright Setup

npx playwright --version 2>/dev/null || echo "NOT_INSTALLED"
ls playwright.config.js playwright.config.ts 2>/dev/null || echo "NO_CONFIG"
ls tests/*.spec.* 2>/dev/null || echo "NO_TESTS"

If Playwright is not installed:

npm install -D @playwright/test
npx playwright install chromium

If no playwright.config.js exists, create it — use the fde-demos-worlds pattern exactly:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  testDir: './tests',
  timeout: 30000,
  use: {
    baseURL: 'http://localhost:[PORT]',
    headless: true,
    viewport: { width: 1440, height: 900 },
  },
  webServer: {
    command: '[DEV_COMMAND]',
    url: 'http://localhost:[PORT]',
    reuseExistingServer: true,
    timeout: 30000,
  },
});

Fill in [PORT] and [DEV_COMMAND] from the project's package.json scripts.


Step 3 — Write Smoke Tests (if none exist)

If tests/ has no .spec.js or .spec.ts files, read the actual app source and generate tests/smoke.spec.js.

Read before writing:

  • src/App.tsx or src/main.tsx — find all routes
  • Component files for each route — find key UI elements (headings, buttons, forms, cards)
  • package.json — confirm dev server command and port

Test structure — follow this pattern exactly (from fde-demos-worlds):

import { test, expect } from '@playwright/test';

// One test per route — minimum
test('[page name] loads — [key elements] visible', async ({ page }) => {
  await page.goto('/[route]');

  // Confirm the page actually rendered something meaningful
  await expect(page.locator('[specific visible element]')).toBeVisible();
  await expect(page.locator('[another key element]')).toBeVisible();
});

// Navigation flows — test that clicking things goes where expected
test('[flow name] — click [element] navigates to [route]', async ({ page }) => {
  await page.goto('/');
  await page.locator('[selector]').click();
  await expect(page).toHaveURL('/[expected-route]');
  await expect(page.locator('[element that proves the page loaded]')).toBeVisible();
});

// Form interactions — test enable/disable state, validation
test('[form name] — [button] disabled when [condition]', async ({ page }) => {
  await page.goto('/[route]');
  await expect(page.locator('button', { hasText: '[button text]' })).toBeDisabled();
});

// Content integrity — no markdown leaking, no raw tokens
test('[page] — no raw markdown markers in rendered output', async ({ page }) => {
  await page.goto('/[route]', { waitUntil: 'networkidle' });
  const bodyText = await page.locator('body').innerText();
  expect(bodyText).not.toContain('###');
  expect(bodyText).not.toMatch(/^##\s/m);
  expect(bodyText.trim().length).toBeGreaterThan(50);
});

Use exact text locators over CSS selectors where possible — page.locator('text=Start demo (English)') is more resilient than page.locator('.card .btn'). The fde-demos-worlds tests do this correctly.

Minimum test count: one test per route, one per significant interactive flow. Do not write tests you cannot verify against the running app — generic tests create false confidence.


Step 4 — Run Tests

npx playwright test --reporter=list 2>&1

If tests fail due to timing on first run, retry once:

npx playwright test --reporter=list --retries=1 2>&1

Do not retry more than once. Flaky is a signal, not a nuisance.

Capture full output: test names, pass/fail, error messages, line numbers on failures.


Step 5 — Manual Golden Path (always, even if all tests pass)

Automated tests cover routes that were already written into tests. The golden path covers what was just built. For every new feature in this delivery:

  1. Navigate to it in the browser
  2. Complete the primary action the user would take
  3. Check the browser console — zero errors (F12 → Console)
  4. Check the Network tab — zero failed requests (red rows)
  5. Try one edge case: empty input, wrong value, fast click

Document each item: what you did, what you saw.


Step 6 — Report to Vera

PLAYWRIGHT REPORT
Date: YYYY-MM-DD
App: [name] at http://localhost:[PORT]
Tests: [N] run | [N] passed | [N] failed

Results:
✓ [test name]
✓ [test name]
✗ [test name] — [exact error message and line]

Console errors on golden path: [none / list]
Network failures on golden path: [none / list]

Manual golden path:
✓ [what you did — what happened]
✓ [what you did — what happened]
✗ [what you did — what failed]

Playwright verdict: PASS / FAIL / PARTIAL
[One sentence on overall state]

A FAIL here is a Vera BLOCKED. Code that reads correctly but fails in the browser has not been delivered.


Non-Negotiables

  • No running server = no Playwright run = BLOCKER. Flag it. Do not approximate.
  • Write tests from the actual source. Read the router and components before writing smoke.spec.js. Tests guessed from nothing create false confidence — worse than no tests.
  • Console errors are failures. A page that renders but throws errors is broken.
  • The golden path is not optional even if all tests pass. New features aren't in tests yet. Manual verification is the only proof for new code.
  • This skill is called by Vera before every sign-off on any web app. Not sometimes. Not on big deliveries. Every time.

Step 7 — Write Playwright Sentinel

After reporting to Vera, write .squad/playwright-results.md with this format:

PLAYWRIGHT RESULTS — YYYY-MM-DD
Tests: [N] run | [N] passed | [N] failed
Console errors: [none / list]
Network failures: [none / list]
Golden path: [pass / fail]

Fill values from the Step 6 report. File presence (not content) is what the push gate checks — but write accurate content for Coach. Without this file, H2 in pre-push-vera.ps1 blocks the push on any project with playwright.config.*.

/deliver Step 4 deletes .squad/playwright-results.md as part of sentinel cleanup.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.