Skip to main content

WebdriverIO Quickstart

This page explains how to run your WebdriverIO tests in Sauce Orchestrate with saucectl.

What You'll Need

How Orchestrate Works

Sauce Orchestrate uses container technology to package and run your tests in the Sauce Labs cloud. See How it Works for more details.

The following example uses a project with a saucectl configuration file that is set up to run in Orchestrate. See saucectl Configuration for more information about the configuration and run options available. The example also has a Dockerfile for building the container image. See Building Images for more information about creating your own container images.

Step 1: Clone the Project

git clone https://github.com/saucelabs/saucectl-imagerunner-example.git

saucectl requires access to a valid Sauce Labs account.

Use Environment Variables

saucectl uses your Sauce Labs credentials as environment variables and prioritizes them over values in the credentials.yml file when both are present. If you have set them, you may skip this step. Not sure if you have them set? Run the following command to check:

echo $SAUCE_USERNAME
echo $SAUCE_ACCESS_KEY

If a value is returned for both variables, they are set.

  1. Run the configure command:

    saucectl configure
  2. Enter your Sauce Labs Username and Access Key at the prompts.

Step 3: Install saucectl

Navigate to the WebdriverIO example in the project you just cloned, then install saucectl.

cd saucectl-imagerunner-example/webdriverio
npm install -g saucectl

Step 4: Run Tests Using saucectl

Run the WebdriverIO tests.

saucectl run

The console displays the running tests, distinguishing which mode is running.

After the tests are run, saucectl outputs the command logs from Orchestrate and downloads the artifacts from the container.

The following is an example CLI output.

13:36:16 INF Downloading artifacts archive

Name Duration Status Attempts
────────────────────────────────────────────────────────────────────────────
✔ WebdriverIO in ImageRunner 1m1s Succeeded 1
────────────────────────────────────────────────────────────────────────────
✔ All suites have passed 1m13s

The results and test assets are also available immediately following test completion in your Sauce Labs account.