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

Chrome cy.visit breaks testpage, but works in Electron #4263

Closed
MrMinimal opened this issue May 21, 2019 · 37 comments
Closed

Chrome cy.visit breaks testpage, but works in Electron #4263

MrMinimal opened this issue May 21, 2019 · 37 comments
Assignees
Labels
browser: chrome type: duplicate This issue or pull request already exists type: unexpected behavior User expected result, but got another

Comments

@MrMinimal
Copy link

MrMinimal commented May 21, 2019

Current behavior:

When running a cy.visit in Chrome 74 the testpages turns nearly blank and displays Cannot GET /__/.
However it does visit the page when Electron is used.

1. Running test
image

2. Redirect?
image

Config
image

Desired behavior:

The cy.visit() call should show the served page at localhost:8080 in an iframe.
The testpage should stay visible (as seen in screenshot 1).

Steps to reproduce:

The following test redirects to the page shown in the screenshot:

cy.visit('http://localhost:8080/index-mocks.html');

Versions:

Windows 10

$ ./cypress --version
Cypress package version: 3.3.0
Cypress binary version: 3.3.0
@MrMinimal
Copy link
Author

MrMinimal commented May 21, 2019

For investigation:
cy.visit('https://google.com') redirects the testpage to the following:

image

Same thing works in Electron:

image

@MrMinimal MrMinimal changed the title Chrome cy.visit localhost page breaks testpage Chrome cy.visit breaks testpage May 21, 2019
@jevors
Copy link

jevors commented May 21, 2019

There is a closed issue with the same problems: #1497

It seems that a browser plugin might be the problem.

@MrMinimal
Copy link
Author

@jevors Thanks for the fast reply but as stated in that issue they also reproduced the issue without any plugins. I don't have any Chrome extensions installed.

@RicardoVaranda
Copy link

We have also been facing this issue for quite some time now and had to use electron to bypass it. It would be great to get a fix.

@jennifer-shehane
Copy link
Member

jennifer-shehane commented May 22, 2019

@MrMinimal The localhost issue will be much harder to reproduce, since we are not running your same application

I am not experiencing the 404 on visiting google.com in Chrome Version 74.0.3729.157 or 74.0.3729.169 on a Mac.

Screen Shot 2019-05-22 at 7 43 52 PM

  • Could you go to the Chrome menu and choose About Google Chrome and list the exact version you are using?
  • Could you also paste your DEBUG logs from when this behavior happens?
  • Can you make sure to remove and/or provide any code you have in your plugins file.

@RicardoVaranda What OS are you using? What Chrome version? Did it start happening at a specific Cypress version?

@lucasmreis
Copy link

I was experiencing the same issue, and upgrading from 3.1.0 to 3.3.0 solved it.

@RicardoVaranda
Copy link

@RicardoVaranda What OS are you using? What Chrome version? Did it start happening at a specific Cypress version?

Hi @jennifer-shehane

I'm running Windows 10 and tried on both :

  • Chrome Version 73.0.3683.75
  • Canary/Chromium Version 69.0.3452.0
    I've tried it on 3.1.0, 3.2.0 and 3.3.0 all resulting in the same problem.

Similar to @MrMinimal the same tests run just fine if I choose to run in Electron 61 without redirecting to a 404 page.

@wojciechsabaj
Copy link

wojciechsabaj commented May 28, 2019

Hi @jennifer-shehane, I also experienced the same behaviour as other people commenting here (@RicardoVaranda, @MrMinimal).

If I am correct, the problem is with setting "top" window.

Here is the test (no rocket science in here):

describe("example", function() {

    it("of test", function() {
        cy.visit("https://www.google.pl/");

    });
});

I would really like to post the screenshots but the corpo firewall is blocking my connection, so I will describe the situation:

In Electron => Dev Tools => Sources I see the following:

top
=> www.google.pl
=> => __
=> => => (index)
=> => __cypress/runner
=> (no domain)
=> Your App: blahblahblah
=> Your Spec: blahblahblah

When I open (index), I see the following info inside:

// set a global so we know the 'top'window
window.__Cypress__ = true

This is probably the part that is failing in Chrome and working in Electron.

When I start test in Electron, I see that the test is running and request to "https://www.google.pl/__" is performed but then the whole Cypress environment inside browser is reloaded and then the test is being run again, that time (I suppose) the 'top' is set correctly and request to "https://www.google.pl" is sent correctly and page is displayed correctly.

When the test is started in Chrome, all I see is the request sent to "https://www.google.pl/__" and the famous 404 error:

"The requested URL /__/ was not found on this server. That’s all we know."

I hope that my description will help you guys with fixing the problem. Cypress is a great framework, although it has some limits imposed by its creators. I was thinking that such requests to Google are outright blocked but it seems to be a problem with Chrome, not with Cypress.

Keeping my fingers crossed for fixing this problem.

Wojtek

@wojciechsabaj
Copy link

OK, I verified the reload when running test in Electron.

At the beginning, Dev Tools => Sources shows this:

top
=> localhost:58230
=> => __
=> => => (index)
=> => __cypress/runner
=> (no domain)
=> Your App: blahblahblah
=> Your Spec: blahblahblah

After a reload, there is a significant change:

top
=> www.google.pl
=> => __
=> => => (index)
=> => __cypress/runner
=> (no domain)
=> Your App: blahblahblah
=> Your Spec: blahblahblah

Chrome also replaces "localhost:xxxxx" with "www.google.pl" but the request fails with 404 error, so it is clear for me that setting the "top" fails in Chrome.

@RicardoVaranda
Copy link

We also seem to be facing this issue if we try to point to an application locally, if we try with electron it works correctly, once we switch to canary / chrome. The tests seem to break out of frame and it redirects within the angular app:

Route not found : /__#/tests/integration%5Cregression%5Cuser.js

@wojciechsabaj
Copy link

wojciechsabaj commented May 28, 2019

Interesting observation:

I set the DEBUG mode on my Windows computer:

https://docs.cypress.io/guides/guides/debugging.html#Print-DEBUG-logs

Then tried to run the test with Electron (output below is visible after the reload, when "localhost" is being replaced with "www.google.pl" in Dev Tools => Sources tree on the left):

