by using official cypress/included:4.2.0 Docker image, I try to run my tests with Chrome (tries with Firefox too):
describe('Login', function() {
it('Enter valid login credentials', function() {
cy.visit('/')
})
})
My cypress.json is:
{
"baseUrl": "https://myAngularApp.com",
"blacklistHosts": [ "google-analytics.com", "amplitude.com"]
}
When baseUrl=https://google.com, everything is OK. But with https://myAngularApp.com (obviously not the real domain), it fails to load the page. This is not a timeout problem. Domain is well resolved too (wget from inside Docker container is OK).
Same test runs fine with cypress open on the same computer.
By adding debug logs, I see weird domains (allthough I don't know how Cypress works), here is a sample when it seems to fail (look for the weird domain at the end like "http://sptzywbkfyswirq/"):
cypress:proxy:http:response-middleware received response { req: { method: 'GET', proxiedUrl: 'https://myAngularApp.com/runtime.5778a90e1b68b1f10bbd.js', headers: { host: 'myAngularApp.com', connection: 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36', 'sec-fetch-dest': 'script', accept: '*/*', 'sec-fetch-site': 'same-origin', 'sec-fetch-mode': 'no-cors', referer: 'https://myAngularApp.com/', 'accept-encoding': 'gzip', 'accept-language': 'en-US,en;q=0.9' } }, incomingRes: { headers: { 'accept-ranges': 'bytes', 'content-encoding': 'gzip', 'content-type': 'application/javascript', date: 'Thu, 26 Mar 2020 17:11:26 GMT', etag: '"5e7cc343-133a"', 'last-modified': 'Thu, 26 Mar 2020 14:59:15 GMT', server: 'nginx/1.17.9', vary: 'Accept-Encoding', 'transfer-encoding': 'chunked' }, statusCode: 200 } } +6ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'PatchExpressSetHeader' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'SetInjectionLevel' } +1ms
cypress:proxy:http:response-middleware injection levels: { isInitial: false, wantsInjection: false, wantsSecurityRemoved: true } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'OmitProblematicHeaders' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'MaybePreventCaching' } +0ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'CopyCookiesFromIncomingRes' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'MaybeSendRedirectToClient' } +0ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'CopyResponseStatusCode' } +0ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'ClearCyInitialCookie' } +1ms
cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'com', domain: 'b2pweb' }, origin: 'https://myAngularApp.com', strategy: 'http', visiting: false, domainName: 'b2pweb.com', fileServer: null } +18ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'MaybeEndWithEmptyBody' } +0ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'MaybeGunzipBody' } +1ms
cypress:proxy:http:response-middleware ungzipping response body +4ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'MaybeInjectHtml' } +0ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'MaybeRemoveSecurity' } +0ms
cypress:proxy:http:response-middleware removing JS framebusting code +1ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'GzipBody' } +1ms
cypress:proxy:http:response-middleware regzipping response body +0ms
cypress:proxy:http Running middleware { stage: 'IncomingResponse', middlewareName: 'SendResponseBodyToClient' } +1ms
cypress:proxy:http Entering stage { stage: 'IncomingRequest' } +3s
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'LogRequest' } +0ms
cypress:proxy:http:request-middleware proxying request { req: { method: 'HEAD', proxiedUrl: 'http://sptzywbkfyswirq/', headers: { host: 'sptzywbkfyswirq', 'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36', 'accept-encoding': 'gzip, deflate' } } } +3s
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'RedirectToClientRouteIfUnloaded' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'RedirectToClientRouteIfNotProxied' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'EndRequestsToBlacklistedHosts' } +0ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'MaybeEndRequestWithBufferedResponse' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'StripUnsupportedAcceptEncoding' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'MaybeSetBasicAuthHeaders' } +0ms
cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'com', domain: 'b2pweb' }, origin: 'https://myAngularApp.com', strategy: 'http', visiting: false, domainName: 'b2pweb.com', fileServer: null } +3s
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'SendRequestOutgoing' } +1ms
cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'com', domain: 'b2pweb' }, origin: 'https://myAngularApp.com', strategy: 'http', visiting: false, domainName: 'b2pweb.com', fileServer: null } +1ms
cypress:network:agent addRequest called { isHttps: false, href: 'http://sptzywbkfyswirq/' } +3s
cypress:network:connect beginning getAddress { hostname: 'sptzywbkfyswirq', port: 80 } +3s
cypress:server:stream_buffer stream buffer writeable final called +3s
cypress:proxy:http Entering stage { stage: 'IncomingRequest' } +11ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'LogRequest' } +0ms
cypress:proxy:http:request-middleware proxying request { req: { method: 'HEAD', proxiedUrl: 'http://aavdrqdu/', headers: { host: 'aavdrqdu', 'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36', 'accept-encoding': 'gzip, deflate' } } } +16ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'RedirectToClientRouteIfUnloaded' } +2ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'RedirectToClientRouteIfNotProxied' } +2ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'EndRequestsToBlacklistedHosts' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'MaybeEndRequestWithBufferedResponse' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'StripUnsupportedAcceptEncoding' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'MaybeSetBasicAuthHeaders' } +1ms
cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'com', domain: 'b2pweb' }, origin: 'myAngularApp.com', strategy: 'http', visiting: false, domainName: 'b2pweb.com', fileServer: null } +18ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'SendRequestOutgoing' } +1ms
cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'com', domain: 'b2pweb' }, origin: 'https://myAngularApp.com', strategy: 'http', visiting: false, domainName: 'b2pweb.com', fileServer: null } +1ms
cypress:network:agent addRequest called { isHttps: false, href: 'http://aavdrqdu/' } +18ms
cypress:network:connect beginning getAddress { hostname: 'aavdrqdu', port: 80 } +18ms
cypress:server:stream_buffer stream buffer writeable final called +18ms
cypress:proxy:http Entering stage { stage: 'IncomingRequest' } +10ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'LogRequest' } +1ms
cypress:proxy:http:request-middleware proxying request { req: { method: 'HEAD', proxiedUrl: 'http://ifaulschhhr/', headers: { host: 'ifaulschhhr', 'proxy-connection': 'keep-alive', 'user-agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36', 'accept-encoding': 'gzip, deflate' } } } +19ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'RedirectToClientRouteIfUnloaded' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'RedirectToClientRouteIfNotProxied' } +0ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'EndRequestsToBlacklistedHosts' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'MaybeEndRequestWithBufferedResponse' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'StripUnsupportedAcceptEncoding' } +1ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'MaybeSetBasicAuthHeaders' } +1ms
cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'com', domain: 'b2pweb' }, origin: 'https://myAngularApp.com', strategy: 'http', visiting: false, domainName: 'b2pweb.com', fileServer: null } +16ms
cypress:proxy:http Running middleware { stage: 'IncomingRequest', middlewareName: 'SendRequestOutgoing' } +1ms
cypress:server:server Getting remote state: { auth: null, props: { port: '443', tld: 'com', domain: 'b2pweb' }, origin: 'https://myAngularApp.com', strategy: 'http', visiting: false, domainName: 'b2pweb.com', fileServer: null } +1ms
cypress:network:agent addRequest called { isHttps: false, href: 'http://ifaulschhhr/' } +16ms
cypress:network:connect beginning getAddress { hostname: 'ifaulschhhr', port: 80 } +16ms
cypress:server:stream_buffer stream buffer writeable final called +16ms
cypress:network:connect error getting address {
hostname: 'sptzywbkfyswirq',
port: 80,
err: OperationalError: getaddrinfo ENOTFOUND sptzywbkfyswirq
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (dns.js:72:26)
{
cause: Error: getaddrinfo ENOTFOUND sptzywbkfyswirq
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (dns.js:72:26)
{
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'sptzywbkfyswirq'
},
isOperational: true,
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'sptzywbkfyswirq'
}
} +80ms
cypress:network:agent got family { family: undefined, href: 'http://sptzywbkfyswirq/' } +86ms
cypress:network:connect error getting address {
hostname: 'ifaulschhhr',
port: 80,
err: OperationalError: getaddrinfo ENOTFOUND ifaulschhhr
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (dns.js:72:26)
{
cause: Error: getaddrinfo ENOTFOUND ifaulschhhr
at GetAddrInfoReqWrap.onlookupall [as oncomplete] (dns.js:72:26)
{
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'ifaulschhhr'
},
isOperational: true,
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'ifaulschhhr'
}
Is there any network tricks here? Or Chrome parameters relative to SPA's like Angular?