CI / CI configuration security checks (push) Successful in 3s
CI / Capabilities and shell quality (push) Successful in 14s
CI / Python tests and compilation (push) Successful in 26s
CI / QMD unit tests (push) Successful in 5s
CI / Build and inspect generated packages (push) Successful in 14s
CI / PowerShell tests on Ubuntu (push) Successful in 1m4s
CI / Installed client configuration smoke tests (push) Successful in 33s
CI / Bash integration and installation guards (push) Successful in 1m1s
4.0 KiB
4.0 KiB
name, description
| name | description |
|---|---|
| e2e-test-write | Use when adding, changing, or fixing end-to-end or UI tests that drive a running app's interface (Playwright, FlaUI, Appium), including flaky UI tests. |
E2E and UI Test Write
Use when a test must drive the real interface of a running application. For isolated logic use unit-test-write; for service boundaries without a UI use integration-test-write. When Superpowers test-driven-development applies, it sets the order (failing test first); this skill decides what deserves an end-to-end test and how to make it reliable.
Decide what to test
- Keep end-to-end tests few. Cover the critical user journeys that carry the product's value, such as sign-in, the main create or checkout flow, and one important failure path.
- Push every check as far down as it can go. Validation rules, edge cases, and calculations belong in unit or component tests; an end-to-end test proves that the layers work together for a real user.
- Do not duplicate lower-level coverage, and delete end-to-end tests that add nothing beyond it.
- Test what you control. Mock or stub third-party services at the network or service boundary instead of driving external sites.
Write the test
- Use the project's existing UI test framework and patterns. Without one, prefer Playwright for web apps (including Angular and Blazor), FlaUI over UI Automation for WPF, and Appium with the MAUI UI testing setup for .NET MAUI. Do not introduce a second framework.
- Inspect the running UI before writing locators: open the page or window, look at the rendered state and its accessible tree, then choose locators from what is actually there.
- Locate elements the way users find them: role and accessible name first (
getByRole,getByLabel), then visible text, then a dedicated test ID. On desktop and mobile useAutomationId, and addAutomationProperties.NameorAutomationIdto the app when an element has none. Never rely on CSS classes, XPath, DOM structure, or element index. - Assert what the user can observe, with assertions that wait and retry until the condition holds (Playwright
expect(locator).toBeVisible(), FlaUIRetry). Never use fixed sleeps such aswaitForTimeoutorThread.Sleep, and do not wait for network idle as a readiness signal. - Keep each test independent: its own browser context or app session, its own data, created through an API or seed step, and no dependence on test order. Share setup such as sign-in through fixtures or stored authentication state, not through a previous test.
- Use synthetic, non-personal test data and test accounts with minimal rights. Never point tests at production or real customer data.
- Use page objects or screen helpers only where several tests share a flow; keep assertions in the test.
Make it reliable
- Treat a flaky test as a defect with a root cause: timing, shared state, test order, animations, unstable data, or environment. Fix that cause instead of adding sleeps or retries.
- Use automatic retries only to collect diagnostics in CI, such as a trace on the first retry, and report tests that pass only on retry. Quarantine a flaky test only with an owner and a tracking item.
- Disable or shorten animations in the test environment where the framework allows it.
- For visual comparisons, pin the operating system, browser, fonts, viewport, and scale factor, and mask dynamic content.
- Run an automated accessibility scan, such as axe-core, on the key screens of web journeys where the project allows it.
Run and report
- Run the new or changed tests locally and record the command and result. In CI, keep traces, screenshots, or videos for failures, and run tests in parallel or shards when the suite is large.
- Confirm a new test fails when the feature is broken, for example by reverting the change or asserting on the missing behavior, so it is not a test that always passes.
- Report which journeys are covered, which checks were pushed down to lower-level tests, anything not run (no browser, emulator, device, or desktop session available), and any remaining flakiness risk.