Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 1.01 KB

File metadata and controls

24 lines (15 loc) · 1.01 KB

Check If an Image Has Loaded

Test Code: index.js

Tested Page: index.html

This example shows how to check whether an image on the page has loaded.

The tested page requests an image from the server. The server responds with the image after a specified timeout.

If the image loads, the promise is resolved, otherwise it's rejected.

During the test, the t.expect.ok method waits for the promise to resolve and checks its result.

TestCafe API in This Example