fixing-flaky-e2e-tests
Skill by streamlit
Diagnoses and fixes flaky Playwright e2e tests in Streamlit's e2e_playwright directory. It is for developers who see intermittent failures, timeouts, snapshot mismatches or browser-specific failures in CI.
Install fixing-flaky-e2e-tests
Built from the published package, never by AI.
git clone --depth 1 https://github.com/streamlit/streamlit /tmp/streamlit && mkdir -p ~/.claude/skills && cp -r /tmp/streamlit/.claude/skills/fixing-flaky-e2e-tests ~/.claude/skills/fixing-flaky-e2e-testsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/streamlit/streamlit /tmp/streamlit && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/streamlit/.claude/skills/fixing-flaky-e2e-tests ~/.gemini/antigravity-cli/skills/fixing-flaky-e2e-testsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Step-by-step: install fixing-flaky-e2e-tests in Antigravity CLI
Skills can run scripts on your machine. Some need an API key: check the README.
About
This agent skill guides an assistant through diagnosing and fixing flaky Playwright end-to-end tests. It includes a script, scripts/fetch_flaky_tests.py, that aggregates tests needing reruns from recent successful playwright.yml CI runs. The skill then describes a workflow: reproduce the failure locally with up to 25 runs, inspect traces, screenshots and snapshot diffs, and apply a minimal fix such as explicit waits, relaxed count assertions, longer timeouts or image loading waits.
The skill is written for developers working on the Streamlit repository. It covers common causes like timing issues, browser retries, short timeouts and snapshot mismatches, and lists browser-specific notes for Firefox, Webkit and Chromium. It also sets rules, such as skipping tests with the flaky marker and using skip_browser only as a last resort with a reason.
Written from the project's SKILL.md and checked against it.
What it can do
- Fetch flaky testsRuns a script that finds the most flaky tests from recent CI runs using playwright_test_stats artifacts.
- Local reproduction loopRuns a test up to 25 times on a chosen browser to capture the first failure with full output.
- Snapshot diagnosisGuides comparison of actual and expected snapshots in test-results/snapshot-updates.
- Timing fixesSuggests explicit waits for visibility, CSS state and loaded images before interactions or screenshots.
- Verification runsDescribes repeating the fixed test 10 or more times on the affected browser before considering it done.
What you need
- Python with uv
- Playwright e2e test setup from the Streamlit repository
- make and the make run-e2e-test target
- Access to CI artifacts for the fetch script
Try asking
- Find the top 10 flaky Playwright tests from the last 4 days of CI runs.
- Reproduce the flakiness in this e2e test on firefox, up to 25 runs.
- Fix the snapshot mismatch in this calendar test by waiting for visibility.
Good to know
- Only fixes tests that can be reproduced locally within 25 runs.
- Skips tests already marked with @pytest.mark.flaky.
- skip_browser should be used only as a last resort with a clear reason.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .claude/skills/fixing-flaky-e2e-tests/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md8 KB
Alternatives to fixing-flaky-e2e-tests
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
fixing-flaky-e2e-tests: common questions
When should this skill be used?
The source says to use it when tests fail intermittently, show timeout errors, have snapshot mismatches, or fail only on specific browsers.
Which tests does it skip?
It skips tests marked with @pytest.mark.flaky, which are tracked separately, and tests that all 25 local runs pass.
How many times should a fix be verified?
The source sets a target of 10 out of 10 passes on the affected browser before the fix is considered complete.
How do I install fixing-flaky-e2e-tests?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is fixing-flaky-e2e-tests free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is fixing-flaky-e2e-tests safe to use?
It scores 89 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to fixing-flaky-e2e-tests?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
