Calling screenshot() on an element that changes sizes after scrolling throws 'is invalid for option "size"' exception
See original GitHub issueCurrent behavior:
Using the screenshot command on an element that changes sizes after scrolling causes an exception to be thrown when trying to stitch them together.
RangeError: The value "-36960000" is invalid for option "size"
at Function.allocUnsafe (buffer.js:272:3)
at Jimp.cropQuiet (Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/node_modules/@jimp/plugin-crop/dist/index.js:42:27)
at Jimp.<computed> [as crop] (Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/node_modules/@jimp/core/dist/index.js:1266:23)
at crop (Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/lib/screenshots.js:145:26)
at Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/lib/screenshots.js:209:22
at arrayEach (Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:516:11)
at Function.forEach (Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/node_modules/lodash/lodash.js:9342:14)
at stitchScreenshots (Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/lib/screenshots.js:206:7)
at Library/Caches/Cypress/3.8.1/Cypress.app/Contents/Resources/app/packages/server/lib/screenshots.js:350:21
at processImmediate (internal/timers.js:439:21)
Desired behavior:
The screenshot command should properly create an image instead of throwing an exception.
Steps to reproduce:
See: https://github.com/Keysox/cypress-screenshot-issue
Versions
Cypress: 3.8.1
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to Use Touch Actions in Appium: Swipe Tap Touch
Press by using an element and duration (in seconds); Press by using x,y coordinates, and duration (in seconds); Horizontal swipe by using the ......
Read more >HTML2Canvas does not render full div, only what is visible on ...
I'm using v5 beta 3. When this code runs, it only renders what is visible on the screen. The #potenzial-page div is essentially...
Read more >Common issues and resolutions for Power Apps
This article lists some common issues that you might encounter while using Power Apps. Where applicable, workarounds are provided. Note. For ...
Read more >ImageView - Android Developers
android:accessibilityLiveRegion, Indicates to accessibility services whether the user should be notified when this view changes.
Read more >Modal | Components - BootstrapVue
These buttons can be customized by setting various props on the component. You can customize the size of the buttons, disable buttons, hide...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is still failing in 4.9.0. Full reproducible example:
index.html
spec.js
Released in
4.11.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v4.11.0, please open a new issue.