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

Can not hover an element that is outside viewport #58

Open
garris opened this issue Aug 15, 2017 · 2 comments
Open

Can not hover an element that is outside viewport #58

garris opened this issue Aug 15, 2017 · 2 comments

Comments

@garris
Copy link
Contributor

garris commented Aug 15, 2017

@dotneet I think this may be a somewhat challenging issue.

I have a document with a height of 1000px and a viewport (window) with a height of only 800px, if I attempt to hover an item which starts at 900px (using mouseMoved()) the hover fails. This makes sense since in normal chrome it is impossible for a user to move the cursor beyond the window bounds. However, it causes confusion when taking screenshots in the document (whole page) context. This is especially true when using backstop because this was not a limitation of phantom.

I am wondering, would it be possible to maintain the user's intended cursor position (probably by simply aggregating arguments to all mouseMoved() calls) prior to switching to document context. If so, would it also be possible to set the user's intended cursor position prior to taking screenshots?

This is a pretty big issue for backstop usecases. What do you think?

@dotneet
Copy link
Contributor

dotneet commented Aug 15, 2017

@garris
Always enabling viewport emulation that is used in .screenshotDocument() will possibly be solution.
I'm not sure if it has possibility to cause another problem.
At least result of both .screenshot() and .scrollTo() will be changed. (this is allowable in backstopjs?)

Anyway I'll confirm whether this idea is possible and or find out another approach.

@garris
Copy link
Contributor Author

garris commented Aug 15, 2017

Thanks for the reply, just to be clear -- the issue is happening with the screenshotMultipleSelectors() use-case.

I like your first idea. Perhaps adding a method to force the necessary emulation (before making any mouseMoved() calls) would ensure there would be no regressions for established chromy cases? It may require some backstop refactoring for .screenshot() use-cases.

I still wonder if it is possible to simply add an extra mouseMoved() if called during chromy chain execution -- could be done just after you switch to alternate viewport (but before you take screenshot). I think this may impose the least amount of change -- but also I don't know if this is possible. ¯_(ツ)_/¯

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

No branches or pull requests

2 participants