Skip to main content

Advanced configuration

There are 3 ways to specify test configuration:

  1. Arguments to eyes.open()
  2. Environment variables
  3. The applitools.config.js file

The list above is also the order of precedence, which means that if you pass a property to eyes.open it will override the environment variable, and the environment variable will override the value defined in the applitools.config.js file.

Configuration properties

Property nameDefault valueDescription
testNameundefinedThe test name
browser{ width: 800, height: 600, name: 'chrome' }The size and browser of the generated screenshots. This does not need to be the same as the browser that TestCafe is running. It could be a different size and browser. For more info and possible values, see the browser section below.

Note: for best performance, if possible Eyes resizes the viewport to the given browser size.
batchIdrandomProvides ability to group tests into batches. For further information, see Grouping tests into batches with the SDK in the Eyes documentation.
batchNameThe name of the first test in the batchProvides a name to the batch (for display purpose only).
baselineEnvNameundefinedThe name of the environment of the baseline.
envNameundefinedA name for the environment in which the application under test is running.
ignoreCaretfalseWhether to ignore or the blinking caret or not when comparing images.
matchLevelStrictThe method to use when comparing two screenshots, which expresses the extent to which the two images are expected to match. Possible values are Strict, Exact, Layout and IgnoreColors. For further information, see How to use Eyes match levels in the Eyes documentation.
baselineBranchNameundefinedThe name of the baseline branch.
parentBranchNameundefinedSets the branch under which new branches are created.
saveFailedTestsfalseSet whether or not failed tests are saved by default.
saveNewTestsfalseSet whether or not new tests are saved by default.
propertiesundefinedCustom properties for the eyes test. The format is an array of objects with name/value properties. For example: [{name: 'My prop', value:'My value'}].
ignoreDisplacementsfalseSets whether Test Manager should intially display mismatches for image features that have only been displaced, as opposed to real mismatches.
compareWithParentBranchfalseIf 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.
ignoreBaselinefalse
notifyOnCompletionfalseIf true batch completion notifications are sent.
accessibilityValidationundefinedAn 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'}

Global configuration properties

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

Property nameDefault valueDescription
apiKeyundefinedThe API key used for working with the Applitools Eyes server.
showLogsfalseWhether or not you want to see logs. Logs are written to the same output of the TestCafe process.

Note that you can also use DEBUG=eyes* for debugging.
serverUrlDefault Eyes server URLThe URL of Eyes server
proxyundefinedSets 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
isDisabledfalseIf true, all api calls to Eyes-Testcafe are ignored.
failTestcafeOnDifftrueIf true, then the TestCafe test fails if an eyes visual test fails. If false and an Eyes test fails, then the TestCafe test does not fail.
tapDirPathundefinedDirectory path of a results file. If set, then a TAP file is created. in this directory when using the waitForResults command in your test. The tap file name is created with the name eyes< ISO-DATE>.tap and contains the Eyes test results

Note that results are scoped per spec file, this means that the results file is created once for each fixture file).
concurrency1The 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.
dontCloseBatchesfalseIf true, batches are not closed for notifyOnCompletion.
disableBrowserFetchingfalseIf true, the SDK will fetch the resources needed for UFG rendering from outside of the browser (useful for sites with large payloads).

Method 1: Arguments for eyes.open

Pass a config object as the only argument.

Example

eyes.open({
appName: 'My app',
batchName: 'My batch',
...
// all other configuration variables apply
})

Method 2: Environment variables

The name of the corresponding environment variable is in uppercase, with the APPLITOOLS_ prefix, and separating underscores instead of camel case:

APPLITOOLS_APP_NAME
APPLITOOLS_SHOW_LOGS
APPLITOOLS_BATCH_NAME
APPLITOOLS_CONCURRENCY
APPLITOOLS_SAVE_DEBUG_DATA
APPLITOOLS_BATCH_ID
APPLITOOLS_BATCH_NAME
APPLITOOLS_BASELINE_ENV_NAME
APPLITOOLS_ENV_NAME
APPLITOOLS_IGNORE_CARET
APPLITOOLS_IS_DISABLED
APPLITOOLS_MATCH_LEVEL
APPLITOOLS_MATCH_TIMEOUT
APPLITOOLS_BRANCH_NAME
APPLITOOLS_BASELINE_BRANCH_NAME
APPLITOOLS_PARENT_BRANCH_NAME
APPLITOOLS_SAVE_FAILED_TESTS
APPLITOOLS_SAVE_NEW_TESTS
APPLITOOLS_COMPARE_WITH_PARENT_BRANCH
APPLITOOLS_IGNORE_BASELINE
APPLITOOLS_SERVER_URL
APPLITOOLS_PROXY
APPLITOOLS_NOTIFY_ON_COMPLETION

Method 3: The applitools.config.js file

You can have a file called applitools.config.js at the same folder location as .testcaferc.json. (The directory from which you run TestCafe. This is usually the project's root directory).

In this file specify the desired configuration, in a valid JSON format.

Example

module.exports = {
appName: 'My app',
showLogs: true,
batchName: 'My batch'
...
// all other configuration variables apply
}