Skip to main content

ConfigurationPlain type

This type 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 setXXXX methods chained with a '.' in a Fluent coding style. In this class, some attributes can be set by both a property and a set command. The properties allow you simple direct access to assign to and retrieve the attribute. The corresponding set method allows you to set multiple attributes using a Fluent style.

agentId property

Syntax

config = { agentId: value_string };

Type: string

The agent id to be configured.

apiKey property

Syntax

config = { apiKey: value_string };

Type: string

Your API key.

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.

appName property

Syntax

config = { appName: value_string };

Type: string

The application name to be configured for the test.

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.

baselineBranchName property

Syntax

config = { baselineBranchName: value_string };

Type: string

The baseline branch name to be configured.

baselineEnvName property

Syntax

config = { baselineEnvName: value_string };

Type: string

The name of the baseline environment.

batch property

Syntax

config = { batch: value_BatchInfoPlain };

Type: BatchInfoPlain

An object that defines the batch configuration.

branchName property

Syntax

config = { branchName: value_string };

Type: string

The branch name to be used by the configuration.

browsersInfo property

Syntax

let suiteConfig = {
browsersInfo: [
{ height: value1_number, width: value2_number, name: "chrome" },
{ deviceName: "Galaxy Note 3", screenOrientation: "landscape" },
{
deviceName: "iPad (7th generation)",
iosVersion: "latest",
screenOrientation: "portrait",
},
],
};
eyes.setConfiguration(suiteConfig);

Type:

(DesktopBrowserInfo|ChromeEmulationInfo|IOSDeviceInfo)[]

List of objects that define browsers and emulated devices to be rendered.

deviceInfo property

Syntax

config = { deviceInfo: value_string };

Type: string

The name of the device, this is displayed in the Device column in the Test Manager.

forceFullPageScreenshot property

Syntax

config = { forceFullPageScreenshot: value_boolean };

Type: boolean

If True, Eyes will do scrolling and stitching if necessary. If False, the result is browser dependent.

hideCaret property

Syntax

config = { hideCaret: value_boolean };

Type: boolean

If True the cursor will be hidden before the image is captured.

Remarks

We recommend using this method instead of Eyes.setIgnoreCaret, Configuration.setIgnoreCaret or CheckSettings.ignoreCaret, since this method/property eliminates cursor related artifacts instead of detecting and ignoring them.

hideScrollbars property

Syntax

config = { hideScrollbars: value_boolean };

Type: boolean

If True scrollbars will be hidden.

hostApp property

Syntax

config = { hostApp: value_string };

Type: string

The value to be used for the Host App property.

hostAppInfo property

Syntax

config = { hostAppInfo: value_string };

Type: string

hostOS property

Syntax

config = { hostOS: value_string };

Type: string

The value to be used for the Host OS Property.

hostOSInfo property

Syntax

config = { hostOSInfo: value_string };

Type: string

ignoreGitMergeBase property

Syntax

config = { ignoreGitMergeBase: value_boolean };

Type: boolean

matchTimeout property

Syntax

config = { matchTimeout: value_number };

Type: number

The timeout to set in milliseconds.

Remarks

You can override the default timeout set by this method for a specific set checkpoint by passing a timeout to one of the check_XXXX methods that support a timeout parameter, e.g. eyes.checkwindow (not yet available in Selenium javascript)You can also override the timeout for a specific test using the check fluent timeout method

parentBranchName property

Syntax

config = { parentBranchName: value_string };

Type: string

The parent branch name to be configured.

properties property

Syntax

config = { properties: [value1_PropertyDataPlain, value2_PropertyDataPlain] };

Type: PropertyDataPlain[]

List of propertydata objects.

Remarks

  • Set multiple properties by calling Eyes.addProperty or Configuration.addProperty multiple times with the same property name and with different values.
  • You should not assign a given value to a property more than once in a given test run.
  • You can also associate properties with a batch using BatchInfo.addProperty.

proxy property

Syntax

config = { proxy: value_ProxySettingsPlain };

Type: ProxySettingsPlain

An object created from the ProxySettings class that contains the user name, password, URI and port.

rotation property

Syntax

