jargon

Frontend & browser·Testing a user interface

you added an attribute to the element purely so the test could find it.

Test id

Also calleddata-testid, test hook

A dedicated attribute used as a stable selector, immune to changes in text, structure and styling. It is the escape hatch for elements with no accessible name and no distinguishing text. Reaching for it first is a smell: it makes the test pass while telling you nothing about whether a user could have found the element either.

Commonly confused with