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

Whoops, there is no test to run error msg when visiting certain websites #3077

Closed
bahmutov opened this issue Jan 7, 2019 · 65 comments
Closed
Labels
prevent-stale mark an issue so it is ignored by stale[bot] topic: 😳 whoops there is no test to run Error msg: "Whoops there is no test to run" type: bug

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Jan 7, 2019

Really weird crash - "Whoops, there is no test to run"

Cypress 3.1.4 on Mac, spec file

it('loads', () => {
  cy.visit(
    'https://stackoverflow.com/questions/379453/useful-add-ins-or-plug-ins-for-native-visual-studio-developer'
  )
})

See movie below

stackoverflow

Sometimes I see the red error message in the command log, but could not record it yet, and it flashes way too quickly to see

Final screenshot

screen shot 2019-01-07 at 3 55 12 pm

@parliament718
Copy link

parliament718 commented Jan 7, 2019

I have a bit of a different result ... My "final screenshot" is ending up on the actual stackoverflow website at a 404 page for the route /__ . Also this happens to me for absolutely any url I use, I always end up thedomain.com/__ at the top level of the browser (in other words, the browser leaves the cypress testing page entirely)

That's what happens when using Chrome 71. If I use the Electron option, then cypress finally puts the URL into the integrated browser on the test page (instead of navigating away from the page entirely), however the page does not load (it just hangs forever on "Loading..."). To be clear this is happening to me regardless of what URL I use.

Also I cannot show any screenshots because github it erroring out when I try to upload them and my company's strict browsing policies prevent me from doing it any other way easily.

It's not a good look that I'm encountering blocking issues on the very first line of code trying to evaluate cypress. I'm actually the one that was pushing my company to switch to cypress. I received push-back but was able to convince them to give me just a view days to evaluate and prove it's good enough to purchase. If this doesn't get fixed fast I probably will not be able to convince anybody of anything.

I'll try older versions for now and hope this bug doesnt exist.

@bahmutov
Copy link
Contributor Author

bahmutov commented Jan 7, 2019

@parliament718 thank you for trying Cypress and reporting this bug. While unfortunate, I can promise that thousands of projects are successfully using Cypress every day locally and on CI to test a variety of sites. Where things can wrong in your case (and for StackOverflow) are custom proxies and redirects that prevent Cypress from correctly loading the site.

When you have started Cypress for the very first time, did it scaffold examples folder and could you run any of the examples there? Something like

mkdir foo 
cd foo
npm init -y
npm i -D cypress
npx cypress open

Then click on any spec file - what happens?

@parliament718
Copy link

parliament718 commented Jan 7, 2019

What happens is

  1. clicking spec file launches browser to http://localhost:49606/__/#/tests/integration\examples\files.spec.js
  2. browser flashes and quickly redirects to https://example.cypress.io/__/#/tests/integration\examples\files.spec.js
  3. Result is 404 with message like "For root URLs (like http://example.com/) you must provide an index.html file."

If I run these example specs with Electron option it runs successfully.

Why does step 2 above happening? I once again notice that redirect to the route with a double underscore ....What is this about? When the cy.visit('localhost:4200/some/url') call ends up redirecting me to localhost:4200/__, my application is obviously running on that port and will begin to bootstrap itself with an invalid route.

I don't understand what cypress expects to happen when it redirects to the url where my application is running with a double underscore route.

Additionally, if I run my example using Electron is just hangs trying to load the localhost:4200/some/url even though this exact url has no problem loading in a regular browser session.

@jennifer-shehane jennifer-shehane changed the title Cannot visit StackOverflow website Whoops, there is no test to run error msg when visiting StackOverflow website Jan 8, 2019
@jennifer-shehane
Copy link
Member

Hey @parliament718, could you provide screenshots of these errors and also any test code you are running to get here? This would be most helpful in tracking the exact issue.

I'm aware of 404 issues involving Chrome 72+ here #1872

Cypress does do some things that appear strange - like switching urls on first visit to the domain you intend use in your cy.visit() to avoid cross domain issues, so some of this is intended behavior, but certainly having the application never load is not intended and is a bug.

@jennifer-shehane jennifer-shehane added topic: 😳 whoops there is no test to run Error msg: "Whoops there is no test to run" stage: ready for work The issue is reproducible and in scope labels Jan 8, 2019
@jennifer-shehane
Copy link
Member

@bahmutov I've labeled all issues we've encountered previously with 'Whoops, there is no test to run' error within this label

Some of them have been related to strange 'framebusting' kind of behavior - especially on large websites. Like this one for example #1517

@parliament718
Copy link

parliament718 commented Jan 8, 2019

@jennifer-shehane @bahmutov

When using Chrome 71 this happens:
img

For example, cy.visit('http://angular.io') and launching the test via Chrome 71 results in this:
img2

Notice the double underscore in the URL and Im no longer on the testing page. This happens for localhost as well, I get redirected to localhost:4200/__ with the double underscore. As expected, this navigates away from the cypress testing page, not sure why cypress it changing the top level url instead of the one in the integrated iframe browser

