Advanced Cypress settings
You can specify test configurations using any of the following:
- Arguments to the
cy.eyesOpen()
command - Environment variables
- Global configuration properties set in the configuration file
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 value | Description |
---|---|---|
testName | The value of Cypress's test title | Test 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 | random | Provides 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 batch | Provides a name for the batch, for display purpose only. |
batchSequenceName | undefined | Name for managing batch statistics. |
baselineEnvName | undefined | Name of the environment of the baseline. |
envName | undefined | Name for the environment in which the application under test is running. |
ignoreCaret | false | If true , Eyes will ignore or the blinking caret when comparing images. |
matchLevel | Strict | The match level to use when comparing screenshots. |
branchName | default | Name of the current branch. |
baselineBranchName | undefined | Name 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 | undefined | Sets the branch under which new branches are created. |
saveDiffs | false | If true , tests with diffs are saved by default as a baseline. |
saveNewTests | true | If true , new tests are saved by default as a baseline. |
properties | undefined | Custom 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 | false | If true , the Test Manager will initially only display real mismatches, not mismatches for image features that have only been displaced. |
compareWithParentBranch | false | If 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 | false | If true batch completion notifications are sent. |
accessibilityValidation | undefined | An 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 | undefined | An object that specifies options to configure renderings on the Ultrafast grid. See visualGridOptions |
layoutBreakpoints | undefined | When 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 |
waitBeforeCapture | 100 | A 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 value | Description |
---|---|---|
apiKey | undefined | The API key used for working with the Applitools Eyes server. See more info in the Applitools API key section above |
batch | undefined | An object which describes different aspects of the batch. The following lines in this table depict the various ways to configure the batch. |
batch.id | random | Provides ability to group tests into batches. Read more about batches here. |
batch.name | Name of first test in the batch | Name for the batch (for display purpose only). |
batch.notifyOnCompletion | false | If true batch completion notifications are sent. |
batch.properties | undefined | Custom 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 | undefined | Name for managing batch statistics. |
disableBrowserFetching | false | If true , page resources for rendering on the UFG will be fetched from outside of the browser. |
dontCloseBatches | false | If true , batches are not closed for notifyOnCompletion . |
enablePatterns | false | |
failCypressAfterAllSpecs | false | If 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 | true | If 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 | false | If true , all calls to Eyes-Cypress commands will be silently ignored. |
proxy | undefined | Sets 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: 'https://myproxy.com:443', username: 'my_user', password: 'my_password', isHttpOnly: false} or: https://username:password@myproxy.com:443 |
removeDuplicateTests | false | If 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 URL | The URL of Eyes server |
showLogs | false | Whether or not you want to see logs of the Eyes-Cypress plugin. Logs are written to the same output of the Cypress process. |
tapDirPath | undefined | Directory 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 | 5 | The 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. |
useDom | false |