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.
- Test Structure:
- Fixture.page Method
- test Function
- Assertion and Evaluation:
- t.expect.ok Method
- Custom Scripts:
- ClientFunction Object