Configuring browsers for the Ultrafast Grid (UFG)
When it comes to multiple browsers and mobile devices, the Ultrafast grid shines. 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
Configuration configuration = eyes.getConfiguration();
configuration
.addBrowser(1400, 700, BrowserType.CHROME)
.addBrowser(1200, 900, BrowserType.FIREFOX)
.addBrowser(1200, 900, BrowserType.SAFARI)
.addBrowser(1200, 900, BrowserType.EDGE_CHROMIUM)
.addBrowser(1200, 900, BrowserType.IE_11)
;
eyes.setConfiguration(configuration);
}
Chrome device emulation
Predefined device:
Configuration configuration = eyes.getConfiguration();
configuration
.addBrowser(new ChromeEmulationInfo(DeviceName.Galaxy_S5, ScreenOrientation.LANDSCAPE))
.addBrowser(new ChromeEmulationInfo(DeviceName.iPhone_11_Pro, ScreenOrientation.PORTRAIT))
;
eyes.setConfiguration(configuration);
iOS device
Configuration configuration = eyes.getConfiguration();
configuration
.addBrowser(new IosDeviceInfo(IosDeviceName.iPhone_11_Pro, ScreenOrientation.PORTRAIT))
.addBrowser(new IosDeviceInfo(IosDeviceName.iPad_Air_4, ScreenOrientation.PORTRAIT, IosVersion.LATEST))
.addBrowser(new IosDeviceInfo(IosDeviceName.iPhone_12_Pro_Max, IosVersion.ONE_VERSION_BACK))
;
eyes.setConfiguration(configuration);
Possible values for iosVersion
are:
IosVersion.LATEST
- the latest iOS version that's supported by the UFGIosVersion.LATEST_ONE_VERSION_BACK'
- one version prior to the latest versionundefined
- the UFG's default
For a list of supported devices, see Devices.