docs: Condition update

This commit is contained in:
soulgalore 2022-06-15 13:29:29 +02:00
parent 841eb0cff0
commit 62a69e1fa2
1 changed files with 3 additions and 2 deletions

View File

@ -1135,8 +1135,9 @@ Wait for an element found by xpath to appear before maxTime. The element needs t
Wait for an element found by selector to appear before maxTime. The element needs to be visible for the user. If the element do not appear within maxTime an error will be thrown.
#### wait.byCondition(condition, maxTime)
Wait for an condition that will eventually return a truthy-value before maxTime. If the condition do not met within maxTime an error will be thrown.
condition example: document.querySelector(`a.active`).innerHTML === 'Start'
Wait for a JavaScript condition that eventually will be a truthy-value before maxTime. If the condition do not met within maxTime an error will be thrown.
You pass on your JavaScript condition like: `wait.byCondition("document.querySelector('a.active').innerHTML === 'Start'");`
#### wait.byPageToComplete()
Wait for the page to finish loading by using the configured [page complete check](/documentation/sitespeed.io/browsers/#choose-when-to-end-your-test). This can be useful if you use Selenium to click on elements and want to wait on a new page to load.