Closed sebbayer closed 6 months ago
I have also encountered this issue, thank you for the recommended solution. Do you have any details about why the position of the mouse persists? In particular I am surprised it is not "reset" following cy.visit()
. Thanks!
Since Cypress 12.0.0 the new Option
testIsolation
is enabled by default, so cookies, cache, localStorage and so on should be reset between tests. Also you have to callcy.visit()
at the beginning of each test now because it does not stay on the page between tests anymore.https://docs.cypress.io/guides/core-concepts/test-isolation
When one Cypress test sets the mouse position via
.realHover()
, the element is still hovered in the following test(s). So following assertions may fail. I think this behaviour is unexpected.Proof of concept would be something like:
And in the test:
A workaround would be something like this at the end of the first test: