
AI-Assisted Cypress CI: Detecting Selector Drift and Proposing Fixes Automatically
CI failures are frustrating — especially when the fix is obvious. A very common scenario: Cypress tests pass locally CI fails overnight The screenshot clearly shows that the UI has changed The test selector is outdated Someone has to open logs and manually update the test Example failure: CypressError: Timed out retrying: Expected to find element: [data-testid="submit-profile-btn"], but never found it. When you open the screenshot, the button is clearly visible, but now the selector is: data-testid="save-profile-btn" This type of issue is selector drift. It happens when the UI changes slightly, but tests still reference the old selector. The fix usually takes seconds, but the debugging process is repetitive. In this article, we will build a small AI-assisted CI workflow that: Runs Cypress tests in GitHub Actions Captures failure artifacts Sends failure context to an LLM The LLM detects possible selector drift A PR. comment suggests the patch This is not autonomous self-healing CI. Inst
Continue reading on Dev.to Webdev
Opens in a new tab



