mcpField
L
laravel:e2e-playwright

laravel:e2e-playwright

github.com/jpcaparasTesting & quality157106 installsUpdated 17w ago
Repository

About laravel:e2e-playwright

A skill for building reliable, maintainable Playwright end-to-end tests in Laravel projects. It provides guidance on test environments, state setup, stable selectors, authentication, and failure-only recordings.

Key features

  1. 01Dedicated `.env.playwright` environment
  2. 02Seeders and factories for test state
  3. 03Stable `data-testid` selectors
  4. 04Reuse authentication storage state
  5. 05Record media only on failure

Use cases

  1. 01Prepare a seeded environment for E2E tests
  2. 02Keep selectors stable during UI refactors
  3. 03Avoid flaky UI login in test setup
  4. 04Capture screenshots or video after failures

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel:e2e-playwright

After installing, type/laravel:e2e-playwrightin Claude Code to confirm it loaded.

Details

From the project README

E2E Playwright (Laravel)

Keep E2E tests reliable, fast, and maintainable.

Environment

# Sail
sail pnpm playwright:test

# Non‑Sail
pnpm playwright:test

Use a dedicated .env.playwright and rebuild schema with migrate:fresh --seed before running.

State & Seeds

  • Provide seeders for common scenarios (users, roles, demo content)
  • Use factories for per‑test setup; reset state between specs

Test IDs & Selectors

  • Prefer data-testid attributes over CSS paths
  • Keep selectors stable through refactors

Auth

  • Reuse storage state when possible (logged‑in cookies/session)
  • Otherwise create user via API/setup to avoid UI login flakiness

Patterns

  • Break large flows into steps; assert key milestones
  • Record videos/screenshots only on failure to keep suites fast

Comments

Markdown supported