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

Unable to test interact js with cypress end-to-end testing library #871

Closed
TimVee opened this issue Nov 18, 2020 · 4 comments
Closed

Unable to test interact js with cypress end-to-end testing library #871

TimVee opened this issue Nov 18, 2020 · 4 comments
Labels

Comments

@TimVee
Copy link

TimVee commented Nov 18, 2020

This issue is the same as #856. That issue was closed because it didn't have a reproducible example, but I've created one here.

Expected behavior

I should be able to automate interaction with Cypress' trigger function, which programmatically creates events.

Actual behavior

Interact js does not pick up any triggered events from cypress.

System configuration

interact.js version: 1.10.0
Browser name and version: Chrome 86, Firefox 81
Operating System: Windows 10

@TimVee
Copy link
Author

TimVee commented Nov 18, 2020

It seems that Cypress by default creates an event of type Event, and not a more specific type like PointerEvent. Does interact.js use instanceof to check the type?

@TimVee
Copy link
Author

TimVee commented Nov 19, 2020

I've tried with the more specific Event types like PointerEvent and MouseEvent, and that makes the reproducible test pass. This issue can be closed because it seems to be an issue with Cypress' default behavior.

@taye
Copy link
Owner

taye commented Nov 27, 2020

By default only the primary mouse button can be used for actions and this button is checked from event.buttons. It looks like the lib you use for triggering pointer events doesn't set the buttons property on the events so it's probably initialized to 0. You might have to open an issue/PR in that repo or trigger your own pointer events with { buttons: 1 }.

@stale
Copy link

stale bot commented Dec 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

2 participants