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 preview window disappears while running a test.

See original GitHub issue

Steps to reproduce

I was following the cypress getting started the tutorial: https://on.cypress.io/writing-your-first-test#Step-1-Visit-a-page

In the sample_spec.js, I have put this code:

describe('Open`` url', function() {
	it('Opens the url', function() {
		cy.visit('https://portal.surveysensum.com/')
	});
});

Then I ran:

touch cypress/integration/sample_spec.js

Then I ran:

npx cypress open

When the cypress gets opened, I selected sample_spec.js and that opened a new chrome window with the cypress preview window on the right and the test stats on the left.

Current behavior:

As soon as the test run starts in the new window, cypress opens my url in chrome main URL bar instead of opening it in the preview window. Plus, cypress throws a js error, which is not hit when opening the url manually

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: ‘’ Error: Cannot match any routes. URL Segment: '’ at e.noMatchError (main.e24cf8bcc1f269304df0.js:1) at t.selector (main.e24cf8bcc1f269304df0.js:1) at t.error (main.e24cf8bcc1f269304df0.js:1) at t._error (main.e24cf8bcc1f269304df0.js:1) at t.error (main.e24cf8bcc1f269304df0.js:1) at t._error (main.e24cf8bcc1f269304df0.js:1) at t.error (main.e24cf8bcc1f269304df0.js:1) at t._error (main.e24cf8bcc1f269304df0.js:1) at t.error (main.e24cf8bcc1f269304df0.js:1) at t._error (main.e24cf8bcc1f269304df0.js:1) at M (polyfills.2e87b51ded3ed1a0ba15.js:1) at M (polyfills.2e87b51ded3ed1a0ba15.js:1) at polyfills.2e87b51ded3ed1a0ba15.js:1 at t.invokeTask (polyfills.2e87b51ded3ed1a0ba15.js:1) at Object.onInvokeTask (main.e24cf8bcc1f269304df0.js:1) at t.invokeTask (polyfills.2e87b51ded3ed1a0ba15.js:1) at e.runTask (polyfills.2e87b51ded3ed1a0ba15.js:1) at g (polyfills.2e87b51ded3ed1a0ba15.js:1) at a (main.e24cf8bcc1f269304df0.js:1) at main.e24cf8bcc1f269304df0.js:1

Desired behavior:

1 - Cypress should open the url in the preview window and not in the main test window 2 - JS error should not hit because the site opens fine, without any js error, when running manually

Versions

Cypress 3.2.0 npm 6.9.0 Windows 7 74-bit

Tried running through VS code as well as through windows command prompt.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
parvaneh-sanaiecommented, Feb 8, 2022

Sometimes the sidebar appears, but the application preview doesn’t, I know it seems so simple, but just zoom out the browser!

1reaction
markbellocommented, Oct 7, 2019

Are your tests running any snapshots? If so, I think it closes the sidebar so it doesn’t appear in snapshots. I had this issue too, and after I removed them the sidebar persisted for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting | Cypress Documentation
Run the same tests in both Electron and Chrome, then compare the screenshots/videos. Look for and isolate any differences in the Command Log....
Read more >
Cypress Test Runner open and disappear as soon as it open7
If the runner won't open you need to clear the app data ... So navigate to C:\Users[username]\AppData\Roaming\Cypress\cy and delete all ...
Read more >
Testing Browser Alerts, Confirmations, and Prompts with ...
Testing alerts in the browser with Cypress ... View the code on Gist. After first triggering the alert, we'll listen to the window:alert...
Read more >
Some UI testing problems and the Cypress way - ITNEXT
Cypress “waits” for you, which means that if a DOM element is not ready when you try to interact with it, no problem!...
Read more >
Cypress.io + Percy = End-to-end functional and visual testing ...
Link to slides: slides.com/bahmutov/visual- testing -with-percy/Other helpful ...
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