agentleFS
ariadossariadoss/superskills/skills/playwright/SKILL.md

playwright

Skill12 starsChanged 4 months agoMITView on GitHub

End-to-end testing with Playwright — generate, run, and debug E2E tests.

  • Installs packages

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 79 edited versions we read keep these.

  • 5

    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
  1. Distinctive:

    Read the source files for the page/component to test.

    line 34
  2. Distinctive:

    Create a test file following the project's existing patterns and directory structure.

    line 37
  3. Distinctive:

    Read error output carefully

    line 64
  4. Very specific:

    Use --trace on and open trace viewer: npx playwright show-trace trace.zip

    line 65
  5. Very specific:

    Use page.pause() for step-by-step debugging in headed mode

    line 67
  6. Very specific:

    Use data-testid attributes for stable selectors

    line 81
  7. Distinctive:

    Prefer user-visible text and ARIA roles over CSS selectors

    line 82
  8. Very specific:

    Use test.step() for complex multi-step flows

    line 83
  9. Very specific:

    Use page.waitForResponse() for async navigation

    line 85
  10. Distinctive:

    Place test files alongside existing test patterns in the project

    line 86

“Common” is measured: kept by at least 6 in 10 of the 79 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 E2E Testing

Generate and run Playwright end-to-end tests for web applications.

Prerequisites

npx playwright --version

If not installed:

npm init playwright@latest
# or add to existing project:
npm install -D @playwright/test && npx playwright install

Workflow

1. Analyze

Read the source files for the page/component to test. Understand routes, interactive elements, and expected behaviors.

2. Generate Test File

Create a test file following the project's existing patterns and directory structure.

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

test.describe('Feature Name', () => {
  test.beforeEach(async ({ page }) => {
    // Setup: navigate, authenticate, seed data
  });

  test('should do expected behavior', async ({ page }) => {
    // Arrange
    // Act
    // Assert
  });
});

3. Run Tests

npx playwright test <file>           # Run specific test file
npx playwright test --headed          # With visible browser
npx playwright test --ui              # Playwright UI mode
npx playwright test --trace on        # Capture trace for debugging

4. Debug Failures

  • Read error output carefully
  • Use --trace on and open trace viewer: npx playwright show-trace trace.zip
  • Take screenshots on failure: await page.screenshot({ path: 'debug.png' })
  • Use page.pause() for step-by-step debugging in headed mode

Capabilities

  • Navigation: page.goto(), URL assertions, redirect verification
  • Forms: page.fill(), page.selectOption(), page.check(), multi-step wizards
  • Assertions: expect(page).toHaveURL(), expect(locator).toBeVisible(), toHaveText()
  • Screenshots: page.screenshot(), full-page, element-level
  • Visual regression: expect(page).toHaveScreenshot() with thresholds
  • Accessibility: @axe-core/playwright, ARIA role selectors, keyboard navigation
  • Network: page.route() for mocking, page.waitForResponse() for API calls

Tips

  • Use data-testid attributes for stable selectors
  • Prefer user-visible text and ARIA roles over CSS selectors
  • Use test.step() for complex multi-step flows
  • Set baseURL in playwright.config.ts
  • Use page.waitForResponse() for async navigation
  • Place test files alongside existing test patterns in the project

Download now (ZIP)

  • Other versions91 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 91

    1. openai/openai-agents-python★ 30ksame name
    2. openai/skills★ 27ksame name
    3. prowler-cloud/prowler★ 15ksame name
    4. hyperdxio/hyperdx★ 10ksame name
    5. bluesky-social/atproto★ 9.7ksame name
    6. netease-youdao/LobsterAI★ 6.2ksame name
    7. Kiln-AI/Kiln★ 5.2ksame name
    8. freestylefly/wesight★ 941same name
    9. Gram-ax/gramax★ 609same name
    10. JetBrains/skills★ 386same name

    81 more not listed

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • Used alongsideProjects with it also use develop-web-game, msw and 9 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 5 projects that use this

    • MicrosoftSkill

      typescript

      TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.

      Also in 7 projects that use this

    • +1 more from thongdn-it
  • In this repository42 other files it gives its agents.

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.