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

Cypress Behind Bluecoat Proxy #939

Closed
charch opened this issue Nov 20, 2017 · 11 comments

Comments

8 participants
@charch
Copy link

commented Nov 20, 2017

  • Operating System: Windows 7 Enterprise SP1
  • Cypress Version: Beta Version 1.0.3
  • Browser Version: Chrome Canary 64.0.3247.0 and Chrome 62.0.3202.94

Is this a Feature or Bug?

Feature

Current behavior:

Our application pulls from CDNs for additional CSS libraries. (semantic, react-md, font-awesome), but when running the tests, it cannot connect through the corporate (BlueCoat) proxy leading to missing styles, functionality and slow page loads (it waits for the connections to timeout).

Desired behavior:

Add the ability to enter proxy credentials in some way. Perhaps add proxy credentials to the configuration options?

@charch charch changed the title Cypress behind Bluecoat proxy Cypress Behind Bluecoat Proxy Nov 20, 2017

@MarcLoupias

This comment has been minimized.

Copy link

commented Nov 21, 2017

If cypress can't connect to CDN to lazy download some source code, how it works for you in dev mode ?

There is something i cannot get here. If cypress can't reach cdn.domain.tld you can't reach it either when running your app locally.

So the issue is in your build not in cypress. You should have a build where everything is local.

You should define more accuratly which test type you want to achieve. What is your context ? Is it local dev test ? CI test ? Something else ?

@charch

This comment has been minimized.

Copy link
Author

commented Nov 21, 2017

@bahmutov

This comment has been minimized.

Copy link
Collaborator

commented Nov 21, 2017

@charch

This comment has been minimized.

Copy link
Author

commented Nov 21, 2017

@MarcLoupias

This comment has been minimized.

Copy link

commented Nov 21, 2017

You should definitely have a purely local build version to run the tests against.

Relying on external service makes your tests unstables (the cypress team loves the term "flaky").

Anytime a problem will occur at your cdn provider or at a network level your tests will fail. They should not.

IMHO your best bet is to try mocking your CDN provider with cy.server, cy.route and cy.fixture.

Check the part named "Change the default whitelisting" from the cy.server API doc to remove the source code assets whitelisting.

You will be able to remove :

  • the proxy settings needs
  • the "flakyness" from your tests

And you can try this right now without changing your build.

@thejones

This comment has been minimized.

Copy link

commented Nov 27, 2017

I am using Cypress to test against another product called Web AppBuilder from Esri (It generates web mapping applications). Because of this dependency it wants/needs to download assets from a CDN to get the ArcGIS JavaScript API. Behind a corporate proxy I am unable to load the application as it fails trying to request the resources. On an outside network it is fine. So, the idea that e2e testing could not use CDN code in unrealistic. If I cannot connect to the ArcGIS API the application wont work anyway. Clearly if everything is local it is better and I am not arguing that, I am just saying that sometimes you need to connect to CDN resources.

Anyway, I have the same issues. If we go to Esri's web site: https://developers.arcgis.com/web-appbuilder/

We can grab a public facing sample:
http://gis.calhouncounty.org/ParcelViewer3.1/

My test file

describe('My First Test', function() {
    //Works
    it('Visits the Kitchen Sink', function() {
      cy.visit('https://example.cypress.io')
    })
    //fails
    it('Visits the jsapi site', function() {
      cy.visit('http://gis.calhouncounty.org/ParcelViewer3.1/')
    })
  })

I am not 100% if that site should work but I get the same behavior with my local apps running on localhost. Hopefully this is somewhat helpful...

This is on Windows 7, latest (LTS) version of Node.

@BasieP

This comment has been minimized.

Copy link

commented Feb 14, 2018

+many on the NO_PROXY setting... it should work, but cypress ignores it :(

@jennifer-shehane

This comment has been minimized.

Copy link
Member

commented Apr 26, 2018

Can ya'll try to set HTTP_PROXY and/or HTTPS_PROXY to your corporate proxy as system/shell environment variables? I detailed some of this fix here: #1469 (comment)

@NickStees

This comment has been minimized.

Copy link

commented Dec 5, 2018

I have been looking around the various proxy related issues, and experimented alot. I want to report I am also behind a BlueCoat proxy, I have HTTP_PROXY and HTTPS_PROXY set to our bluecoat proxy. To make it more complicated we use a PAC file but this is a pretty common setup for Governments. Basically we have proxy problems with just about every piece of software, especially if its trying to get https resources. We usually have to set our software to verify_ssl=FALSE in order to get things to work. Is that something Cypress can work in?

@cypress-bot

This comment has been minimized.

Copy link

commented Apr 1, 2019

The code for this is done in cypress-io/cypress#3531, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot

This comment has been minimized.

Copy link

commented May 17, 2019

Released in 3.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.