config = { rotation: value_ImageRotationPlain };

Type: ImageRotationPlain

Type definitions

ImageRotationPlain

The legal values that an image may be rotated by. This may have the following values: -270|-180|-90|0|90|180|270

The number of degrees to rotate.

saveNewTests property

Syntax

config = { saveNewTests: value_boolean };

Type: boolean

If False, the user will need to save the baseline explicitly in the Test Manager for new tests to be saved to the baseline. If True, Eyes will automatically create a baseline for tests with a status of 'new' (the default behavior).

scaleRatio property

Syntax

config = { scaleRatio: value_number };

Type: number

The scale ratio to use.

scrollRootElement property

Syntax

config = { scrollRootElement: value };

Type:

WebElement|Selector

Type definitions

Selector

Used to identify an HTML element defined as |import('selenium-webdriver').Locator|{using:string;value:string}|string|{selector:string;Type: string}.

The element that should be scrolled.

sendDom property

Syntax

config = { sendDom: value_boolean };

Type: boolean

If True, DOM information will be sent. If False, DOM information will not be sent.

Remarks

Sending DOM information is enabled by default, so use this method only if you have to disable it.

serverUrl property

Syntax

config = { serverUrl: value_string };

Type: string

The URL of the Eyes server. Pass a value of null to use the default cloud server.

stitchMode property

Syntax

config = { stitchMode: value_StitchModePlain };

Type: StitchModePlain

Type definitions

StitchModePlain

This type allows passing strings instead of enumerated values, for the list of enum values see StitchMode.

The stitch mode to use.

stitchOverlap property

Syntax

config = { stitchOverlap: value_number };

Type: number

The width of the stitch overlap in pixels.

testName property

Syntax

config = { testName: value_string };

Type: string

The test name to be configured for the test.

viewportSize property

Syntax

config = { viewportSize: value_RectangleSizePlain };

Type: RectangleSizePlain

An object that defines the width and height of the test browser viewport in pixels.

visualGridOptions property

Syntax

config = { visualGridOptions: value };

Type: Record<string,any>

Remarks

The following configuration key/value pairs are currently supported:

'chromeHeadless'

Normally, the Ultrafast Grid renders its images using Headless Chrome. There are cases where the behavior of Headless Chrome is different from that of regular Chrome browser, and if the baseline was created with a regular Chrome browser, the differences will be found. Set this option to a value of false to instruct the Ultrafast Grid to use a regular Chrome browser instead of the Headless Chrome browser, so as to eliminate differences that arise because of the different types of Chrome browser.

'polyfillAdoptedStyleSheets'

Adopted Stylesheets are a way to create and distribute reusable styles when using a Shadow DOM. Adopted Stylesheets are not supported by all browsers, so their use may cause mismatches when doing cross-browser validation. By default, when the Ultrafast Grid detects that a page being checked uses Adopted Stylesheets, it will not render that checkpoint, the check will fail, and the test will be aborted. In the Test Manager, the test results for that run will have an Aborted status, and the step that failed will have a Missing status.

To enable rendering of checkpoints that include Adopted Stylesheets, and to ensure that the test can complete successfully, you need to explicitly set the Ultrafast Grid option polyfillAdoptedStyleSheets to a value of true or false:

  • Setting a value of true instructs the Ultrafast Grid to polyfill Adopted Stylesheets.
  • Setting a value of false instructs the Ultrafast Grid to render the page without polyfilling Adopted Stylesheets.

You can set this option globally using the method Configuration.setVisualGridOption

You can override the global value for a given checkpoint using the method CheckSettings.visualGridOption.

Example

JavaScript
    suiteConfig = new Configuration() 
.setVisualGridOptions(new VisualGridOption("polyfillAdoptedStyleSheets", true))
/* ... other configurations */ ;
/*
* Assign the configuration to all newly created Eyes instances
*/
eyes = new Eyes(runner);
eyes.setConfiguration(suiteConfig);

waitBeforeScreenshots property

Syntax

config = { waitBeforeScreenshots: value_number };

Type: number

The time to wait in milliseconds. Passing a value of less than or equal to zero will cause the default value to be used.