This page details the different options for using the
- Run tests locally with Docker and send results to Sauce Labs
- Run tests remotely on Sauce Labs virtual machines
- Run tests against a local app server / app running on
default test location
Unless you specify a test directory,
saucectl executes tests based on the test directory generated for the framework you selected during installation. For example, with Cypress,
saucectl will attempt to locate
cypress.json, as well as the default
The following steps outline how to run your tests on your local machine with the containerized solution. This is the preferred option if you wish to run tests on your local machine, or if you wish to accelerate test execution in CI.
docker Syntax Page
docker syntax reference page for further details.
mode syntax reference page for further details.
For example, if you want to run all the suites in docker, set the default
docker, as in the following example:
saucectl can provide a default image to run your tests. You can also specify a Docker image in the
config.yml, as shown in the following example:
Refer to the framework version support matrix for a list of framework-specific images.
The configuration field:
saucectl how to copy the test files into the docker container. There are currently two choices
Please refer to the
fileTransfer syntax page for further detals.
supported frameworks: Cypress
If you wish to run your tests on Sauce Labs VMs, set the default
sauce, as shown in the following example:
If you wish to increase your VM concurrency you can also use the flag
--ccy <vm number>.
You can also designate
concurrency in the
config.yml like so:
Please note that VM concurrency depends on the suite number rather than the number of
.spec.js |.test.js files. Plese visit the CLI Reference for more information regarding command parameters:
Your concurrency and VM entitlements also depend on your Sauce Labs subscription tier. For more information please visit the pricing guide
supported frameworks: Cypress
When you run tests on Sauce Labs VMs you have access to a wide range of OS + browser combinations. In order to test against multiple different browsers, you can indicate the desired combinations in the
For full examples, please visit this repository
If you're running tests on Sauce Labs VMs, but the site under test is protected behind strict network security/policies, you can utilize Sauce Connect Proxy to circumvent the problem.
You can use the
--tunnel-id flag with
saucectl in order to use an existing Sauce Connect tunnel with your test session:
For more information on how to use the
--tunnel-idflag, please visit the CLI Reference.
To enable Sauce Connect Proxy in the
config.yml, use the
For more information regarding how to install, setup, and configure Sauce Connect Proxy, please visit the Sauce Connect Proxy documentation
After tests complete, Testrunner Toolkit uploads the test assets (logs, test results, and test videos) to your Sauce Labs account and displays a job link like so:
From this job link you can review, share, and analyze the test results just as you would with any other test framework executed on Sauce Labs.
If you plan to run tests against a local app server / app running on
localhost (either on your host machine or in a CI pipeline) there are specific workflows you must follow.
Need to Access Custom Node Modules?
If you have third party, or custom modules that are required test dependencies, you can utilize the
npm field in your
config.yml in order to include those packages during test execution. Refer to the syntax reference for further details.
Set the default or suite-specific
docker container can access the local app server (e.g.
localhost:<port>/) from your host machine. After the tests complete the results upload to the Sauce Labs results dashboard.
If you wish to test the app running on a local app server with Sauce Labs VMs:
- Download and launch Sauce Connect
- Specify a
tunnel-id(either in the config or using the
Here is a working example of this use case using Sauce Connect and GitHub Actions.
Please see Using Sauce Connect for further details.
The examples here show how Pipeline testing can be used. Try them and find your own use cases.
Every Testrunner image comes with a preconfigured setup that allows you to focus on writing tests instead of tweaking with the configurations. Our initial
testrunner flavors come either with Cypress, Playwright, or TestCafe as an automation framework.
The Playwright testrunner image also exposes a global
browser variable that represents Playwright's
Browser class. In addition to that you also have access to a pre-generated browser context via
context as well as to a page frame via