Reputation: 25699
I'm trying to do this
$I->seeElement('DIV#security IMG.verisign');
to check if the images with the Verisign logo is loaded, but the test passes even if the image is not loaded (for a 404 if the file name of the source is wrong).
What's the right way to check for image loaded?
Upvotes: 2
Views: 614
Reputation: 42538
You can check the naturalHeight to validate that the image correctly loaded:
$this->assertGreaterThan($element->getAttribute('naturalHeight'), 1);
Upvotes: 2