← newsletter
Issue 4

Survive or Notice: What Your Locators Cost and What They Miss

Two more measured experiments: a healer that repaired every test and left the suite just as fragile, and the most stable suite, which caught no regressions. Plus four open-source Playwright tools.

Two questions, not one

Issue 3 ended on mutation testing: coverage measures what tests execute, not what they verify. The two experiments since then split a similar hair for locators. Every locator debate asks which selectors survive UI change. Almost nobody asks what the suite still notices afterwards.

Both experiments use seven tests per suite and public repos you can re-run.

Experiment 3: the healer repaired everything, and that is the problem

I broke a suite with two releases of realistic drift (a redesign, then a CSS-modules migration) and pointed Playwright's healer agent at the failures.

The healer is good. It repaired all 10 failures in 4 minutes 36 seconds, with zero incorrect fixes.

Then I ran the healed suites against the next release:

Healed suitevs the next release
CSS legacy0/7, all broken again
ARIA-first7/7
test-ids7/7

Across two releases the CSS suite consumed 14 healing repairs. The ARIA-first suite needed 2. The test-id suite needed 1. The healer restores a suite to exactly the fragility it had before. Locator strategy did more for maintenance cost than the AI did.

Full numbers, including the healer's own warning about its repairs: Self-Healing Tests: What the Vendors Aren't Telling You.

Experiment 4: the suite that survived best noticed least

Four suites, and five accessibility regressions a sighted user would not see.

Regressions caughtCSS legacytest-idsARIA-firstARIA snapshots
Out of 51045

The test-id suite ran against a build containing all five regressions at once and finished 7/7 green. It was also the suite that survived drift best. Stability and detection are different axes.

ARIA snapshots caught all five, and paid for it in drift: 3/7 after the redesign, second-worst. The repair was cheap, though. --update-snapshots regenerated every stale template in 31 seconds and wrote a patch for review instead of touching the test file.

The blend the numbers support: act with roles and labels, assert with scoped ARIA snapshots where semantics matter, and treat each test-id as a blind spot you chose.

That one is here: ARIA Snapshots: The Assertion Layer Your Locators Are Missing.

Four tools, each with its own page

The experiments keep pointing at the same gaps in a real suite, so I have been building tools for them. Each now has a page with the problem, how it works, requirements and an FAQ:

All four are MIT-licensed and on npm.

One question to take into your week

"If a redesign quietly broke a screen-reader user's path through our login form tonight, which test would fail?"

If the answer is none, pick one form and add a single scoped toMatchAriaSnapshot() assertion to it. Then change a label and watch what happens.

Stay connected

Gary Parker Quality Architect & Strategic Advisor

Enjoy this issue?

Subscribe to get future issues delivered straight to your inbox.