dx584905
dx584905

Reputation: 311

How to simulate mouse wheel in Cypress?

I'm not able to simulate the mouse wheel. This code seems to do nothing.

cy.get('#elId')
 .trigger('mousemove')
 .trigger('wheel', { deltaY: -10, force: true })

Upvotes: 2

Views: 3933

Answers (1)

user2237529
user2237529

Reputation: 81

cy.get('#elId').trigger("wheel", { deltaY: -66.666666, wheelDelta: 120, wheelDeltaX: 0, wheelDeltaY: 120, bubbles: true})

Try the above

Upvotes: 2

Related Questions