Home

Awesome

testcafe-browser-provider-saucelabs

Build Status Build Status

This plugin integrates TestCafe with the SauceLabs Testing Cloud.

Install

npm install testcafe-browser-provider-saucelabs

Usage

Before using this plugin, save the SauceLabs username and access key to environment variables SAUCE_USERNAME and SAUCE_ACCESS_KEY, as described in SauceLabs documentation.

You can determine the available browser aliases by running

testcafe -b saucelabs

If you run tests from the command line, use the browser alias when specifying browsers:

testcafe "saucelabs:Chrome@beta:Windows 10" 'path/to/test/file.js'

If you leave out the browser version, it'll run against the latest stable version:

testcafe "saucelabs:Chrome:Windows 10" 'path/to/test/file.js'

When you use API, pass the alias to the browsers() method:

testCafe
    .createRunner()
    .src('path/to/test/file.js')
    .browsers('saucelabs:Chrome@beta:Windows 10')
    .run();

Configuration

Use the following environment variables to set additional configuration options:

Example:

export SAUCE_SCREEN_RESOLUTION="1920x1080"
export SAUCE_JOB="E2E TestCafe"
export SAUCE_BUILD="Build 42"
testcafe saucelabs:safari,saucelabs:chrome tests/

Author

Developer Express Inc. (https://devexpress.com)