cypress run - runs the same test twice and freezes in terminal
See original GitHub issueCurrent behavior:
cypress run
will run the tests file twice and will freeze
Expected behavior:
cypress run
will run test one by one and will end with tests summary
How to reproduce the current behavior:
clone this repo https://github.com/ddeath/cypress-freezes-bug and run cypress run
Additional Info (images, notes, stack traces, etc)
- Operating System: Linux Mint 18 Sarah
- Cypress Version: 0.19.2
- Browser/Browser Version: Chrome 60
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:14 (4 by maintainers)
Top Results From Across the Web
cypress run - runs the same test twice and freezes in terminal
Current behavior: cypress run will run the tests file twice and will freeze. Expected behavior: cypress run will run test one by one...
Read more >Cypress freezing on multiple tests - Stack Overflow
Freezing happens in different spots, sometimes on different tests, on different cypress runs.
Read more >Cypress - Percy Docs
Integrating Percy with your Cypress tests. ... Note the double dash, ... Migrating can be done by running the following commands and following...
Read more >Troubleshooting | Cypress Documentation
Run the same tests in both Electron and Chrome, then compare the ... After running this command, you will need to run cypress...
Read more >Common errors | npm Docs
Random errors · Some strange issues can be resolved by simply running npm cache clean and trying again. · If you are having...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey guys - reproduced/solved this today for myself in the following manner.
Had three unique test suites All
cy.visit
s are directed at the same urlWrote a function in test two that I ended up needing in test three but not test one so I exported the function from test two instead of making a Cypress command, then imported it in test three. All the tests ran perfectly when run solo.
When run headless the repeat test would run as normal, but it takes an eternity so I didn’t want this running twice even if it was harmless.
The export caused the gui and headless to run all tests as follows
Removed the export and made it into a command instead and the issue is resolved.
Hope this shed some light on things, or at least didn’t make things less clear.
I think I might have something concrete.
Running
cypress run
with a test that doescy.visit("https://google.com")
appears to crash/freeze on the initial run if you don’t have a baseUrl set in the cypress.json.I’m not entirely sure why this is but my guess is it might be comparing the
baseUrl
(null) to the base url in thecy.visit
in this case"https://google.com"
figuring they are different and reloading or something.If anyone can confirm this behaviour perhaps we could change the docs to say that
baseUrl
is required in the cypress.json until it’s fixed.