agentleFS
witi-projectswiti-projects/Skills/adding-e2e-tests/SKILL.md

adding-e2e-tests

Skill2 starsChanged 7 months agoMITView on GitHub

Set up Playwright end-to-end testing in a project, including test configuration, example tests, and CI integration. Use when the user says "/adding-e2e-tests", "adding e2e tests", or asks about adding e2e tests.

  • Reads credentials
  • Installs packages

2 other projects use a version of this, 2 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when the user asks to add end-to-end tests, browser tests, integration tests, or set up Playwright.

    line 8
  2. Very specific:

    Use data-testid attributes for selectors instead of CSS classes.

    line 74
  3. Very specific:

    Use test.describe to group related tests.

    line 75
  4. Very specific:

    Run npx playwright codegen to record tests interactively.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “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

Add E2E Tests (Playwright)

Use this skill when the user asks to add end-to-end tests, browser tests, integration tests, or set up Playwright.

Steps

  1. Install Playwright

    npm init playwright@latest

    This creates playwright.config.ts, a tests/ directory, and installs browsers. If the project already has a test runner, install manually:

    npm install -D @playwright/test
    npx playwright install
  2. Configure playwright.config.ts

    • Set baseURL to the local dev server URL (e.g. http://localhost:3000).
    • Configure webServer to start the dev server automatically:

      webServer: {
        command: "npm run dev",
        url: "http://localhost:3000",
        reuseExistingServer: !process.env.CI,
      },
    • Enable only chromium for local dev speed; enable all browsers in CI.
  3. Create a smoke test — write a basic test that verifies the app loads:

    import { test, expect } from "@playwright/test";
    
    test("homepage loads", async ({ page }) => {
      await page.goto("/");
      await expect(page).toHaveTitle(/.+/);
    });
  4. Add page object pattern (optional) — for larger apps, create a tests/pages/ directory with page objects that encapsulate selectors and actions.
  5. Add npm scripts

    {
      "test:e2e": "playwright test",
      "test:e2e:ui": "playwright test --ui"
    }
  6. Add to .gitignore

    test-results/
    playwright-report/
    blob-report/
  7. CI integration — add a GitHub Actions step that runs npx playwright install --with-deps then npm run test:e2e. Use the official actions/upload-artifact to save the HTML report on failure.

Notes

  • Use data-testid attributes for selectors instead of CSS classes.
  • Use test.describe to group related tests.
  • Run npx playwright codegen to record tests interactively.

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.