Frontend & browser·Testing a user interface
the test broke because someone added a wrapping div, not because anything the user sees changed.
Brittle selector
Also calledfragile selector
A query tied to implementation detail — a generated class name, a nth-child chain, a deep CSS path — which fails on refactors that change nothing observable. Every such failure trains the team to distrust the suite, which is more expensive than the bug it might have caught. Querying by role, label and text is the durable alternative because those are the things that are meant to stay stable.