Skip to content
Advertisement

Setup Cypress.io to access a page through a proxy

Is it possible to setup cypress.io to access pages through a proxy?

I have a proxy that I need to go through, in order to test my application. Is there anyway to configure cypress.io to honour the standard HTTP_PROXY environment variables.. or is there some other setup that is required?

Advertisement

Answer

Update:

This is now well documented at: https://docs.cypress.io/guides/references/proxy-configuration.html

Unix

export HTTP_PROXY=http://my-company-proxy.com

Windows

set HTTP_PROXY=http://my-company-proxy.com

There is a Cypress issue open to track this: https://github.com/cypress-io/cypress/issues/1469

This covers many of the common issues with getting through a corporate proxy and ways of working around them.

The following is an excerpt from the issue:

Setting Environment Variables

Set HTTP_PROXY and/or HTTPS_PROXY to your corporate proxy

HTTP_PROXY=http://my-proxy-address cypress run

Set NO_PROXY for localhost to prevent it from hitting corporate proxy

NO_PROXY=localhost cypress run

Other workarounds

For cy.visit()

  • Enable permissions in the Cypress chrome extension
  • Check the Chrome ProxyMode if you have administration rights
  • Try using Electron

For Download

  • Try the direct download if you’re having issues during install.
  • Workaround for install using CYPRESS_BINARY_VERSION.

For accessing ‘Runs’ tab in Test Runner

If you need to set up a project, you have to do it in this tab. Fortunately, you should only need to do this once. Try to do this once outside of the corporate proxy then you should be good to go.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement