Configuration class
This class is used to create a configuration object that is used to configure an Eyes object by passing it to the Eyes.setConfiguration method.
You can use this configuration object instead of using the various Eyes methods and properties that set the same attributes. Typically you set up a Configuration object by calling its set<xyz> methods chained with a '.' in a Fluent coding style.
Import statement
import com.applitools.eyes.selenium.Configuration;
Configuration method
Syntax
Configuration config = new Configuration();
Parameters
This method does not take any parameters.
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 set<XYZ> methods of the Configuration class.
addBrowser method
Syntax
Configuration value = configuration.addBrowser(renderBrowserInfo);
Configuration value = configuration.addBrowser(desktopBrowserInfo);
Configuration value = configuration.addBrowser(chromeEmulationInfo);
Configuration value = configuration.addBrowser(iosDeviceInfo);
Configuration value = configuration.addBrowser(width, height, browserType, baselineEnvName);
Configuration value = configuration.addBrowser(width, height, browserType);
Configuration value = configuration.addBrowser(width, height, browserType, baselineEnvName);
Configuration value = configuration.addBrowser(width, height, browserType);
Parameters
desktopBrowserInfo
Type:
DesktopBrowserInfoWhich desktop browser type and viewport size to use.
Java/* test suite setup */
chromeEmulationInfo
Type:
ChromeEmulationInfoWhich mobile device to emulate and its vertical or horizontal orientation.
Java/* test suite setup */
suiteConfig = new Configuration()
.addBrowser(new ChromeEmulationInfo(DeviceName.Galaxy_S5, ScreenOrientation.LANDSCAPE))
/* ... other configurations */ ;
/*
* Assign the configuration to all newly created Eyes instances
*/
eyes = new Eyes(runner);
eyes.setConfiguration(suiteConfig);
iosDeviceInfo
Type:
IosDeviceInfo
Defines the mobile device to be simulated and its vertical or horizontal orientation.
/* test suite setup */
suiteConfig = new Configuration()
.addBrowser(new IosDeviceInfo(IosDeviceName.iPhone_11, ScreenOrientation.PORTRAIT))
/* Assign the configuration to all newly created Eyes instances /*
eyes = new Eyes(runner);
eyes.setConfiguration(suiteConfig);
width
Type: int
The width of the browser viewport for this target. The maximum viewport width for all browsers is 5120. If this limit is exceeded, then execution of the checkpoint will fail.
Use this in conjunction with the browserType parameter.
height
Type: int
The height of the browser viewport for this target. There is no height limit.
Use this in conjunction with the browserType parameter.
browserType
Type:
BrowserTypeThe type of browser for this target.
/* test suite setup */
suiteConfig = new Configuration()
.addBrowser(viewPortWidth, viewPortHeight, BrowserType.CHROME)
/* ... other configurations */ ;
/*
* Assign the configuration to all newly created Eyes instances
*/
eyes = new Eyes(runner);
eyes.setConfiguration(suiteConfig);
baselineEnvName
Type: String
The name of the baseline environment. If provided, then the viewport, host app (browser), and OS that define the baseline are defined by the baseline environment name and not by the execution environment. The name should already be defined in the Test Manager. If it is not defined, then it will be created based on the execution environment of the first test that uses that name. For more information see Running cross-environment tests.
Use this in conjunction with the
browserTypeparameter.
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 set<XYZ> methods of the Configuration class.
Remarks
By default, the entire page is rendered. The viewport width and height parameters impact the baseline that is chosen, unless the baseline environment configuration or parameter has been provided. The viewport passed to the Eyes.open method does not impact the baseline used, but could impact the page layout if the page has any viewport size-sensitive factors such as HTML, CSS or Javascript.
addBrowsers method
Syntax
Configuration configval = config.addBrowsers(browserInfos);
Parameters
browserInfos
Type: IRenderingBrowserInfo...
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 set<XYZ> methods of the Configuration class.
Remarks
You can use this method to pass a list of configurations instead of configuring each browser device individually using multiple calls to addBrowser.
Example
/* test suite setup */
IRenderingBrowserInfo[] browserList = {
new DesktopBrowserInfo(viewPortWidth, viewPortHeight, BrowserType.FIREFOX),
new ChromeEmulationInfo(DeviceName.Galaxy_Note_3, ScreenOrientation.LANDSCAPE),
new IosDeviceInfo(IosDeviceName.iPhone_8, ScreenOrientation.PORTRAIT)
};
suiteConfig = new Configuration()
.addBrowsers(browserList)
/* ... other configurations */ ;
/*
* Assign the configuration to all newly created Eyes instances
*/
eyes = new Eyes(runner);
eyes.setConfiguration(suiteConfig);
addDeviceEmulation method
Syntax
Configuration configval = config.addDeviceEmulation(deviceName, orientation);
Configuration configval = config.addDeviceEmulation(deviceName);
Configuration configval = config.addDeviceEmulation(deviceName, baselineEnvName);
Configuration configval = config.addDeviceEmulation(deviceName, orientation, baselineEnvName);
Parameters
deviceName
Type:
DeviceNameThe name of the device, from the list of devices defined by
DeviceName.
orientation
Type:
ScreenOrientation
Whether the device is in portrait or landscape mode.
baselineEnvName
Type: String
The name of the baseline environment. If provided, then the viewport, host app (browser), and OS that define the baseline are defined by the baseline environment name and not by the execution environment. The name should already be defined in the Test Manager. If it is not defined, then it will be created based on the execution environment of the first test that uses that name. For more information see Running cross-environment tests.
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 set<XYZ> methods of the Configuration class.
addMobileDevice method
Syntax
Configuration value = configuration.addMobileDevice(iosDeviceInfo);
Configuration value = configuration.addMobileDevice(iosDeviceInfo, version);
Parameters
iosDeviceInfo
Type: IosDeviceInfo
Description needed.
version
Type: String
Description needed.
Return value
Type: Configuration
addMobileDevices method
Syntax
Configuration value = configuration.addMobileDevices(iosDeviceInfo, iosDeviceInfos);
Parameters
iosDeviceInfo
Type: IosDeviceInfo
Description needed.
iosDeviceInfos
Type: IosDeviceInfo...
Description needed.
Return value
Type: Configuration
addMultiDeviceTarget method
Syntax
Configuration value = configuration.addMultiDeviceTarget(deviceTarget, deviceTargets);
Parameters
deviceTarget
Type: DeviceTarget
Description needed.
deviceTargets
Type: DeviceTarget...
Description needed.
Return value
Type: Configuration
addProperty method
Syntax
Configuration value = configuration.addProperty(name, value);
Parameters
name
Type: String
Description needed.
value
Type: String
Description needed.
Return value
Type: Configuration
clearProperties method
Syntax
configuration.clearProperties();
Parameters
This method does not take any parameters.
Return value
Type: void
getAbortIdleTestTimeout method
Syntax
Integer value = configuration.getAbortIdleTestTimeout();
Parameters
This method does not take any parameters.
Return value
Type: Integer
getAccessibilityValidation method
Syntax
AccessibilitySettings configval = config.getAccessibilityValidation();
Parameters
This method does not take any parameters.
Return value
Type: AccessibilitySettings
Remarks
For more information about the Contrast advisor feature see Contrast advisor.
getAgentId method
Syntax
String configval = config.getAgentId();
Parameters
This method does not take any parameters.
Return value
Type: String
getApiKey method
Syntax
String configval = config.getApiKey();
Parameters
This method does not take any parameters.
Return value
Type: String
getAppName method
Syntax
String configval = config.getAppName();
Parameters
This method does not take any parameters.
Return value
Type: String
getAutProxy method
Syntax
AutProxySettings value = configuration.getAutProxy();
Parameters
This method does not take any parameters.
Return value
Type: AutProxySettings
getBaselineBranchName method
Syntax
String configval = config.getBaselineBranchName();
Parameters
This method does not take any parameters.
Return value
Type: String
getBaselineEnvName method
Syntax
String configval = config.getBaselineEnvName();
Parameters
This method does not take any parameters.
Return value
Type: String
getBaselineEnvOptions method
Syntax
BaselineEnvOptions value = configuration.getBaselineEnvOptions();
Parameters
This method does not take any parameters.
Return value
Type: BaselineEnvOptions
getBatch method
Syntax
BatchInfo configval = config.getBatch();
Parameters
This method does not take any parameters.
Return value
Type: BatchInfo
getBranchName method
Syntax
String configval = config.getBranchName();
Parameters
This method does not take any parameters.
Return value
Type: String
getBrowsersInfo method
Syntax
List<RenderBrowserInfo> value = configuration.getBrowsersInfo();
Parameters
This method does not take any parameters.
Return value
Type: List<RenderBrowserInfo>
getDefaultMatchSettings method
Syntax
ImageMatchSettings value = configuration.getDefaultMatchSettings();
Parameters
This method does not take any parameters.
Return value
Type: ImageMatchSettings
getDeviceInfo method
Syntax
String configval = config.getDeviceInfo();
Parameters
This method does not take any parameters.
Return value
Type: String
getEnablePatterns method
Syntax
Boolean value = configuration.getEnablePatterns();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getEnvironmentName method
Syntax
String value = configuration.getEnvironmentName();
Parameters
This method does not take any parameters.
Return value
Type: String
getFailureReports method
Syntax
FailureReports value = configuration.getFailureReports();
Parameters
This method does not take any parameters.
Return value
Type: FailureReports
getFeatures method
Syntax
List<Feature> value = configuration.getFeatures();
Parameters
This method does not take any parameters.
Return value
Type: List<Feature>
getFigmaBaselines method
Syntax
Object value = configuration.getFigmaBaselines();
Parameters
This method does not take any parameters.
Return value
Type: Object
getFigmaOptions method
Syntax
FigmaOptions value = configuration.getFigmaOptions();
Parameters
This method does not take any parameters.
Return value
Type: FigmaOptions
getForceFullPageScreenshot method
Syntax
Boolean configval = config.getForceFullPageScreenshot();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getGitMergeBaseTimestamp method
Syntax
Calendar value = configuration.getGitMergeBaseTimestamp();
Parameters
This method does not take any parameters.
Return value
Type: Calendar
getHideCaret method
Syntax
boolean configval = config.getHideCaret();
Parameters
This method does not take any parameters.
Return value
Type: boolean
getHideScrollbars method
Syntax
boolean configval = config.getHideScrollbars();
Parameters
This method does not take any parameters.
Return value
Type: boolean
getHostApp method
Syntax
String configval = config.getHostApp();
Parameters
This method does not take any parameters.
Return value
Type: String
getHostingAppInfo method
Syntax
String configval = config.getHostingAppInfo();
Parameters
This method does not take any parameters.
Return value
Type: String
getHostOS method
Syntax
String configval = config.getHostOS();
Parameters
This method does not take any parameters.
Return value
Type: String
getIgnoreCaret method
Syntax
boolean configval = config.getIgnoreCaret();
Parameters
This method does not take any parameters.
Return value
Type: boolean
getIgnoreDisplacements method
Syntax
boolean configval = config.getIgnoreDisplacements();
Parameters
This method does not take any parameters.
Return value
Type: boolean
getIgnoreGitMergeBase method
Syntax
Boolean value = configuration.getIgnoreGitMergeBase();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getIsDisabled method
Syntax
Boolean value = configuration.getIsDisabled();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getLayoutBreakpoints method
Syntax
List<Integer> value = configuration.getLayoutBreakpoints();
Parameters
This method does not take any parameters.
Return value
Type: List<Integer>
getLayoutBreakpointsOptions method
Syntax
LayoutBreakpointsOptions value = configuration.getLayoutBreakpointsOptions();
Parameters
This method does not take any parameters.
Return value
Type: LayoutBreakpointsOptions
getMatchLevel method
Syntax
MatchLevel configval = config.getMatchLevel();
Parameters
This method does not take any parameters.
Return value
Type: MatchLevel
Remarks
For a full description of the affect of each match levels and the different ways to apply them to tests, checkpoints and regions, How to use Eyes match levels.
getMatchTimeout method
Syntax
int configval = config.getMatchTimeout();
Parameters
This method does not take any parameters.
Return value
Type: int
getMobileOptions method
Syntax
MobileOptionsData value = configuration.getMobileOptions();
Parameters
This method does not take any parameters.
Return value
Type: MobileOptionsData
getOsInfo method
Syntax
String configval = config.getOsInfo();
Parameters
This method does not take any parameters.
Return value
Type: String
getOverlap method
Syntax
StitchOverlap value = configuration.getOverlap();
Parameters
This method does not take any parameters.
Return value
Type: StitchOverlap
getParentBranchName method
Syntax
String configval = config.getParentBranchName();
Parameters
This method does not take any parameters.
Return value
Type: String
getProperties method
Syntax
List<PropertyData> value = configuration.getProperties();
Parameters
This method does not take any parameters.
Return value
Type: List<PropertyData>
getProxy method
Syntax
AbstractProxySettings configval = config.getProxy();
Parameters
This method does not take any parameters.
Return value
Type: AbstractProxySettings
The value returned is a ProxySettings object or null if no proxy is set.
getRotation method
Syntax
Integer value = configuration.getRotation();
Parameters
This method does not take any parameters.
Return value
Type: Integer
getSaveDiffs method
Syntax
Boolean configval = config.getSaveDiffs();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getSaveFailedTests method
Syntax
Boolean value = configuration.getSaveFailedTests();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getSaveNewTests method
Syntax
boolean configval = config.getSaveNewTests();
Note: This method is a static method.
Parameters
This method does not take any parameters.
Return value
Type: boolean
getScaleRatio method
Syntax
Double value = configuration.getScaleRatio();
Parameters
This method does not take any parameters.
Return value
Type: Double
getServerUrl method
Syntax
URI configval = config.getServerUrl();
Parameters
This method does not take any parameters.
Return value
Type: URI
getSessionType method
Syntax
SessionType value = configuration.getSessionType();
Parameters
This method does not take any parameters.
Return value
Type: SessionType
getStitchMode method
Syntax
StitchMode configval = config.getStitchMode();
Parameters
This method does not take any parameters.
Return value
Type: StitchMode
getStitchOverlap method
Syntax
int configval = config.getStitchOverlap();
Parameters
This method does not take any parameters.
Return value
Type: int
getTestName method
Syntax
String configval = config.getTestName();
Parameters
This method does not take any parameters.
Return value
Type: String
getUseCeilForViewportSize method
Syntax
Boolean value = configuration.getUseCeilForViewportSize();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getUseDom method
Syntax
Boolean value = configuration.getUseDom();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
getViewportSize method
Syntax
RectangleSize configval = config.getViewportSize();
Parameters
This method does not take any parameters.
Return value
Type: RectangleSize
getVisualGridOptions method
Syntax
List<VisualGridOption> configval = config.getVisualGridOptions();
Parameters
This method does not take any parameters.
Return value
Type: List<VisualGridOption\>
getWaitBeforeCapture method
Syntax
Integer value = configuration.getWaitBeforeCapture();
Parameters
This method does not take any parameters.
Return value
Type: Integer
getWaitBeforeScreenshots method
Syntax
int configval = config.getWaitBeforeScreenshots();
Parameters
This method does not take any parameters.
Return value
Type: int
getWebDriverProxy method
Syntax
WebDriverProxySettings value = configuration.getWebDriverProxy();
Parameters
This method does not take any parameters.
Return value
Type: WebDriverProxySettings
isBypassCSP method
Syntax
Boolean value = configuration.isBypassCSP();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isCaptureStatusBar method
Syntax
Boolean value = configuration.isCaptureStatusBar();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isDefaultLayoutBreakpointsSet method
Syntax
Boolean value = configuration.isDefaultLayoutBreakpointsSet();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isDisableBrowserFetching method
Syntax
Boolean value = configuration.isDisableBrowserFetching();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isForceFullPageScreenshot method
Syntax
Boolean value = configuration.isForceFullPageScreenshot();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isRenderingConfig method
Syntax
Boolean value = configuration.isRenderingConfig();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isSendDom method
Syntax
Boolean configval = config.isSendDom();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isUseCookies method
Syntax
Boolean value = configuration.isUseCookies();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
isVisualGrid method
Syntax
Boolean value = configuration.isVisualGrid();
Parameters
This method does not take any parameters.
Return value
Type: Boolean
setAbortIdleTestTimeout method
Syntax
Configuration value = configuration.setAbortIdleTestTimeout(abortIdleTestTimeout);
Parameters
abortIdleTestTimeout
Type: Integer
Description needed.
Return value
Type: Configuration
setAccessibilityValidation method
Syntax
Configuration configval = config.setAccessibilityValidation(accessibilitySettings);
Parameters
accessibilitySettings
Type:
AccessibilitySettings
The required accessibility settings. A value of null will disable accessibility checking.
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 set<XYZ> methods of the Configuration class.
Remarks
For more information about the Contrast advisor feature see Contrast advisor.
setAgentId method
Syntax
Configuration configval = config.setAgentId(agentId);
Parameters
agentId
Type: String
The agent id to be configured.
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 set<XYZ> methods of the Configuration class.
setApiKey method
Syntax
Configuration configval = config.setApiKey(apiKey);
Parameters
apiKey
Type: String
Your API key.
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 set<XYZ> methods of the Configuration class.
Remarks
Set this immediately after the Eyes object is created (before calling open). If you have an environment variable called APPLITOOLS_API_KEY that is set to the value of your API key, then you do not need to call this method, and Eyes will take the string from the environment value.
setAppName method
Syntax
Configuration configval = config.setAppName(appName);
Parameters
appName
Type: String
The application name to be configured for the test.
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 set<XYZ> methods of the Configuration class.
Remarks
If you call this method, it must be called before the call to Eyes.open. In the call to Eyes.open, if you provide the application parameter, then it will override the value set here. If you don't provide the parameter or pass a null, then the value set here will be used.