question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cypress run - runs the same test twice and freezes in terminal

See original GitHub issue

Current 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)

cypress_bug

  • Operating System: Linux Mint 18 Sarah
  • Cypress Version: 0.19.2
  • Browser/Browser Version: Chrome 60

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
adubatlcommented, Jul 11, 2018

Hey guys - reproduced/solved this today for myself in the following manner.

Had three unique test suites All cy.visits are directed at the same url

Wrote 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

test one
test two(exported function in here)
test two
test three(function imported here)

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.

1reaction
ryancosanscommented, Jul 11, 2018

I think I might have something concrete.

Running cypress run with a test that does cy.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 the cy.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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found