The examples use @applitools/eyes-selenium
but are relevant also for webdriver.io and protractor SDK's.
const {IosDeviceName, ScreenOrientation} = require('@applitools/eyes-selenium')
// ...
configuration.addBrowser({
iosDeviceInfo: {
deviceName: IosDeviceName.iPhone_11,
screenOrientation: ScreenOrientation.LANDSCAPE,
},
})
const {IosDeviceName, ScreenOrientation} = require('@applitools/eyes-selenium')
// ...
configuration.addBrowsers(
{
iosDeviceInfo: {
deviceName: IosDeviceName.iPhone_11,
screenOrientation: ScreenOrientation.LANDSCAPE,
},
},
{
iosDeviceInfo: {
deviceName: IosDeviceName.iPhone_7,
screenOrientation: ScreenOrientation.PORTRAIT,
},
},
)
const {ScreenOrientation, DeviceName} = require('@applitools/eyes-selenium')
// ...
configuration.addBrowser({
deviceName: DeviceName.iPhone_XS,
screenOrientation: ScreenOrientation.PORTRAIT,
})
const {ScreenOrientation, DeviceName} = require('@applitools/eyes-selenium')
// ...
configuration.addBrowser({
chromeEmulationInfo: {
deviceName: DeviceName.iPhone_6_7_8,
screenOrientation: ScreenOrientation.PORTRAIT,
},
})
const {BrowserType} = require('@applitools/eyes-selenium')
// ...
configuration.addBrowser({
name: BrowserType.EDGE_CHROMIUM_TWO_VERSIONS_BACK,
width: 768,
height: 1024,
})
cy.eyesOpen({
appName: 'Play Cypress',
browser: [
// Desktop
{
name: 'edgechromium-two-versions-back',
width: 768,
height: 1024,
},
// Device emulation
{
deviceName: 'iPhone X',
screenOrientation: 'landscape',
},
// Mobile Web API
{
iosDeviceInfo: {
deviceName: 'iPhone XR',
screenOrientation: 'landscape',
},
},
],
});
// Or one browser only method
cy.eyesOpen({
appName: 'Play Cypress',
browser: {
iosDeviceInfo: {
deviceName: 'iPhone XR',
screenOrientation: 'landscape',
},
},
});
module.exports = {
browser: [
// Desktop
{
name: 'edgechromium-two-versions-back',
width: 768,
height: 1024,
},
// Device emulation
{
deviceName: 'iPhone X',
screenOrientation: 'landscape',
},
// Mobile Web API
{
iosDeviceInfo: {
deviceName: 'iPhone XR',
screenOrientation: 'landscape',
},
},
],
}
await eyes.open({
appName: 'Hello World!',
testName: 'My first JavaScript test!',
t,
browser: [
// Desktop
{
name: 'edgechromium-two-versions-back',
width: 768,
height: 1024,
},
// Device emulation
{
deviceName: 'iPhone X',
screenOrientation: 'landscape',
},
// Mobile Web API
{
iosDeviceInfo: {
deviceName: 'iPhone XR',
screenOrientation: 'landscape',
},
},
],
});