Comments (14)
@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.
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.
@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.
- 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.
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 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.
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.js16
which is in end-of-life status. You might like to try updating tocypress-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.
#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.
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.
@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.
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.
Thanks for your explanation!
- Your question would need to go back to the Cypress.io team who provided PR fix: patch new tab creation for firefox 124 and up to fix issue where… #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?
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.
@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.
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)
- Test run summary time is wildly incorrect HOT 1
- Cypress doesn't see e2e.ts files No such file or directory HOT 2
- Cypress blocks my xhr request HOT 7
- Cannot override cy.clock a second time
- After upgrading to 13.7.1, execution in Cypress cloud getting stuck after few spec files , error: This spec does not have any test results because it timed out. HOT 1
- opening tab in test window no longer works - chrome HOT 1
- Support webpack-dev-server v5 in @cypress/webpack-dev-server HOT 5
- Remove support for webpack-dev-server v3 inside @cypress/webpack-dev-server
- Support Angular 18 for Component Testing
- Cypress failing to verify the server is running even when wait-on passes HOT 3
- Specifying specPattern via CLI args doesn't work in component-testing mode
- Cypress is blocking my tests due to human confirmation in any browser HOT 2
- Support Ubuntu 24.04 HOT 3
- cypress cloud filter by shows Jan 1, 1970 - Jan 19, 2038 HOT 1
- Upgrade CircleCI Runner 1.1 variants to 3.0 HOT 1
- If anything but a number is passed as the timeout option on cy.get(), the test never reaches the failure state HOT 4
- cacheAcrossSpecs works in the local test runner UI but fails in the CI/CD pipeline.
- Cypress - Error 400 HOT 4
- My Run is terminating when one testcase is failed HOT 3
- Add an option to ignore preferences files load on browser relaunch HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cypress.