When I try to use Electron to launch the test it cannot load the page:
img3

Navigating to this URL the standard way via browser does in fact open my application.

@parliament718
Copy link

@jennifer-shehane @bahmutov I have until the end of this week (max) to evaluate cypress for my company until we move on to other solutions. I still cannot get past this issue. Are the screenshots above expected behavior?

@bahmutov
Copy link
Contributor Author

bahmutov commented Jan 9, 2019

@parliament718 something goes terribly terribly wrong in your case (remote URLs, framebusting, etc) that we do not have time figure out. We won't have time figure out this unfortunately in any urgent time frame.

@parliament718
Copy link

@bahmutov My company has strict browsing policies, are there any external calls that cypress makes to any domain other than *.cypress.io that I perhaps need to have whitelisted?

@jennifer-shehane
Copy link
Member

Hey @parliament718, I've been unable to replicate this behavior on my end with Chrome 70 & 72. Did you narrow down the issue to Chrome 71? Or were you just mentioning that.

Also, have you by chance set the modifyObstructiveCode configuration to false?

Whitelisting only our domain (*.cypress.io) should be sufficient.

@parliament718
Copy link

parliament718 commented Jan 10, 2019

@jennifer-shehane I've tried modifyObstructiveCode false with no success. Also, how can I try via Chrome 70/72? I only see the 71 option and Electron in my dropdown.

Also, please note I am on a windows machine, do you have one to try on ?

@parliament718
Copy link

parliament718 commented Jan 14, 2019

@jennifer-shehane Has anyone had a chance to test on windows? Also how can I test on Chrome 70/72 if I dont see the option in the dropdown?

@jennifer-shehane
Copy link
Member

Hey @parliament718, you would need to download that specific Chromium version on your machine - adding it as an application, as you would any other browser - then it should be detected within Cypress for the dropdown. It's not great documentation, but this explains how to download a specific Chromium version. https://www.chromium.org/getting-involved/download-chromium

@jennifer-shehane jennifer-shehane added stage: needs investigating Someone from Cypress needs to look at this and removed stage: ready for work The issue is reproducible and in scope labels Jan 29, 2019
@JonesInTheFastLane
Copy link

This might be a silly question but you do have describe part also in your spec?

@devipv02
Copy link

devipv02 commented Feb 17, 2019

Hi @jennifer-shehane , i get the same message 'Whoops, there is no test to run.' when i try to access any page using http. When i use https://google.com it works fine. But when i use http://localhost:8000 it opens the page, flashes for a second and then throws the above message.
Below is the code i'm using: [Browser: chrome 71, OS: mac]

describe('Login page', () => {
  it('Login', () => {
    cy.visit('http://localhost:8000')
  })
})

@marinav
Copy link

marinav commented Mar 15, 2019

Hi,

I had the same problem and it took me a long time to understand why. Indeed this is framebusting, and it's not easy to find what's wrong. Regarding my app, I commented on bits of code and I finally found it came from the google tag manager. So I added this to my cypress.json file :

"blacklistHosts": ["www.googletagmanager.com"]

like @jennifer-shehane suggest it here : 2052. And now it works !!

Good luck !

@suellenz
Copy link

Hello everybody, I have the same problem of @parliament718, I tried the suggest of @marinav however it is still happening.
@jennifer-shehane do you know how is it going? I'm making some POC to present to my team to select a best tool to automated the tests however since we have this problem I cannot present for them cypress like an option.
Thank you.

@vrodnyanskiy
Copy link

This problem just started for me when I added
"modifyObstructiveCode": false.

@flotwig
Copy link
Contributor

flotwig commented Jun 25, 2019

The issue in the OP is coming from code on StackOverflow that is causing frame busting. If I blacklist StackOverflow's javascript, it works:

{
  "blacklistHosts": [
    "cdn.sstatic.net"
  ]
}

So it seems like there's another frame busting case we need to identify and protect against.

@neliza
Copy link

neliza commented Jul 3, 2019

hey all, I was facing the same problem and the workaround that works was to change the browser to another one than Chrome.
Screen Shot 2019-07-03 at 2 50 48 PM
This another browser works for me. So, it looks like this is a chrome's version problem. I think that could be related to the arrangement between chrome within cypress and the local chrome in the machine. And this could be the reason that this problem happens only for some people.
If someone has the correct versions that chrome should have on cypress and locally, please, share here.
Thanks.

@uc-any
Copy link

uc-any commented Sep 5, 2019

I also find this issue when I am running my test code.
It comes when my site redirects me from https://www.ucertify.com to https://www.ucertify.com/[xyz].

@spinkpanther-dev
Copy link

This blocked me too!
Any solution?

@hoangtran22792
Copy link

This still blocks me for a long time,someone please help me to fix this.
Untitled

@rangabarath
Copy link

rangabarath commented Oct 26, 2020

This issue is resolved using #992 code snippet in support/index.js

#992 (comment)

@straris
Copy link

straris commented Oct 30, 2020

@rangabarath perhaps for your case, would be great to know what that was.

@gretherMG
Copy link

