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
As you can see, buttons can be located by aria-label attribute and by innerText. But the problem is if we have a button with both aria-label and innerText values, we can't find that button by innerText value, because our locator return the first value from aria-label attribute.
So I suggest to add ability to define an array of functions as locator. So locator could be look like this:
I'm off two minds on this. It sounds easier, but how often do you really want to have it be both? In the case of MUI what is the case where the inner text and the aria label are different (I'm guessing that there is, but just curious what it is)
For example, this is a locator of material-ui Button
interactors/packages/material-ui/src/button.ts
Line 10 in 6454cc6
As you can see, buttons can be located by
aria-label
attribute and byinnerText
. But the problem is if we have a button with botharia-label
andinnerText
values, we can't find that button byinnerText
value, because our locator return the first value fromaria-label
attribute.So I suggest to add ability to define an array of functions as locator. So locator could be look like this:
And then you can find your button by any of these possible ways.
The text was updated successfully, but these errors were encountered: