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

Cypress change visiting url with adding /__/#/tests/__all #4453

Closed
OksanaFirtych opened this issue Jun 13, 2019 · 11 comments
Closed

Cypress change visiting url with adding /__/#/tests/__all #4453

OksanaFirtych opened this issue Jun 13, 2019 · 11 comments
Labels
type: duplicate This issue or pull request already exists

Comments

@OksanaFirtych
Copy link

Cypress adds some unexpected suffix in testing url.

Current behavior:

  1. cy.visit('http://localhost:3000/')

  2. run cypress.

  3. it openes url http://localhost:3000/__/#/tests/__all

  4. Page not found

  5. cy.visit('http://localhost:3000/simple')

  6. run cypress.

  7. it openes url http://localhost:3000/__/#/tests/__all

  8. Page not found

Desired behavior:

Should visit exactly url from script http://localhost:3000/ or http://localhost:3000/simple and test rendered page.

Steps to reproduce: (app code and test code)

I've created testing repository. https://github.com/OksanaFirtych/test_cypress

  1. Clone repository
  2. npm run start
    Visit http://localhost:3000/ or http://localhost:3000/simple in browes to verify that it's started
  3. npm run cy:open
  4. Run all specs or main.spec.js

Versions

Cypress 3.2.0
Chrome 75.0.3770.80

@OksanaFirtych
Copy link
Author

Could somebody confirm that it existing bug or say what I'm doing wrong, please? This quite critical thing doesn't allow me to move forward.

@rizsky
Copy link

rizsky commented Jun 14, 2019

same as i did. But it run smoothly when it headless or when its browser is electron. When its on chrome 😕 so what i did is force to desired link to run the test. But its just wasting time (almost 2-3 second wasted for reload the page)

@flotwig
Copy link
Contributor

flotwig commented Jun 14, 2019

@OksanaFirtych Cypress works by opening your tests in a frame inside of a URL that looks like http://<your testing domain>/__/#/tests/<tests that are running>, so this in itself is not an issue. Is your site not loading properly?

@OksanaFirtych
Copy link
Author

@flotwig Yes, my site with routing isn't loading at all any pages. But if I remove routing at all it will work under cypress. As you can see above it's not only mine problem.

@flotwig
Copy link
Contributor

flotwig commented Jun 17, 2019

@OksanaFirtych I see, can you share a screenshot of the failure and a copy of the entire DEBUG log? Here are some instructions: https://docs.cypress.io/guides/guides/debugging.html#Print-DEBUG-logs

@OksanaFirtych
Copy link
Author

@flotwig it looks like nothing.
Screenshot 2019-06-17 at 22 04 25

cy.log

@flotwig
Copy link
Contributor

flotwig commented Jun 17, 2019

@OksanaFirtych Can you share a screenshot of chrome://policy from the browser that Cypress launches? This looks similar to #1253.

Does it work if you run it in Electron?

@OksanaFirtych
Copy link
Author

Yes, it works with Electron

Screenshot 2019-06-18 at 09 28 10
Screenshot 2019-06-18 at 09 28 43

@flotwig
Copy link
Contributor

flotwig commented Jun 18, 2019

I see ProxyMode: pac_script in your settings, which unfortunately means you are being affected by #1253 - your administrator has settings that are preventing Cypress from launching Chrome. We can't do much about this from our end. You can check this comment for some known workarounds.

Closing as duplicate of #1253

@flotwig flotwig closed this as completed Jun 18, 2019
@flotwig flotwig added the type: duplicate This issue or pull request already exists label Jun 18, 2019
@AbreezaSaleem
Copy link

AbreezaSaleem commented Jun 15, 2020

I have a url like this as well but when I try to hit a url with a different domain it gives me something like

https://twitter.com/__/#/tests/integration/folder/test_spec.js

And since it is an invalid url, my application reroutes to the default url (localhost:3000/users) and for some reason the whole test_spec.js runs again. And when it reaches the test that visits the twitter url it again reroutes to the default url and again the tests in the test_spec.js start running again and the cycle continues.

Also, I have defined two describe blocks in the spec file which means I wont be getting the same origin error.

Can someone please tell me how I can just visit the https://twitter.com link when using cypress.visit?

@jennifer-shehane

@jennifer-shehane
Copy link
Member

A fix for this is available starting in 4.6.0 as an experiment which you can access by setting this config option in your cypress.json or elsewhere:

{
	"experimentalSourceRewriting": true
}

The fix is experimental, so there may be some situations where the this is not fixed.

If you're still this issue while setting the experimentalSourceRewriting to true in 4.6.0 - open a new issue with a reproducible example + screenshots, etc - filling out our issue template.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants