e2e-testing-patterns
Build Reliable End-to-End Test Suites
End-to-end tests catch critical bugs before users do, but flaky tests slow down deployment and erode confidence. This skill teaches proven patterns for building fast, reliable E2E test suites with Playwright and Cypress that improve code quality without slowing down your team.
Download the skill ZIP
Upload in Claude
Go to Settings → Capabilities → Skills → Upload skill
Toggle on and start using
Test it
Using "e2e-testing-patterns". Create a custom Cypress command for user login
Expected outcome:
Generated a custom Cypress command that accepts email and password parameters, navigates to the login page, fills in credentials using data-testid selectors, clicks the submit button, and verifies successful redirect to the dashboard. Includes TypeScript type definitions for IDE autocomplete support.
Using "e2e-testing-patterns". How do I make this test less flaky?
Expected outcome:
Identified three flakiness sources: fixed timeout waits should be replaced with conditional waits, CSS class selectors should use data-testid attributes, and parallel tests share state through global variables. Provided specific code changes with proper waitForLoadState, role-based selectors, and isolated test fixtures.
Using "e2e-testing-patterns". Set up visual regression testing with Playwright
Expected outcome:
Created a visual regression test pattern that captures full-page screenshots, handles different viewport sizes, excludes dynamic content like timestamps, and uses pixel difference thresholds to reduce false positives. Includes baseline generation workflow and CI integration steps.
Security Audit
SafeThis skill provides educational content for end-to-end testing patterns with Playwright and Cypress. All static findings are false positives: weak crypto detections are from filename patterns, backtick executions are code examples in documentation, environment variable access is legitimate test configuration, and hardcoded URLs are localhost test endpoints. No security risks identified.
Quality Score
What You Can Build
QA Engineer Building Test Automation
A quality assurance engineer needs to establish E2E testing standards for a new project. They use this skill to generate Page Object Models, set up CI/CD integration, and implement reliable waiting strategies that reduce test flakiness.
Frontend Developer Testing User Flows
A frontend developer wants to add E2E tests for critical user workflows like authentication and checkout. They use this skill to create network mocking patterns, custom fixtures, and accessibility tests that catch regressions early.
Tech Lead Establishing Testing Standards
A technical lead needs to establish E2E testing best practices across multiple teams. They use this skill to document selector strategies, parallel testing patterns, and debugging approaches that improve test suite maintainability.
Try These Prompts
Create a Page Object Model for a login page with email, password fields, and error handling using Playwright
Review this test and suggest fixes for flaky behavior caused by timing issues and race conditions
Create network interception patterns to mock API failures and edge cases for a user profile page
Design a sharding strategy to run 200 E2E tests across 4 CI workers with optimal distribution
Best Practices
- Use semantic selectors like getByRole and getByLabel instead of CSS classes to create stable tests that survive UI refactoring
- Implement proper waiting strategies with conditional waits and assertions rather than fixed timeouts to eliminate flaky tests
- Keep tests independent with isolated fixtures and cleanup to enable parallel execution and reliable test runs
Avoid
- Using fixed timeouts like waitForTimeout instead of waiting for specific conditions leads to unreliable tests that fail intermittently
- Testing implementation details or internal state instead of user-visible behavior creates brittle tests that break with refactoring
- Sharing state between tests or relying on test execution order prevents parallel execution and causes cascading failures