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

Discrepancy in the properties of pointerdown event triggered by realClick #576

Closed
alirezamirian opened this issue Oct 27, 2023 · 2 comments · Fixed by #582
Closed

Discrepancy in the properties of pointerdown event triggered by realClick #576

alirezamirian opened this issue Oct 27, 2023 · 2 comments · Fixed by #582
Labels

Comments

@alirezamirian
Copy link
Contributor

Pointerdown events triggered as a result of calling realClick, have pressure 0, but in a real click, pressure is .5 in Chrome and Firefox. That can make code that uses libraries which are sensitive to those properties behave differently when testing with cypress.

Suggested solution

Add force: 0.5, to the Input.dispatchMouseEvent cdp command params. it's supported and sets pressure in the triggered event. I can open a PR if I get the green light.

If for some reason it's not acceptable to set force to 0.5 by default, an option would also make it possible to work around the issue.

@dmtrKovalenko
Copy link
Owner

dmtrKovalenko commented Oct 27, 2023

Yes I think it’s reasonable to set the default to cypress and provide an option to override. Feel free to open a pr.

I think that’s not even a breaking change

alirezamirian added a commit to alirezamirian/cypress-real-events that referenced this issue Nov 2, 2023
Real mouse press leads to pointerdown events with pressure set to 0.5, in Chrome and Firefox. Setting [force](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent:~:text=clicked%20(default%3A%200).-,force,-number) to 0.5 matches that.

Closes dmtrKovalenko#576
dmtrKovalenko pushed a commit that referenced this issue Nov 2, 2023
Real mouse press leads to pointerdown events with pressure set to 0.5, in Chrome and Firefox. Setting [force](https://chromedevtools.github.io/devtools-protocol/tot/Input/#method-dispatchMouseEvent:~:text=clicked%20(default%3A%200).-,force,-number) to 0.5 matches that.

Closes #576
@dmtrKovalenko
Copy link
Owner

🎉 This issue has been resolved in version 1.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants