0

I am using the a tool provided by saucelabs to create a user test.

I have a div containing an image and when you hover over it a box displaying where your magnifying appears and that area is then displayed to the right

The aim of the test is to verify when a user hovers over my main image a second div is displayed showing a magnified version of that image

So far I have created a test that passes but while I can see the magnification area over the image there is no image being displayed to the right of that. So in my eyes thats failing

Why is the test passing if the image is not being displayed?

NB

My last command is waitForVisible (which passes) and reading the documentation it states

Determines if the specified element is visible. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one of its ancestors. This method will fail if the element is not present.

tony09uk
  • 2,442
  • 9
  • 37
  • 61

1 Answers1

0

I'm not familiar with saucelabs nor their tool you mention, but I use RobotFramework + Selenium and I believe they are very alike.

Your problem may be because you are testing the visibility of your popup div only, add a new test just after that to test the visibility of the image to the right.

I would use something like this (please change the command names as needed):

...
Mouse Over | {locator of the element triggering the popup}
Wait Until Element Is Visible | {locator of the div with the magnified area}
Element Should Be Visible | {locator of the magnified image to the right}
Mouse Out | {locator of the element triggering the popup}
Element Should Not Be Visible | {locator of the div with the magnified area}
Element Should Not Be Visible | {locator of the magnified image to the right}
...

This way we first trigger the popup by hovering the image, then we wait for and assert the magnified area delimiter over the image, then we assert the magnified image itself to the right, then we make sure everything is back to normal when we remove the mouse pointer from the image.

Dalvenjia
  • 1,595
  • 1
  • 10
  • 15