Configuring the browser
Eyes-Testcafe 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 eyes.open
.
Possible values are:
chrome
firefox
edgechromium
edgelegacy
ie10
ie11
safari
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
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.
Getting a screenshot of multiple browsers in parallel
You can send an array of browsers.
Example
eyes.open({
...
browser: [
{width: 800, height: 600, name: 'firefox'},
{width: 1024, height: 768, name: 'chrome'},
{width: 1024, height: 768, name: 'ie11'}
]
}
Note: that if only a single browser is set, then Eyes-Testcafe changes the TestCafe's browser viewport to that size.
Device emulation
To enable Chrome's device emulation, you can send a device name and screen orientation.
Example
eyes.open({
// ...
browser: {
deviceName: 'iPhone 16',
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.
}
}
Possible values for screen orientation are landscape
and portrait
; if no value is specified, the default is portrait
.
For a list of supported devices, see Chrome mobile emulation .
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
eyes.open({
// ...
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
eyes.open({
// ...
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)
},
}
})
For a list of supported devices, see Chrome mobile emulation .
Possible values for iosVersion
are:
'latest'
- the latest iOS version that's supported by the UFG'latest-1'
- one version prior to the latest versionundefined
- the UFG's default