DEV Community

Discussion on: Don't use CSS classes for testing in Unit Tests or E2E

Collapse
 
alohci profile image
Nicholas Stimpson

Except that's not valid HTML,. You should use data-probe-id instead.

Collapse
 
activenode profile image
David Lorenz

Thanks for the comment. In our company we do use data-probe-id. However even though that is true in actual HTML context it really rarely ever comes with business related downsides not doing so.

If you are all about validity for a specific reason then you could redefine your own doctype :)