From 01c3514b783a0e09892052d433835359a7c648d4 Mon Sep 17 00:00:00 2001 From: nico-bellante <35939126+nico-bellante@users.noreply.github.com> Date: Tue, 24 Sep 2019 07:28:25 -0700 Subject: [PATCH] Increase max viewport width to 4000px (#5189) * increasing max viewport width to 4000px * Update window_spec.coffee --- packages/driver/src/cy/commands/window.coffee | 2 +- packages/driver/src/cypress/error_messages.coffee | 2 +- .../integration/commands/window_spec.coffee | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/driver/src/cy/commands/window.coffee b/packages/driver/src/cy/commands/window.coffee index e6b3ec5a1375..0d6ca733cd3b 100644 --- a/packages/driver/src/cy/commands/window.coffee +++ b/packages/driver/src/cy/commands/window.coffee @@ -159,7 +159,7 @@ module.exports = (Commands, Cypress, cy, state, config) -> widthAndHeightAreWithinBounds = (width, height) -> _.every [width, height], (val) -> - val >= 20 and val <= 3000 + val >= 20 and val <= 4000 switch when _.isString(presetOrWidth) and _.isBlank(presetOrWidth) diff --git a/packages/driver/src/cypress/error_messages.coffee b/packages/driver/src/cypress/error_messages.coffee index 1c98ecfdac07..54d6801baaba 100644 --- a/packages/driver/src/cypress/error_messages.coffee +++ b/packages/driver/src/cypress/error_messages.coffee @@ -976,7 +976,7 @@ module.exports = { viewport: bad_args: "#{cmd('viewport')} can only accept a string preset or a width and height as numbers." - dimensions_out_of_range: "#{cmd('viewport')} width and height must be between 20px and 3000px." + dimensions_out_of_range: "#{cmd('viewport')} width and height must be between 20px and 4000px." empty_string: "#{cmd('viewport')} cannot be passed an empty string." invalid_orientation: "#{cmd('viewport')} can only accept '{{all}}' as valid orientations. Your orientation was: '{{orientation}}'" missing_preset: "#{cmd('viewport')} could not find a preset for: '{{preset}}'. Available presets are: {{presets}}" diff --git a/packages/driver/test/cypress/integration/commands/window_spec.coffee b/packages/driver/test/cypress/integration/commands/window_spec.coffee index ca012cf72d49..fc6ff91e4bf7 100644 --- a/packages/driver/test/cypress/integration/commands/window_spec.coffee +++ b/packages/driver/test/cypress/integration/commands/window_spec.coffee @@ -640,7 +640,7 @@ describe "src/cy/commands/window", -> it "throws when passed negative numbers", (done) -> cy.on "fail", (err) => expect(@logs.length).to.eq(1) - expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 3000px." + expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px." done() cy.viewport(800, -600) @@ -648,7 +648,7 @@ describe "src/cy/commands/window", -> it "throws when passed width less than 20", (done) -> cy.on "fail", (err) => expect(@logs.length).to.eq(1) - expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 3000px." + expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px." done() cy.viewport(19, 600) @@ -656,16 +656,16 @@ describe "src/cy/commands/window", -> it "does not throw when passed width equal to 20", -> cy.viewport(20, 600) - it "throws when passed height greater than than 3000", (done) -> + it "throws when passed height greater than than 4000", (done) -> cy.on "fail", (err) => expect(@logs.length).to.eq(1) - expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 3000px." + expect(err.message).to.eq "cy.viewport() width and height must be between 20px and 4000px." done() - cy.viewport(1000, 3001) + cy.viewport(1000, 4001) - it "does not throw when passed width equal to 3000", -> - cy.viewport(200, 3000) + it "does not throw when passed width equal to 4000", -> + cy.viewport(200, 4000) it "throws when passed an empty string as width", (done) -> cy.on "fail", (err) =>