dyad:deflake-e2e

Detect and fix flaky Playwright E2E tests by running them repeatedly and investigating failures.

21.4k|2.6k|Updated Apr 11, 2025
One-click install
npx skills add https://github.com/dyad-sh/dyad --skill dyad-deflake-e2e
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dyad:deflake-e2e
Source: https://github.com/dyad-sh/dyad/tree/main/.claude/skills/deflake-e2e
Command: npx skills add https://github.com/dyad-sh/dyad --skill dyad-deflake-e2e

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Flaky end-to-end tests erode trust in CI pipelines and waste developer time on false failures. This Skill systematically identifies which Playwright E2E tests are flaky, diagnoses the root cause, and applies fixes so tests pass consistently.

Core Features & Use Cases

  • Flakiness Detection: Runs each E2E test 10 times with retries disabled to reliably surface intermittent failures.
  • Root Cause Investigation: Re-runs failing tests with Playwright browser debug logging to uncover timing issues, race conditions, animation interference, and state leakage.
  • Guided Fixes and Verification: Applies Playwright best practices (stable selectors, explicit waits, test isolation), updates snapshot baselines when needed, and re-runs tests 10 times to confirm stability.
  • Use Case: A developer notices main.spec.ts fails intermittently in CI. They invoke this Skill on that file, which reproduces the flakiness locally, identifies a missing visibility wait, fixes the test, and verifies 10 consecutive passing runs.

Quick Start

Deflake the E2E test file main.spec.ts by running it repeatedly, investigating any failures, and fixing the flaky test.

Frequently Asked Questions about dyad:deflake-e2e

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

FAQPage Schema
How do I find flaky Playwright E2E tests?

Run each test file 10 times using Playwright's --repeat-each=10 flag with PLAYWRIGHT_RETRIES=0 to disable automatic retries. A test is considered flaky if it fails at least once out of the 10 runs.

How to debug a flaky Playwright test failure?

Re-run the failing test with DEBUG=pw:browser to enable Playwright browser debug logging. Analyze the output for timing issues, race conditions, animation interference, network variability, or state leaking between tests.

Why do Playwright retries hide flaky tests in CI?

CI environments default to 2 retries, so a flaky test can fail initially then pass on retry and be reported as stable. Setting PLAYWRIGHT_RETRIES=0 disables retries so every intermittent failure is surfaced.

What are common fixes for flaky Playwright tests?

Common fixes include awaiting expect(locator).toBeVisible() before interactions, using stable selectors like data-testid or role, waiting for networkidle on network-dependent tests, and ensuring proper test isolation with clean state.

Should I change application code to fix a flaky E2E test?

No. This workflow assumes the application code is correct and only modifies test files and snapshot baselines. Fixes focus on waits, selectors, and test isolation rather than changing the app under test.