Skip to main content

Advanced Cypress settings

You can specify test configurations using any of the following:

These items are listed in order of precedence. This means that if you pass a property to cy.eyesOpen it will override the environment variable, and the environment variable will override the value defined in the applitools.config.js file.

Available configuration properties

Property name Default valueDescription
testName The value of Cypress's test titleTest name. If is not specified, the test name will be the title of the it block where the test is running.
browser { width: 800, height: 600, name: 'chrome' }The size and browser of generated screenshots. This does not need to be the same as the browser that Cypress is running, it could be a different size and different browser. For additional information and possible values, see Browser configuration.
batchId randomProvides ability to group tests into batches. For further information, see Grouping tests into batches with the SDK.
batchName The name of the first test in the batchProvides a name for the batch, for display purpose only.
batchSequenceName undefinedName for managing batch statistics.
baselineEnvName undefinedName of the environment of the baseline.
envName undefinedName for the environment in which the application under test is running.
ignoreCaret falseIf true, Eyes will ignore or the blinking caret when comparing images.
matchLevel StrictThe match level to use when comparing screenshots.
branchName defaultName of the current branch.
baselineBranchName undefinedName of the baseline branch, this must be the name of an existing Eyes branch. The test will take a baseline from this branch. If the defined branch does not have a baseline, a new baseline will be created in the current branch.
parentBranchName undefinedSets the branch under which new branches are created.
saveDiffs falseIf true, tests with diffs are saved by default as a baseline.
saveNewTests trueIf true, new tests are saved by default as a baseline.
properties undefinedCustom properties for the eyes test. The format is an array of objects with name/value properties. For example: [{name: 'My prop', value:'My value'}].
ignoreDisplacements falseIf true, the Test Manager will initially only display real mismatches, not mismatches for image features that have only been displaced.
compareWithParentBranch falseIf true, the test will take a baseline from the parent branch. If the parent branch does not have a baseline, a new baseline will be created in the current branch.
ignoreBaseline false
notifyOnCompletion falseIf true batch completion notifications are sent.
accessibilityValidation undefinedAn object that specifies the accessibility level and guidelines version to use for the screenshots. Possible values for level are None, AA and AAA, and possible values for guidelinesVersion are WCAG_2_0 and WCAG_2_1. For example: {level: 'AA', guidelinesVersion: 'WCAG_2_0'}
visualGridOptions undefinedAn object that specifies options to configure renderings on the Ultrafast grid. See visualGridOptions
layoutBreakpoints undefinedWhen set to true, a snapshot of the DOM will be taken once for each browser/device size in the browser configuration. For optimization purposes, an array of numbers can be passed. The DOM snapshot will be taken once for every width in the array. See layoutBreakpoints
waitBeforeCapture100A parameter that is set to wait a certain amount of milliseconds before capturing the pages snapshot. This will also apply between page resizes when using layoutBreakpoints.

Global configuration properties

The following configuration properties cannot be defined using the first method of passing them to cy.eyesOpen. They should be defined either in the applitools.config.js file or as environment variables.

The configuration file, applitools.config.js needs to be placed in the folder which contains cypress.json and must be in a valid JSON format, for example:

module.exports = {
appName: 'My app',
showLogs: true,
batchName: 'My batch'
// all other configuration variables apply
Property name Default valueDescription
apiKey undefinedThe API key used for working with the Applitools Eyes server. See more info in the Applitools API key section above
batch undefinedAn object which describes different aspects of the batch. The following lines in this table depict the various ways to configure the batch. randomProvides ability to group tests into batches. Read more about batches here. Name of first test in the batchName for the batch (for display purpose only).
batch.notifyOnCompletion falseIf true batch completion notifications are sent.
batch.propertiesundefinedCustom properties for the entire batch. The format is an array of objects with name/value properties. For example: [{name: 'My prop', value:'My value'}].
batch.sequenceName undefinedName for managing batch statistics.
disableBrowserFetching falseIf true, page resources for rendering on the UFG will be fetched from outside of the browser.
dontCloseBatches falseIf true, batches are not closed for notifyOnCompletion.
enablePatterns false
failCypressAfterAllSpecsfalseIf true, Eyes checks for diffs only after all specs are complete. This means that if there are multiple spec files, the suite will run faster, but will not identify diffs in individual spec files and the file will be shown as pass in the Cypress report even if there are diffs.
failCypressOnDiff trueIf true, then the Cypress test fails if an Eyes test fails. If false and an Eyes test fails, then the Cypress test does not fail.
isDisabled falseIf true, all calls to Eyes-Cypress commands will be silently ignored.
proxy undefinedSets the proxy settings to be used in network requests to Eyes server. This can be either a string to the proxy URI, or an object containing the URI, username and password.

For example:
{url: '', username: 'my_user', password: 'my_password', isHttpOnly: false}
removeDuplicateTests falseIf true, all duplicate tests except for the latest test are deleted.
This setting is needed if test retries are enabled in Cypress.
serverUrl Default Eyes server URLThe URL of Eyes server
showLogs falseWhether or not you want to see logs of the Eyes-Cypress plugin. Logs are written to the same output of the Cypress process.
tapDirPath undefinedDirectory path of a results file. If set, then a TAP file is created in this directory, the tap file name is created with the name ISO-DATE-eyes.tap and contains the Eyes test results (Note that because of a current Cypress limitation the results are scoped per spec file, this means that the results file is created once for each spec file).
testConcurrency 5The maximum number of tests that can run concurrently. The default value is the allowed amount for free accounts. For paid accounts, set this number to the quota set for your account.