Skip to content

Files

Latest commit

8f4a2e3 · Apr 16, 2021

History

History

check-if-image-loaded

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 20, 2020
Oct 20, 2020
Apr 16, 2021

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