question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use cypress on application bigger that 4000px wide

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
flotwigcommented, 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
})
0reactions
cypress-bot[bot]commented, Dec 12, 2019

Released in 3.8.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

viewport | Cypress Documentation
Control the size and orientation of the screen for your application. You can set the viewport's width and height globally by defining viewportWidth...
Read more >
Generate High-Resolution Videos and Screenshots - Cypress
This blog post shows how to increase the resolution of the videos and screenshots recorded during the cypress run execution.
Read more >
Best Practices - Cypress Documentation
Best Practice: Test specs in isolation, programmatically log into your application, and take control of your application's state.
Read more >
Split a very long Cypress test into shorter ones using App ...
My example application is called cypress-example-forms and it has a multi-page form. The user needs to fill 3 pages of fields before clicking ......
Read more >
Cypress App
The names and purposes of the visual parts of Cypress; How to use the Selector ... Running a large number of specs sequentially...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found