Cypress preview window disappears while running a test.
See original GitHub issueSteps 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:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top GitHub Comments
Sometimes the sidebar appears, but the application preview doesn’t, I know it seems so simple, but just zoom out the browser!
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