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

Unable to integrate with Chrome but can with Chromium #16375

Closed
hpinsley opened this issue May 6, 2021 · 9 comments · Fixed by #16409
Closed

Unable to integrate with Chrome but can with Chromium #16375

hpinsley opened this issue May 6, 2021 · 9 comments · Fixed by #16409

Comments

@hpinsley
Copy link

hpinsley commented May 6, 2021

Current behavior

I am having trouble getting Cypress (version 7.2.0) to integrate with Google Chrome (version 89.0.4389.114 (Official Build) (64-bit)). When Chrome is launched by the Cypress runner, Chrome displays:

Whoops, we can't run your tests.
This browser was not launched through Cypress. Tests cannot run.

This is likely due to the fact that the Cypress extension doesn't load. Based on research, my guess is that is has something to do with group policy at my firm (although they tell me that they don't block extensions). This is based on the fact that the extension doesn't load (you don't see the CY icon in the upper right of the screen), and this information: https://docs.cypress.io/guides/references/error-messages#Cypress-detected-policy-settings-on-your-computer-that-may-cause-issues suggests that Windows Group Policy might be the culprit.

However, I do see Chrome policies in place when I enter chrome://policy. I've included a snapshot below. I worked with my IT department to set an override for myslef to specifically include the static id of the Cypress extension (which I found here https://docs.cypress.io/guides/references/troubleshooting#Windows to be caljajdfkjjjdehjdoimjkkakekklcck). You can see it listed in the policy snapshot below in both the ExtensionInstallAllowList and ExtensionInstallWhiteList. Neither of these things have helped.

My IT department also tells me that they actually proactively force some extensions to load into Chrome, and we hypothesized that perhaps we might be able to use that mechanism, but that apparently requires both an extension id and a URL (from where it would presumably be loaded). I don't think that can be tried in this case.

Other things I've tried:

  • Deleting the contents under AppData\Roaming\Cypress\cy (I've seen posts where this was suggested as a troubleshooting step for some issues)
  • Setting a proxy
  • Installing Chromium under C:\Program Files (x86)\Google\chrome-win32 -- Cypress finds Chromium and works fine
@jennifer-shehane
Copy link
Member

This error is thrown in our code here: https://github.com/cypress-io/cypress/blob/develop/packages/server/lib/util/chrome_policy_check.js#L109:L109

We previously had a bug where this policy check would fail because registry.js was not included in the binary. Wonder if this occurred again. #4986

@hpinsley Does this issue occur on previous versions of Cypress for you?

@hpinsley
Copy link
Author

hpinsley commented May 7, 2021

Hi Jennifer. I have not used Cypress before so I haven't tried other versions. Are you suggesting I try a different version? Also, would this error result in the failure of the Cypress Chrome extension to load and the subsequent "Whoops..." message?

Thanks for your help!

@mbehery85
Copy link

mbehery85 commented May 7, 2021

When I had this problem, I changed the settings in the cypress.json file to the following:

"chromeWebSecurity": false

However now with Cypress working on cross browsers now and wanting to use Chrome use this:

cypress run --browser chrome

Alternatively you can add shortcuts by defining them as shown below:

cy:run:chrome": "cypress run --browser chrome"

Hope this helps.

@hpinsley
Copy link
Author

hpinsley commented May 7, 2021

Thank you @mbehery85. I didn't mention this in my original post, but do have that "chromeWebSecurity": false in my cypress.json file. (That's the sole setting I have in there). Unfortunately, I don't think that pertains to the ability to load the Cypress extension into Chrome.

@mbehery85
Copy link

mbehery85 commented May 7, 2021

Oh ok @hpinsley , I came across this feed which maybe of use to get around this situation post (#4762)

@BossJ
Copy link

BossJ commented May 10, 2021

I have a similar case where I'm trying to use cypress within my organization's group policy, that being said "caljajdfkjjjdehjdoimjkkakekklcck" isn't blacklisted and there isn't a whitelist.

I'm seeing the same issue regarding the policy check when trying to run cypress @7.2.0 with electron @89.0.4328.0 (assuming it's the same as your config above) and with chrome @90.0.4430.93 (in this case I get a failure connecting to chrome's dev tools and after retrying a failure to connect, the cypress extension isn't loaded onto chrome if run with a head).

I also tried with cypress @6.9.1 in an older repo where I had cypress working (albeit on chrome ~83 a few months ago) and ran into the same issues with the newer versions.

Tried a final time using an example build I found on git (https://github.com/cypress-io/cypress-and-jest-typescript-example) which runs on cypress @6.8.0 and ran into the same issues. Here's the debug log for this build:

cypress-debug.txt

@jennifer-shehane
Copy link
Member

Going to try to update registry-js #16409

@jennifer-shehane
Copy link
Member

We made an update released in 7.3.0 which we think should resolve the issue.

Please let us know if updating to 7.3.0 resolves the issue.

@BossJ
Copy link

BossJ commented May 14, 2021

Hey @jennifer-shehane, in my case it was an issue stemming from running cypress within admin command prompt/vs-code.

Not sure if the upgrade helped fix my problem or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants