testing-e2e

Guides writing and running Playwright end-to-end tests against production-like nginx stands.

1|Updated Jan 14, 2024
One-click install
npx skills add https://github.com/Eyhenij/rt-tools --skill testing-e2e-eyhenij
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-e2e
Source: https://github.com/Eyhenij/rt-tools/tree/main/.claude/skills/testing-e2e
Command: npx skills add https://github.com/Eyhenij/rt-tools --skill testing-e2e-eyhenij

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? End-to-end tests often pass locally but fail in pipelines, silently skip coverage, or miss defects that only appear with accumulated UI state. This Skill encodes the rules for writing reliable Playwright e2e tests that actually catch production defects. ## Core Features & Use Cases - State-accumulation testing method: Explains why e2e tests must chain clicks without reloads, use qa-dataid selectors, and poll for state instead of reading on the next line. - Run commands and stands: Provides ready-made commands for running suites against a production build served behind real nginx via BASE_URL, including single-worker runs for admin suites sharing a live database. - Switch and coverage discipline: Distinguishes stand-state switches from environment-variable switches, and covers redirect assertions with maxRedirects: 0 plus a catalog of common failure modes. - Use Case: You need to reproduce a bug where a panel stays stuck after navigating between sections. Use this Skill to write a click-sequence Playwright test, raise the seeded stand, and run the suite against it. ## Quick Start Ask the assistant to write or fix an end-to-end test in the e2e suite and run it against the local stand using the provided nx e2e commands.

Frequently Asked Questions about testing-e2e

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

FAQPage Schema
How do I write end-to-end tests that catch accumulated state bugs?

Chain multiple clicks on the same elements a user clicks, without reloading between steps. Entering by direct URL resets the application state, so defects like a panel stuck after navigation only reproduce through sequential interaction.

How to run Playwright e2e tests against a production build behind nginx?

Raise the stand from the production build, then run the suite with BASE_URL pointing at the stand address, for example BASE_URL=http://localhost:PORT npx nx e2e <target> -- --project=chromium. With BASE_URL set, no local server is started and locale redirect checks activate.

Why do Playwright tests pass locally but fail in CI pipelines?

Reading screen state on the line after a click races the network response, which arrives later on busy pipeline machines. Await the expected state by polling until it matches instead of using fixed pauses or immediate reads.

How do I assert a 301 redirect in Playwright without following it?

Use request.get with maxRedirects set to 0, then assert the response status is 301 and the location header matches the target. The browser follows redirects automatically, so the final page status would read 200 and hide the redirect code.

Why do admin e2e tests fail when run in parallel?

Tests using a real session edit the same objects in the live database and interfere with each other. Run the full admin suite with --workers=1; the same files that failed on eight workers pass on one.

When should I use unit tests instead of end-to-end tests?

Anything verifiable by a single visit to an address is cheaper to close with a unit test on a pure function or a screen measurement. End-to-end tests are reserved for cases where state accumulates across interactions.