cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.72k stars 3.16k forks source link

Cypress.io does not launch chrome on Windows 10: 'Whoops, we can't run your tests' #6889

Closed utd20 closed 1 year ago

utd20 commented 4 years ago

Current behavior:

I updated cypress from 4.2.0 to 4.3.0 and now I am not able to run my cypress tests in chrome. I get the following error message

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

I am able to run my tests in firefox, edge and electron. But not Chrome and Canary.

I tried to delete the app data so cypress could rebuild them but it did not rebuild.

image

Desired behavior:

I want to run my tests also in chrome.

Test code to reproduce

its not necessary which code i use. its the same with example.spec

Versions

i am using windows 10 enterprise version 1903, cypress.io 4.3.0, Chrome Version 80.0.3987.149 (64bit) Canary Version 82.0.4081.0 (64bit)

jennifer-shehane commented 4 years ago

Yes, generally deleting App Data does help in these cases.

Electron is using 80.0.3987.158 - which is even a bit above your version, so I don't think it's related to the Chrome version per se.

utd20 commented 4 years ago

Yes, generally deleting App Data does help in these cases.

Electron is using 80.0.3987.158 - which is even a bit above your version, so I don't think it's related to the Chrome version per se.

  • Does downgrading to 4.2.0 fix your issue?

no it doesnt work for me

  • Can you ensure your company did not recently block Chrome extensions - your company will need to whitelist our extension if so. Or maybe some other corporate setting behind Chrome has changed?

I asked my company to whitelist that extension. but it still doesnt work.

Spookyguy commented 4 years ago

@jennifer-shehane as you can see, the cypress icon was not visible in the browser before @utd20's company whitelisted the extension. Therefore whitelisting could not be the problem with my issue (#7947).

jennifer-shehane commented 4 years ago

Yeah, I'm not sure why this is happening for a select number of people on Windows.

utd20 commented 4 years ago

Yeah, I'm not sure why this is happening for a select number of people on Windows.

  • Does the browser launch outside of Chrome for everyone else? (Firefox, Electron, Edge)
  • Are you all behind a corporate proxy? With proxy configured?
  • Could you run Cypress in debug mode mode and print the entire set of logs here?

I cannot run cypress in debug mode. but i can reach other webpages besides localhost. And i can use cypress with every other browser.

utd20 commented 4 years ago

hmm. i tried to use cypress with chrome today after 3 month. it opens my localhost website but does not do the tests. also i can not see the "test steps" at the left side of my browser

Spookyguy commented 4 years ago

@jennifer-shehane Cypress does not offer firefox nor edge. But the debuglog says 'whitelisted:false' when running with Chrome:

cypress:server:util:socket_whitelist is incoming request whitelisted? { isWhitelisted: false, reqUrl: '/__socket.io/?EIO=3&transport=websocket', remotePort: 52658, remoteAddress: '127.0.0.1' } +5s

So I guess the extension is not whitelisted despite the fact, that the extension icon shows up in Chrome.

jennifer-shehane commented 4 years ago

Yeah, that log does seem to indicate that something is not going through with the proxy config.

Certain group policies (GPOs) on Windows may prevent Cypress from working as intended, which can cause tests to break.

Can you read here for more info and workarounds: https://on.cypress.io/error-messages#Cypress-detected-policy-settings-on-your-computer-that-may-cause-issues and see if any of those resolve your issues?

Spookyguy commented 4 years ago

Tried suggestions given on the linked page. First tried to delete the registry keys, but couldn't find any of the mentioned ones in my registry. Then tried it with chromium, but Cypress refused to launch it with the error

Error: We could not identify a known browser at the path you provided:

