Skip to content

Commit

Permalink
Merge pull request #76 from himbolion/main
Browse files Browse the repository at this point in the history
fix: use cypress config to force resolution viewport size everywhere
  • Loading branch information
PippoRaimondi authored Mar 24, 2022
2 parents d6a7ece + 9aa375f commit 344acfb
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
@@ -1,8 +1,8 @@
import { recurse } from 'cypress-recurse';

const compareSnapshotCommand = defaultScreenshotOptions => {
const height = process.env.HEIGHT || 1440
const width = process.env.WIDTH || 1980
const height = Cypress.config('viewportHeight') || 1440
const width = Cypress.config('viewportWidth') || 1980

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

0 comments on commit 344acfb

Please sign in to comment.