Skip to content

Commit

Permalink
Merge pull request #51 from uktrade/fix/viewport-fails-if-string
Browse files Browse the repository at this point in the history
fix: ensure viewport is read as a number rather than a string
  • Loading branch information
PippoRaimondi authored Nov 19, 2021
2 parents 71742ae + 7e9dc8a commit 630adb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ const compareSnapshotCommand = defaultScreenshotOptions => {
const width = process.env.WIDTH || 1980

// Force screenshot resolution to keep consistency of test runs across machines
Cypress.config('viewportHeight', height)
Cypress.config('viewportWidth', width)
Cypress.config('viewportHeight', parseInt(height, 10))
Cypress.config('viewportWidth', parseInt(width, 10))

Cypress.Commands.add(
'compareSnapshot',
Expand Down

0 comments on commit 630adb9

Please sign in to comment.