agentleFS
soden46soden46/syarif-laravel-ai-skills/skills/e2e-playwright/SKILL.md

e2e-playwright

Skill4 starsChanged 5 months agoMITView on GitHub

Laravel E2E testing with official Playwright patterns for locators, auth state, seeds, traces, screenshots, CI, and cross-browser workflows.

  • Reads credentials

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when a Laravel task involves Playwright E2E tests, browser workflow coverage, regression tests, screenshots, traces, auth …

    line 11
  2. Very specific:

    Use the official microsoft/playwright repository as the source for current Playwright behavior when APIs, CLI, MCP, browser support, …

    line 13
  3. Very specific:

    Write tests with user-facing locators first: getByRole, getByLabel, getByText, getByPlaceholder, and getByTestId only when semantic …

    line 20
  4. Very specific:

    Prefer Playwright web-first assertions such as toBeVisible, toHaveText, toHaveURL, toHaveValue, and toHaveScreenshot over fixed sleeps.

    line 21
  5. Distinctive:

    Run the smallest meaningful Playwright command locally and report skipped browsers, missing services, or environment blockers explicitly.

    line 24
  6. Very specific:

    Keep .env, credentials, tokens, private URLs, raw customer data, and real auth state out of tests, screenshots, traces, and fixtures.

    line 29
  7. Distinctive:

    Use Laravel fakes for mail, notifications, queues, files, events, and HTTP integrations when the browser flow does not need the real …

    line 30
  8. Distinctive:

    Wait for app-specific readiness: Vite assets loaded, Livewire requests settled, Inertia navigation finished, queued job state visible, …

    line 31
  9. Very specific:

    Add stable data-testid attributes only when accessible locators are not reliable and the project accepts test IDs.

    line 32
  10. Very specific:

    Use ui-agent-browser when UI/UX design or implementation is still being explored.

    line 36
  11. Distinctive:

    Do not call Playwright coverage complete unless:

    line 40

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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

E2E Playwright

Use this skill when a Laravel task involves Playwright E2E tests, browser workflow coverage, regression tests, screenshots, traces, auth setup, or converting manual browser findings into durable tests.

Use the official microsoft/playwright repository as the source for current Playwright behavior when APIs, CLI, MCP, browser support, locators, traces, or configuration details matter: https://github.com/microsoft/playwright. Prefer the linked Playwright docs and API reference over remembered APIs.

Workflow

  1. Detect how the project runs Laravel, assets, queues, database, and browser tests: host, Sail, Docker, package manager, Vite, Playwright config, existing test helpers, and CI commands.
  2. Reuse project-local Playwright patterns first: auth helpers, seed scripts, storage state, route helpers, page objects, fixtures, test IDs, screenshots, and trace settings.
  3. Seed deterministic data through Laravel factories, seeders, HTTP setup routes, API helpers, or existing test bootstrap. Avoid fragile production-like data dependencies.
  4. Write tests with user-facing locators first: getByRole, getByLabel, getByText, getByPlaceholder, and getByTestId only when semantic locators are not stable enough.
  5. Prefer Playwright web-first assertions such as toBeVisible, toHaveText, toHaveURL, toHaveValue, and toHaveScreenshot over fixed sleeps.
  6. Cover the high-value user workflow, not every implementation detail. Include success, validation failure, authorization-dependent UI, empty state, loading or queued state, and destructive confirmation when relevant.
  7. Capture traces, screenshots, videos, or console/network evidence only when they help debug failures or support handoff.
  8. Run the smallest meaningful Playwright command locally and report skipped browsers, missing services, or environment blockers explicitly.

Laravel Setup Rules

  • Authenticate through existing Laravel test helpers when available. If the project uses storage state, create it from a safe test user and never commit real cookies, tokens, or session files.
  • Keep .env, credentials, tokens, private URLs, raw customer data, and real auth state out of tests, screenshots, traces, and fixtures.
  • Use Laravel fakes for mail, notifications, queues, files, events, and HTTP integrations when the browser flow does not need the real external system.
  • Wait for app-specific readiness: Vite assets loaded, Livewire requests settled, Inertia navigation finished, queued job state visible, fonts ready, and network idle only when it is meaningful.
  • Add stable data-testid attributes only when accessible locators are not reliable and the project accepts test IDs.

Playwright And Agent Browser

Use ui-agent-browser when UI/UX design or implementation is still being explored. Use agent-browser for low-token browser inspection, then convert the accepted workflow into Playwright when it should become a repeatable regression test.

Completion Gate

Do not call Playwright coverage complete unless:

  • the tested workflow is tied to real Laravel routes, Livewire actions, Inertia pages, or API contracts;
  • deterministic setup and teardown exist or the dependency on local state is explicit;
  • locators are resilient and user-facing where possible;
  • assertions prove behavior and state, not only that the page loads;
  • auth, validation, authorization, loading, empty, and success states are covered when relevant;
  • screenshots/traces are enabled or captured where failure diagnosis needs them;
  • the exact command run and any skipped checks are reported.

Related Skills

  • using-laravel-standards
  • ui-agent-browser
  • responsive-ui-testing
  • testing
  • runner-selection

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.