We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
Can somebody help me with code example of the following situation:
I have a question form on which there could be follow up question depending on the answer of the first question.
So my issue is that I want to poll for let say 3 seconds if an element will become available after a click.
A saw that locator.isVisible timeout option is DEPRECATED, so how do we do it now?
The text was updated successfully, but these errors were encountered:
If you know that the element should become visible the recommended way is to use web-first assertion:
assertThat(page.locator(".my-element")).isVisible();
Otherwise you can do a generic poll using page.waitForTimeout like this:
Instant start = Instant.now(); while (!locator.isVisible() && Duration.between(start, Instant.now()).getSeconds() < 3) { page.waitForTimeout(100); }
In the next version we may introduce generic poll method to simplify code like this.
poll
Sorry, something went wrong.
Hi @yury-s, thanks for the hints.
Usually I use web-first assertions, but they are not returning Boolean.
There are cases where I do not know if this element will become available, so I am using for example an if statement.
e.g. -> if (element.IsVisible) do something.
But as we know .isVisible() is returning immediately, so we need some time to wait for it.
Will try the waitForTimeout, but having generic poll method will be great.
Thanksss!
Closing since we have web-first assertions for that. I filed a separate feature request for assert.poll here: #940
No branches or pull requests
Hello,
Can somebody help me with code example of the following situation:
I have a question form on which there could be follow up question depending on the answer of the first question.
So my issue is that I want to poll for let say 3 seconds if an element will become available after a click.
A saw that locator.isVisible timeout option is DEPRECATED, so how do we do it now?
The text was updated successfully, but these errors were encountered: