-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Initial visit() is very slow on Angular apps with an external resource #1608
Comments
Take a picture of the network request that is timing out including the timings inside the network panel. |
There are several issues opening concerning corporate proxy. It is possible that is the issue - that you configured something in Chrome a while ago that needs configuring in the Cypress browser. See all corporate proxy issues: #1469 |
I took a look through those, and while we do have a proxy, in my Network Settings (on the mac) I'm bypassing the proxy for localhost calls. My Cypress test does run: describe('First Cypress Test', () => {
it('doesnt do much', () => {
cy.visit('http://localhost:4200/#/login');
expect(true).to.equal(true);
});
}); but the problem is that it times out on external resources in my app (which is I guess where it would need to be using the proxy, as it should since the resource isn't hosted at localhost). If I do |
@jdhines appreciate your explanation of this. It all makes sense, and fixing all the proxy issues is something that is up on our radar. I'm not sure how feasible it will be for Cypress to read off the system proxy configuration automatically - but at the very least we'll be able to support various proxy configuration settings and this is a use case we'll code for. By chance do you have any other development specific applications you could point us to that you've either:
It would be helpful for us to look at and model after other applications solving the same problems as us. Also - could you provide a screenshot of your system settings including the localhost bypass? Make sure to blackout anything that's sensitive in them. All of that would be super helpful. |
#1312 is very similar to mine. I think basically what I need to do is alert Cypress to use the proxy, but bypass it for localhost. As far as working apps go, I've been developing with Angular, and if I create a fresh Angular app (repro link in the first post), then throw a link to say Bootstrap's CDN into the Angular app's generated |
@jdhines actually we already support the Do |
I gave that a try. Setting it with the protocol That said, setting both
has the same effect as this:
The only difference is with |
So I've turned the FontAwesome and Bootstrap resources into local sources, and removed Tether altogether since I didn't need it, which just leaves the Google fonts I'm embedding, and I can't localize those. For tests, I wouldn't really care if the custom fonts didn't load, it's just that it tries to pull the fonts for 30 seconds, and obviously I can't build a suite of tests if each one with a Found #1237, and added this to my
and it bypasses it as it should, so the test runs quickly. Obviously, this is a workaround as opposed to a proxy solution, but it'll do for now. |
In my case, it was the firewall, so I set Cypress to be allowed on private & public and it worked |
I'm also black listing google fonts for now, but would hope that cypress can support this. |
The code for this is done in cypress-io/cypress#3531, but has yet to be released. |
Released in |
Current behavior:
Started up a new Angular app (
ng new cypress-test
), installed Cypress, didng serve
, wrote a simple test just visiting the home page and looking for the sample text, and that test ran fine.Then, added in a
<link>
to the Bootstrap CDN in the app'sindex.html
and suddenly the Cypress test cranks for exactly 30 seconds (the status bar in Chrome says "Establishing secure connection..."), and then runs the test, but prints out a timeout error to the console:Tried this with Font Awesome, and some Google Fonts, and all 3, and it still takes 30 seconds, so it's not an issue with slow responses from the external resource; there seems to be some issue with those links in the
<head>
section that Cypress doesn't like.Desired behavior:
The tests load the application's pages in roughly the same time as loading them normally via localhost is.
Steps to reproduce:
npm install
ng serve
npx cypress open
)Versions
Cypress 2.1.0
Chrome 62
Mac OS High Sierra
The text was updated successfully, but these errors were encountered: