Opinions·3 February 2026 · 7 min read
data-testid isn't a test smell. Brittle tests are.
There's a take going around that data-testid 'couples tests to implementation.' It's exactly backwards — data-testid is the only selector explicitly decoupled from implementation.
cypressplaywrightselectors