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

BaseStrategy.setScrollArea endY is out of range #66

Open
GaryAlway opened this issue Feb 13, 2017 · 3 comments
Open

BaseStrategy.setScrollArea endY is out of range #66

GaryAlway opened this issue Feb 13, 2017 · 3 comments

Comments

@GaryAlway
Copy link

GaryAlway commented Feb 13, 2017

re: BaseStrategy.js

I updated the following code in order to debug your library as I was getting an exception when saving full document screenshots.

} else if (endY > documentHeight) { throw new Error(${endY} is out of range ${documentHeight}); }

The output is as follows:

Error: 2030 is out of range 2029
at MergeScreenshotStrategy.setScrollArea (node_modules/wdio-screenshot/lib/utils/strategies/BaseStrategy.js:48:15)
at makeAreaScreenshot$ (node_modules/wdio-screenshot/lib/modules/makeAreaScreenshot.js:85:30)
at tryCatch (node_modules/regenerator-runtime/runtime.js:64:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:355:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:116:21)
at tryCatch (node_modules/regenerator-runtime/runtime.js:64:40)
at invoke (node_modules/regenerator-runtime/runtime.js:154:20)
at node_modules/regenerator-runtime/runtime.js:164:13
at process._tickDomainCallback (internal/process/next_tick.js:129:7)

@GaryAlway GaryAlway changed the title BaseStrategy.setScrollArea endY is always out of range BaseStrategy.setScrollArea endY is out of range Feb 23, 2017
@GaryAlway
Copy link
Author

I am still getting this error but only occasionally. Do you have any idea why this might be happening?
Thanks

@mansn
Copy link

mansn commented Apr 18, 2017

@GaryAlway I'm guessing that this relates to zinserjan/wdio-screenshot/pull/54. Not sure if it's going to get merged though, sounds like there might be some other solution being built.

@emilyrohrbough
Copy link

emilyrohrbough commented Aug 30, 2018

Currently, when using the wdio-visual-regression service, when using checkElement() and an element is larger than the viewport, the screenshot fails because the BaseStrategy attempts to scroll the element in view. The error outputs are a bit unclear as to why until digging through code.

Outputs typically received:

endX is out of range

or

endY is out of range

I have logged an issue to add an additional option to "crop" the element screenshot at the viewport edge: #87

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

3 participants