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

fix: "RangeError: Index out of range | The value of "offset" is out of range" #9281

Merged
merged 6 commits into from
Nov 30, 2020

Conversation

santam85
Copy link
Contributor

@santam85 santam85 commented Nov 23, 2020

Closes #2034

Some browsers return in certain situations a negative offset for element positions, and this is generally not an issue in Cypress, until it attempts to crop a screenshot.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 23, 2020

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Nov 23, 2020

CLA assistant check
All committers have signed the CLA.

@santam85 santam85 changed the title Clamp lower bound of screenshot cropping to 0 Fix "RangeError: Index out of range | The value of "offset" is out of range" Nov 23, 2020
@santam85 santam85 changed the title Fix "RangeError: Index out of range | The value of "offset" is out of range" fix: "RangeError: Index out of range | The value of "offset" is out of range" Nov 23, 2020
Copy link
Member

@jennifer-shehane jennifer-shehane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This looks great. I've added a test to ensure this fixes the issue and we don't have a regression in the future.

This is good to merge in if all the tests pass.

@santam85
Copy link
Contributor Author

@jennifer-shehane good to hear. Any idea why the circleci checks were not coming in for me?

@jennifer-shehane
Copy link
Member

@santam85 Sometimes they don't run for certain outside contributors and it's not obvious why. I haven't had time to investigate why ☹️

@jennifer-shehane jennifer-shehane merged commit 7271384 into cypress-io:develop Nov 30, 2020
@jennifer-shehane
Copy link
Member

Before

Screen Shot 2020-11-30 at 3 06 54 PM

After

No error

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

Successfully merging this pull request may close these issues.

Error during screenshot capture: RangeError: Index out of range | The value of "offset" is out of range.
3 participants