e2e-testing-patterns

Implements end-to-end test suites with Playwright and Cypress patterns.

2|Updated Feb 15, 2026
One-click install
npx skills add https://github.com/SkinnnyJay/simpill-utils --skill e2e-testing-patterns-skinnnyjay
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: e2e-testing-patterns
Source: https://github.com/SkinnnyJay/simpill-utils/tree/main/.agents/skills/e2e-testing-patterns
Command: npx skills add https://github.com/SkinnnyJay/simpill-utils --skill e2e-testing-patterns-skinnnyjay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/test, cypress, @axe-core/playwright, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? End-to-end tests are often flaky, slow, and hard to maintain, causing teams to lose trust in their test suites and ship regressions. This Skill provides proven Playwright and Cypress patterns for building deterministic, fast, and maintainable E2E tests. ## Core Features & Use Cases - Playwright Patterns: Page Object Model, custom fixtures for test data, proper waiting strategies, and network mocking/interception. - Cypress Patterns: Custom commands, cy.intercept for API mocking, and configuration best practices. - Advanced Techniques: Visual regression testing, parallel sharding, accessibility testing with axe-core, and flaky test debugging. - Use Case: When setting up E2E tests for a checkout flow, use the Page Object Model pattern with fixtures to create isolated test users, mock the Stripe API, and run tests sharded across CI workers. ## Quick Start Write a Playwright E2E test for the login flow using the Page Object Model pattern with proper waiting strategies.

Frequently Asked Questions about e2e-testing-patterns

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

FAQPage Schema
How do I write E2E tests with Playwright?▼

Playwright E2E tests use the test runner with page objects, role-based locators like getByRole and getByLabel, and auto-waiting assertions via expect. Configure projects in playwright.config.ts to run across Chromium, Firefox, WebKit, and mobile devices.

Playwright vs Cypress for end-to-end testing?▼

Playwright supports multiple browsers including WebKit and offers built-in parallel sharding and trace viewing. Cypress provides custom commands and cy.intercept for API mocking with a simpler debugging experience. Both support network mocking and TypeScript.

How to fix flaky Playwright tests?▼

Flaky tests usually come from fixed timeouts like waitForTimeout. Replace them with condition-based waits such as waitForURL, waitForResponse, or auto-waiting expect assertions, and use trace viewer and screenshots on failure to diagnose issues.

How do I mock API responses in Cypress?▼

Use cy.intercept to stub API responses with custom status codes and bodies, modify requests or responses in flight, and simulate slow networks with response delays. Alias intercepts with .as() and use cy.wait() to synchronize test steps.

What selectors should I use in E2E tests?▼

Use data-testid or data-cy attributes and role-based locators like getByRole and getByLabel for stable selectors. Avoid CSS classes, nth-child, and deep DOM paths since they break when styling or markup structure changes.

When should I not use E2E tests?▼

Avoid E2E tests for unit-level logic, API contract validation, and edge cases since they are too slow. Follow the testing pyramid: many unit tests, some integration tests, and few E2E tests focused only on critical user journeys.