-
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
Cypress tests fail in air-gapped network on Firefox #31036
Comments
The issue is reproducible with Steps to reproducegit clone https://github.com/cypress-io/cypress-docker-images
cd cypress-docker-images cd examples/basic-mini
docker run -it --rm -v .:/app -w /app --entrypoint cypress cypress/included:14.0.2 run -b firefox OR cd examples/basic
npm install [email protected]
docker build . -f Dockerfile.browsers -t test-browsers
docker run -it --rm --entrypoint bash test-browsers -c "npx cypress run -b firefox"
|
https://www.npmjs.com/package/geckodriver found in cypress/packages/server/package.json Line 76 in d1a75e3
attempts to download a driver export const GECKODRIVER_CARGO_YAML = 'https://raw.githubusercontent.com/mozilla/geckodriver/release/Cargo.toml' |
We should be able to preinstall |
I repeated my tests and found that the issue is also reproducible without using a Cypress Docker image, so any fix would be better placed directly in Cypress rather than in a Cypress Docker image. Ubuntu First with connected network: git clone https://github.com/cypress-io/cypress-docker-images
cd cypress-docker-images
cd examples/basic
npm ci
npm install cypress@latest Disconnect network, reboot, then navigate to same directory npx cypress run -b firefox Debug Logs
|
@MikeMcC399 I don't know how feasible this would be because we would need to ship every OS specific version of the driver with each OS specific version of the binary for a not very common use case. I'm suggesting we ship it in the docker container to at least mitigate the inconvenience of downloading the driver for the most likely use case of having an offline system. The tests should still run offline, assuming |
This comment has been minimized.
This comment has been minimized.
I can offer the following comments & suggestions: To allow testing of Firefox with Cypress inside an air-gapped network requires the provisioning of Geckodriver binaries to the air-gapped network. Cypress uses the npm module geckodriver to download the driver for use with Firefox. If a custom Cypress Docker image is built in a network connected to Internet with a RUN npx cypress run -b firefox then the Docker image will include the Geckodriver saved to It should also be possible to use the information Setting a CDN URL for binary download which describes creating a local copy of the Geckodriver CDN and using the environment variable GECKODRIVER_CDNURL=https://INTERNAL_CDN/geckodriver/download As noted in the OP, the Reasons for not adding a cached Geckodriver to Cypress itself were already given in #31036 (comment). Now, after looking at this in detail, I don't feel that there should be any steps added to standard Cypress Docker images to include cached Geckodriver images either, unless there were to be a high demand from multiple users. This is a special case which is better dealt with by individual customization. I have decided against opening a new issue in the cypress-io/cypress-docker-images/issues for this reason. |
If you need more specific advice for using Cypress Docker images to test Firefox in an air-gapped network, I suggest that you open a new issue in https://github.com/cypress-io/cypress-docker-images/issues. It might be helpful to add this as a known issue with a documented workaround. For instance, using |
Current behavior
In an air gapped network, running a component or e2e tests using cypress on Firefox using the
cypress/included
docker image fails with the following error:This is likely a regression introduced in release
13.15.1
which started usinggeckodriver
.Desired behavior
I expect the test to run in an air gapped network. It should not send any request to the internet.
Test code to reproduce
Any test in Firefox in an air-gapped network.
Cypress Version
14.0.2
Node version
v22.13.1
Operating System
Debian bookworm
Debug Logs
Other
I also attempted to override the environment variables supported by geckodriver to use a local path
But it failed
node-fetch
does not supportfile:
.The text was updated successfully, but these errors were encountered: