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
Labels
existing workaround pkg/driver This is due to an issue in the packages/driver directory

Comments

@digiink
Copy link
Contributor

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

@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Dec 4, 2019
@jennifer-shehane jennifer-shehane added pkg/driver This is due to an issue in the packages/driver directory stage: ready for work The issue is reproducible and in scope and removed stage: ready for work The issue is reproducible and in scope labels Dec 4, 2019
@jennifer-shehane
Copy link
Member

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

@gabbersepp
Copy link
Contributor

Is there a valid reason for the limits?

@cypress-bot cypress-bot bot added stage: work in progress and removed stage: ready for work The issue is reproducible and in scope labels Dec 4, 2019
@digiink
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

flotwig commented Dec 5, 2019

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

@cypress-bot
Copy link
Contributor

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.
Labels
existing workaround pkg/driver This is due to an issue in the packages/driver directory
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants