Reputation: 2224
I have a "react" app, #controlsBar
should be visible when mouseover #video-container
, but the following code failed
cy.get("#controlsBar").should("be.hidden");
cy.get("#video-container")
.trigger("mouseover")
.then((elem) => {
cy.get(elem).children().eq(3).should("be.visible"); //this is #controlsBar
//cy.get("#controlsBar").should("be.visible"); //this failed also
cy.get("#controlsBar").invoke("show");
});
Upvotes: 0
Views: 595
Reputation: 18650
I would suggest you to use the cypress-real-events package.
To Install use npm install cypress-real-events
.
Then under cypress/support/index.js
file write import "cypress-real-events/support";
.
Then in your test you can write:
cy.get("#video-container").realHover()
Upvotes: 2