-
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
ensureUrl
failure (potentially due to corporate proxy usage)
#1541
Comments
ensureUrl
failureensureUrl
failure (potentially due to corporate proxy usage)
This is correct, |
I am getting the same error when running my tests in circleCI and updating env variables didn't help. Are there any progress on this? |
To elaborate on @katerynae's comment (I am a teammate), we started getting the error when we switched from a url that was redirected to a cdn using cname rules, to one that was proxied through cloudflare and an nginx server. |
I have been using a workaround of just passing an environmental variable effectively replacing the var randomstring = require("randomstring");
const BASE_URL = Cypress.env('testUrl'); // until https://github.com/cypress-io/cypress/issues/1541 is resolved using testUrl env var instead of baseUrl
var randomString;
describe('bug highlight', function () {
before(function () {
randomString = randomstring.generate();
console.log('randomString1', randomString);
})
context('bug', function () {
it('post', () =>{
console.log('randomString2', randomString);
return cy.request({
method: 'POST',
url: `https://e.deployads.com/e/whatismyip.com`, //non-example case I would use var BASE_URL defined above via an env variable
form: false,
body: {"jsr":{"_count":1,"bdl":"7133","msg":"Okay","u":"https://www.whatismyip.com/what-is-my-public-ip-address/","pv":`${randomString}`,"sid":"jn6d3c0k2juz91","r":"https://www.google.com/","sta":200,"tas":1539368968738,"bld":17252,"s":"whatismyip.com","uid":"jn6d3c0k2juz91","typ":"im","cfdt":"D","rt":115,"_type":"jsr"}}
}).then((response) => {
console.log('in request response');
cy.expect(response.status).to.eq(200);
})
})
it('visit', () =>{
console.log('randomString3', randomString);
cy.visit('https://google.com');
})
})
}) |
The code for this is done in cypress-io/cypress#3531, but has yet to be released. |
Please could someone confirm that version 3.2.0 has fixed this issue? Running on a different network without proxies, I don't have the same issue. |
Latest release was 3/15/2019 https://github.com/cypress-io/cypress/releases So this is not a part of 3.2.0. |
This issue is still pending release - as indicated by this comment #1541 (comment) and the label of This is not part of 3.2.0. We will comment on this issue as soon as it is released. |
My mistake - sorry for the confusion! |
Released in |
Current behaviour:
Desired behavior:
Tests run after successful
ensureUrl
checkHow to reproduce:
Run tests over proxy.
Or this might be to do with the fact our baseURL serves 403 responses - which is normal behaviour for us. Our tests query sub-urls, which return 200 responses. This theory is inconsistent with the
http://example.com
call failing theensureUrl
check.Our hunch is that node's
net.connect
method, used in the ensureUrl check isn't respecting proxy settings.https://github.com/cypress-io/cypress/blob/master/packages/server/lib/util/connect.coffee#L10
Additional Info (images, stack traces, etc)
We are able to run via the Cypress UI, but with a warning message in the UI.
When I commented out the following
ensureURL
check, tests were able to run.The text was updated successfully, but these errors were encountered: