You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea of a data-test-subj it for precise element targeting in complex UIs. This should function much like the id attribute, meaning that it only has a single value (i.e. no spaces) and excluding the uniqueness requirement. There should be no reason to include modifiers in the data-test-subj for the same element in order to change its behavior. Changing behavior should be done with an additional attribute to modify the behavior.
Case in point, the example below uses the test subject of kbnAppWrapper [modifier] even though both visibleChrome and hiddenChrome, when visible, will point to the same DOM element.
The idea of a
data-test-subj
it for precise element targeting in complex UIs. This should function much like theid
attribute, meaning that it only has a single value (i.e. no spaces) and excluding the uniqueness requirement. There should be no reason to include modifiers in thedata-test-subj
for the same element in order to change its behavior. Changing behavior should be done with an additional attribute to modify the behavior.Case in point, the example below uses the test subject of
kbnAppWrapper [modifier]
even though bothvisibleChrome
andhiddenChrome
, when visible, will point to the same DOM element.Instead, the more canonical approach would be to get the element and test if it has the correct attributes.
Given this I see no good reason to allow multiple test subject ids on the same element. For example...
I'm open to other reasons why multiple test ids would be appropriate but I cannot think of any.
The text was updated successfully, but these errors were encountered: