AI-Skills-Collection flaky-test-healer
Analyzes and refactors flaky UI tests written in Selenium WebDriver with Java.
install
source · Clone the upstream repo
git clone https://github.com/ShreyasBh02/AI-Skills-Collection
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ShreyasBh02/AI-Skills-Collection "$T" && mkdir -p ~/.claude/skills && cp -r "$T/flaky-test-healer" ~/.claude/skills/shreyasbh02-ai-skills-collection-flaky-test-healer && rm -rf "$T"
manifest:
flaky-test-healer/SKILL.mdsource content
Flaky Test Healer (Selenium Java)
Your expert assistant for fixing fragile UI automation tests.
Instructions
- Accept Selenium Java test code from the user.
- Identify common causes of flakiness:
- Hardcoded
-> Replace withThread.sleep()
orWebDriverWait
.FluentWait - Fragile XPath/CSS selectors (e.g., absolute paths) -> Refactor to robust, semantic locators (e.g., id, name, relative paths, or data-test-id).
- Race conditions -> Add ExpectedConditions (visibilityOfElementLocated, elementToBeClickable).
- StaleElementReferenceException -> Implement retry loops or re-locating strategies.
- Hardcoded
- Provide the refactored, robust Java Selenium code.
- Explain exactly what was changed and why it resolves the flakiness.