I done this before, and it's really good way of targeting elements. That said, instead of data-test I just copied bootstraps approach to attributes (e.g. data-toggle="dropdown" & data-tatget="#something"), which seemed a bit more semantic.
data-test
data-toggle="dropdown"
data-tatget="#something"
I like the bootstrap technique too. Used it in couple of times in the past. Don't do it recently, since most of browser work, I do is React now days.
What I like about data-test is the intent it reveals. This is for easier test targeting. Not implementation detail.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I done this before, and it's really good way of targeting elements. That said, instead of
data-test
I just copied bootstraps approach to attributes (e.g.data-toggle="dropdown"
&data-tatget="#something"
), which seemed a bit more semantic.I like the bootstrap technique too. Used it in couple of times in the past. Don't do it recently, since most of browser work, I do is React now days.
What I like about
data-test
is the intent it reveals. This is for easier test targeting. Not implementation detail.