"run" is much slower than "open"
See original GitHub issueThis seems like a bug - the headless version of the tests run 4x - 5x slower than the headed ones. (cypress run
is about 4x-5x slower than the same tests run via cypress open
)
Current behavior:
I have a test suite with 77 tests in it currently.
In local dev I have been using the open command, per the docs. The GUI is awesome, thank you for this. The ability to select one tests suite at a time to test on the fly is great. And when I run all tests at once, they run fun fairly quick. All 77 of them run in about 1:15. This is acceptable, especially considering all of the debugging tools that are available in this mode. But cypress open
isn’t the problem.
We’re working on getting a CI in place. In preparation for this, I ran the tests via cypress run
as this is how I would expect our CI server to operate. I was (honestly) shocked to find that they were running 4x-5x slower in the headless electron browser. Tests routinely take at least 4:10 to complete in this mode. I’ve dug through other issues, google, docs, everything I could find and I have not found a way to speed this up (aside from running in parallel… which I don’t feel addresses the real problem here).
Desired behavior:
Tests run at last as fast vis cypress run
as they do for cypress open
.
Steps to reproduce: (app code and test code)
…This may be a little tough. The bug is not a specific ‘this blew up’ but more a ‘this really seems like wrong behavior, at the top level’. But if you feel that I can provide something specific, please ask.
Versions
Cypress 3.1.3 Node 10.12.0 Yarn 1.9.4 MacOS X High Sierra Chrom 71 (cypress open executing in this browser)
config:
{
"integrationFolder": "src/app/components/_pages/", // we keep tests with their corresponding component
"testFiles": "**/*.int.spec.js", // as a result, we had to easily denote cypress tests
"baseUrl": "http://localhost:3000/",
"video": false,
"chromeWebSecurity": false
}
Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:19
- Comments:38 (10 by maintainers)
@tarponjargon @lugus @sergiomap Switching to Chrome solved this issue for me. Chrome runs about 4x faster than Electron on my machine.
cypress run --headless --browser chrome
After digging into some source codes of cypress, could we introduce an env like
autoRunAll
foropen
, and check this env atspecs.jsx
file when it gui ready, If it’s true, then auto triggerrun all Specs
.I thinks this can be an option to reduce run time on CI caused by browser relaunching.