e2e-testing-patterns

Implements Playwright end-to-end testing patterns including authentication fixtures, page objects, and CI sharding.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/SleyiW/iWana-neXt --skill e2e-testing-patterns-sleyiw
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: e2e-testing-patterns
Source: https://github.com/SleyiW/iWana-neXt/tree/main/.agents/skills/e2e-testing-patterns
Command: npx skills add https://github.com/SleyiW/iWana-neXt --skill e2e-testing-patterns-sleyiw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing reliable end-to-end tests is hard: tests become flaky, selectors break on UI changes, login flows slow down suites, and CI pipelines run sequentially. This Skill provides proven Playwright patterns for the iWana neXt stack to build stable, fast, and maintainable E2E test suites. ## Core Features & Use Cases - Authentication Fixtures with storageState: Perform programmatic login once and reuse the session token across tests, eliminating slow UI logins in every test. - Page Object Model & Semantic Selectors: Standardize tests using getByRole, getByLabel, and getByText selectors plus reusable page classes, avoiding fragile CSS selectors. - Flaky Test Debugging & CI Sharding: Diagnose flaky tests with traces and repeat-each runs, and split suites across parallel CI shards with GitHub Actions matrix configuration. - Use Case: When a login test times out intermittently in CI, apply the fixture-based authentication pattern and trace viewer workflow to identify the race condition and stabilize the suite. ## Quick Start Use the e2e-testing-patterns skill to write a Playwright test for the login flow using the authentication fixture and Page Object Model.

Frequently Asked Questions about e2e-testing-patterns

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

FAQPage Schema
How do I reuse login sessions across Playwright tests?

Create a custom fixture that performs a programmatic API login, stores the access token in localStorage, and exposes an authenticated page to tests. This avoids slow UI logins in every test and reduces total suite time.

How to debug flaky Playwright tests in CI?

Run tests with --trace=on to capture traces, then open them with npx playwright show-trace. Use --repeat-each=5 to reproduce flakiness locally, and replace fixed waits like waitForTimeout with explicit assertions such as toBeVisible.

What selectors should I use in Playwright tests?

Prioritize semantic selectors: getByRole first, then getByLabel and getByText, with getByTestId as a fallback. Avoid CSS class selectors, especially Tailwind utility classes, because they break whenever styling changes.

Can I use Cypress instead of Playwright for this project?

No, the project stack only supports Playwright for end-to-end testing. Cypress is explicitly listed as an anti-pattern, and unit or integration tests should use the separate testing-patterns approach instead.

How do I run Playwright tests in parallel on CI?

Use Playwright sharding with --shard=N/4 to split the suite across workers. In GitHub Actions, define a matrix strategy with shard values 1 through 4 so each job runs one quarter of the tests concurrently.