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.