The saucectl CLI makes setting up, writing, and running web tests easier and faster for developers during early pipeline testing. First it supported Puppeteer, followed by Cypress, TestCafe, and Playwright to provide the flexibility to test the way you want, along with Sauce Labs insights, at scale.
How to Run Cypress Tests in Parallel with Sauce Labs
In this example we’ll take a look at setting up and running Cypress tests in parallel using the saucectl with GitHub Actions. Then we will view the test results in the Sauce Labs UI.
Note: Find examples for using other test frameworks or CI/CD examples in the documentation.
Prerequisites: You’ll need a Sauce Labs and a GitHub account. You will also need existing cypress tests. In our example we have multiple tests located in the
1. In your root project directory, create the following directory tree:
2. And then add your Sauce Labs credentials to the GitHub Actions Secret Settings.
3. Add a
./sauce/config.yml, similar to this example, and set
a. This will distribute and run the tests across as many jobs as you have defined in your CI
4. Create Github Action test.yml
In this example, we’re adding two parallel jobs:
5. Now, when you commit these files, GitHub will detect the new workflow actions and launch
saucectl to run your tests.
The output may look like this:
Congrats! The tests are now running in parallel with the help of saucectl and you can view screenshots, videos and test results in Sauce Labs.
Sauce Labs is committed to supporting our users in delivering digital confidence, and providing what they need to test better, test faster, and test at scale.
Developers using saucectl can run tests locally, or in their CI/CD pipelines, and then view the results in the Sauce Labs UI. In our next iterations, you will be able to configure tests from saucectl to execute in our virtual cloud environment. This will increase scalability and reliability to help developers truly embrace quality without sacrificing speed.
Try It For Yourself!
saucectl is completely free! If you’d like to try it out for yourself, head over to our Github repo where you can get started right away.