Skip to content

Latest commit

 

History

History

check-if-image-loaded

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

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