saucectl — the Sauce Labs test orchestrator CLI — to run Cypress tests directly from your existing Cypress project.
- Don't have Cypress tests but want to try? Follow the steps below to use the Cypress Demo Repo to build a sample project structure, working configuration file, and sample Cypress test — get up and running in less than 10 minutes!
- Already running Cypress? Let
saucectlrun your tests in the Sauce Labs Cloud, where you have access to thousands of OS/browser combinations and Sauce Labs analytics.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license)
- Your Sauce Labs Username and Access Key
- Node.js to use the NPM package manager
- A GitHub account
Step 1: Install
In a terminal shell, run the install command from your chosen
saucectl home directory.
npm install -g saucectl
Step 2: Link Your Sauce Labs Account
saucectl requires access to a valid Sauce Labs account.
saucectl detects your Sauce Labs credentials 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:
If a value is returned for both variables, they are set.
Enter your Sauce Labs Username and Access Key at the prompts.
Step 3: Set up Your Cypress Project
Clone the Cypress Demo Repo to get a Cypress project structure, Cypress-ready configuration file, and sample Cypress test. Use the command below that is applicable to your GitHub setup.
git clone https://github.com/saucelabs/saucectl-cypress-example.git
git clone email@example.com:saucelabs/saucectl-cypress-example.git
Step 4: Run Tests
Navigate to the version folder for the example you would like to use. v1 is an example for Cypress 10. v1alpha is an example for Cypress 9. Then use the
run command to execute the sample test included with the
Cypress 10 example
Cypress 9 example
The console displays the executing tests, distinguishing which mode is running.
The results and test assets are available immediately following test completion in your Sauce Labs account.