Giter Site home page Giter Site logo

Firefox 124 + Cypress 13.7.1 The browser never connected. Something is wrong. The tests cannot run. Aborting... after first test with multiple tests on CI about cypress HOT 14 CLOSED

akepley0280 avatar akepley0280 commented on June 7, 2024
Firefox 124 + Cypress 13.7.1 The browser never connected. Something is wrong. The tests cannot run. Aborting... after first test with multiple tests on CI

from cypress.

Comments (14)

akepley0280 avatar akepley0280 commented on June 7, 2024 2

@MikeMcC399 I can definitely say we use a specific userAgent in our FF tests as well, making it break for us as well, only when running against CI (only because we only set this in the GH action workflow for the FF run)

'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:107.0) Gecko/20100101 Firefox/107.0'

@gsouf thanks for bringing this up! This was driving me insane

from cypress.

akepley0280 avatar akepley0280 commented on June 7, 2024 2

looking at our history, we can probably just update the userAgent used to 124.0 in the custom config. Our issue appeared to be something around the (X11; Ubuntu; Linux x86_64 that the CI runner uses Ubuntu. I'm going to verify if that works.

from cypress.

gsouf avatar gsouf commented on June 7, 2024 1

@MikeMcC399 May I request you to try again with firefox 124 and cypress 13.7.1 and try to specify a custom user agent in the cypress config file, ie:

module.exports = {

  // ... some config

  e2e: {
        // ... some config
  
        // specify user agent:
          userAgent: 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/114.0'
  }
}

For me it fails with the user agent string, and works when I remove it

from cypress.

MikeMcC399 avatar MikeMcC399 commented on June 7, 2024 1
  • The fix in PR #29179 relies on the user agent string in order to decide whether to do things differently for Firefox 124 and above.

from cypress.

MikeMcC399 avatar MikeMcC399 commented on June 7, 2024 1

@akepley0280

Are you also specifying userAgent in your tests?

Edit:
Define environment variable DEBUG=cypress:config:browser before running tests to find out if the log shows:

userAgent: null,
...
userAgent: { value: null, from: 'default' },

or something non-null.

from cypress.

AtofStryker avatar AtofStryker commented on June 7, 2024 1

@AtofStryker thanks for the details. But knowing that does it make sense to expose the ability to change the user agent? It seems that as long as an user is specifying a UA it's potentially going to break the cypress runtime itself.

For which use case, in the first place, does cypress allow users to configure a custom user agent?

@gsouf Cypress allows the use of custom user agents. You should be able to change the user agent without being impacted. That currently does not work in this case, so we are exploring solutions where we don't rely on the user agent to interpret the version for the fix. Either we can forward the version from the binary, or we can apply the fix more broadly. I should be looking into this shortly!

from cypress.

MikeMcC399 avatar MikeMcC399 commented on June 7, 2024

@akepley0280

I tried to reproduce your issue using the repo https://github.com/cypress-io/cypress-example-kitchensink. The workflow I set up to use Firefox failed with Firefox 124.0 until I updated to Cypress 13.7.1 when it then succeeded, and so unfortunately I was not successful in recreating your problem.

I have a couple of comments which may or may not help:

  • It looks like you have video explicitly enabled, and that does not work for current versions of Firefox (see #18415). I would suggest disabling it, which is the default in Cypress 13.x anyway (see https://docs.cypress.io/guides/references/migration-guide#Video-updates).

  • cypress-io/github-action@v5 is no longer supported, as it relies on Node.js 16 which is in end-of-life status. You might like to try updating to cypress-io/github-action@v6 although I doubt that will make any difference.

  • You also have the error from #29085 in your logs. This is probably irrelevant though.

from cypress.

gsouf avatar gsouf commented on June 7, 2024

#29172 was supposed to fix this issue on cypress 13.7.1. After upgrading to firefox 124 and cypress 13.7.1 I am still experiencing this issue in my local setup and in CI pipelines:

  (Run Starting)

  ┌────────────────────────────────────────────────────────
  │ Cypress:        13.7.1                                                                         │
  │ Browser:        Firefox 124 (headless)                                                         │
  │ Node Version:   v20.10.0 (/usr/local/bin/node)                                                 │

First test passes then second tests fails to connect to the browser:


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

The browser never connected. Something is wrong. The tests cannot run. Aborting...

I'll try to provide a minimal reproducible sample

from cypress.

MikeMcC399 avatar MikeMcC399 commented on June 7, 2024

@gsouf

Your Firefox user agent string is not consistent with Firefox 124.0. It should end with rv:124.0) Gecko/20100101 Firefox/124.0 if you have userAgent specified and you are testing with Firefox 124.0.

from cypress.

gsouf avatar gsouf commented on June 7, 2024

@MikeMcC399 from my expectation the user agent string itself shouldn't change how cypress behaves. We use it to make sure our app will detect that it's an unsupported browser during E2E, and I'm sure that other users will do the same. It's a lot faster than having to manage multiple firefox binaries when all we need is to change the UA string.

I'm not even sure why cypress would allow us to change the UA string if it breaks cypress itself.

Any chance we can expect a more solid support for firefox >124?

from cypress.

MikeMcC399 avatar MikeMcC399 commented on June 7, 2024

@gsouf

Thanks for your explanation!

  • Your question would need to go back to the Cypress.io team who provided PR #29179. The author was @AtofStryker, so perhaps he will be able to comment why the version from the userAgent is being used instead of the version extracted from the Firefox binary, and whether this could be changed to suit also your use-case?

from cypress.

AtofStryker avatar AtofStryker commented on June 7, 2024

@gsouf

Thanks for your explanation!

I opted to use the userAgent in the fix because the fix is within Cypress' Firefox web extension. The extension is responsible for creating/deleting tabs in the Firefox browser, and the most available property to determine the version is the userAgent from that context. AFAIK, we don't have another way to immediately determining the version from within the browser context.

We could likely pass in the binary version detected in the app at time of launch and forward that to the extension request, but that seemed somewhat involved and unnecessary. It can be done, but it would need to be baked into Cypress itself and it likely a lot easier to adapt your UA to include the version in which is being run.

from cypress.

gsouf avatar gsouf commented on June 7, 2024

@AtofStryker thanks for the details. But knowing that does it make sense to expose the ability to change the user agent? It seems that as long as an user is specifying a UA it's potentially going to break the cypress runtime itself.

For which use case, in the first place, does cypress allow users to configure a custom user agent?

from cypress.

cypress-bot avatar cypress-bot commented on June 7, 2024

Released in 13.7.2.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.7.2, please open a new issue.

from cypress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.