C:\Users\********\AppData\Local\Chromium\Application\chrome.exe`

The output from the command we ran was:
    at get (C:\Users\*******\AppData\Local\Cypress\Cache\4.10.0\Cypress\resources\app\packages\server\lib\errors.js:946:15)
    at Object.throwErr [as throw] (C:\Users\********\AppData\Local\Cypress\Cache\4.10.0\Cypress\resources\app\packages\server\lib\errors.js:964:9)
    at C:\Users\********\AppData\Local\Cypress\Cache\4.10.0\Cypress\resources\app\packages\server\lib\browsers\index.js:119:28

I used following command:

cypress open --browser C:\Users\*******\AppData\Local\Chromium\Application\chrome.exe

chromium.exe is working if called directly from the command line.

Coding-Means-Always-Learning commented 4 years ago

Hello @jennifer-shehane Even i am encountering this issue I am new to cypress and able to execute the example tests ok in Cypress Its only when i try Launching the tests in Chrome, i am encountering the issue

TornadoChap commented 4 years ago

Hi :jennifer-shehane I am facing the same issue. This is the first time I am trying Cypress and not able to proceed further due to the issue. I am using Chrome 84 version and latest version of Cypress on Windows 10 The example tests run alright on the electron browser but not on chrome. Get the same "Whoops, we can't run your tests. The browser was not launched through Cyrpess.Tests cannot run" error. There is also no cypress extension in the test window. Have tried all the steps mentioned like clearing the app data etc but no luck. image

KuroiRaven commented 3 years ago

Hello @jennifer-shehane ,

I am currently trying to use Cypress as a test-runner at work but I am facing the same issue as my peers. I am either getting a "Whoops, we can't run your tests." error if I do not specify a baseUrl or just loading the baseUrl without the cypress test-runner... The tests do run fine on electron though. That makes me think that it is not proxy-related.

I tried it at home and it seems that everything works fine there.

When checking the cypress extension, I din't find anything that was specifying that the extension was blocked. Tried to clean the cache but it didn't help.

Desired behavior:

I want to run my tests also in chrome.

Test code to reproduce

its not necessary which code i use. its the same with example.spec

Versions

OS: Windows 10 Enterprise Cypress.io: 5.2.0 Chrome: 85.0.4183.121 (Build officiel) (64 bits)

kevin-clark2 commented 3 years ago

Hello @jennifer-shehane

I have the same issue. On the work system, the test runner will not open and run tests in Chrome. It runs fine in Electron and Edge.

Is the test runner trying to call api.cypress.io and being blocked?

Here is some logs ----

  cypress:server:project get project status for client id undefined at path C:\work\dev\vci-dashboard-app\dashboard-app +10s
  cypress:server:project no project id +1ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.19648896887533596, data: { id: undefined, path: 'C:\
\work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } }, originalData: { id: 0.19648896887533596, data: { id: undefined, path:
'C:\\work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } } } +1ms
  cypress:server:events got request for event: ping:api:server, undefined +5s
  cypress:network:connect beginning getAddress { hostname: 'api.cypress.io', port: 443 } +22s
  cypress:network:connect got addresses { hostname: 'api.cypress.io', port: 443, addresses: [ { address: '172.67.69.12', family: 4 }, { a
ddress: '104.26.6.176', family: 4 }, { address: '104.26.7.176', family: 4 } ] } +34ms
  cypress:server:events sending ipc data { type: 'ping:api:server', data: { id: 0.4604542597099468, data: { address: '172.67.69.12', fami
ly: 4 } }, originalData: { id: 0.4604542597099468, data: { address: '172.67.69.12', family: 4 } } } +60ms
  cypress:server:events got request for event: get:project:status, { id: undefined, path: 'C:\\work\\dev\\vci-dashboard-app\\dashboard-ap
p' } +5s
  cypress:server:project get project status for client id undefined at path C:\work\dev\vci-dashboard-app\dashboard-app +10s
  cypress:server:project no project id +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.9349231314744331, data: { id: undefined, path: 'C:\\
work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } }, originalData: { id: 0.9349231314744331, data: { id: undefined, path: 'C
:\\work\\dev\\vci-dashboard-app\\dashboard-app', state: 'VALID' } } } +2ms
  cyp

OS: Windows 10 Enterprise
Cypress.io: 5.2.0
Version 85.0.4183.102 (Official Build) (32-bit)
KuroiRaven commented 3 years ago

Hey, @kevin-clark2, I found a solution. There is a chrome parameter that is managed by the active-directory (Registry-key : ProxyMode) that does interfer with Cypress settings or something. #1253

When I remove it from the register, cypress launch without a problem, you might want to try this out ?

joshuakeel commented 3 years ago

Thanks a bunch, @KuroiRaven and @jennifer-shehane. I encountered this issue for the first time today, and it turns out that the ProxyMode registry setting was causing my issue as well. Chrome is managed by my organization through Group Policy, and I assume this ProxyMode setting is being set as part of the managed settings.

Handy docs link for more details: https://docs.cypress.io/guides/references/error-messages.html#Cypress-detected-policy-settings-on-your-computer-that-may-cause-issues

jennifer-shehane commented 3 years ago

Certain group policies (GPOs) on Windows may prevent Cypress from working as intended, which can cause tests to break. We do try to detect this and should warn when it is detected.

Can everyone read here for more info and workarounds: https://on.cypress.io/error-messages#Cypress-detected-policy-settings-on-your-computer-that-may-cause-issues and see if any of those resolve your issues?

KuroiRaven commented 3 years ago

Thanks for the reply, I will check it and tell you if it does help ! :)

cypress-app-bot commented 1 year ago

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

cypress-app-bot commented 1 year ago

This issue has been closed due to inactivity.