cypress-parallel
cypress-parallel copied to clipboard
support for run-ct command
Hello,
Our team is trying to adopt component testing of cypress and wonders if we can run them in parallel locally.
I have tried using cypress-parallel package to run in parallel, hoping that I just need to swap run command to run-ct. But unfortunately it did not work.
Before I start pasting error messages and my attempts, I would like to know if it is officially supported (or it is possible) from this repo, or has anyone successfully got it working.
Cheers
@hcho112 this is will work in local machine without any issue. can help If you can share the error message.
Hey @hcho112 , were you able to get this working?
My apologies for late update. Our team decided not to proceed with cypress unit testing so I kind of stopped investigating the issue.
I am using Cypress for React based component testing and cannot get it to work in parallel. I think what happens is that Webpack is launched for each thread and, as a result, only 1 webpack instance is able to launch in parallel? So as a result only 1 thread ever actually runs. I am using this script (specs exist in src folder):
"cy:parallel": "cypress-parallel -s cy:ct:run -t 2 -d src/**/*.spec.cy.tsx",
The run starts but Webpack shuts down for one of the threads:
[webpack-dev-server] Gracefully shutting down. To force exit, press ^C again. Please wait... [webpack-dev-middleware] wait until bundle finished: /__cypress/src/index.html
It then resumes on the other thread and a handful of the specs therefore run.
Any ideas?
Quick update on above for anyone who has similar problem. I was able to fix shortly after typing the above! I needed to remove a hard coded port value from the webpack config. So it was down to a port conflict. With that removed webpack assigns each instance a free port within the 8000 range. Seems ok now.
Interestingly though, the run time is actually slower running the tests in parallel (using an m1 macbook) than when doing it via single cypress instance. I suspect this is down to the overheard of launching 4 webpack instances.
So I actually am not sure cypress-parallel is worth it for when using Cypress for component mounting/testing