add_browsers method
Request that the test be run using the Ultrafast Grid to generate checkpoint images on multiple desktop browsers and viewport sizes.
Syntax
configval = config.add_browsers(renders_info)
Parameters
- renders_info
- Type:*Union[DesktopBrowserInfo,IosDeviceInfo,ChromeEmulationInfo]
One or more browser or device configuration definitions passed as an array or multiple parameters.
Define the browser or device configurations using instances of one or more of the following classes:
- DesktopBrowserInfo: to run the test on a desktop browser.
- IosDeviceInfo: to run the test on a Simulated iOS mobile device.
- ChromeEmulationInfo: to run the test using on an emulated mobile device.
Return value
- Type: Configuration
-
The value returned is the object that called the method.
This allows you to use a fluent style to call the
setXXXX
methods of the Configuration class.
Remarks
You can use this method to pass a list of configurations, for example based on a configuration file
instead of configuring each browser device
individually using multiple calls to Configuration.add_browser.
Example
# test suite setup
target_list = [
DesktopBrowserInfo(viewport_width, viewport_height, BrowserType.FIREFOX),
ChromeEmulationInfo(DeviceName.Galaxy_S3, ScreenOrientation.LANDSCAPE),
IosDeviceInfo(IosDeviceName.iPhone_8, ScreenOrientation.PORTRAIT)
]
suite_config = (Configuration()
.add_browsers(target_list)
# ... other configurations
)
#
# Assign the configuration to all newly created Eyes instances
#
eyes = Eyes(runner)
eyes.set_configuration(suite_config)