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

Use cypress on application bigger that 4000px wide #5871

Closed
digiink opened this issue Dec 4, 2019 · 8 comments · Fixed by #5882
Closed

Use cypress on application bigger that 4000px wide #5871

digiink opened this issue Dec 4, 2019 · 8 comments · Fixed by #5882

Comments

@digiink
Copy link
Contributor

@digiink digiink commented Dec 4, 2019

Current behavior:

I have a application which is displayed across multiple screens which is bigger that the max screen size of 400px wide

cy.viewport(7680, 1601);
Error:
CypressError: cy.viewport() width and height must be between 20px and 4000px.

Desired behavior:

The max cy.viewport() width and height increased to 8000px.

Steps to reproduce: (app code and test code)

cy.viewport(7680, 1601);

https://github.com/digiink/cypress-test-tiny

Versions

Cypress package version: 3.6.1
Cypress binary version: 3.6.1
Mac OS 10.14
Chrome 78

@jennifer-shehane

This comment has been minimized.

Copy link
Member

@jennifer-shehane jennifer-shehane commented Dec 4, 2019

Here is the previous PR that upped the max value: #5189

@gabbersepp

This comment has been minimized.

Copy link
Contributor

@gabbersepp gabbersepp commented Dec 4, 2019

Is there a valid reason for the limits?

@digiink

This comment has been minimized.

Copy link
Contributor Author

@digiink digiink commented Dec 4, 2019

No valid reason, I feel that the max should be set in the config with a default lower limit set in the code but this is outside my ability in this codebase at the moment.

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Dec 4, 2019

Is there a valid reason for the limits?

I think the intention is to prevent users from accidentally setting something unreasonably huge and crashing/freezing the browser. I do not think there is a practical reason outside of that.

Instead of adding more config options, I'm in favor of just removing the limitation. In the year 2022, people are probably gonna be using Cypress with 16k res screens, so I think we should just save the time now and remove the restriction, or set it to something that is clearly infeasible (like 100k or 1 million).

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Dec 4, 2019

As a workaround, you can suppress this error by using cy.stub to stub out the Cypress error function.

Add the following to your specs or to your support file:

beforeEach(() => {
  cy.stub(Cypress.utils, "throwErrByPath")
  .callThrough() // still throw other types of errors
  .withArgs("viewport.dimensions_out_of_range").returns() // suppress invalid value errors
})
@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Dec 5, 2019

The code for this is done in cypress-io/cypress#5882, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Dec 5, 2019

Created an issue to remove/vastly increase the limits: #5892

@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Dec 12, 2019

Released in 3.8.0.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.