cypress: Takes too long before starting the test execution
Current behavior:
Cypress is taking too much time to initialize the cypress before starting the test actual execution. Actual execution of test takes only ~8-10 seconds, but when I start test using CLI i.e. using
cypress run -- --spec "cypress/integration/specname" --browser chrome
it will take around 30 seconds before it even starts the chrome.
Currently I’m working on windows 10, I have seen many tutorials and they seemed fast on mac OS. Is it in any way OS dependent when it comes to performance? especially, when you are running test through CLI.
Desired behavior:
It should only take few seconds if not zero, before it starts test execution
Steps to reproduce:
- First of all I have configured my project in order to write the test cases in typescript.
- My Spec file,
describe('My First Cypress Test', () => {
it('Not much', () => {
cy.visit('https://www.google.co.in/');
});
});
- Now you need to run the code using command,
cypress run -- --spec "cypress/integration/specname" --browser chrome
or
npm run cypress:run -- --spec "cypress/integration/specname" --browser chrome
Versions
Windows: 10 Enterprise this is my package.json
{
"name": "cypress-spike",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"cypress:run": "./node_modules/.bin/cypress run",
"cypress:open": "./node_modules/.bin/cypress open",
"test-junit": "cypress run --reporter junit --reporter-options 'mochaFile=junit-results/my-test-output.xml'",
"test-multiple": "cypress run --reporter mocha-multi-reporters --reporter-options configFile=config.json",
"delete:reports": "rm cypress/results/* || true",
"prereport": "npm run delete:reports"
},
"dependencies": {},
"devDependencies": {
"@cypress/webpack-preprocessor": "^4.0.3",
"@types/node": "^11.9.4",
"cypress": "^3.1.5",
"cypress-xpath": "^1.3.0",
"mocha": "^6.0.1",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi-reporters": "^1.1.7",
"mochawesome": "^3.1.1",
"ts-loader": "^5.3.3",
"typescript": "^3.3.3",
"webpack": "^4.29.5"
},
"author": "",
"license": "ISC"
}
Thanks in advance
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 14
- Comments: 26 (5 by maintainers)
Okay even that much time is enough for me… Mine is taking like forever
can someone from the cypress team like @jennifer-shehane please shed some light on why it takes that long? it adds up and blows out our test times by almost double the total time, and that’s even on a lightning fast local development computer.
Note that this may be related to the nature of Windows (semi micro-kernel architecture, NTFS filesystem etc.), and ultimately unsolvable (although, it can be possibly improved to a degree — but no idea how).
Same issue I am facing now. I am using cypress 9.5.3 and running inside the docker. For loading the tests it is taking almost 40s right now.
our tests in Github’s CI now after migrating k8s cluster sometimes take 20 minutes 😱 Just one test sometimes takes 2-3 minutes by itself … not sure what’s happening
hi guys, i understand this is closed but this is definitely an issue - we are now adding up to 30-40% extra time to our regression suite for specs just to wait for tests to be loaded - what is the root cause and is there a best practice to resolve it?
the more specs/tests we are adding, it getting slower. all of our specs are under
cypress/integrationWe’re working on giving more logging during the preprocessor step. Currently we hide stderr, but we’re going to change that, so you’ll be able to see webpack output for example. https://github.com/cypress-io/cypress/issues/5765
Yes! same for me, after upgrading to the latest version of the Cypress Cucumber package, it runs after 15 sec!!
@StephRagazzi I notice you’re also using Cucumber – have you tried updating the preprocessor to version
2.0.1?@jennifer-shehane Are you guys even working on this issue? This is really pain point for us as we wanted to use Cypress for our workflows. We are just waiting with NO response from your side
You might get a better idea of what’s causing the slowdown by enabling debug logs.
set the env var
DEBUG=cypress*Windows:
OSX/Linux:
DEBUG=cypress* npm run cypress:run