3.5.0-3.6.1 regression screenshot on element can be out of bounds
See original GitHub issueCurrent behavior:
We take a screenshot of an element:
which is clearly within bounds but we get the following error from cypress:
RangeError [ERR_OUT_OF_RANGE] [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 7423996. Received -6368
at boundsError (internal/buffer.js:58:9)
at Buffer.readUInt32BE (internal/buffer.js:205:5)
at Jimp.<anonymous> (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\@jimp\plugin-crop\dist\index.js:46:37)
at scan (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\@jimp\utils\dist\index.js:46:9)
at Jimp.scanQuiet (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\@jimp\core\dist\index.js:1308:32)
at Jimp.cropQuiet (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\@jimp\plugin-crop\dist\index.js:45:12)
at Jimp.(anonymous function) [as crop] (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\@jimp\core\dist\index.js:1222:23)
at crop (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\lib\screenshots.js:145:26)
at d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\lib\screenshots.js:362:19
at tryCatcher (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:547:31)
at Promise._settlePromise (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:604:18)
at Promise._settlePromise0 (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:649:10)
at Promise._settlePromises (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\promise.js:729:18)
at _drainQueueStep (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:93:12)
at _drainQueue (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:86:9)
at Async._drainQueues (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (d:\work\1\s\node_modules\.azure_pipeline_cypress_cache\3.6.1\Cypress\resources\app\packages\server\node_modules\bluebird\js\release\async.js:15:14)
at processImmediate (internal/timers.js:443:21)
so somehow, cypress thinks the element begins at -6368.
Steps to reproduce: (app code and test code)
I can try and work on a small repro case, but I wanted to check first to see if there are any other reports (cannot find myself in github issues) or you have an idea of what to check?
Also, I’m not particularly bothered by this issue as I will just change the screenshots to be full page in this case - they are only shaving off a few pixels.
Versions
3.6.1, windows 10
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
How to capture the screenshot of a specific element rather ...
This program captures the screenshot of the whole page and crop the element based on its location. The element image will be available...
Read more >screenshot - Cypress Documentation
Cypress then automatically takes a screenshot when the test fails, but it is possible something in your application changed within this 100ms timeframe....
Read more >Taking screenshots — Firefox Source Docs documentation
With this parameter, even the parts of the webpage which are outside the current bounds of the window will be included in the...
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
Hi @jennifer-shehane I am getting an element out of bounds exception with some element.
cypress 4.0.2 cypress-plugin-snapshots 1.2.9 cypress-visual-regression 1.0.5 @jennifer-shehane can I DM you my test with the failing line?
having the same problem… any workarounds here? thanks
it happens only via cypress run, does not happen with cypress open…