Skip to main content

waitForStaticToLoad

Available from testplane v8.32.0

Overview

Use the waitForStaticToLoad command to wait for static elements on the page to load, such as fonts, CSS styles, and images.

When the timeout is reached, if the page is still not loaded, it does not throw an error but returns a result with the reason.

Automatically called when executing assertView.

warning

If an image is loaded via the background-image property defined in external CSS styles, Testplane will only be able to wait for this image if these styles are served from a local server, or if the element has a crossorigin attribute set to anonymous.

Usage

const result = await browser.waitForStaticToLoad({ timeout: 5000, interval: 300 });
// { ready: true }
// { ready: false, reason: "Document is loading" }
// { ready: false, reason: "JavaScript is running" }
// { ready: false, reason: "Fonts are loading" }
// { ready: false, reason: "Image from https://example.com/image.jpg is loading" }
// { ready: false, reason: "Styles from https://example.com/style.css are loading" }
// { ready: false, reason: "Resources are not loaded", pendingResources: ["https://example.com/image.jpg"] }

Command Parameters

NameTypeDefaultDescription
timeoutNumber5000Timeout in milliseconds.
intervalNumber500Interval in milliseconds between condition checks.