Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to run parallel cypress tests on local machine, for example 5 streams

Tags:

I'm trying to setup cypress on my local machine and run parallel tests. But I can't find some information how to do this.

like image 686
Lev Boichenko Avatar asked Aug 09 '19 04:08

Lev Boichenko


1 Answers

Technically, it's possible. Cypress does not recommend it since running multiple cypress instances on the same machine consumes lots of resources (CPU over all) and it slows down the entire machine performances with useless results.

Anyway if you have limited resources and you cannot use the official dashboard or you don't have more than one CI server available, you can run your test on a single machine launching cypress run multiple times dividing your test suite in multiple folders.

I've created a npm library called cypress-parallel (https://github.com/tnicola/cypress-parallel) that (after the first run), balances and splits the test suite in multiple subsets, based on the tests run history and for each subset it launches a Cypress command. It also collect the results from all the specs file, logging them at the end of the execution. In terms of performances, it seems that with 2 processes you can improve your overall tests execution time time up to 40%.

like image 61
Nicola Tommasi Avatar answered Sep 21 '22 14:09

Nicola Tommasi