deflake-e2e_skill

This skill identifies and fixes flaky E2E tests by running them repeatedly and investigating failures to stabilize CI outcomes.
  • TypeScript

19.7k

GitHub Stars

1

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill dyad-sh/dyad --skill deflake-e2e

  • SKILL.md3.8 KB

Overview

This skill identifies and fixes flaky end-to-end (E2E) tests by running them repeatedly, inspecting failures, and applying Playwright best practices to stabilize tests. It guides you through running tests 10 times, diagnosing intermittent failures, applying test-side fixes, updating snapshots when appropriate, and verifying the fixes.

How this skill works

The skill runs specified E2E test files (or prompts to run the entire suite) 10 times with automatic retries disabled to expose intermittent failures. For any test that fails at least once, it enables browser debug logs to surface timing, animation, network, or state-leak issues, then recommends and applies test-level fixes and snapshot updates. Finally, it re-runs the tests to confirm stability.

When to use it

  • You see intermittent E2E failures in CI or locally that pass on retry.
  • You want to validate whether a failing test is genuinely broken or flaky.
  • You need a reproducible process to stabilize visual or timing-sensitive tests.
  • You maintain a test suite where tests share global state or cause flakiness.
  • You need to update failing snapshot baselines after intentional UI changes.

Best practices

  • Always run npm install and npm run build before E2E runs; E2E tests exercise the built binary.
  • Disable Playwright automatic retries (PLAYWRIGHT_RETRIES=0) so flakiness is visible.
  • Run each candidate test 10 times (--repeat-each=10) to classify flaky tests reliably.
  • Prefer stable selectors (data-testid, role, text) and explicit expect checks (toBeVisible) before interactions.
  • Use page.waitForLoadState('networkidle') and minimal explicit waits only when necessary; isolate tests and reset state.
  • Do not change application code—limit changes to test files and snapshot baselines.

Example use cases

  • Investigating a UI test that occasionally times out in CI but passes locally.
  • Stabilizing a visual snapshot test that shows minor pixel diffs across runs.
  • Finding race conditions where an element is interacted with before it becomes ready.
  • Confirming a suspected flaky test no longer fails after applying waits or selector fixes.
  • Documenting which tests were flaky and summarizing fixes for team review.

FAQ

A test is considered flaky if it fails at least once out of 10 runs with Playwright retries disabled.

When should I update snapshot baselines?

Update snapshots only when visual differences are legitimate changes; run with --update-snapshots and then re-run the 10 repeats to verify stability.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
deflake-e2e skill by dyad-sh/dyad | VeilStrat