Selector Drift Recovery

petrkindlmann/qa-skills/skills/selector-drift-recovery

by petrkindlmannb3bb61bd268bMIT168 starsListed Oct 9, 2026Updated Oct 9, 2026Repository updated 4 months ago

Bulk-regenerate broken test selectors after a UI refactor or redesign. Detects drift between old and new DOM with an aria-snapshot diff, maps old locators to new equivalents using role-first + region scoping, validates against the new build, and produces a single PR with grouped per-file selector updates and per-change evidence. Assumes Playwright >= 1.50 (trace viewer DOM-snapshot panel, getByRole filtering, ariaSnapshot). Use when: "UI refactor broke tests," "redesign broke tests," "bulk update selectors," "regenerate selectors after refactor," "selector drift," "fix N broken tests after redesign." Not for: healing one flaky test at runtime — use test-reliability. Not for: writing a new test suite from scratch — use playwright-automation. Not for: re-recording tests after a framework switch (Selenium to Playwright) — use test-migration. Related: test-reliability, playwright-automation, test-migration, ci-cd-integration, visual-testing.

Includes scriptsSoftware Development

Add to a SourceWeft workspace

  1. Open the skill in your dashboard and add it to a workspace.
  2. Enable it for the chats that should use it.

This skill includes scripts. They run in your workspace sandbox when the skill is used — review the file list and source before adding it.

Add to SourceWeft

You will be asked to sign in first, then taken straight to this skill.

Ask your agent to install it

Paste this prompt into Claude Code, Codex, Cursor or another agent that can run commands — or into SourceWeft chat. The agent reads this skill's install guide, shows you its source, license and scripts, and installs it with the SourceWeft CLI once you agree.

Read https://sourceweft.com/skills/gh-petrkindlmann-qa-skills-selector-drift-recovery/install.md and install the skill it describes. Before installing, show me its source, license and whether it ships scripts, and wait for my OK. Ask me before changing anything else on my machine.

Read the install guide the agent follows

Install it yourself from a terminal

For Claude Code, Codex, Cursor and other local agents. The SourceWeft CLI fetches the skill from its source repository at the commit scanned here, and verifies every file against the hashes recorded when the skill was scanned. If anything differs, nothing is written.

npx @sourceweft/cli skills install @petrkindlmann/selector-drift-recovery

Add --agent claude-code, codex, cursor or universal to choose which agent gets it (Claude Code by default).

Installed locally, this skill's scripts run on your machine, not in a sandbox. Read them first — the CLI asks before installing.

Upstream installer — not verified by SourceWeft

The open-source skills installer fetches the same pinned commit, but does not check the files against the hashes SourceWeft recorded.

npx skills add https://github.com/petrkindlmann/qa-skills/tree/b3bb61bd268b147476252c6ed5a0440c87b97441/skills/selector-drift-recovery

Source and attribution

Source:petrkindlmann/qa-skillsinskills/selector-drift-recoveryat commitb3bb61b

License: MIT

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal

More from petrkindlmann/qa-skills

Visual Testing

petrkindlmann

Guides visual regression testing with Playwright screenshots and hosted tools like Chromatic, Percy and Argos CI.

Software Development168updated 4 months ago

Unit Testing

petrkindlmann

Guides writing effective unit tests in Jest, Vitest and pytest, covering test doubles, coverage gating, snapshots, fake timers and mutation testing.

Software Development168updated 4 months ago

Test Suite Curation

petrkindlmann

Audit a whole regression suite and prune/restructure it with evidence: per-test coverage fingerprinting, AST near-duplicate clustering, CI-history mining for never-failing and flaky tests, prune decision rules (redundant/obsolete/low-value/keep), smoke/core/extended tiering by risk and defect-detection history, and a defensible "what we deleted and why" record. Deletion is destructive — quarantine and human sign-off are mandatory. Use when: "audit the test suite," "prune redundant tests," "find duplicate tests," "which tests can we delete," "restructure into smoke/core/extended," "is this test pulling its weight," "shrink the regression suite." Not for: Judging whether an individual test is WELL-WRITTEN (smells, assertions) — that is ai-qa-review. Healing one flaky test at runtime — that is test-reliability. Bulk selector regeneration after a UI refactor — that is selector-drift-recovery. Related: ai-qa-review, coverage-analysis, test-reliability, risk-based-testing, qa-project-context.

Awaiting classification168updated 4 months ago

Test Strategy

petrkindlmann

Produce a multi-quarter QA strategy document. Covers scope, risk-based prioritization, test levels (unit/integration/E2E), pyramid analysis, entry/exit criteria, quality KPIs, tool selection rationale, CI scaling levers, and timeline planning. Output is an actionable strategy document, not a shelf document. Use when: "test strategy," "QA strategy doc," "testing approach," "QA roadmap," "multi-quarter QA direction." Not for: a single-sprint or single-release plan — use test-planning. Not for: identifying which areas carry the most risk — use risk-based-testing first. Related: risk-based-testing, qa-metrics, release-readiness, test-planning, test-reliability.

Awaiting classification168updated 4 months ago

Test Planning

petrkindlmann

Builds a one-page sprint or release test plan with coverage mapping, effort estimation, prioritization, allocation, and scheduling.

Productivity & Workflow168updated 4 months ago

Test Migration

petrkindlmann

Guides incremental test-suite migration between frameworks, such as Selenium, Cypress, or Jest to Playwright or Vitest, with parallel CI.

Software Development168updated 4 months ago