We have an project environment like this:
https://opt_in_opt_out.bzr.project.independer.nl
If I start the runner and select any script the page stays empty.

Just run the scripts just like normal
Make a project environment with _ (underscores) in it.
Run a script against it
Cypress: 3.0.1
Windows 7
Chrome 74.0.3729.169
@bvanderneut Sorry, I'm having a hard time following what exactly you are doing.
Also, please try upgrading to 3.3.1 first. Your issue may already be resolved.
There are no errors shown in the devtools, console or terminal
baseurl is https://opt_in_opt_out.bzr.project.independer.nl
script just does this
describe('Check newsletter functionality', () => {
beforeEach(function () {
cy.fixture('Algemeen/persoonsgegevens.json').as('persoonsgegevens');
});
it('Check if redirect works', function () {
cy.visit('/gegevens/aanmelden.aspx');
cy.url().should('contain', '/gegevens/voorkeuren');
cy.visit('/gegevens/afmelden.aspx');
cy.url().should('contain', '/gegevens/voorkeuren');
});
});
We deploy our site with TFS if that's what you mean. But if I deploy the same repository to an other url like https://newsletter.bzr.project.independer.nl it works fine.
I am running them from the runner it self. Also running them headless in the terminal is not working. There it gives the message "Timed out waiting for the browser to connect. Retrying..." and then after that "The browser never connected. Something is wrong. The tests cannot run. Aborting..."
Just tested with the 3.3.1 version but the same result.
@bvanderneut Having the same issue here with 4.2.0. ~I did a bit of digging and apparently underscores in URL is not supported by the spec ! Mentionned here: https://stackoverflow.com/questions/9142309/may-url-scheme-contain-an-underscore with reference to: https://tools.ietf.org/html/rfc3986#page-171~ Edit: This is wrong and only refers to the scheme part of the URL, thanks @kenjiru
We have sanitized URLs for our feature deployments and it basically creates a URL using the branch name, with some character substitution. One of our branch was failing cypress with a repeating pattern:
Timed out waiting for the browser to connect. Retrying...
Timed out waiting for the browser to connect. Retrying again...
The browser never connected. Something is wrong. The tests cannot run. Aborting...
Digging into the logs (set env variable DEBUG to "*" when running cypress), I was able to find three instances of these messages at roughly 1 minute interval each:
2020-03-26T02:38:35.4425329Z [31;1mcypress:launcher [0mchrome stderr: [0326/023835.439101:ERROR:ssl_client_socket_impl.cc(941)] handshake failed; returned -1, SSL error code 1, net_error -167 [31m+6s[0m
2020-03-26T02:38:35.4441516Z [32;1mcypress:server:util:socket_whitelist [0mwhitelisted socket closed, removing { localPort: [33m52164[39m } [32m+7ms[0m
2020-03-26T02:38:35.4449098Z [36;1mcypress-verbose:server:browsers:cri-client:recv:[<--] [0mreceived CDP message { id: [33m3[39m, result: { frameId: [32m'2C1E4805A4374E81E017D24F50AAFFA7'[39m, loaderId: [32m'6F437AF6F6C13636A11E5589EFB17A74'[39m, errorText: [32m'net::ERR_SSL_SERVER_CERT_BAD_FORMAT'[39m } } [36m+2s[0m
Followed by, a few moments later, chrome being terminated
2020-03-26T02:41:27.8999786Z [34;1mcypress:server:browsers [0mkilling browser process [34m+60s[0m
2020-03-26T02:41:27.9000767Z [34;1mcypress:server:browsers:chrome [0mclosing remote interface client [34m+60s[0m
2020-03-26T02:41:27.9005437Z [34;1mcypress:server:browsers:chrome [0mclosing chrome [34m+2ms[0m
2020-03-26T02:41:27.9258953Z [31;1mcypress:launcher [0mchrome exited: { code: [1mnull[22m, signal: [32m'SIGTERM'[39m } [31m+60s[0m
2020-03-26T02:41:27.9294869Z [34;1mcypress:server:browsers [0mbrowser process killed [34m+24ms[0m
2020-03-26T02:41:27.9295774Z [31mThe browser never connected. Something is wrong. The tests cannot run. Aborting...[39m
2020-03-26T02:41:27.9298696Z [31monError is not a function[39m
2020-03-26T02:41:27.9299455Z [31mTypeError: onError is not a function[39m
2020-03-26T02:41:27.9300311Z [31m at /home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/lib/modes/run.js:1036:11[39m
2020-03-26T02:41:27.9302706Z [31m at tryCatcher (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)[39m
2020-03-26T02:41:27.9304148Z [31m at Promise._settlePromiseFromHandler (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)[39m
2020-03-26T02:41:27.9307190Z [31m at Promise._settlePromise (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)[39m
2020-03-26T02:41:27.9308681Z [31m at Promise._settlePromise0 (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)[39m
2020-03-26T02:41:27.9310027Z [31m at Promise._settlePromises (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:729:18)[39m
2020-03-26T02:41:27.9311373Z [31m at _drainQueueStep (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)[39m
2020-03-26T02:41:27.9312672Z [31m at _drainQueue (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)[39m
2020-03-26T02:41:27.9314292Z [31m at Async._drainQueues (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)[39m
2020-03-26T02:41:27.9315490Z [31m at Immediate.Async.drainQueues [as _onImmediate] (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)[39m
2020-03-26T02:41:27.9316186Z [31m at processImmediate (internal/timers.js:439:21)[39m
2020-03-26T02:41:27.9316758Z [31m[39m
2020-03-26T02:41:27.9317347Z [34;1mcypress:server:cypress [0mexiting with err TypeError: onError is not a function
2020-03-26T02:41:27.9317912Z at /home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/lib/modes/run.js:1036:11
2020-03-26T02:41:27.9318530Z at tryCatcher (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/util.js:16:23)
2020-03-26T02:41:27.9319344Z at Promise._settlePromiseFromHandler (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:547:31)
2020-03-26T02:41:27.9320115Z at Promise._settlePromise (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:604:18)
2020-03-26T02:41:27.9320871Z at Promise._settlePromise0 (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:649:10)
2020-03-26T02:41:27.9321615Z at Promise._settlePromises (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/promise.js:729:18)
2020-03-26T02:41:27.9322351Z at _drainQueueStep (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:93:12)
2020-03-26T02:41:27.9323084Z at _drainQueue (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:86:9)
2020-03-26T02:41:27.9323835Z at Async._drainQueues (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:102:5)
2020-03-26T02:41:27.9324634Z at Immediate.Async.drainQueues [as _onImmediate] (/home/runner/.cache/Cypress/4.2.0/Cypress/resources/app/packages/server/node_modules/bluebird/js/release/async.js:15:14)
2020-03-26T02:41:27.9325237Z at processImmediate (internal/timers.js:439:21)
2020-03-26T02:41:27.9325788Z [34m+3m[0m
I was able to recreate the issue locally, running against a URL with an underscore in it. Running against the same application code but without an underscore in the URL made the error go away.
Fun investigation ! I think we could benefit of a clearer error message in that case (pre-flight check before starting the browser maybe ?) but at the root, it seems underscores should not be part of url domains (or sub-domains).
Cheers and happy debugging :D !
cc: @jennifer-shehane
@Niceplace The Stackoverflow question and the RFC referenced in it RFC3986#section-3.1 refers to the scheme part of the URL.
So my understanding is that it's perfectly legal for the rest of the URL to can contain an _ as explained in here RFC2181#section-11
So this looks like a bug in Cypress.
@kenjiru I think that's backwards. Domains outside of URLs can include underscores - as the SO answer mentions, "Domains with underscores are very common in the wild. Check _jabber._tcp.gmail.com or _sip._udp.apnic.net.".
However, domains inside URLs cannot include underscores. Notice that the above domains are not meant to be visited via URL, they're for DNS-based service discovery only.
So even though it works in some web browsers, it's technically not valid, so you may wish to update your domains at some point in the future to not include underscores.
I agree that Cypress should be patched to allow underscores in domains though, since the behavior should not differ from the behavior of a real browser.
Is there any fix or workaround found by cypress team? We cannot tell the world to fix their URL's always, there should be fix in cypress.
@niraj-nagtilak1990 We do not recommend testing websites that you do not directly control. https://on.cypress.io/best-practices#Visiting-external-sites
There are no current workarounds.
Most helpful comment
@Niceplace The Stackoverflow question and the RFC referenced in it RFC3986#section-3.1 refers to the
schemepart of the URL.So my understanding is that it's perfectly legal for the rest of the URL to can contain an
_as explained in here RFC2181#section-11So this looks like a bug in Cypress.