I’ve come across a lot of articles lately claiming that using data-testid is the best way to define selectors in your tests. Apparently, they simplify element selection, ensure maintainability and stability and decouple your tests from UI changes.

I couldn’t disagree more.