Skip to content

Commit 31bc204

Browse files
authored
fix: Geckodriver installation script version string comparison (#1447)
1 parent 12a796a commit 31bc204

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

factory/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ NODE_VERSION="${FACTORY_DEFAULT_NODE_VERSION}"
1818

1919
# Update the FACTORY_VERSION to deploy cypress/factory if you make changes to
2020
# BASE_IMAGE, FACTORY_DEFAULT_NODE_VERSION, YARN_VERSION, factory.Dockerfile or installScripts
21-
FACTORY_VERSION='7.0.1'
21+
FACTORY_VERSION='7.0.2'
2222

2323
# Cypress officially supports the latest 3 major versions of Chrome, Firefox, and Edge only
2424

factory/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change log
22

3+
## 7.0.2
4+
5+
- Fixed Geckodriver installation script logic for Geckodriver versions > `0.99.x`. Addresses [#1444](https://github.com/cypress-io/cypress-docker-images/issues/1444).
6+
37
## 7.0.1
48

59
- Fixed Firefox installation script logic for Firefox versions > `999.x`. Addresses [#1443](https://github.com/cypress-io/cypress-docker-images/issues/1443).

factory/installScripts/geckodriver/install-geckodriver-version.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,15 @@ if (!geckodriverVersion) {
1010

1111
// See https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html for compatibility matrix
1212
// geckodriver < 0.34.0 only supports up to Firefox 120, which is no longer supported by Cypress
13-
const MIN_GECKO = '0.34.0'
14-
15-
if (geckodriverVersion < MIN_GECKO) {
16-
console.log(`geckodriver version ${geckodriverVersion} provided, minimum version ${MIN_GECKO} required, skipping geckodriver install`)
13+
const MINIMUM_GECKO_MAJOR = 0
14+
const MINIMUM_GECKO_MINOR = 34
15+
const geckodriverMajorVersion = geckodriverVersion.split('.').map(Number)[0]
16+
const geckodriverMinorVersion = geckodriverVersion.split('.').map(Number)[1]
17+
18+
if (geckodriverMajorVersion < MINIMUM_GECKO_MAJOR
19+
|| (geckodriverMajorVersion === MINIMUM_GECKO_MAJOR && geckodriverMinorVersion < MINIMUM_GECKO_MINOR)
20+
) {
21+
console.log(`geckodriver version ${geckodriverVersion} provided, minimum version ${MINIMUM_GECKO_MAJOR}.${MINIMUM_GECKO_MINOR}.x required, skipping geckodriver install`)
1722
process.exit(0)
1823
}
1924

0 commit comments

Comments
 (0)