cypress:driver emitted: 'config' - with args: Object +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "message" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "backend:request" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "automation:request" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "mocha" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "collect:run:state" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "log:added" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "log:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "before:screenshot" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "after:screenshot" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "paused" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run:async" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:after:run" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "run:start" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "run:end" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "viewport:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "config" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "stop" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "url:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "page:loading" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "visit:failed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "script:error" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +133ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:before:load" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run:async" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "resume:next" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "resume:all" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "clear:fixtures:cache" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:alert" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:confirmed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "stability:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "navigation:changed" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "form:submitted" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:before:load" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "stop" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "runnable:after:run:async" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run:async" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:unload" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:before:load" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'run:start' +40ms
cypress_runner.js:13588 cypress:driver emitted: 'test:before:run' - with args: Object +14ms Test {title: "of test", body: "function () {↵    cy.wait(30000);↵    cy.visit("https://www.google.pl/?gws_rd=ssl");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'test:before:run:async' to '3' listeners - with args: Object +7ms Test {title: "of test", body: "function () {↵    cy.wait(30000);↵    cy.visit("https://www.google.pl/?gws_rd=ssl");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'automation:request' - with args: "get:cookies" +44ms {domain: "google.pl"}
cypress_runner.js:13588 cypress:driver emitted: 'automation:request' - with args: "clear:cookies" +24ms (4) [{…}, {…}, {…}, {…}]
cypress_runner.js:13588 cypress:driver emitted: 'command:enqueued' - with args: Object +57ms
cypress_runner.js:13588 cypress:driver emitted: 'command:enqueued' - with args: Object +3ms
cypress_runner.js:13588 cypress:driver emitted: 'command:start' - with args: $Command +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "command:enqueued" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'next:subject:prepared' - with args: undefined +1ms (2) [undefined, 30000]
cypress_runner.js:13588 cypress:driver emitted: 'command:log:added' - with args: Object +7ms
cypress_runner.js:13588 cypress:driver emitted: 'log:added' - with args: Object +38ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'removeListener' - with args: "command:enqueued" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'command:end' - with args: $Command +30s
cypress_runner.js:13588 cypress:driver emitted: 'command:start' - with args: $Command +6ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "command:enqueued" +5ms
cypress_runner.js:13588 cypress:driver emitted: 'command:log:added' - with args: Object +11ms
cypress_runner.js:13588 cypress:driver emitted: 'log:added' - with args: Object +25ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:load" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'removeListener' - with args: "command:enqueued" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'page:loading' - with args: true +6ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: false +0ms beforeunload
cypress_runner.js:13588 cypress:driver emitted: 'window:before:unload' - with args: BeforeUnloadEvent +1ms
cypress_runner.js:13588 cypress:driver emitted: 'window:unload' - with args: Event +2ms
cypress_runner.js:13588 cypress:driver emitted: 'navigation:changed' - with args: "page navigation event (load)" +5ms
cypress_runner.js:13588 cypress:driver emitted: 'window:load' - with args: Window +1ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: true +1ms load
cypress_runner.js:13588 cypress:driver emitted: 'backend:request' - with args: "resolve:url" +2ms https://www.google.pl/?gws_rd=ssl {auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: "GET", …}auth: nullbody: nullfailOnStatusCode: trueheaders: __proto__: Objectmethod: "GET"retryOnNetworkFailure: trueretryOnStatusCodeFailure: falsetimeout: 30000__proto__: Object
cypress_runner.js:13588 cypress:driver emitted: 'command:log:changed' - with args: Object +7ms
cypress_runner.js:13588 cypress:driver emitted: 'log:changed' - with args: Object +3ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:load" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: false +3ms beforeunload
cypress_runner.js:13588 cypress:driver emitted: 'window:before:unload' - with args: BeforeUnloadEvent +1ms
cypress_runner.js:13588 cypress:driver emitted: 'command:log:changed' - with args: Object +7ms
cypress_runner.js:13588 cypress:driver emitted: 'log:changed' - with args: Object +1ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'window:unload' - with args: Event +366ms
cypress_runner.js:13588 cypress:driver emitted: 'url:changed' - with args: "https://www.google.pl/?gws_rd=ssl" +19ms
cypress_runner.js:13588 cypress:driver emitted: 'navigation:changed' - with args: "page navigation event (before:load)" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'window:before:load' - with args: Window +2ms
Jq @ ?gws_rd=ssl:260
_.Kq @ ?gws_rd=ssl:258
_.Iq.C @ ?gws_rd=ssl:262
invoke @ cypress_runner.js:76996
timerOverride @ cypress_runner.js:77090
setTimeout (async)
callThrough @ cypress_runner.js:77044
(anonymous) @ cypress_runner.js:77093
_.Iq.C @ ?gws_rd=ssl:262
Kk.w @ ?gws_rd=ssl:215
Mq @ ?gws_rd=ssl:266
(anonymous) @ ?gws_rd=ssl:249
Jq @ ?gws_rd=ssl:260
(anonymous) @ ?gws_rd=ssl:259
cypress_runner.js:13588 cypress:driver emitted: 'navigation:changed' - with args: "page navigation event (load)" +721ms
cypress_runner.js:13588 cypress:driver emitted: 'window:load' - with args: Window +3ms
cypress_runner.js:13588 cypress:driver emitted: 'page:loading' - with args: false +7ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: true +1ms load
cypress_runner.js:13588 cypress:driver emitted: 'command:end' - with args: $Command +26ms
cypress_runner.js:13588 cypress:driver emitted: 'command:queue:before:end' +2ms
cypress_runner.js:13588 cypress:driver emitted: 'command:queue:end' +1ms
cypress_runner.js:13588 cypress:driver emitted: 'runnable:after:run:async' to '1' listeners - with args: Object +1ms Test {title: "of test", body: "function () {↵    cy.wait(30000);↵    cy.visit("https://www.google.pl/?gws_rd=ssl");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'command:log:changed' - with args: Object +19ms
cypress_runner.js:13588 cypress:driver emitted: 'log:changed' - with args: Object +3ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'test:after:run' - with args: Object +8ms Test {title: "of test", body: "function () {↵    cy.wait(30000);↵    cy.visit("https://www.google.pl/?gws_rd=ssl");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'run:end' +10ms

However, when I run the test case with Chrome, reload is performed but no such logs are present in console. This may mean that the browser cannot connect to the Cypress environment, where "top" is set. Correct me if I'm wrong.

@RicardoVaranda
Copy link

@jennifer-shehane @flotwig @brian-mann

Hey guys, is there any further logs we can provide to help resolve this issue? Essentially this is blocking us internally to run any tests other than using the built in "Electron".

I'll be happy to supply any logs / details required to try and get to the bottom of this issue.

Thanks

@jennifer-shehane
Copy link
Member

The top url reloads when you do not have a baseUrl set, Cypress has no idea what url you are planning to visit before it reaches the cy.visit() command - when it reaches the url there, it reloads the page so that the top domain is the domain you are visiting.

You can read more about this intended behavior here: https://on.cypress.io/best-practices#Setting-a-global-baseUrl

@RicardoVaranda
Copy link

RicardoVaranda commented May 30, 2019

@jennifer-shehane

Thanks for your reply, we have previously tried setting the baseUrl but it comes out to the same result,
if we use the built in Electron it visit the page fine and runs the tests, if we run it within Chromium it breaks out of the test interface, it starts off trying to access:

http://localhost:4201/__/#/tests/integration\regression\user.js

and then gets redirected to:

http://localhost:4201/__#/tests/integration%5Cregression%5Cuser.js

This route obviously doesn't exist within our app and redirects to a 404 page.

@wojciechsabaj
Copy link

I also noticed another format of slashes in console when running tests on Electron vs. Chrome

@flotwig
Copy link
Contributor

flotwig commented May 30, 2019

I can't reproduce this with Chrome 73 and Cypress 3.3.0 on Windows 10 either:
image

@RicardoVaranda Please supply the complete DEBUG logs from your session, it should help to figure out what the issue could be.

@wojciechsabaj
Copy link

@flotwig we probably both experience the same issue (me and @RicardoVaranda).

Here are my logs:

Cypress 3.3.1

Chrome 74:

[ '--test-type',
  '--ignore-certificate-errors',
  '--start-maximized',
  '--silent-debugger-extension-api',
  '--no-default-browser-check',
  '--no-first-run',
  '--noerrdialogs',
  '--enable-fixed-layout',
  '--disable-popup-blocking',
  '--disable-password-generation',
  '--disable-save-password-bubble',
  '--disable-single-click-autofill',
  '--disable-prompt-on-repos',
  '--disable-background-timer-throttling',
  '--disable-renderer-backgrounding',
  '--disable-renderer-throttling',
  '--disable-restore-session-state',
  '--disable-translate',
  '--disable-new-profile-management',
  '--disable-new-avatar-menu',
  '--allow-insecure-localhost',
  '--reduce-security-for-testing',
  '--enable-automation',
  '--disable-infobars',
  '--disable-device-discovery-notifications',
  '--autoplay-policy=no-user-gesture-required',
  '--disable-site-isolation-trials',
  '--metrics-recording-only',
  '--disable-prompt-on-repost',
  '--disable-hang-monitor',
  '--disable-sync',
  '--disable-web-resources',
  '--safebrowsing-disable-auto-update',
  '--safebrowsing-disable-download-protection',
  '--disable-client-side-phishing-detection',
  '--disable-component-update',
  '--disable-default-apps',
  '--use-fake-ui-for-media-stream',
  '--use-fake-device-for-media-stream',
  '--proxy-server=http://localhost:59356',
  '--disable-web-security',
  '--allow-running-insecure-content',
  '--proxy-bypass-list=<-loopback>' ]
GET /__/ 200 12.629 ms - -
GET /__cypress/runner/cypress_runner.css 200 8.201 ms - -
GET /__cypress/runner/cypress_runner.js 200 6.409 ms - -
GET /__cypress/runner/cypress_runner.css 304 45.755 ms - -
GET /__cypress/iframes/integration/test2.js 200 15.630 ms - 698
GET /__cypress/runner/fonts/fontawesome-webfont.woff2?v=4.7.0 200 18.792 ms - 77160
GET /__cypress/tests?p=cypress\support\index.js-148 200 28.686 ms - -
GET /__cypress/tests?p=tests\test2.js-462 200 60.841 ms - 663

Console log:

Download the React DevTools for a better development experience: https://fb.me/react-devtools
VM11 cypress_runner.js:118992 Download the React DevTools for a better development experience: https://fb.me/react-devtools
VM11 cypress_runner.js:172393 console.clear() was prevented due to 'Preserve log'
VM11 cypress_runner.js:83394 GET https://www.google.pl/__/ 404 (Not Found)
locHref @ VM11 cypress_runner.js:83394
(anonymous) @ VM11 cypress_runner.js:73578
tryCatcher @ VM11 cypress_runner.js:132142
Promise._settlePromiseFromHandler @ VM11 cypress_runner.js:130160
Promise._settlePromise @ VM11 cypress_runner.js:130217
Promise._settlePromise0 @ VM11 cypress_runner.js:130262
Promise._settlePromises @ VM11 cypress_runner.js:130341
(anonymous) @ VM11 cypress_runner.js:127056
Promise.then (async)
schedule @ VM11 cypress_runner.js:131368
Async.settlePromises @ VM11 cypress_runner.js:127055
Promise._fulfill @ VM11 cypress_runner.js:130288
Promise._resolveCallback @ VM11 cypress_runner.js:130080
(anonymous) @ VM11 cypress_runner.js:130132
fn @ VM11 cypress_runner.js:77559
Socket.onack @ VM11 cypress_runner.js:179617
Socket.onpacket @ VM11 cypress_runner.js:179541
(anonymous) @ VM11 cypress_runner.js:173765
Emitter.emit @ VM11 cypress_runner.js:176673
Manager.ondecoded @ VM11 cypress_runner.js:179049
(anonymous) @ VM11 cypress_runner.js:173765
Emitter.emit @ VM11 cypress_runner.js:173903
Decoder.add @ VM11 cypress_runner.js:180198
Manager.ondata @ VM11 cypress_runner.js:179039
(anonymous) @ VM11 cypress_runner.js:173765
Emitter.emit @ VM11 cypress_runner.js:176673
Socket.onPacket @ VM11 cypress_runner.js:174794
(anonymous) @ VM11 cypress_runner.js:174611
Emitter.emit @ VM11 cypress_runner.js:176673
Transport.onPacket @ VM11 cypress_runner.js:175229
Transport.onData @ VM11 cypress_runner.js:175221
ws.onmessage @ VM11 cypress_runner.js:176357
Navigated to https://www.google.pl/__/

Electron 61:

{ projectRoot: 'XXXXXXXXXXXXXXXXXX',
  browsers:
   [ { name: 'chrome',
       family: 'chrome',
       displayName: 'Chrome',
       version: '74.0.3729.131',
       path: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
       majorVersion: '74' },
     { name: 'electron',
       family: 'electron',
       displayName: 'Electron',
       version: '61.0.3163.100',
       path: '',
       majorVersion: '61',
       info: 'Electron is the default browser that comes with Cypress. This is the browser that runs in headless mode. Selecting this browser is useful when debugging. The version number indicates the underlying Chromium version that Electron uses.' } ],
  proxyUrl: 'http://localhost:59356',
  userAgent: null,
  proxyServer: 'http://localhost:59356',
  socketIoRoute: '/__socket.io',
  chromeWebSecurity: false,
  url: 'http://localhost:59356/__/#/tests/integration\\test2.js',
  isTextTerminal: false,
  browser:
   { displayName: 'Electron',
     family: 'electron',
     info: 'Electron is the default browser that comes with Cypress. This is the browser that runs in headless mode. Selecting this browser is useful when debugging. The version number indicates the underlying Chromium version that Electron uses.',
     isChosen: true,
     majorVersion: '61',
     name: 'electron',
     path: '',
     version: '61.0.3163.100',
     isHeaded: true,
     isHeadless: false},
  x: 1432,
  y: -8,
  width: 1936,
  height: 1216,
  devTools: true,
  minWidth: 100,
  minHeight: 100,
  contextMenu: true,
  partition: 'persist:interactive',
  trackState:
   { width: 'browserWidth',
     height: 'browserHeight',
     x: 'browserX',
     y: 'browserY',
     devTools: 'isBrowserDevToolsOpen' },
  show: true,
  frame: true,
  recordFrameRate: null,
  onPaint: null,
  webPreferences:
   { partition: null,
     chromeWebSecurity: true,
     nodeIntegration: false,
     backgroundThrottling: false } }
GET /__/ 200 96.891 ms - -
GET /__cypress/runner/cypress_runner.css 200 50.862 ms - -
GET /__cypress/runner/cypress_runner.js 200 21.637 ms - -
GET /__cypress/runner/fonts/fontawesome-webfont.woff2?v=4.7.0 200 23.070 ms - 77160
GET /__cypress/iframes/integration/test2.js 200 13.152 ms - 698
GET /__cypress/tests?p=tests%5Ctest2.js-519 200 28.712 ms - 663
GET /__cypress/tests?p=cypress%5Csupport%5Cindex.js-012 200 31.825 ms - -
GET /__/ 200 3.097 ms - -
GET /__cypress/runner/cypress_runner.css 200 4.658 ms - -
GET /__cypress/runner/cypress_runner.js 200 6.136 ms - -
GET /__cypress/runner/fonts/fontawesome-webfont.woff2?v=4.7.0 200 1.205 ms - 77160
GET /__cypress/iframes/integration/test2.js 200 5.290 ms - 698
GET /__cypress/tests?p=tests%5Ctest2.js-834 200 2.958 ms - 663
GET /__cypress/tests?p=cypress%5Csupport%5Cindex.js-000 200 3.340 ms - -
GET / 200 18.172 ms - -
GET /tia/tia.png 200 11.651 ms - -
GET /images/branding/googlelogo/1x/googlelogo_color_272x92dp.png 200 30.990 ms - -
GET /gen_204?atyp=i&ct=rfl&cad=&ei=_NXwXO7YBqb3qwGd9JPYAg&zx=1559287301539 204 32.914 ms - -
GET /gen_204?atyp=i&ct=rfl&cad=&ei=_NXwXO7YBqb3qwGd9JPYAg&zx=1559287301579 204 33.943 ms - -
POST /gen_204?s=webhp&t=aft&atyp=csi&ei=_NXwXO7YBqb3qwGd9JPYAg&rt=wsrt.362,aft.318,prt.318&ima=0&imn=3 204 37.856 ms - -
GET /images/nav_logo299.png 200 36.605 ms - -
GET /xjs/_/js/k=xjs.s.pl.6H9Ih1cA2xA.O/m=Fkg7bd,HcFEGb,IvlUe,MC8mtf,OF7gzc,RMhBfe,T4BAC,TJw5qb,TbaHGc,Y33vzc,cdos,hsm,iDPoPb,jsa,mvYTse,tg8oTe,uz938c,vWNDde,ws9Tlc,xpltpb,yQ43ff,d,csi/am=AABgEdi7AyD_XwEAdgEABO4CG1kgQWhYNUA/d=1/dg=2/rs=ACT90oHctQFUXS3zwxKV_QJwyZcDoHlE-A 200 15.862 ms - -
GET /xjs/_/js/k=xjs.s.pl.6H9Ih1cA2xA.O/am=AABgEdi7AyD_XwEAdgEABO4CG1kgQWhYNUA/d=1/exm=Fkg7bd,HcFEGb,IvlUe,MC8mtf,OF7gzc,RMhBfe,T4BAC,TJw5qb,TbaHGc,Y33vzc,cdos,csi,d,hsm,iDPoPb,jsa,mvYTse,tg8oTe,uz938c,vWNDde,ws9Tlc,xpltpb,yQ43ff/ed=1/dg=2/rs=ACT90oHctQFUXS3zwxKV_QJwyZcDoHlE-A/m=aa,abd,async,dv7Bfe,dvl,fEVMic,foot,k27Oqb,lu,m,mUpTid,mu,sb_wiz,sf,sonic,spch,tnqaT,xz7cCd?xjs=s1 200 61.742 ms - -
GET /compressiontest/gzip.html 200 362.890 ms - -
POST /gen_204?atyp=i&ei=_NXwXO7YBqb3qwGd9JPYAg&vet=10ahUKEwjuxpjpncXiAhWm-yoKHR36BCsQsmQIDA..s&zx=1559287302241 204 374.257 ms - -
POST /gen_204?atyp=csi&ei=_NXwXO7YBqb3qwGd9JPYAg&s=webhp&t=all&imn=3&adh=&wif=1&conn=onchange&ima=1&ime=1&imeb=0&imeo=0&wh=1111&scp=0&mem=ujhs.35,tjhs.54,jhsl.2190&sto=&sys=hc.4&rt=iml.849,prt.318,aft.318,dcl.356,xjsls.393,xjses.673,xjsee.723,xjs.724,ol.1862,wsrt.362,cst.327,dnst.0,rqst.49,rspt.17,sslt.17,rqstt.330,unt.1,cstt.3,dit.718&zx=1559287303133 204 34.138 ms - -
GET /adsid/google/ui 204 141.556 ms - -

Console log:

Download the React DevTools for a better development experience: https://fb.me/react-devtools
cypress_runner.js:118992 Download the React DevTools for a better development experience: https://fb.me/react-devtools
cypress_runner.js:172393 console.clear() was prevented due to 'Preserve log'
Navigated to https://www.google.pl/__/
cypress_runner.js:162528 Download the React DevTools for a better development experience: https://fb.me/react-devtools
cypress_runner.js:118992 Download the React DevTools for a better development experience: https://fb.me/react-devtools
cypress_runner.js:172393 console.clear() was prevented due to 'Preserve log'
cypress_runner.js:13588 cypress:driver emitted: 'config' - with args: Object +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "message" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "backend:request" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "automation:request" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "mocha" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "collect:run:state" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "log:added" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "log:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "before:screenshot" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "after:screenshot" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "paused" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run:async" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:after:run" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "run:start" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "run:end" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "viewport:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "config" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "stop" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "url:changed" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "page:loading" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "visit:failed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "script:error" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +143ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:before:load" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run:async" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "resume:next" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "resume:all" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "clear:fixtures:cache" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:alert" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:confirmed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "stability:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "navigation:changed" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "form:submitted" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:before:load" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "stop" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "runnable:after:run:async" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run:async" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:unload" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "test:before:run" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:before:load" +0ms
cypress_runner.js:13588 cypress:driver emitted: 'run:start' +44ms
cypress_runner.js:13588 cypress:driver emitted: 'test:before:run' - with args: Object +16ms Test {title: "of test", body: "function () {↵    cy.wait(5000);↵    cy.visit("https://www.google.pl/");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'test:before:run:async' to '3' listeners - with args: Object +5ms Test {title: "of test", body: "function () {↵    cy.wait(5000);↵    cy.visit("https://www.google.pl/");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'automation:request' - with args: "get:cookies" +48ms {domain: "google.pl"}
cypress_runner.js:13588 cypress:driver emitted: 'automation:request' - with args: "clear:cookies" +18ms (3) [{…}, {…}, {…}]
cypress_runner.js:13588 cypress:driver emitted: 'command:enqueued' - with args: Object +83ms
cypress_runner.js:13588 cypress:driver emitted: 'command:enqueued' - with args: Object +3ms
cypress_runner.js:13588 cypress:driver emitted: 'command:start' - with args: $Command +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "command:enqueued" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'next:subject:prepared' - with args: undefined +1ms (2) [undefined, 5000]
cypress_runner.js:13588 cypress:driver emitted: 'command:log:added' - with args: Object +7ms
cypress_runner.js:13588 cypress:driver emitted: 'log:added' - with args: Object +27ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'removeListener' - with args: "command:enqueued" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'command:end' - with args: $Command +5s
cypress_runner.js:13588 cypress:driver emitted: 'command:start' - with args: $Command +3ms
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "command:enqueued" +3ms
cypress_runner.js:13588 cypress:driver emitted: 'command:log:added' - with args: Object +3ms
cypress_runner.js:13588 cypress:driver emitted: 'log:added' - with args: Object +18ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:load" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'removeListener' - with args: "command:enqueued" +2ms
cypress_runner.js:13588 cypress:driver emitted: 'page:loading' - with args: true +6ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: false +1ms beforeunload
cypress_runner.js:13588 cypress:driver emitted: 'window:before:unload' - with args: BeforeUnloadEvent +8ms
cypress_runner.js:13588 cypress:driver emitted: 'window:unload' - with args: Event +4ms
cypress_runner.js:13588 cypress:driver emitted: 'navigation:changed' - with args: "page navigation event (load)" +10ms
cypress_runner.js:13588 cypress:driver emitted: 'window:load' - with args: Window +1ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: true +1ms load
cypress_runner.js:13588 cypress:driver emitted: 'backend:request' - with args: "resolve:url" +2ms https://www.google.pl/ {auth: null, failOnStatusCode: true, retryOnNetworkFailure: true, retryOnStatusCodeFailure: false, method: "GET", …}
cypress_runner.js:13588 cypress:driver emitted: 'command:log:changed' - with args: Object +5ms
cypress_runner.js:13588 cypress:driver emitted: 'log:changed' - with args: Object +6ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'newListener' - with args: "window:load" +85ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: false +3ms beforeunload
cypress_runner.js:13588 cypress:driver emitted: 'window:before:unload' - with args: BeforeUnloadEvent +1ms
cypress_runner.js:13588 cypress:driver emitted: 'command:log:changed' - with args: Object +5ms
cypress_runner.js:13588 cypress:driver emitted: 'log:changed' - with args: Object +2ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'window:unload' - with args: Event +358ms
cypress_runner.js:13588 cypress:driver emitted: 'url:changed' - with args: "https://www.google.pl/" +16ms
cypress_runner.js:13588 cypress:driver emitted: 'navigation:changed' - with args: "page navigation event (before:load)" +1ms
cypress_runner.js:13588 cypress:driver emitted: 'window:before:load' - with args: Window +2ms
cypress_runner.js:13588 cypress:driver emitted: 'navigation:changed' - with args: "page navigation event (load)" +2s
cypress_runner.js:13588 cypress:driver emitted: 'window:load' - with args: Window +1ms
cypress_runner.js:13588 cypress:driver emitted: 'page:loading' - with args: false +4ms
cypress_runner.js:13588 cypress:driver emitted: 'stability:changed' - with args: true +0ms load
cypress_runner.js:13588 cypress:driver emitted: 'command:end' - with args: $Command +16ms
cypress_runner.js:13588 cypress:driver emitted: 'command:queue:before:end' +1ms
cypress_runner.js:13588 cypress:driver emitted: 'command:queue:end' +1ms
cypress_runner.js:13588 cypress:driver emitted: 'runnable:after:run:async' to '1' listeners - with args: Object +1ms Test {title: "of test", body: "function () {↵    cy.wait(5000);↵    cy.visit("https://www.google.pl/");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'command:log:changed' - with args: Object +10ms
cypress_runner.js:13588 cypress:driver emitted: 'log:changed' - with args: Object +3ms {get: ƒ, unset: ƒ, invoke: ƒ, serializeError: ƒ, toJSON: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'test:after:run' - with args: Object +13ms Test {title: "of test", body: "function () {↵    cy.wait(5000);↵    cy.visit("https://www.google.pl/");↵  }", async: 0, sync: true, fn: ƒ, …}
cypress_runner.js:13588 cypress:driver emitted: 'run:end' +7ms

It seems that something fails with Chrome after switching the page URL:

Electron:
GET /__cypress/tests?p=tests%5Ctest2.js-834 200 2.958 ms - 663
GET /__cypress/tests?p=cypress%5Csupport%5Cindex.js-000 200 3.340 ms - -

Chrome:
GET /__cypress/tests?p=tests\test2.js-462 200 60.841 ms - 663

@wojciechsabaj
Copy link

This may be an interesting point - however, I am not sure if this can be related to Chrome and not Electron, as both are based on Chrome/Chromium...

https://stackoverflow.com/a/35921090

List of unwise characters are allowed but may cause problems:

   unwise      = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"

I think Chrome is trying to fix your URL "mistake" for you. Does the API have a method that would accept the account name in a POST body?

The API should provide some sort of documentation on how it's expecting to receive the account name. I don't think you are ever going to be able to reliably send the backslash character.

Maybe the difference is just between Chrome and Chromium (Electron)? Electron is a built-in browser from atom.io and it is based on Chromium.

@wojciechsabaj
Copy link

wojciechsabaj commented May 31, 2019

Aaaaaaaand I think we got it @RicardoVaranda @flotwig :)

Electron:

Request URL:https://www.google.pl/__/
Request Method:GET
Status Code:200 OK
Remote Address:127.0.0.1:51865
Referrer Policy:no-referrer-when-downgrade
Response Headers
view source
Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/html; charset=utf-8
Date:Fri, 31 May 2019 07:50:17 GMT
ETag:W/"5314-5I3V7qTU4c0JQhf2S9ZONMLBBOg"
Transfer-Encoding:chunked
Vary:Accept-Encoding
Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:pl
Connection:keep-alive
Cookie:CONSENT=WP.27a79c; GZ=Z=0; NID=184=JxWLi6xwUHa98xajcHfcMdNyu9TbcnfddB2zaNxeTnZnlKnkYawLNQNurHZwfEbKyYikhyPyjC7-XERvIAUoVIYZPEPzt2dEqhUg5TU3ri9Ng9TyeMO4Q7P6g548IUV3_Mp6HUcGuzb2G9piLJBLJnqp8kpwfl0XsA5kE5lzaK0; 1P_JAR=2019-05-31-07; ANID=AHWqTUlKfvSrkNlB9_nLQRPuhpLw8cQ-_qvcwcP7NmwHi8_gUv4O6h5edj-R6JSa
Host:www.google.pl
Referer:http://localhost:51865/__/
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.3.1 Chrome/61.0.3163.100 Electron/2.0.18 Safari/537.36

Chrome:

Request URL: https://www.google.pl/__/
Request Method: GET
Status Code: 404 Not Found
Remote Address: 172.217.16.35:443
Referrer Policy: no-referrer-when-downgrade
Alt-Svc: quic=":443"; ma=2592000; v="46,44,43,39"
Content-Length: 1564
Content-Type: text/html; charset=UTF-8
Date: Fri, 31 May 2019 07:51:33 GMT
Referrer-Policy: no-referrer
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Accept-Encoding: gzip, deflate, br
Accept-Language: pl-PL,pl;q=0.9,en-US;q=0.8,en;q=0.7
Connection: keep-alive
Cookie: ANID=OPT_OUT; CONSENT=YES+PL.pl+V12; NID=184=BVrRq_smER_BlLairRrscR-eaqLhaU3wV4IiWAJNj_3-_HhpjMY1nsMZkQ9KJwlqGukcme-tIY2MGwSg9oGK7OcJ_ngPjQlMgMuxZXAEZODTwtxrxSd-WW_xiRC-EgMDnnCC7gSmVWmJfUiZGCL9ON7p6S8rBozfZw_qNXtSFZI; 1P_JAR=2019-05-31-07
Host: www.google.pl
Referer: http://localhost:51865/__/
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
X-Client-Data: CI62yQEIpLbJAQjBtskBCKmdygEIs5/KAQioo8oBCLGnygEI4qjKAQjxqcoB

Take a look at remote address of a successful and failed request for https://www.google.pl/__/:

Electron (successful):
Remote Address:127.0.0.1:51865

Chrome (failed):
Remote Address: 172.217.16.35:443

@RicardoVaranda
Copy link

RicardoVaranda commented Jun 3, 2019

I've freshly installed cypress and set up a simple test like so:

    it('should load page', () => {
        cy.visit({
            url: 'http://localhost:4200/group/test',
            failOnStatusCode: false,
        });
    });

Prior to cypress open I ran:

set CYPRESS_PORT=2222

I also have no proxy configuration set and I'm pointing to a local environment as can be seen above.

These are the initial request headers we have on Electron:

Request URL:http://localhost:4200/__/
Request Method:GET
Status Code:200 OK
Remote Address:127.0.0.1:2222
Referrer Policy:no-referrer-when-downgrade
Response Headers
view source
Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/html; charset=utf-8
Date:Mon, 03 Jun 2019 14:56:46 GMT
ETag:W/"255e-m8PRwp8wj7Uy/SnGzWoDWOV+3Xs"
Transfer-Encoding:chunked
Vary:Accept-Encoding
Request Headers
view source
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:en-US
Cookie:__cypress.unload=true
Host:localhost:4200
Proxy-Connection:keep-alive
Referer:http://localhost:2222/__/
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/3.3.0 Chrome/61.0.3163.100 Electron/2.0.18 Safari/537.36

Compared to the same request on Canary / Chromium:

Request URL: http://localhost:4200/__/
Request Method: GET
Status Code: 200 OK
Remote Address: 127.0.0.1:4200
Referrer Policy: no-referrer-when-downgrade
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Connection: keep-alive
Content-Length: 1301
Content-Type: text/html; charset=UTF-8
Date: Mon, 03 Jun 2019 15:00:21 GMT
ETag: W/"515-i2agwmiy+iPeGS3mlsQQLLAP8v0"
X-Powered-By: Express
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: keep-alive
Cookie: __cypress.unload=true
Host: localhost:4200
Referer: http://localhost:2222/__/
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-site
Sec-Fetch-User: ?1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3804.0 Safari/537.36

While most of the requests are equal on Canary / Chromium it seems the remote address are different.

@wojciechsabaj
Copy link

@flotwig any updates on this? We already provided the potential problem description, could you check this?

TL;DR: Remote address (host and port) in request headers is not set to Localhost when using Chrome. Everything is working on Electron.

@flotwig flotwig self-assigned this Jun 5, 2019
@flotwig
Copy link
Contributor

flotwig commented Jun 5, 2019

This is interesting, thank you for discovering this discrepancy. Remote Address should be the host:port of Cypress's proxy server, not the host:port of the AUT; that makes me think that somehow we're not passing the correct proxy server to Chrome in certain situations.

@wojciechsabaj Can you could supply the DEBUG logs for when you use Electron vs when you use Chrome? That should narrow it down and allow me to find the source of the bug. Note, these are not the debug logs from the browser console, but the debug logs that you get in the command line. Something like this should work:

set DEBUG=cypress:*
cypress open
# a bunch of logs should appear, open Electron and then open Chrome and share

I'm also wondering if this could be #1253 in action - corporate policy preventing us from setting the proxy Cypress needs. Could you share screenshots of chrome://policy/ (after clicking image) and of chrome://net-internals/#proxy from the browser launched by Cypress?

@flotwig flotwig changed the title Chrome cy.visit breaks testpage Chrome cy.visit breaks testpage, but works in Electron Jun 5, 2019
@wojciechsabaj
Copy link

@flotwig I also previously attached my command prompt debug logs, check them out here:

#4263 (comment)

The first section under Chrome and Electron browser names.

After setting "DEBUG", I get the following results:

START:

> XXXXXXXXXXXXXX@1.0.0 cypress-gui D:\XXXXXXXXXXXXXX
> cypress open

  cypress:cli cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","D:\\XXXXXXXXXXXXXX\\node_modules\\cypress\\bin\\cypress","open"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli program parsing arguments +5ms
  cypress:cli opening Cypress +1ms
  cypress:cli parsed cli options {} +1s
  cypress:cli opening from options {"project":"D:\\XXXXXXXXXXXXXX"} +0ms
  cypress:cli command line arguments ["--project","D:\\XXXXXXXXXXXXXX"] +1ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +1ms
  cypress:cli checking if executable exists C:\Users\XXXXXX\AppData\Local\Cypress\Cache\3.3.1\Cypress\Cypress.exe +3ms
  cypress:cli Binary is executable? : true +3ms
  cypress:cli binaryDir is  C:\Users\XXXXXX\AppData\Local\Cypress\Cache\3.3.1\Cypress +1ms
  cypress:cli Reading binary package.json from: C:\Users\XXXXXX\AppData\Local\Cypress\Cache\3.3.1\Cypress\resources\app\package.json +0ms
  cypress:cli Found binary version 3.3.1 installed in: C:\Users\XXXXXX\AppData\Local\Cypress\Cache\3.3.1\Cypress +24ms
  cypress:cli { verified: true } +35ms
  cypress:cli is Verified ? true +12ms
  cypress:cli needs to start own Xvfb? false +0ms
  cypress:cli spawning, should retry on display problem? false +0ms
  cypress:cli spawning Cypress with executable: C:\Users\XXXXXX\AppData\Local\Cypress\Cache\3.3.1\Cypress\Cypress.exe +5ms
  cypress:cli spawn args [ '--project', 'D:\\XXXXXXXXXXXXXX', '--cwd', 'D:\\XXXXXXXXXXXXXX' ] { detached: false, stdio: 'inherit', windowsHide: false } +1ms

  cypress:ts Running without ts-node hook in environment "production" +0ms
  cypress:server:cypress starting cypress with argv [ 'C:\\Users\\XXXXXX\\AppData\\Local\\Cypress\\Cache\\3.3.1\\Cypress\\Cypress.exe', '--project', 'D:\\XXXXXXXXXXXXXX', '--cwd', 'D:\\XXXXXXXXXXXXXX' ] +0ms
  cypress:server:args argv array: [ 'C:\\Users\\XXXXXX\\AppData\\Local\\Cypress\\Cache\\3.3.1\\Cypress\\Cypress.exe', '--project', 'D:\\XXXXXXXXXXXXXX', '--cwd', 'D:\\XXXXXXXXXXXXXX' ] +0ms
  cypress:server:args argv parsed: { _: [ 'C:\\Users\\XXXXXX\\AppData\\Local\\Cypress\\Cache\\3.3.1\\Cypress\\Cypress.exe' ], project: 'D:\\XXXXXXXXXXXXXX', cwd: 'D:\\XXXXXXXXXXXXXX' } +4ms
  cypress:server:args options { _: [ 'C:\\Users\\XXXXXX\\AppData\\Local\\Cypress\\Cache\\3.3.1\\Cypress\\Cypress.exe' ], project: 'D:\\XXXXXXXXXXXXXX', cwd: 'D:\\XXXXXXXXXXXXXX', config: {} } +1ms
  cypress:server:args argv options: { _: [ 'C:\\Users\\XXXXXX\\AppData\\Local\\Cypress\\Cache\\3.3.1\\Cypress\\Cypress.exe' ], project: 'D:\\XXXXXXXXXXXXXX', cwd: 'D:\\XXXXXXXXXXXXXX', config: {}, projectRoot: 'D:\\XXXXXXXXXXXXXX' } +1ms
  cypress:server:appdata path: C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production +0ms
  cypress:server:cypress starting in mode interactive +3s
  cypress:server:appdata path: C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production +8s
  cypress:server:appdata path: C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +9ms
  cypress:server:appdata path: C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\browsers +34s
  cypress:server:timers queuing timer id 1 after 500 ms +0ms
  cypress:server:timers child received timer id 1 +0ms
  cypress:server:timers child sending timer id 1 +505ms
  cypress:server:timers clearing timer id 1 from queue { '1': { args: [], ms: 500, cb: [Function] } } +511ms
  cypress:server:saved_state making saved state from C:\Users\XXXXXX\AppData\Local\Cypress\Cache\3.3.1\Cypress\resources\app\packages\server +0ms
  cypress:server:saved_state for project path D:\XXXXXXXXXXXXXX +1ms
  cypress:server:saved_state state path for project D:\XXXXXXXXXXXXXX +3ms
  cypress:server:appdata path: C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +611ms
  cypress:server:saved_state full state path C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +0ms
  cypress:server:saved_state making new state file around C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +0ms
  cypress:server:file get values from C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +0ms
  cypress:server:file attempt to get lock on C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +1ms
  cypress:server:file gettin lock succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +171ms
  cypress:server:file read C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +20ms
  cypress:server:file read succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +11ms
  cypress:server:file attempt to unlock C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +1ms
  cypress:server:timers queuing timer id 2 after 2000 ms +227ms
  cypress:server:timers child received timer id 2 +232ms
  cypress:server:timers clearing timer id 2 from queue { '2': { args: [], ms: 2000, cb: [Function: timeoutTimeout] } } +2ms
  cypress:server:file unlock succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +4ms
  cypress:server:windows creating electron window with options { backgroundColor: '#dfe2e4', width: 791, height: 541, minWidth: 458, minHeight: 400, x: 557, y: 173, type: 'INDEX', devTools: false, trackState: { width: 'appWidth', height: 'appHeight', x: 'appX', y: 'appY', devTools: 'isAppDevToolsOpen' }, onBlur: [Function: onBlur], onFocus: [Function: onFocus], onClose: [Function: onClose], show: true, url: 'file://C:\\Users\\XXXXXX\\AppData\\Local\\Cypress\\Cache\\3.3.1\\Cypress\\resources\\app\\packages\\desktop-gui\\dist\\index.html', webPreferences: { preload: 'C:\\Users\\XXXXXX\\AppData\\Local\\Cypress\\Cache\\3.3.1\\Cypress\\resources\\app\\packages\\server\\lib\\ipc\\ipc.js', partition: null, chromeWebSecurity: true, nodeIntegration: false, backgroundThrottling: false, backgroundColor: '#dfe2e4' }, frame: true, contextMenu: false, recordFrameRate: null, onPaint: null, onCrashed: [Function: onCrashed], onNewWindow: [Function: onNewWindow] } +0ms
  cypress:server:events got request for event: on:menu:clicked, undefined +0ms
  cypress:server:events got request for event: get:options, undefined +1ms
  cypress:server:events got request for event: get:current:user, undefined +1ms
  cypress:server:file get values from C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +2s
  cypress:server:file attempt to get lock on C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +0ms
  cypress:server:events sending ipc data { type: 'get:options', data: { id: 0.3832462893969264, data: { _: [Array], project: 'D:\\XXXXXXXXXXXXXX', cwd: 'D:\\XXXXXXXXXXXXXX', config: {}, projectRoot: 'D:\\XXXXXXXXXXXXXX', onFocusTests: [Function: onFocusTests], os: 'win32', version: '3.3.1' } } } +2ms
  cypress:server:file gettin lock succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +6ms
  cypress:server:file read C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +3ms
  cypress:server:file read succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +139ms
  cypress:server:file attempt to unlock C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +0ms
  cypress:server:timers queuing timer id 3 after 2000 ms +2s
  cypress:server:timers child received timer id 3 +2s
  cypress:server:timers clearing timer id 3 from queue { '3': { args: [], ms: 2000, cb: [Function: timeoutTimeout] } } +3ms
  cypress:server:file unlock succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\cache +6ms
  cypress:server:events sending ipc data { type: 'get:current:user', data: { id: 0.7381415512475384, data: {} } } +154ms
  cypress:server:timers child sending timer id 2 +53ms
  cypress:server:events got request for event: on:focus:tests, undefined +81ms
  cypress:server:events got request for event: on:spec:changed, undefined +1ms
  cypress:server:events got request for event: on:config:changed, undefined +1ms
  cypress:server:events got request for event: on:project:error, undefined +0ms
  cypress:server:events got request for event: on:project:warning, undefined +0ms
  cypress:server:events got request for event: open:project, 'D:\\XXXXXXXXXXXXXX' +1ms
  cypress:server:events got request for event: updater:check, undefined +4ms
  cypress:server:updater checking for new version of Cypress. current version is 3.3.1 +0ms
  cypress:launcher checking one browser chrome +0ms
  cypress:launcher looking up chrome on win32 platform +3ms
  cypress:launcher exe path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe +1ms
  cypress:launcher found C:\Program Files (x86)\Google\Chrome\Application\chrome.exe ? true +2ms
  cypress:network:agent addRequest called for https://download.cypress.io/desktop.json +0ms
  cypress:server:updater latest version of Cypress is: 3.3.1 +1s
  cypress:server:updater new version of Cypress does not exist +0ms
  cypress:server:events sending ipc data { type: 'updater:check', data: { id: 0.2863365080135798, data: false } } +1s
  cypress:launcher Version=74.0.3729.169 +1s
  cypress:launcher browser chrome at 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' version 74.0.3729.169 +1ms
  cypress:launcher setting major version for {"name":"chrome","family":"chrome","displayName":"Chrome","version":"74.0.3729.169","path":"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe"} +1ms
  cypress:launcher browser chrome version 74.0.3729.169 major version 74 +0ms
  cypress:launcher checking one browser chromium +1ms
  cypress:launcher looking up chromium on win32 platform +0ms
  cypress:launcher exe path C:\Program Files (x86)\Google\chrome-win32\chrome.exe +0ms
  cypress:launcher found C:\Program Files (x86)\Google\chrome-win32\chrome.exe ? false +1ms
  cypress:launcher browser chromium not installed +0ms
  cypress:launcher checking one browser canary +0ms
  cypress:launcher looking up canary on win32 platform +0ms
  cypress:launcher exe path C:\Users\XXXXXX\AppData\Local\Google\Chrome SxS\Application\chrome.exe +0ms
  cypress:launcher found C:\Users\XXXXXX\AppData\Local\Google\Chrome SxS\Application\chrome.exe ? false +1ms
  cypress:launcher browser canary not installed +0ms
  cypress:server:project Project created D:\XXXXXXXXXXXXXX +0ms
  cypress:server:openproject opening project D:\XXXXXXXXXXXXXX +0ms
  cypress:server:project opening project instance D:\XXXXXXXXXXXXXX +1ms
  cypress:server:config setting support file D:\XXXXXXXXXXXXXX\cypress\support +0ms
  cypress:server:config for project root D:\XXXXXXXXXXXXXX +1ms
  cypress:server:config set support folder D:\XXXXXXXXXXXXXX\cypress\support +4ms
  cypress:server:config setting plugins file D:\XXXXXXXXXXXXXX\plugins +0ms
  cypress:server:config for project root D:\XXXXXXXXXXXXXX +0ms
  cypress:server:config set pluginsFile to D:\XXXXXXXXXXXXXX\plugins\index.js +3ms
  cypress:server:config set scaffold paths +1ms
  cypress:server:scaffold scaffolded files ["tests\\examples\\actions.spec.js","tests\\examples\\aliasing.spec.js","tests\\examples\\assertions.spec.js","tests\\examples\\connectors.spec.js","tests\\examples\\cookies.spec.js","tests\\examples\\cypress_api.spec.js","tests\\examples\\files.spec.js","tests\\examples\\local_storage.spec.js","tests\\examples\\location.spec.js","tests\\examples\\misc.spec.js","tests\\examples\\navigation.spec.js","tests\\examples\\network_requests.spec.js","tests\\examples\\querying.spec.js","tests\\examples\\spies_stubs_clocks.spec.js","tests\\examples\\traversal.spec.js","tests\\examples\\utilities.spec.js","tests\\examples\\viewport.spec.js","tests\\examples\\waiting.spec.js","tests\\examples\\window.spec.js","cypress\\fixtures\\example.json","cypress\\support\\commands.js","cypress\\support\\index.js","plugins\\index.js"] +0ms
  cypress:server:config got file tree +3ms
  cypress:server:project get saved state +22ms
  cypress:server:saved_state making saved state from C:\Users\XXXXXX\AppData\Local\Cypress\Cache\3.3.1\Cypress\resources\app\packages\server +4s
  cypress:server:saved_state for project path D:\XXXXXXXXXXXXXX +0ms
  cypress:server:saved_state state path for project D:\XXXXXXXXXXXXXX +1ms
  cypress:server:appdata path: C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +4s
  cypress:server:saved_state full state path C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +4s
  cypress:server:file get values from C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +2s
  cypress:server:file attempt to get lock on C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +0ms
  cypress:server:file gettin lock succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +11ms
  cypress:server:file read C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +0ms
  cypress:server:file read succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +1ms
  cypress:server:file attempt to unlock C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +1ms
  cypress:server:timers queuing timer id 4 after 2000 ms +2s
  cypress:server:timers child received timer id 4 +2s
  cypress:server:timers clearing timer id 4 from queue { '4': { args: [], ms: 2000, cb: [Function: timeoutTimeout] } } +1ms
  cypress:server:file unlock succeeded or failed for C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\projects\XXXXXXXXXXXXXX-ecd2590d6bc3bd23192a2e4d19eb49e1\state.json +4ms
  cypress:server:scaffold determine if new project by globbing files in { integrationFolder: 'D:\\XXXXXXXXXXXXXX\\tests' } +23ms
  cypress:server:scaffold found 2 files in folder D:\XXXXXXXXXXXXXX\tests +9ms
  cypress:server:scaffold determine if we should scaffold: +1ms
  cypress:server:scaffold - empty? false +0ms
  cypress:server:scaffold - different number of files? true +1ms
  cypress:server:scaffold - same sizes? false +0ms
  cypress:server:scaffold untouched scaffold false modal closed true +0ms
  cypress:server:scaffold plugins folder D:\XXXXXXXXXXXXXX\plugins +1ms
  cypress:server:plugins plugins.init D:\XXXXXXXXXXXXXX\plugins\index.js +0ms
  cypress:server:timers child sending timer id 3 +345ms
  cypress:server:plugins:child pluginsFile: D:\XXXXXXXXXXXXXX\plugins\index.js +0ms
  cypress:server:plugins:child require pluginsFile +2ms
  cypress:server:plugins:child run plugins function +268ms
  cypress:server:plugins:child register event _get:task:body with id 0 +0ms
  cypress:server:plugins:child register event _get:task:keys with id 1 +1ms
  cypress:server:plugins:child register event before:browser:launch with id 2 +0ms
  cypress:server:plugins register plugins process event _get:task:body with id 0 +1s
  cypress:server:plugins register event '_get:task:body' +0ms
  cypress:server:plugins register plugins process event _get:task:keys with id 1 +0ms
  cypress:server:plugins register event '_get:task:keys' +0ms
  cypress:server:plugins register plugins process event before:browser:launch with id 2 +0ms
  cypress:server:plugins register event 'before:browser:launch' +1ms
  cypress:server:project plugin config yielded: {} +1s
  cypress:server:buffers resetting buffers +0ms
  cypress:server:timers child sending timer id 4 +2s
  cypress:server:server Server listening on  { address: '127.0.0.1', family: 'IPv4', port: 59346 } +0ms
  cypress:server:appdata path: C:\Users\XXXXXX\AppData\Roaming\Cypress\cy\production\proxy +2s
  cypress:https-proxy Created SNI HTTPS Proxy on port 59348 +0ms
  cypress:server:server Setting remoteAuth undefined +101ms
  cypress:server:server Setting remoteOrigin http://localhost:59346 +12ms
  cypress:server:server Setting remoteStrategy file +0ms
  cypress:server:server Setting remoteHostAndPort null +0ms
  cypress:server:server Setting remoteDocDomain localhost +1ms
  cypress:server:server Setting remoteFileServer http://localhost:59347 +0ms
  cypress:server:server Getting remote state: { auth: undefined, props: null, origin: 'http://localhost:59346', strategy: 'file', visiting: undefined, domainName: 'localhost', fileServer: 'http://localhost:59347' } +0ms
  cypress:server:project project config: {} +1s
  cypress:server:project watch settings files +8ms
  cypress:server:project scaffolding project D:\XXXXXXXXXXXXXX +20ms
  cypress:server:scaffold support folder D:\XXXXXXXXXXXXXX\cypress\support, support file D:\XXXXXXXXXXXXXX\cypress\support\index.js +3s
  cypress:server:scaffold verify scaffolding in D:\XXXXXXXXXXXXXX\cypress\support +1ms
  cypress:server:scaffold integration folder D:\XXXXXXXXXXXXXX\tests +1ms
  cypress:server:scaffold fixture folder D:\XXXXXXXXXXXXXX\cypress\fixtures +0ms
  cypress:server:scaffold verify scaffolding in D:\XXXXXXXXXXXXXX\cypress\fixtures +0ms
  cypress:server:timers queuing timer id 5 after 0 ms +3s
  cypress:server:timers child received timer id 5 +571ms
  cypress:server:scaffold folder D:\XXXXXXXXXXXXXX\cypress\support already exists +5ms
  cypress:server:timers child sending timer id 5 +1ms
  cypress:server:scaffold folder D:\XXXXXXXXXXXXXX\cypress\fixtures already exists +0ms
  cypress:server:project attempt watch plugins file: D:\XXXXXXXXXXXXXX\plugins\index.js +8ms
  cypress:server:project plugins file found? true +1ms
  cypress:server:project watch plugins file +2ms
  cypress:server:timers clearing timer id 5 from queue { '5': { args: [], ms: 0, cb: [Function: clear] } } +93ms
  cypress:server:timers clearing timer id 5 from queue {} +1ms
  cypress:server:timers queuing timer id 6 after 0 ms +1ms
  cypress:server:timers child received timer id 6 +94ms
  cypress:server:events sending ipc data { type: 'open:project', data: { id: 0.4543170778361585, data: { env: [Object], chromeWebSecurity: false, integrationFolder: 'D:\\XXXXXXXXXXXXXX\\tests', pluginsFile: 'D:\\XXXXXXXXXXXXXX\\plugins\\index.js', screenshotsFolder: 'D:\\XXXXXXXXXXXXXX', videosFolder: 'D:\\XXXXXXXXXXXXXX', video: false, viewportWidth: 1000, viewportHeight: 1081, projectRoot: 'D:\\XXXXXXXXXXXXXX', projectName: 'XXXXXXXXXXXXXX', report: false, browsers: [Array], port: 59346, hosts: null, morgan: true, baseUrl: null, socketId: null, userAgent: null, isTextTerminal: false, reporter: 'spec', reporterOptions: null, blacklistHosts: null, clientRoute: '/__/', xhrRoute: '/xhrs/', socketIoRoute: '/__socket.io', socketIoCookie: '__socket.io', reporterRoute: '/__cypress/reporter', ignoreTestFiles: '*.hot-update.js', testFiles: '**/*.*', defaultCommandTimeout: 4000, requestTimeout: 5000, responseTimeout: 30000, pageLoadTimeout: 60000, execTimeout: 60000, taskTimeout: 60000, videoCompression: 32, videoUploadOnPasses: true, modifyObstructiveCode: true, waitForAnimations: true, animationDistanceThreshold: 5, numTestsKeptInMemory: 50, watchForFileChanges: true, trashAssetsBeforeRuns: true, autoOpen: false, fileServerFolder: 'D:\\XXXXXXXXXXXXXX', supportFile: 'D:\\XXXXXXXXXXXXXX\\cypress\\support\\index.js', fixturesFolder: 'D:\\XXXXXXXXXXXXXX\\cypress\\fixtures', namespace: '__cypress', javascripts: [], cypressEnv: 'production', resolved: [Object], parentTestsFolder: 'D:\\XXXXXXXXXXXXXX', parentTestsFolderDisplay: 'XXXXXXXXXXXXXX', supportFolder: 'D:\\XXXXXXXXXXXXXX\\cypress\\support', integrationExampleName: 'examples', integrationExamplePath: 'D:\\XXXXXXXXXXXXXX\\tests\\examples', scaffoldedFiles: [Array], state: [Object], isNewProject: false, proxyUrl: 'http://localhost:59346', browserUrl: 'http://localhost:59346/__/', reporterUrl: 'http://localhost:59346/__cypress/reporter', xhrUrl: '__cypress/xhrs/' } } } +3s
  cypress:server:timers child sending timer id 6 +2ms
  cypress:server:timers clearing timer id 6 from queue { '6': { args: [], ms: 0, cb: [Function: clear] } } +4ms
  cypress:server:timers clearing timer id 6 from queue {} +1ms
  cypress:server:events got request for event: get:specs, undefined +22ms
  cypress:server:timers queuing timer id 7 after 250 ms +19ms
  cypress:server:openproject check for spec updates +3s
  cypress:server:timers child received timer id 7 +21ms
  cypress:server:events got request for event: get:project:status, { path: 'D:\\XXXXXXXXXXXXXX' } +2ms
  cypress:server:project get project status for undefined D:\XXXXXXXXXXXXXX +115ms
  cypress:server:project no project id +0ms
  cypress:server:openproject watch test files: **/*.* in D:\XXXXXXXXXXXXXX\tests +2ms
  cypress:server:specs looking for test specs in the folder: D:\XXXXXXXXXXXXXX\tests +0ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.7834304855660976, data: { path: 'D:\\XXXXXXXXXXXXXX', state: 'VALID' } } } +7ms
  cypress:server:specs found spec file D:/XXXXXXXXXXXXXX/tests/test.js +31ms
  cypress:server:specs found spec file D:/XXXXXXXXXXXXXX/tests/test2.js +5ms
  cypress:server:specs found 2 spec files: [ { name: 'test.js', relative: 'tests\\test.js', absolute: 'D:/XXXXXXXXXXXXXX/tests/test.js' }, { name: 'test2.js', relative: 'tests\\test2.js', absolute: 'D:/XXXXXXXXXXXXXX/tests/test2.js' } ] +0ms
  cypress:server:events sending ipc data { type: 'get:specs', data: { id: 0.7318687702176732, data: { integration: [Array] } } } +50ms
  cypress:server:timers child sending timer id 7 +252ms
  cypress:server:timers clearing timer id 7 from queue { '7': { args: [], ms: 250, cb: [Function: timerExpired] } } +253ms
  cypress:server:events got request for event: get:project:status, { path: 'D:\\XXXXXXXXXXXXXX' } +10s
  cypress:server:project get project status for undefined D:\XXXXXXXXXXXXXX +10s
  cypress:server:project no project id +2ms
  cypress:server:events sending ipc data { type: 'get:project:status', data: { id: 0.5316017121949304, data: { path: 'D:\\XXXXXXXXXXXXXX', state: 'VALID' } } } +4ms

Starting Chrome:

  cypress:server:events got request for event: get:project:status, { path: 'D:\\XXXXXXXXXXXXXX' } +10s
cypress:server:plugins:child execute plugin event: before:browser:launch ({ eventId: 2, invocationId: 'inv2' }) +5m
{ displayName: 'Chrome',
family: 'chrome',
isChosen: true,
majorVersion: '74',
name: 'chrome',
path: 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe',
version: '74.0.3729.169',
isHeaded: true,
isHeadless: false }
cypress:server:timers child received timer id 8 +5m
cypress:server:timers child sending timer id 8 +1s
cypress:server:timers child received timer id 9 +10s
cypress:server:timers child received timer id 10 +11ms
cypress:server:timers child received timer id 11 +5s
cypress:server:timers child received timer id 12 +6ms
cypress:server:timers child received timer id 13 +2ms
cypress:server:timers child received timer id 14 +1ms
cypress:server:timers child received timer id 15 +20ms
cypress:server:timers child received timer id 16 +289ms
cypress:server:timers child received timer id 17 +202ms
cypress:server:timers child sending timer id 14 +491ms
cypress:server:timers child received timer id 18 +10s
cypress:server:timers child sending timer id 18 +2ms
cypress:server:timers child received timer id 19 +8s
cypress:server:timers child sending timer id 19 +15ms
cypress:server:timers child received timer id 20 +1ms
cypress:server:timers child received timer id 21 +14ms
cypress:server:timers child sending timer id 21 +2ms
cypress:server:timers child received timer id 22 +1s
cypress:server:timers child sending timer id 22 +3ms
cypress:server:timers child received timer id 23 +27ms
cypress:server:timers child sending timer id 23 +1ms
cypress:server:timers child received timer id 24 +109ms
cypress:server:timers child received timer id 25 +100ms
cypress:server:timers child received timer id 26 +9ms
cypress:server:timers child received timer id 27 +40ms
cypress:server:timers child received timer id 28 +1ms
cypress:server:timers child received timer id 29 +0ms
cypress:server:timers child received timer id 30 +0ms
cypress:server:timers child received timer id 31 +1ms
cypress:server:timers child received timer id 32 +0ms
cypress:server:timers child received timer id 33 +0ms
cypress:server:timers child received timer id 34 +1ms
cypress:server:timers child received timer id 35 +0ms
cypress:server:timers child received timer id 36 +0ms
cypress:server:timers child received timer id 37 +1ms
cypress:server:timers child received timer id 38 +0ms
cypress:server:timers child received timer id 39 +0ms
cypress:server:timers child received timer id 40 +1ms
cypress:server:timers child received timer id 41 +0ms
cypress:server:timers child received timer id 42 +0ms
cypress:server:timers child received timer id 43 +0ms
cypress:server:timers child received timer id 44 +1ms
cypress:server:timers child received timer id 45 +0ms
cypress:server:timers child received timer id 46 +0ms
cypress:server:timers child received timer id 47 +3ms
cypress:server:timers child received timer id 48 +4ms
cypress:server:timers child received timer id 49 +1ms
cypress:server:timers child received timer id 50 +2ms
cypress:server:timers child received timer id 51 +2ms
cypress:server:timers child received timer id 52 +3ms
cypress:server:timers child received timer id 53 +4ms
cypress:server:timers child received timer id 54 +4s
cypress:server:timers child received timer id 55 +1s
cypress:server:timers child received timer id 56 +23ms
cypress:server:timers child received timer id 57 +12ms
cypress:server:timers child received timer id 58 +173ms
cypress:server:timers child received timer id 59 +233ms
cypress:server:timers child received timer id 60 +3ms
cypress:server:timers child received timer id 61 +5ms
cypress:server:timers child received timer id 62 +3ms
cypress:server:timers child received timer id 63 +4ms
cypress:server:timers child received timer id 64 +2ms
cypress:server:timers child received timer id 65 +2ms
cypress:server:timers child received timer id 66 +35ms
cypress:server:timers child received timer id 67 +5ms
cypress:server:timers child received timer id 68 +9ms
cypress:server:timers child received timer id 69 +2ms
cypress:server:timers child received timer id 70 +138ms
cypress:server:timers child received timer id 71 +12ms

Starting Electron:

  cypress:server:timers child received timer id 75 +10s
  cypress:server:plugins:child execute plugin event: before:browser:launch ({ eventId: 2, invocationId: 'inv4' }) +2m
{ displayName: 'Electron',
  family: 'electron',
  info: 'Electron is the default browser that comes with Cypress. This is the browser that runs in headless mode. Selecting this browser is useful when debugging. The version number indicates the underlying Chromium version that Electron uses.',
  isChosen: true,
  majorVersion: '61',
  name: 'electron',
  path: '',
  version: '61.0.3163.100',
  isHeaded: true,
  isHeadless: false }
  cypress:server:timers child sending timer id 20 +104ms
  cypress:server:timers child received timer id 76 +330ms
  cypress:server:timers child sending timer id 24 +959ms
  cypress:server:timers child sending timer id 76 +42ms
  cypress:server:timers child sending timer id 25 +58ms
  cypress:server:timers child sending timer id 26 +48ms
  cypress:server:timers child sending timer id 27 +0ms
  cypress:server:timers child sending timer id 28 +2ms
  cypress:server:timers child sending timer id 29 +0ms
  cypress:server:timers child sending timer id 30 +0ms
  cypress:server:timers child sending timer id 31 +3ms
  cypress:server:timers child sending timer id 32 +0ms
  cypress:server:timers child sending timer id 33 +0ms
  cypress:server:timers child sending timer id 34 +0ms
  cypress:server:timers child sending timer id 35 +0ms
  cypress:server:timers child sending timer id 36 +1ms
  cypress:server:timers child sending timer id 37 +0ms
  cypress:server:timers child sending timer id 38 +0ms
  cypress:server:timers child sending timer id 39 +0ms
  cypress:server:timers child sending timer id 40 +1ms
  cypress:server:timers child sending timer id 41 +2ms
  cypress:server:timers child sending timer id 42 +1ms
  cypress:server:timers child sending timer id 43 +1ms
  cypress:server:timers child sending timer id 44 +0ms
  cypress:server:timers child sending timer id 45 +0ms
  cypress:server:timers child sending timer id 46 +0ms
  cypress:server:timers child sending timer id 47 +3ms
  cypress:server:timers child sending timer id 48 +0ms
  cypress:server:timers child sending timer id 49 +0ms
  cypress:server:timers child sending timer id 50 +3ms
  cypress:server:timers child sending timer id 51 +3ms
  cypress:server:timers child sending timer id 52 +1ms
  cypress:server:timers child sending timer id 53 +7ms
  cypress:server:timers child sending timer id 75 +431ms
  cypress:server:timers child received timer id 77 +496ms
  cypress:server:timers child received timer id 78 +45ms
  cypress:server:timers child received timer id 79 +2s
  cypress:server:timers child received timer id 80 +10ms
  cypress:server:timers child received timer id 81 +2ms
  cypress:server:timers child received timer id 82 +2ms
  cypress:server:timers child sending timer id 77 +244ms
  cypress:server:timers child sending timer id 78 +46ms
  cypress:server:timers child received timer id 83 +62ms
  cypress:server:timers child received timer id 84 +90ms
  cypress:server:timers child received timer id 85 +74ms
  cypress:server:timers child sending timer id 85 +1ms
  cypress:server:timers child received timer id 86 +1ms
  cypress:server:timers child sending timer id 86 +1ms
  cypress:server:timers child received timer id 87 +17ms
  cypress:server:timers child sending timer id 87 +2ms
  cypress:server:timers child received timer id 88 +17ms
  cypress:server:timers child sending timer id 88 +2ms
  cypress:server:timers child received timer id 89 +19ms
  cypress:server:timers child sending timer id 89 +2ms
  cypress:server:timers child received timer id 90 +44ms
  cypress:server:timers child received timer id 91 +60ms
  cypress:server:timers child sending timer id 82 +321ms
  cypress:server:timers child sending timer id 54 +32ms
  cypress:server:timers child sending timer id 55 +1s
  cypress:server:timers child sending timer id 56 +23ms
  cypress:server:timers child sending timer id 57 +12ms
  cypress:server:timers child sending timer id 59 +406ms
  cypress:server:timers child sending timer id 60 +3ms
  cypress:server:timers child sending timer id 61 +4ms
  cypress:server:timers child sending timer id 62 +3ms
  cypress:server:timers child sending timer id 63 +13ms
  cypress:server:timers child sending timer id 64 +4ms
  cypress:server:timers child sending timer id 65 +24ms
  cypress:server:timers child sending timer id 66 +4ms
  cypress:server:timers child sending timer id 67 +3ms
  cypress:server:timers child sending timer id 68 +9ms
  cypress:server:timers child sending timer id 69 +3ms
  cypress:server:timers child sending timer id 70 +145ms
  cypress:server:timers child received timer id 92 +3s
  cypress:server:timers child received timer id 93 +188ms
  cypress:server:timers child received timer id 94 +1s
  cypress:server:timers child received timer id 95 +1s
  cypress:server:timers child received timer id 96 +11ms
  cypress:server:timers child received timer id 97 +2ms
  cypress:server:timers child received timer id 98 +0ms
  cypress:server:timers child received timer id 99 +161ms
  cypress:server:timers child received timer id 100 +97ms
  cypress:server:timers child received timer id 101 +77ms
  cypress:server:timers child received timer id 102 +100ms
  cypress:server:timers child received timer id 103 +35ms
  cypress:server:timers child sending timer id 98 +531ms
  cypress:server:timers child received timer id 104 +5s
  cypress:server:timers child sending timer id 72 +18s
  cypress:server:timers child received timer id 105 +1s
  cypress:server:timers child sending timer id 94 +4s

Chrome chrome://policy/:

AllowDinosaurEasterEgg: false

ComponentUpdatesEnabled: false

DefaultBrowserSettingEnabled: false

HardwareAccelerationModeEnabled: true

HideWebStoreIcon: true

MetricsReportingEnabled: false

PasswordManagerEnabled: false

ProxySettings:
{
 "ProxyMode": "direct"
 }

SafeBrowsingExtendedReportingOptInAllowed: false

SyncDisabled: true

After visiting "chrome://net-internals/#proxy" I only see those two buttons:

"Re-apply settings" "Clear bad proxies"

I hope that this will help you to pinpoint the problem.

@flotwig
Copy link
Contributor

flotwig commented Jun 5, 2019

@wojciechsabaj It does look like you're experiencing #1253 - see how you have "ProxyMode": "direct" set? This direct setting forces Chrome to never use a proxy, which is why you're having this issue.

This isn't something that we can fix from Cypress's end, since there's no way to block Chrome from loading policy. You may be able to ask your administrator to lift this policy restriction.

Can you try the workaround listed in this issue comment? #1253 (comment)

@RicardoVaranda @MrMinimal Can you check your chrome://policy/ and chrome://net-internals/#proxy as well?

@wojciechsabaj
Copy link

@flotwig, good catch! I am very eager to check this out but my corpo computer is so locked that I have no access to delete the value 😭 It will only be possible from Rescue Mode, after loading the hive, changing the value and unloading the hive. Is this possible for Cypress to display a warning if such key is detected on system?

@RicardoVaranda
Copy link

@flotwig

Since we are having similar issues I'll also post our findings within our corp:

After setting set DEBUG=cypress:*

When I switch and run on Chromium and Electron it doesn't seem to generate any logs but when we initially run:
cypress open

These are the logs:

C:\Users\XXXXX\Desktop\testing>.\node_modules\.bin\cypress open
  cypress:cli cli starts with arguments ["C:\\Program Files\\nodejs\\10.14.2\\node.exe","C:\\Users\\XXXXX\\Desktop\\testing\\node_modules\\cypress\\bin\\cypress","open"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli program parsing arguments +8ms
  cypress:cli opening Cypress +2ms
  cypress:cli parsed cli options {} +378ms
  cypress:cli opening from options {"project":"C:\\Users\\XXXXX\\Desktop\\testing"} +0ms
  cypress:cli command line arguments ["--project","C:\\Users\\XXXXX\\Desktop\\testing"] +0ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +1ms
  cypress:cli checking if executable exists C:\Users\XXXXX\AppData\Local\Cypress\Cache\3.3.0\Cypress\Cypress.exe +5ms
  cypress:cli Binary is executable? : true +4ms
  cypress:cli binaryDir is  C:\Users\XXXXX\AppData\Local\Cypress\Cache\3.3.0\Cypress +0ms
  cypress:cli Reading binary package.json from: C:\Users\XXXXX\AppData\Local\Cypress\Cache\3.3.0\Cypress\resources\app\package.json +0ms
  cypress:cli Found binary version 3.3.0 installed in: C:\Users\XXXXX\AppData\Local\Cypress\Cache\3.3.0\Cypress +6ms
  cypress:cli { verified: true } +7ms
  cypress:cli is Verified ? true +4ms
  cypress:cli needs to start own XVFB? false +0ms
  cypress:cli spawning, should retry on display problem? false +1ms
  cypress:cli spawning Cypress with executable: C:\Users\XXXXX\AppData\Local\Cypress\Cache\3.3.0\Cypress\Cypress.exe +5ms
  cypress:cli spawn args [ '--project', 'C:\\Users\\XXXXX\\Desktop\\testing', '--cwd', 'C:\\Users\\XXXXX\\Desktop\\testing' ] { detached: false, stdio: 'inherit', windowsHide: false } +1ms

Sadly due to company rules can't send all of the information but I can tell you that

chrome://policy/ returns

      "ProxySettings": {
         "level": "mandatory",
         "scope": "machine",
         "source": "sourcePlatform",
         "value": {
            "ProxyMode": "system"
         }
      },

Please let me know if you require anything else from chrome://policy and I'll see if I'm able to release it.

In chrome://net-internals/#proxy like @wojciechsabaj I also only get two other buttons
"Re-apply settings" "Clear bad proxies"

@flotwig
Copy link
Contributor

flotwig commented Jun 5, 2019

@wojciechsabaj Good idea, I've created an issue to track adding a warning: #4391

@RicardoVaranda Thanks for supplying this, it looks like you are also having the ProxyMode issue described in #1253. ProxyMode: system means that Chrome will always use your system's proxy settings, which prevents Chrome from using the proxy that Cypress supplies. The workaround (besides just using Electron) is to remove the policy: #1253 (comment)

@RicardoVaranda
Copy link

@flotwig Thank you for looking into it, sadly I don't see this change happening in corporations with emphasis on security. In our case this is a company wide policy.

@flotwig
Copy link
Contributor

flotwig commented Jun 5, 2019

@RicardoVaranda You may be able to delete the policy yourself if you have local administrator access.

Sidebar: It's especially unfortunate that so many companies have this policy set, as forcing a proxy is basically just security theater. It does nothing to make you more secure. Users can get around being forced to use a proxy by using other browsers that don't respect policy, like SRWare Iron, or by injecting a DLL that blocks the policy. Of course, your company's network will not allow Internet access without going through the proxy, which also makes forcing ProxyMode redundant. 🙄

@flotwig flotwig added type: unexpected behavior User expected result, but got another browser: chrome and removed type: bug labels Jun 5, 2019
@wojciechsabaj
Copy link

wojciechsabaj commented Jun 6, 2019

@RicardoVaranda An idea that comes to my mind is to try to use the portable version of Chrome/Chromium, as portable version should not use the Windows registry and store the values inside the file in program dir instead.

FYI, "Managed by your organization" was introduced in Chrome 73. I do not know if installation of an older version of Chrome can help in accessing the proxy settings and removing them.

@flotwig
Copy link
Contributor

flotwig commented Jun 7, 2019

@MrMinimal Can you check and let us know if you are also being affected by policy? Just sharing your chrome://policy should shed some light on the issue.

@cypress-bot cypress-bot bot added the stage: awaiting response Potential fix was proposed; awaiting response label Jun 7, 2019
@RicardoVaranda
Copy link

@wojciechsabaj That's a possibility but it's subjective to the level of security or restrictions within your organisation. Within ours it's quite strict and as a result installations and even execution of programs are all restricted by policy.

We will continue using electron for now but sadly this makes cypress harder to sell internally. Not being able to run it in an external browser which is often the default one is raising a lot of questions. We have a requirement to also test integration with a chrome extension which you are not able to do with electron.

@flotwig
Copy link
Contributor

flotwig commented Jun 7, 2019

@wojciechsabaj I tried to use portable Chrome from portableapps.com as a workaround, but it doesn't seem to work. Did you have success with a particular portable version of Chrome?

Also, fyi, using Chromium instead of Chrome may work to bypass the policy.

@wojciechsabaj
Copy link

I also tried Chrome Portable and it was also overtaken by my organization - which seems kinda strange, 'cause portable version of the browser should not use the settings in registry. I am currently using Electron but I will try to work on this topic when I have more time.

Thank you all for your engagement in solving the problem. Keep up the good work!

@flotwig flotwig added the type: duplicate This issue or pull request already exists label Jun 17, 2019
@flotwig
Copy link
Contributor

flotwig commented Jun 17, 2019

Closing this issue for now since it looks like a duplicate of #1253

@MrMinimal - if you do not have Chrome policies set by your organization (check chrome://policy) feel free to re-open as then it would not be a duplicate of #1253.

@flotwig flotwig closed this as completed Jun 17, 2019
@jennifer-shehane jennifer-shehane removed the stage: awaiting response Potential fix was proposed; awaiting response label Jun 25, 2019
@yaminikkotharu12
Copy link

Hi Everyone,

Is there a workaround for this issue , as even I am facing the same issue. Unfortunately I can't use Electron as it's not a supported browser. Also my chrome://policy/ has { "ProxyMode": "system" }.
Any help is appreciated.

@jennifer-shehane
Copy link
Member

@yaminikkotharu12 Please see this comment #1253 (comment)

@cypress-io cypress-io locked as off-topic and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
browser: chrome type: duplicate This issue or pull request already exists type: unexpected behavior User expected result, but got another
Projects
None yet
Development

No branches or pull requests

8 participants