Cypress: Cy.visit() does not load page

Created on 11 Apr 2019  路  15Comments  路  Source: cypress-io/cypress

Current behavior:

Upon running cy.visity() and inputing a URL, the request times out.

Desired behavior:

Trying to run a simple cy.visit() command but unable to

Page does not load and hangs until it times out. On the command line there is a Head 500 error

Steps to reproduce: (app code and test code)

Versions

running 3.1.5 as i am having issues with 3.2

Linux

pkhttps-proxy duplicate

Most helpful comment

Those HEAD / 500 errors are unrelated, they're a result of Chrome's behavior, detailed in #3151.

@chris2kus31 if you're behind a corporate proxy, this is a known issue with visiting HTTPS domains behind a proxy and will be fixed in the upcoming Cypress 3.3.0 release. Here is the relevant issue, note that the workarounds listed here will not enable you to test HTTPS-hosted websites (including example.cypress.io): #1469

Closing as duplicate of #1459

All 15 comments

What is the url you are trying to visit ?

Could you share the line of code ?

The tutorial URL. https://example.cypress.io. It lags and then times out. on the command line i can see a HEAD 500 error.

HEAD / 500 48.458 ms - -
HEAD / 500 41.724 ms - -
HEAD / 500 37.204 ms - -
GET /generate_204 204 9.275 ms - -

This works fine for me (v3.2.0)

describe('Cy Visit', function() {
  it('test visit method', function() {
    cy.visit('https://example.cypress.io')
  })
});

right, it might be a proxy issue. as it returns an error saying that Page could not load

The pages load in the browser ? i mean, outside cypress.

i'm seeing this logs too

HEAD / 500 76.457 ms - -
HEAD / 500 83.168 ms - -
HEAD / 500 100.969 ms - -

but it's working anyway

The page doesnt load on my browser. I get a 'page could not load" message

Those HEAD / 500 errors are unrelated, they're a result of Chrome's behavior, detailed in #3151.

@chris2kus31 if you're behind a corporate proxy, this is a known issue with visiting HTTPS domains behind a proxy and will be fixed in the upcoming Cypress 3.3.0 release. Here is the relevant issue, note that the workarounds listed here will not enable you to test HTTPS-hosted websites (including example.cypress.io): #1469

Closing as duplicate of #1459

@flotwig so there is no workaround for this right now?

@chris2kus31 Sadly not. However, this limitation only applies to https-hosted websites.

If you're testing something on http://localhost, it won't go through your proxy and it'll work fine.

If you're testing another http site (say http://example.com), then the workaround of setting the HTTP_PROXY environment variable as described in #1469 will allow Cypress to use your proxy to access that website pre-3.3.0.

Other than that, you'll have to wait for 3.3.0 to use Cypress behind a corporate proxy.

@flotwig so if i am testing say this local site https://local-giving.kcmhq.org/ it will failed to load right now?

@chris2kus31 it depends. If you need to go through your corporate proxy to access this site, then no, it will not work because Cypress before 3.3.0 does not support proxies for https websites.

If it's an https site on localhost, it should work fine since it doesn't try to use your corporate proxy.

Got it. Thank you @flotwig

@flotwig is there an estimate as to when 3.3 will be release?

@chris2kus31 No, but we're working to get it out very soon.

The tutorial URL. https://example.cypress.io. It lags and then times out. on the command line i can see a HEAD 500 error.

HEAD / 500 48.458 ms - -
HEAD / 500 41.724 ms - -
HEAD / 500 37.204 ms - -
GET /generate_204 204 9.275 ms - -

Try to do this, i managed to get cypress 3.3.0 behind a corporate firewall like this:

PROXY_HTTP="http://your_corp_proxy.xxx.com:3128"
PROXY_HTTPS="https://your_corp_proxy.xxx.com:3128"
NO_PROXY="localhost,undefined,domain_which_works_without_proxy.com" npx cypress open

I've added that undefined string into NO_PROXY var after i saw that when I executed the same line with DEBUG=cypress:* i found out that several connections http://undefined/... were trying to go through the proxy which obviously will never work.

Was this page helpful?
0 / 5 - 0 ratings