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 · Fixed by #3531
Closed

Cypress Behind Bluecoat Proxy #939

charch opened this issue Nov 20, 2017 · 11 comments · Fixed by #3531
Assignees

Comments

@charch
Copy link

charch 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
Copy link

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
Copy link
Author

charch commented Nov 21, 2017 via email

@bahmutov
Copy link
Contributor

bahmutov commented Nov 21, 2017 via email

@charch
Copy link
Author

charch commented Nov 21, 2017 via email

@MarcLoupias
Copy link

MarcLoupias 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.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Nov 27, 2017
@thejones
Copy link

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
Copy link

BasieP commented Feb 14, 2018

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

@jennifer-shehane
Copy link
Member

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
Copy link

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
Copy link
Contributor

cypress-bot bot 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
Copy link
Contributor

cypress-bot bot 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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants