Skip to content

Commit 01c3514

Browse files
nico-bellanteflotwig
authored andcommitted
Increase max viewport width to 4000px (#5189)
* increasing max viewport width to 4000px * Update window_spec.coffee
1 parent e0fb38f commit 01c3514

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/driver/src/cy/commands/window.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ module.exports = (Commands, Cypress, cy, state, config) ->
159159

160160
widthAndHeightAreWithinBounds = (width, height) ->
161161
_.every [width, height], (val) ->
162-
val >= 20 and val <= 3000
162+
val >= 20 and val <= 4000
163163

164164
switch
165165
when _.isString(presetOrWidth) and _.isBlank(presetOrWidth)

packages/driver/src/cypress/error_messages.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ module.exports = {
976976

977977
viewport:
978978
bad_args: "#{cmd('viewport')} can only accept a string preset or a width and height as numbers."
979-
dimensions_out_of_range: "#{cmd('viewport')} width and height must be between 20px and 3000px."
979+
dimensions_out_of_range: "#{cmd('viewport')} width and height must be between 20px and 4000px."
980980
empty_string: "#{cmd('viewport')} cannot be passed an empty string."
981981
invalid_orientation: "#{cmd('viewport')} can only accept '{{all}}' as valid orientations. Your orientation was: '{{orientation}}'"
982982
missing_preset: "#{cmd('viewport')} could not find a preset for: '{{preset}}'. Available presets are: {{presets}}"

packages/driver/test/cypress/integration/commands/window_spec.coffee

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -640,32 +640,32 @@ describe "src/cy/commands/window", ->
640640
it "throws when passed negative numbers", (done) ->
641641
cy.on "fail", (err) =>
642642
expect(@logs.length).to.eq(1)
643-
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 3000px."
643+
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px."
644644
done()
645645

646646
cy.viewport(800, -600)
647647

648648
it "throws when passed width less than 20", (done) ->
649649
cy.on "fail", (err) =>
650650
expect(@logs.length).to.eq(1)
651-
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 3000px."
651+
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px."
652652
done()
653653

654654
cy.viewport(19, 600)
655655

656656
it "does not throw when passed width equal to 20", ->
657657
cy.viewport(20, 600)
658658

659-
it "throws when passed height greater than than 3000", (done) ->
659+
it "throws when passed height greater than than 4000", (done) ->
660660
cy.on "fail", (err) =>
661661
expect(@logs.length).to.eq(1)
662-
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 3000px."
662+
expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px."
663663
done()
664664

665-
cy.viewport(1000, 3001)
665+
cy.viewport(1000, 4001)
666666

667-
it "does not throw when passed width equal to 3000", ->
668-
cy.viewport(200, 3000)
667+
it "does not throw when passed width equal to 4000", ->
668+
cy.viewport(200, 4000)
669669

670670
it "throws when passed an empty string as width", (done) ->
671671
cy.on "fail", (err) =>

0 commit comments

Comments
 (0)