-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: waitForOneOf(Locator[], timeout: number = <global.timeout>): Locator, throws #29840
Comments
@subpardaemon Perhaps you are looking for |
are they chainable? if so, then yes, i'm probably looking for that... (how did i miss that?!) |
i mean chainable as in i can have more than 2, ideally, N alternative locators. |
Yes, you can call |
It seems like the issue has been resolved. If you still encounter problems, please file a new issue with a repro and link to this one. |
馃殌 Feature Request
A new method that takes an array of Locators and an optional timeout, and waitFor()s for each of them. Using a Promise.any, it would throw only if none of the Locators appear (or are present) or are ambigious. If any of the waitFor()s resolve successfully first, they become the "winner".
Example
Example of not knowing what will "greet" us:
Example of different implementations on different environments:
Motivation
There are a lot of occasions where, depending on the tested systems' state, we might have to be waiting on for different locators and choose a path depending on which one won out. Other times, if a tested site is under heavy development, the same thing (like a modal's title) might look different in development, beta and production, and having a method like this can alleviate the pain that come come from situations like that.
The text was updated successfully, but these errors were encountered: