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

#5181 - increase max viewport width from 3000 to 4000 px #5188

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/driver/src/cy/commands/window.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/driver/src/cypress/error_messages.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down