测试与安全

selector-drift-recovery

petrkindlmann/qa-skills

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.

  • 1049 次安装
  • 226 星标
  • 收录于

安装命令

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

SKILL.md

This is the bulk, offline, batch counterpart to test-reliability. They share the multi-attribute locator + confidence scoring primitives but run in opposite directions: test-reliability heals one selector at runtime behind a guarded threshold; selector-drift-recovery regenerates N selectors offline against the new DOM and bundles them into a PR. If you are doing the second workflow inside test-reliability, switch here.

Quick Route

Situation Go to
One broken test, not a refactor Stop — use test-reliability instead
200+ broken selectors across many files Split by area first (one PR per page/dir), then Phase 1
Refactor changed flows/semantics, not just structure Stop — rewrite from specs with playwright-automation
Framework switch (Selenium → Playwright) Stop — use test-migration, not drift recovery
No old-DOM reference exists anywhere Capture one (Phase 1) or scope down — without it this is "rewrite tests"
Have old + new DOM, ready to map Phase 1 → 6 below