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 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.
Using statement
using Configuration = Applitools.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 setXXXX
methods of the Configuration
class.
AccessibilityValidation property
Syntax
AccessibilitySettings configval; // give relevant initial value config.AccessibilityValidation = configval; configval = config.AccessibilityValidation
Type: AccessibilitySettings
Remarks
For more information about the Contrast advisor feature see Contrast advisor.
AgentId property
Syntax
string configval; // give relevant initial value config.AgentId = configval; configval = config.AgentId
Type: string
ApiKey property
Syntax
string configval; // give relevant initial value config.ApiKey = configval; configval = config.ApiKey
Type: string
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
string configval; // give relevant initial value config.AppName = configval; configval = config.AppName
Type: string
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
string configval; // give relevant initial value config.BaselineBranchName = configval; configval = config.BaselineBranchName
Type: string
BaselineEnvName property
Syntax
string configval; // give relevant initial value config.BaselineEnvName = configval; configval = config.BaselineEnvName
Type: string
Batch property
Syntax
BatchInfo configval; // give relevant initial value config.Batch = configval; configval = config.Batch
Type: BatchInfo
BranchName property
Syntax
string configval; // give relevant initial value config.BranchName = configval; configval = config.BranchName
Type: string
HideCaret property
Syntax
bool configval; // give relevant initial value config.HideCaret = configval; configval = config.HideCaret
Type: bool
Remarks
We recommend using this method instead of Eyes.IgnoreCaret
, Configuration.SetIgnoreCaret
or CheckSettings.IgnoreCaret
, since this method/property eliminates cursor related artifacts instead of detecting and ignoring them.
HideScrollbars property
Syntax
bool configval; // give relevant initial value config.HideScrollbars = configval; configval = config.HideScrollbars
Type: bool
HostApp property
Syntax
string configval; // give relevant initial value config.HostApp = configval; configval = config.HostApp
Type: string
HostOS property
Syntax
string configval; // give relevant initial value config.HostOS = configval; configval = config.HostOS
Type: string
IgnoreCaret property
Syntax
bool configval; // give relevant initial value config.IgnoreCaret = configval; configval = config.IgnoreCaret
Type: bool
Remarks
We recommend using HideCaret
or SetHideCaret
since this eliminates cursor related artifacts instead of detecting and ignoring them.
IgnoreDisplacements property
Syntax
bool configval; // give relevant initial value config.IgnoreDisplacements = configval; configval = config.IgnoreDisplacements
Type: bool
Remarks
Ignore displacements is only active when using a Match level of Strict
or IgnoreColors
LayoutBreakpoints property
Syntax
int configval; // give relevant initial value config.LayoutBreakpoints = configval; configval = config.LayoutBreakpoints
Type: int
Remarks
This method sets the default for all checkpoints on all tests that are configured using this Configuration object. This default can be overridden for a specific checkpoint by using the CheckSettings.LayoutBreakpoints
method.
MatchLevel property
Syntax
MatchLevel configval; // give relevant initial value config.MatchLevel = configval; configval = config.MatchLevel
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.
MatchTimeout property
Syntax
TimeSpan configval; // give relevant initial value config.MatchTimeout = configval; configval = config.MatchTimeout
Type: TimeSpan
Remarks
You can override the default timeout set by this property for a specific set checkpoint by passing a timeout to one of the check_XXXX methods that support a timeout parameter, e.g. CheckWindow
. You can also override the timeout for a specific test using the check fluent Timeout method
ParentBranchName property
Syntax
string configval; // give relevant initial value config.ParentBranchName = configval; configval = config.ParentBranchName
Type: string
SaveDiffs property
Syntax
bool? configval; // give relevant initial value config.SaveDiffs = configval; configval = config.SaveDiffs
Type: bool?
SaveNewTests property
Syntax
bool configval; // give relevant initial value config.SaveNewTests = configval; configval = config.SaveNewTests
Type: bool
SendDom property
Syntax
bool configval; // give relevant initial value config.SendDom = configval; configval = config.SendDom
Type: bool
Remarks
Sending DOM information is enabled by default, so use this method only if you have to disable it.
ServerUrl property
Syntax
string configval; // give relevant initial value config.ServerUrl = configval; configval = config.ServerUrl
Type: string
StitchMode property
Syntax
StitchModes configval; // give relevant initial value config.StitchMode = configval; configval = config.StitchMode
Type: StitchModes
StitchOverlap property
Syntax
int configval; // give relevant initial value config.StitchOverlap = configval; configval = config.StitchOverlap
Type: int
TestName property
Syntax
string configval; // give relevant initial value config.TestName = configval; configval = config.TestName
Type: string
ViewportSize property
Syntax
RectangleSize configval; // give relevant initial value config.ViewportSize = configval; configval = config.ViewportSize
Type: RectangleSize
VisualGridOptions property
Syntax
VisualGridOption[] configval; // give relevant initial value config.VisualGridOptions = configval; configval = config.VisualGridOptions
Type: VisualGridOption
[]
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.SetVisualGridOptions
You can override the global value for a given checkpoint using the method CheckSettings.VisualGridOptions
.