Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longpress event #1487

Closed
daggett206 opened this issue Mar 22, 2018 · 2 comments · May be fixed by schanne/cypress#1, schanne/cypress#4 or schanne/cypress#11
Closed

Longpress event #1487

daggett206 opened this issue Mar 22, 2018 · 2 comments · May be fixed by schanne/cypress#1, schanne/cypress#4 or schanne/cypress#11

Comments

@daggett206
Copy link

[X] Question

Guys, is there a way to emulate long-press event on dom-node?

@daggett206
Copy link
Author

upd, just use

 cy.get(`selector`).trigger('mousedown');
 cy.wait(1000);
 cy.get(`selector`).trigger('mouseleave');

@kingdido999
Copy link

For some reason, long press was only triggered if I specify the mouse events on left button:

cy.get('selector')
  .trigger('mousedown', { button: 0 })
  .wait(1000)
  .trigger('mouseup', { button: 0 })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants