-
Notifications
You must be signed in to change notification settings - Fork 393
Support testing with Firefox in air-gapped environment (Docker) #1348
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
Comments
Breaking change Cypress 13.15.1The requirement for an Internet connection was introduced by [email protected]. For air-gapped users of Cypress Docker images, this was a breaking change. Running the steps to reproduce with the version [email protected], before the migration to geckodriver, succeeds to test with Firefox. Connected to Internet: docker pull cypress/included:13.15.0 then disconnected from Internet: docker run -it --rm -v .:/app -w /app --entrypoint cypress cypress/included:13.15.0 run -b firefox # succeeds |
AssessmentGECKODRIVER_AUTO_INSTALLAccording to geckodriver > README > Installing, the environment variable setting This does not immediately apply to the cypress npm package, because the GECKODRIVER_PATHgeckodriver > README > Options > customGeckoDriverPath lists
Proof of ConceptUsing git clone https://github.com/cypress-io/cypress-docker-images
cd cypress-docker-images
cd examples/basic
cp Dockerfile.browsers Dockerfile.firefox-geckodriver
npm ci Edit RUN wget -O /tmp/geckodriver.tar.gz \
https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-linux64.tar.gz
RUN tar -C /opt -xaf /tmp/geckodriver.tar.gz
RUN rm /tmp/geckodriver.tar.gz
ENV GECKODRIVER_PATH=/opt/geckodriver Execute build command with Internet connection: docker build --progress plain -f Dockerfile.firefox-geckodriver -t test-firefox-geckodriver . Disconnect network and execute: docker run -it --rm --entrypoint bash test-firefox-geckodriver -c "npx cypress run -b firefox" Firefox runs successfully. RecommendationFurther research if installing a geckodriver together with Firefox can be integrated into the Factory build process. |
What would you like?
Give the
cypress/factory
Cypress Docker image, and associated process, the ability to generate other Cypress Docker images that do not require an Internet connection when testing against Firefox.In an air-gapped environment, testing against Firefox:
Allow custom images, built from
cypress/factory
,cypress/base
orcypress/browsers
to test successfully.Allow
cypress/included
images to test successfully out of the box.Why is this needed?
Some users require to test in an air-gapped network (meaning no connection to any external networks or cloud resources).
Since the release [email protected], Cypress consumes the geckodriver to help automate the Firefox browser instead of the cypress-io/marionette-client.
If an attempt is made to run Cypress from a Docker image with Firefox, and there is no Internet connection, then Firefox fails to run, with an error message
Other
A driver package
mozilla/geckodriver
, current release v0.36.0, is sourced on mozilla/geckodriverAn npm wrapper package geckodriver, current release v5.0.0, is sourced on webdriverio-community/node-geckodriver, provides a wrapper to aid in downloading the mozilla/geckodriver
Steps to reproduce
With Internet connection
Disconnect network and attempt to execute, testing against Firefox, which fails trying to download a missing driver:
Logs
The text was updated successfully, but these errors were encountered: