Skip to main content

Configuring Browsers for the Ultrafast Grid (UFG)

The Ultrafast Grid allows you to run tests across multiple browsers and devices. You can run one functional test, and in the background have multiple screenshots rendered for different browsers, viewport sizes, and mobile devices.

The API methods are:

  • configuration.addBrowser(browser) to add a single browser configuration.
  • configuration.addBrowsers(browser1, browser2, ...) to add single or multiple browser configurations.

Here are examples for how to execute visual tests on different browsers and platforms:

Desktop Browsers

const {BrowserType} = require('@applitools/eyes-webdriverio')
// ...
const configuration = eyes.getConfiguration()
configuration.addBrowsers(
{name: BrowserType.EDGE_CHROMIUM, width: 768, height: 1024},
{name: BrowserType.EDGE_LEGACY, width: 768, height: 1024},
{name: BrowserType.FIREFOX, width: 768, height: 1024},
{name: BrowserType.CHROME, width: 768, height: 1024},
{name: BrowserType.IE_11, width: 768, height: 1024},
{name: BrowserType.IE_10, width: 768, height: 1024},
{name: BrowserType.SAFARI, width: 768, height: 1024},
{name: BrowserType.CHROME_ONE_VERSION_BACK, width: 768, height: 1024},
{name: BrowserType.CHROME_TWO_VERSIONS_BACK, width: 768, height: 1024},
// ...
)
eyes.setConfiguration(configuration)

Chrome Device Emulation

Predefined Device

const {ScreenOrientation, DeviceName} = require('@applitools/eyes-webdriverio')
// ...
const configuration = eyes.getConfiguration()
configuration.addBrowsers(
{
chromeEmulationInfo: {
deviceName: DeviceName.iPhone_6_7_8,
},
},
{
chromeEmulationInfo: {
deviceName: DeviceName.Galaxy_S9_Plus,
screenOrientation: ScreenOrientation.LANDSCAPE,
},
},
)
eyes.setConfiguration(configuration)

Custom Device

const configuration = eyes.getConfiguration()
configuration.addBrowser({
chromeEmulationInfo: {
width: 800,
height: 600,
deviceScaleFactor: 3,
},
})
eyes.setConfiguration(configuration)

iOS Device

const {
IosDeviceName,
ScreenOrientation,
IosVersion,
} = require("@applitools/eyes-webdriverio");
// ...
const configuration = eyes.getConfiguration();
configuration.addBrowser({
iosDeviceInfo: {
deviceName: IosDeviceName.iPhone_11,
screenOrientation: ScreenOrientation.LANDSCAPE, // optional, default: ScreenOrientation.PORTRAIT
iosVersion: IosVersion.LATEST, // optional, default: undefined (determined by the Ultrafast grid)
},
});
eyes.setConfiguration(configuration);

For a list of supported devices, see Devices.

Possible values for iosVersion are:

  • IosVersion.LATEST - The latest iOS version that is supported by the Ultrafast Grid
  • IosVersion.LATEST_ONE_VERSION_BACK' - One version prior to the latest version
  • undefined - The default version used by the Ultrafast Grid