Start Cypress tests on CI from your terminal
Advent day 14: Trigger CircleCI run with some tests by using run-cy-on-ci CLI utility
Imagine you are looking at a Cypress test and wonder “is it flaky? will it pass on CI right now?” If you have configured the cypress-grep plugin in your project and are using CircleCI you can start a new pipeline to run just this test using my new utility run-cy-on-ci. The video below shows the utility in action - it does not take much to set up!
For example, to run all tests with “logs in” in the title, use
npx run-cy-on-ci -g “logs in”
You can run all tests tagged “@smoke”
npx run-cy-on-ci -t @smoke
You can run the selected tests 5 times in a row, burning them
npx run-cy-on-ci -g “part of the title” --burn 5
If you have configured CircleCI parallelization pipeline parameter, you can use multiple machines to finish the tests faster:
npx run-cy-on-ci --tag @regression --machines 10
No matter what parameters you use, the utility prints the pipeline information and its workflows’ URLs.
Let the CI sweat a little.