Cypress browser configuration
Eyes-Cypress will take a screenshot of the page in the requested browser, the browser can be set in the applitools.config.js
or by passing it to cy.eyesOpen
.
Supported values
chrome
firefox
edgechromium
edgelegacy
ie10
ie11
safari
Previous browser versions
*-one-version-back
and *-two-versions-back
are relative to the version of the same browser.
For example, if chrome
refers to version 79, then chrome-one-version-back
will be Chrome 78 and chrome-two-versions-back
will be Chrome 77.
Supported values
chrome-one-version-back
chrome-two-versions-back
firefox-one-version-back
firefox-two-versions-back
safari-one-version-back
safari-two-versions-back
edgechromium-one-version-back
edgechromium-two-versions-back
Getting a screenshot of multiple browsers in parallel
You can send an array of browsers
Example
cy.eyesOpen({
...
browser: [
{width: 800, height: 600, name: 'firefox'},
{width: 1024, height: 768, name: 'chrome'},
{width: 1024, height: 768, name: 'ie11'}
]
}
Note: If only a single browser is set, then Eyes-Cypress changes the Cypress application viewport to that viewport size.
Device emulation
To enable Chrome's device emulation, you can send a device name and screen orientation.
Example
cy.eyesOpen({
...
browser: {
deviceName: 'iPhone X',
screenOrientation: 'landscape',
name: 'chrome' // optional, just to make it explicit this is browser emulation and not a real device. Only chrome is supported for device emulation.
}
}
Values
Possible values for screen orientation are:
landscape
portrait
(default).
For a list of supported devices, see DeviceName enum
In addition, you can use Chrome's device emulation with custom viewport sizes, pixel density and mobile mode, by passing deviceScaleFactor
and mobile
in addition to width
and height
.
Example
cy.eyesOpen({
...
browser: {
width: 800,
height: 600,
deviceScaleFactor: 3,
mobile: true,
name: 'chrome' // optional, just to make it explicit this is browser emulation and not a real device. Only Chrome is supported for device emulation.
}
}
iOS device
For a list of supported devices, see DeviceName enum
Possible values for iosVersion
:
'latest'
- The latest iOS version that's supported by the Ultrafast Grid'latest-1'
- One version prior to the latest versionundefined
- The default of the Ultrafast Grid.
Example
cy.eyesOpen({
// ...
browser: {
iosDeviceInfo: {
deviceName: 'iPhone XR',
screenOrientation: 'landscape', // optional, default: 'portrait'
iosVersion: 'latest' // optional, default: undefined (i.e. the default is determined by the Ultrafast grid)
},
}
})