Skip to content

Commit

Permalink
Increase max viewport width to 4000px (#5189)
Browse files Browse the repository at this point in the history
* increasing max viewport width to 4000px

* Update window_spec.coffee
  • Loading branch information
nico-bellante authored and flotwig committed Sep 24, 2019
1 parent e0fb38f commit 01c3514
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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 @@ -640,32 +640,32 @@ 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)

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)

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

4 comments on commit 01c3514

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 01c3514 Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the linux x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/linux-x64/circle-develop-01c3514b783a0e09892052d433835359a7c648d4-154158/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.5.0/circle-develop-01c3514b783a0e09892052d433835359a7c648d4-154153/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 01c3514 Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 ia32 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/win32-ia32/appveyor-develop-01c3514b783a0e09892052d433835359a7c648d4-27631267/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.5.0/win32-ia32/appveyor-develop-01c3514b783a0e09892052d433835359a7c648d4-27631267/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 01c3514 Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AppVeyor has built the win32 x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

set CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/win32-x64/appveyor-develop-01c3514b783a0e09892052d433835359a7c648d4-27631267/cypress.zip
npm install https://cdn.cypress.io/beta/binary/3.5.0/win32-x64/appveyor-develop-01c3514b783a0e09892052d433835359a7c648d4-27631267/cypress.zip

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 01c3514 Sep 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Circle has built the darwin x64 version of the Test Runner.

You can install this pre-release platform-specific build using instructions at https://on.cypress.io/installing-cypress#Install-pre-release-version.

You will need to use custom CYPRESS_INSTALL_BINARY url and install Cypress using an url instead of the version.

export CYPRESS_INSTALL_BINARY=https://cdn.cypress.io/beta/binary/3.5.0/darwin-x64/circle-develop-01c3514b783a0e09892052d433835359a7c648d4-154171/cypress.zip
npm install https://cdn.cypress.io/beta/npm/3.5.0/circle-develop-01c3514b783a0e09892052d433835359a7c648d4-154170/cypress.tgz

Please sign in to comment.