0036-laravel-e2e-playwright

Standardize Playwright end-to-end testing for Laravel with stable selectors and authentication flows.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0036-laravel-e2e-playwright
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: 0036-laravel-e2e-playwright
Source: https://github.com/MrJmpl3/codex_____data_____configuration/tree/main/skills/0036-laravel-e2e-playwright
Command: npx skills add https://github.com/MrJmpl3/codex_____data_____configuration --skill 0036-laravel-e2e-playwright

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Laravel end-to-end tests often become flaky and slow because they rely on inconsistent state setup, fragile selectors, and UI-based authentication.

Core Features & Use Cases

  • Environment consistency: Use a dedicated .env.playwright and rebuild the database schema reliably with migrate:fresh --seed before running.
  • State & seed reliability: Add seeders for common scenarios and use factories for per-test setup while resetting state between specs.
  • Stable selectors and auth: Prefer data-testid over CSS paths, reuse Playwright storage state when possible, or create users via API/setup to avoid UI login flakiness.
  • Fast, diagnosable execution: Assert key milestones while splitting large flows into steps, and record videos/screenshots only on failure.

Quick Start

Run the Sail command sail pnpm playwright:test after ensuring you rebuild and seed your schema with migrate:fresh --seed using a dedicated .env.playwright.

Frequently Asked Questions about 0036-laravel-e2e-playwright

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why are my Laravel Playwright E2E tests flaky and how do I fix them?▼

Laravel Playwright E2E tests become flaky due to inconsistent state setup, fragile CSS selectors, and UI-based authentication. You fix this by using migrate:fresh --seed, data-testid attributes, and API-based authentication.

How do I set up a dedicated environment for Laravel Playwright testing?▼

You establish environment consistency for Laravel Playwright testing by using a dedicated .env.playwright file and rebuilding the database schema reliably with migrate:fresh --seed before running your tests.

What is the best way to handle authentication in Playwright for Laravel?▼

The best way to handle authentication in Playwright for Laravel is reusing Playwright storage state or creating users via API/setup, which avoids UI login flakiness and ensures deterministic login handling across specs.

How do I manage database state and seeding between Playwright test specs?▼

You manage database state between Playwright test specs by adding seeders for common scenarios and using model factories for per-test setup while resetting the database state between each specification.

Does this Playwright Laravel testing setup work with Sail?▼

Yes, this Playwright Laravel testing setup works with Sail and non-Sail environments, supporting deterministic login handling and state setup across both configurations using sail pnpm playwright:test.

How do I reduce slow execution and diagnose failures in Playwright E2E tests?▼

You reduce slow execution and diagnose failures in Playwright E2E tests by asserting key milestones, splitting large flows into steps, and recording videos or screenshots only on failure to reduce overhead.