Optional abilityOptional callStatic forWait for a specific event on page.
the event on browser to wait for.
Optional options: WaitForEventActionOptions<T>new Wait instance
simple call
Wait.forEvent<Page>('page');
Static forWait for a specific event on page.
the event on page to wait for.
Optional options: WaitForEventActionOptions<T>new Wait instance
simple call
Wait.forEventOnPage<Download>('download');
Static forWait until the
pageFunction returns a
truthy value. It resolves to a JSHandle of the truthy value.
Function to be evaluated in the page context.
Optional argument: ArgOptional argument to pass to
pageFunction.
Optional options: WaitForFunctionActionOptionsnew Wait instance
const selector = '.foo';
await actor.attemptsTo(
Wait.forFunction(
(selector) => !!document.querySelector(selector),
selector
);
);
Static forWait for a specific status of the page.
either 'load', 'domcontentloaded' or 'networkidle'
Optional options: WaitForLoadStateActionOptionsnew Wait instance
Wait.forLoadState('networkidle');
Static forWait for a specific locator to exist.
the locator.
Optional options: WaitForLocatorActionOptions(optional) advanced locator lookup options.
new Wait instance
simple call with just locator
Wait.forLocator('myLocator');
with options
Wait.forLocator(
'myLocator', {
hasText: 'myText',
subLocator: ['mySubLocator', { hasText: 'anotherText' } ]
}
);
Static forWait for request matching the url or predicate.
url or predicate to wait for
Optional options: WaitForRequestActionOptionsnew Wait instance
Wait.forRequest('example.com');
Static forWait for response matching the url or predicate.
url or predicate to wait for
Optional options: WaitForResponseActionOptionsnew Wait instance
Wait.forRequest('example.com');
Static forWait for the page specified url.
url to wait for
Optional options: WaitForUrlActionOptionsnew Wait instance
Wait.forUrl('networkidle');
Wait for loading state or a locator or url.