Hi good afternoon, I too something similar happens, I start my test the functions login correctly, then step test select from the menu and the other test filling information of the person I am referring, income type identification and the identity card (number), then I click on the button to consult and there in the 3rd test case is that it sends the message to me, however I'm not going to another url, just what you do when you click on the button is loading a component under the button with information from the person consulted. attached images, thank you in advance for your help.

error
error2

attentive to your prompt response. Greetings

@lasithdilshan20
Copy link

Hi Community,

Any workaround for this issue? Still, I cannot sort out this issue, We are dealing with sensitive data so can not share the scripts.
I tried out a couple of solutions in here but the issue was still there.
Please let me know any work around.

image

@yanmin-zhang
Copy link

yanmin-zhang commented Feb 19, 2021

I am experiencing the same issue. When I click on the below link, I am getting this error.
<b><a target="_top" href="/oscar/group/view.html?groupID=xxxxxx">yyyyy</a></b>
@binpol6 do you have resolve it? I have same issue

@straris
Copy link

straris commented Feb 26, 2021

Would be great to get an update of the priority on this, actually thinking of migrating to another framework because of the issue.

@handriss
Copy link

handriss commented Mar 16, 2021

I am facing the same issue. I am using cy.visit() and cypress redirects to a double underscore url.

I created a question about it on Stackoverflow for anyone interested in reproducing this issue: https://stackoverflow.com/questions/66613875/app-in-cypress-redirects-outside-does-not

@TimurNurlygayanov
Copy link

Hi, I also have this issue and it is a blocker to even start my first test with Cypress...

@MuckT
Copy link

MuckT commented Apr 3, 2021

@handriss did you try the workaround I posted in the stack overflow question?

@alexlazarciuc
Copy link

alexlazarciuc commented May 17, 2021

Facing same issue, none of the workarounds are working.

@jjing0227
Copy link

Having the same issue when modifyObstructiveCode is set to false.

@GIJAREASHISH
Copy link

After removing modifyObstructiveCode working for me.

@olitomas
Copy link

olitomas commented Oct 6, 2021

My javascript runs this code after pressing a button. After removing "top" Cypress stopped behaving like this.

    //Doesn't work
    window.top.location.href = '/helloworld/';
    
    //Works
    window.location.href = '/helloworld/';

@Lvlynfnt
Copy link

My javascript runs this code after pressing a button. After removing "top" Cypress stopped behaving like this.

    //Doesn't work
    window.top.location.href = '/helloworld/';
    
    //Works
    window.location.href = '/helloworld/';

@olitomas will this be applicable with my link https://www.intacct.com/ia/acct/login.phtml
the subject issue is still happening with the site i'm accessing

@jennifer-shehane do we have other workaround that will work for this issue?

@olitomas
Copy link

My javascript runs this code after pressing a button. After removing "top" Cypress stopped behaving like this.

    //Doesn't work
    window.top.location.href = '/helloworld/';
    
    //Works
    window.location.href = '/helloworld/';

@olitomas will this be applicable with my link https://www.intacct.com/ia/acct/login.phtml the subject issue is still happening with the site i'm accessing

@jennifer-shehane do we have other workaround that will work for this issue?

I cant see why not.

@mathiasvandaele
Copy link

Hello,

having the same issue here

We are testing a payment module, and after entering informations (card number, cvc, expiry date) the payment is supposed to be successful and then we're supposed to be redirected to a success page.

in the log: i can see the redirection but it leaves me with the same page you all have (there is no test to run)

GET /success 302 1.183 ms - 52
GET /__/ 200 0.800 ms - -

none of the workaround have worked

@mattvb91
Copy link

@mathiasvandaele Ive literally just found your comment because cypress has started bailing out after testing a stripe iframe to enter credit card info. Did you ever manage to solve this?

@ShanonJackson
Copy link

This problem is killing us because our application redirect to Azure B2C for login/logout/identity management and the second it just redirected it just says "Whoops can't find tests".

Really rough to deal with as none of the work arounds here work; Interestingly enough logging in through b2c its fine its just all the other flows that ruin us.

@twistedclown
Copy link

We are experiencing the same issue when we select a different company id in our site and the site updates to bring in the company id settings for the user. The site is iframe structure. I didn't know if there was a way to make cypress to ignore the updating of the site in order to continue running the tests.

@cypress-bot cypress-bot bot added stage: icebox and removed stage: needs investigating Someone from Cypress needs to look at this labels Apr 28, 2022
@feliperaul
Copy link

Having the same crash trying to use cypress to test a Stripe Checkout payment flow.

@nagash77 nagash77 added the prevent-stale mark an issue so it is ignored by stale[bot] label Apr 3, 2023
@jennifer-shehane
Copy link
Member

Since this issue hasn't had activity in a while, we'll close the issue until we can confirm this is still happening. Please open a new issue if there is new information to provide around this error in newer versions of Cypress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prevent-stale mark an issue so it is ignored by stale[bot] topic: 😳 whoops there is no test to run Error msg: "Whoops there is no test to run" type: bug
Projects
None yet
Development

No branches or pull requests