-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 cy.visit redirects to HTML and is unable to load main.js / Cypress UI lost #3124
Comments
Hey @ethernal, can you double check your Browser version and ensure it is version 64? I am currently experiencing this issue on Chromium 72 & 73, but not Chromium 70. Setting This almost seems related to this issue where Cypress is loading a static html file. This needs more investigation. |
I have also checked with Chrome 71 - same behavior with enterprise version. No if there was a way to revert that change it would be great. @jennifer-shehane are you able to provide chrome enterprise installers for version that works for you so I can check if this is configuration issue or Chrome issue? |
When testing with Electron (builtin setup) then everything works. I just now tested with Chrome 71 on my desktop PC and it seems there are settings in Chrome managed via GPO that make Cypress fail. So this is an issue with my configuration of Chrome as Electron will use engine that is not managed by admins. Is there a way to check which setting(s) is/are affecting Cypress or is there a way to use some custom installation of Chrome (portable?) and point Cypress to it ex. npm/yarn dependency? |
@ethernal I'm glad you commented with an update, I was having trouble reproducing this behavior under Chrome 71. If it's localized to your group policy then I can press pause on that. Re: installing other versions of Chrome - You can install Chromium (the open source side of Chrome), and we support that. You can also install Chrome Canary, which is the nightly build of Chrome. Both of these will be auto-detected next time you run Cypress. Will these work to evade your group policy? Here's some docs about that: https://docs.cypress.io/guides/core-concepts/launching-browsers.html#Browsers |
@flotwig I read that documentation and Installed both Chrome Beta and Chromium. Neither is picked up by Cypress also I would love to see in Documentation side by side information on how to use cypress.json ex. to run chrome the docs say:
What I am missing is that in cypress.json I should put
Also the API docs suggest there are only 2 settings: "chrome" and "electron" so how do I specify chromium when Cypress did not see it installed (got one from: https://chromium.woolyss.com/) Also a link to any supported Chromium version would be great as it's a pain to find a stable version. PS. can we use cypress.config.js as well or only json? |
To run Chromium, the command is
Only If you can't get Chromium working, for now, there is not a way to explicitly pass the path of your browser to Cypress like proposed in #1026. Does the Electron browser work for your needs in the mean time? |
Yes it does. I did check earlier and that config changed nothing as you said. Although first change made the internal browser use Electron so that was misleading. I think we can close the issue. PS is there a way to check what settings make Chrome act so strange? It would be useful for troubleshooting I believe. |
@ethernal You can visit |
I removed the domain names and internal addresses but it is all. No real data/options are removed:: {
"chromePolicies": {
"BackgroundModeEnabled": {
"level": "mandatory",
"scope": "machine",
"source": "sourcePlatform",
"value": false
},
"HomepageLocation": {
"level": "mandatory",
"scope": "machine",
"source": "sourcePlatform",
"value": "https://internalNetwork.domain.com/"
},
"JavaScriptAllowedForUrls": {
"level": "mandatory",
"scope": "machine",
"source": "sourcePlatform",
"value": [ "*.domain.com ", "*.internalDomain.internal " ]
},
"ProxySettings": {
"level": "mandatory",
"scope": "machine",
"source": "sourcePlatform",
"value": {
"ProxyMode": "system"
}
},
"SyncDisabled": {
"level": "mandatory",
"scope": "machine",
"source": "sourcePlatform",
"value": true
}
},
"extensionPolicies": {
"ghbmnnjooekpmoecnnnilnnbdlolhkhi": {
}
}
} |
Been looking in to the proxy problems, and it looks your |
Is this a Feature or Bug?
Bug. Possibly in my configuration. I did post a question on gitter and was without answer. Also it seems that more context will be beneficial so using GitHub for it.
Current behavior:
When running
npm run server
and thennpm run cypress
from https://github.com/ethernal/react-boilerplate and selectingsmoketest_homepage_spec.js
Cypress runs and redirects to the page with 'Hello World'. No JS is loaded so the App and styles are not loaded.Also there is no Cypress UI/console (framebusting?).
Video (MP4) file in ZIP as MP4 are not supported.
cypress-react-app-redirect-and-ui-lost-video.zip
When running localhost manually it loads OK (console tab)..
..and Network tab:
When run by Cypress it cannot find the main.js served by WDS from memory:
This is URL copied to Firefox:
Running Cypress in debug/log (localStorage.debug='cypress/*' in console) mode shows:
Desired behavior:
Run a test and return fail/pass, see the Cypress UI. Tell me what I am doing wrong.
Steps to reproduce: (app code and test code)
Clone latest commit from: https://github.com/ethernal/react-boilerplate
run:
yarn install
npm run server
npm run cypress
Select
smoketest_homepage_spec.js
test. It will show the HTML file without JS loaded.Versions
Cypress package version: 3.1.4
Cypress binary version: 3.1.4
Windows 10 1803 Enterprise
Browser: Version 64.0.3282.186 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: