Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cy.visit() on SPA redirected #3697

Closed
zts3y opened this issue Mar 12, 2019 · 11 comments
Closed

cy.visit() on SPA redirected #3697

zts3y opened this issue Mar 12, 2019 · 11 comments
Labels
topic: 😳 whoops there is no test to run Error msg: "Whoops there is no test to run"

Comments

@zts3y
Copy link

zts3y commented Mar 12, 2019

Current behavior:

Using simply a cy.visit() to browse to a URL that happens to be a single page application, the page will render in the runner before quickly being redirected to a base url of __ and the runner losing connection and reporting "Whoops, there is no test to run." In normal Chrome browser, a redirect is not observed.

Desired behavior:

URL should not change, or if a redirect is common for this tool to function, it should be followed and tests continue to run.

Steps to reproduce: (app code and test code)

cy.visit('https://www.medicare.gov/physiciancompare');

Terminal will report:

GET /physiciancompare/ 302 2.960 ms - 52
GET /__/ 200 4.412 ms - -

Versions

Cypress: 3.1.5
Windows 10

@jennifer-shehane jennifer-shehane added the topic: 😳 whoops there is no test to run Error msg: "Whoops there is no test to run" label Mar 14, 2019
@jennifer-shehane
Copy link
Member

I am able to recreate this. I notice that a location popup comes up directly before it go to the 'Whoops' page - I don't think that is related, but there is an issue open to disable the dialog here: #2671

Screen Shot 2019-03-14 at 12 31 44 PM

Screen Shot 2019-03-14 at 12 31 48 PM

I notice you logged a 302 redirect. Can you share the code of how you are performing the actual redirect? It's possible that you're redirecting from window.top instead of window which would cause this behavior.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Mar 14, 2019
@zts3y
Copy link
Author

zts3y commented Mar 14, 2019

Thanks @jennifer-shehane. I don't think the geolocation request is related as I've seen the same behavior on other applications without that feature. I'm working to get more information regarding the redirect now.

@suellenz
Copy link

Hey @jennifer-shehane I have the same problem, if you want to see it to get more information I can show you.

@zts3y
Copy link
Author

zts3y commented Mar 29, 2019

@jennifer-shehane, I heard back from folks that would know the answer to the redirect question. There is nothing on the hosting end that would cause this, and no rules existed that would present this behavior without it also being visible when examining it manually in a browser.

I tested my application locally, and Cypress works as expected there though.

@suellenz
Copy link

@jennifer-shehane so don't have a solution for this problem? I really want to make some tests with cypress.

@jennifer-shehane
Copy link
Member

@suellenz You are welcome to forward any information directly to support@cypress.io in reference to this bug

@cypress-bot cypress-bot bot added stage: needs investigating Someone from Cypress needs to look at this and removed stage: needs information Not enough info to reproduce the issue labels May 2, 2019
@suellenz
Copy link

suellenz commented May 2, 2019

@jennifer-shehane Thank you so much, I'm going to try again and make more some tests and if I still have with same problem I'll forward the bug to the support just like you suggested me.

@jennifer-shehane
Copy link
Member

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

@jennifer-shehane jennifer-shehane removed stage: needs investigating Someone from Cypress needs to look at this type: bug labels Apr 28, 2020
@electronrecord
Copy link

Hi there, I have the same issue of "Whoops, there is no test to run."
I have installed cypress per project, did not touch cypress.json, and started with npx cypress open.

When I run actions.spec.js with a modified visit URL - https://www.portail-autoentrepreneur.fr I get the error message. It does work with other websites though. This website is made with VUE SSR.

Anyone encountered this issue of no tests to run?

thanks

@jennifer-shehane
Copy link
Member

@electronrecord Typically we've seen this issue when clicking on links that have target=_parent #3121 but there are some other issues open as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: 😳 whoops there is no test to run Error msg: "Whoops there is no test to run"
Projects
None yet
Development

No branches or pull requests

4 participants