Repository: nightwatchjs/nightwatch
Pull request #4235 (2024-07-09 10:17:50)

Update ws dependency
Thanks in advance for your contribution. Please follow the below steps in submitting a pull request, as it will help us with reviewing it quicker.

- [ ] Before marking your PR for review, please test and verify your changes by making appropriate modifications to any of the Nightwatch example tests (present in `examples/tests` directory of the project) and running them. `ecosia.js` and `duckDuckGo.js` are good examples to work with.
- [ ] Create a new branch from master (e.g. `features/my-new-feature` or `issue/123-my-bugfix`);
- [ ] If you're fixing a bug also create an issue if one doesn't exist yet;
- [ ] If it's a new feature explain why do you think it's necessary. Please check with the maintainers beforehand to make sure it is something that we will accept. Usually we only accept new features if we feel that they will benefit the entire community;
- [ ] Please avoid sending PRs which contain drastic or low level changes. If you are certain that the changes are needed, please discuss them beforehand and indicate what the impact will be;
- [ ] If your change is based on existing functionality please consider refactoring first. Pull requests that duplicate code will most likely be ignored;
- [ ] Do not include changes that are not related to the issue at hand;
- [ ] Follow the same coding style with regards to spaces, semicolons, variable naming etc.;
- [ ] Always add unit tests - PRs without tests are most of the times ignored.



Patch:
diff --git a/package-lock.json b/package-lock.json
index 631a04f7..7ebbfa93 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "nightwatch",
-  "version": "3.6.3",
+  "version": "3.6.4",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "nightwatch",
-      "version": "3.6.3",
+      "version": "3.6.4",
       "license": "MIT",
       "dependencies": {
         "@nightwatch/chai": "5.0.3",
@@ -28,7 +28,7 @@
         "ejs": "^3.1.10",
         "envinfo": "7.11.0",
         "glob": "7.2.3",
-        "jsdom": "^23.1.0",
+        "jsdom": "^24.1.0",
         "lodash": "^4.17.21",
         "minimatch": "3.1.2",
         "minimist": "1.2.6",
@@ -37,7 +37,7 @@
         "open": "8.4.2",
         "ora": "5.4.1",
         "piscina": "^4.3.1",
-        "selenium-webdriver": "4.21.0",
+        "selenium-webdriver": "4.22.0",
         "semver": "7.5.4",
         "stacktrace-parser": "0.1.10",
         "strip-ansi": "6.0.1",
@@ -1724,9 +1724,9 @@
       }
     },
     "node_modules/agent-base": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
-      "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz",
+      "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==",
       "dependencies": {
         "debug": "^4.3.4"
       },
@@ -4124,9 +4124,9 @@
       "dev": true
     },
     "node_modules/http-proxy-agent": {
-      "version": "7.0.0",
-      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
-      "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
+      "version": "7.0.2",
+      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
+      "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
       "dependencies": {
         "agent-base": "^7.1.0",
         "debug": "^4.3.4"
@@ -4136,9 +4136,9 @@
       }
     },
     "node_modules/https-proxy-agent": {
-      "version": "7.0.2",
-      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
-      "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==",
+      "version": "7.0.5",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz",
+      "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==",
       "dependencies": {
         "agent-base": "^7.0.2",
         "debug": "4"
@@ -4892,30 +4892,30 @@
       }
     },
     "node_modules/jsdom": {
-      "version": "23.1.0",
-      "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.1.0.tgz",
-      "integrity": "sha512-wRscu8dBFxi7O65Cvi0jFRDv0Qa7XEHPix8Qg/vlXHLAMQsRWV1EDeQHBermzXf4Dt7JtFgBLbva3iTcBZDXEQ==",
+      "version": "24.1.0",
+      "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.0.tgz",
+      "integrity": "sha512-6gpM7pRXCwIOKxX47cgOyvyQDN/Eh0f1MeKySBV2xGdKtqJBLj8P25eY3EVCWo2mglDDzozR2r2MW4T+JiNUZA==",
       "dependencies": {
         "cssstyle": "^4.0.1",
         "data-urls": "^5.0.0",
         "decimal.js": "^10.4.3",
         "form-data": "^4.0.0",
         "html-encoding-sniffer": "^4.0.0",
-        "http-proxy-agent": "^7.0.0",
-        "https-proxy-agent": "^7.0.2",
+        "http-proxy-agent": "^7.0.2",
+        "https-proxy-agent": "^7.0.4",
         "is-potential-custom-element-name": "^1.0.1",
-        "nwsapi": "^2.2.7",
+        "nwsapi": "^2.2.10",
         "parse5": "^7.1.2",
-        "rrweb-cssom": "^0.6.0",
+        "rrweb-cssom": "^0.7.0",
         "saxes": "^6.0.0",
         "symbol-tree": "^3.2.4",
-        "tough-cookie": "^4.1.3",
+        "tough-cookie": "^4.1.4",
         "w3c-xmlserializer": "^5.0.0",
         "webidl-conversions": "^7.0.0",
         "whatwg-encoding": "^3.1.1",
         "whatwg-mimetype": "^4.0.0",
         "whatwg-url": "^14.0.0",
-        "ws": "^8.16.0",
+        "ws": "^8.17.0",
         "xml-name-validator": "^5.0.0"
       },
       "engines": {
@@ -4930,27 +4930,10 @@
         }
       }
     },
-    "node_modules/jsdom/node_modules/tough-cookie": {
-      "version": "4.1.3",
-      "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
-      "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
-      "dependencies": {
-        "psl": "^1.1.33",
-        "punycode": "^2.1.1",
-        "universalify": "^0.2.0",
-        "url-parse": "^1.5.3"
-      },
-      "engines": {
-        "node": ">=6"
-      }
-    },
-    "node_modules/jsdom/node_modules/universalify": {
-      "version": "0.2.0",
-      "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
-      "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
-      "engines": {
-        "node": ">= 4.0.0"
-      }
+    "node_modules/jsdom/node_modules/rrweb-cssom": {
+      "version": "0.7.1",
+      "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz",
+      "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg=="
     },
     "node_modules/jsesc": {
       "version": "2.5.2",
@@ -6363,9 +6346,9 @@
       }
     },
     "node_modules/nwsapi": {
-      "version": "2.2.7",
-      "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
-      "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ=="
+      "version": "2.2.10",
+      "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.10.tgz",
+      "integrity": "sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ=="
     },
     "node_modules/nyc": {
       "version": "15.1.0",
@@ -7608,9 +7591,9 @@
       "dev": true
     },
     "node_modules/selenium-webdriver": {
-      "version": "4.21.0",
-      "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.21.0.tgz",
-      "integrity": "sha512-WaEJHZjOWNth1QG5FEpxpREER0qptZBMonFU6GtAqdCNLJVxbtC3E7oS/I/+Q1sf1W032Wg0Ebk+m46lANOXyQ==",
+      "version": "4.22.0",
+      "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.22.0.tgz",
+      "integrity": "sha512-GNbrkCHmy249ai885wgXqTfqL2lZnclUH/P8pwTDIqzyFxU3YhDiN7p/c9tMFA4NhgRdEBO2QCG+CWmG7xr/Mw==",
       "dependencies": {
         "jszip": "^3.10.1",
         "tmp": "^0.2.3",
@@ -8425,6 +8408,28 @@
       "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==",
       "dev": true
     },
+    "node_modules/tough-cookie": {
+      "version": "4.1.4",
+      "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz",
+      "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==",
+      "dependencies": {
+        "psl": "^1.1.33",
+        "punycode": "^2.1.1",
+        "universalify": "^0.2.0",
+        "url-parse": "^1.5.3"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/tough-cookie/node_modules/universalify": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
+      "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==",
+      "engines": {
+        "node": ">= 4.0.0"
+      }
+    },
     "node_modules/tr46": {
       "version": "5.0.0",
       "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
@@ -10336,9 +10341,9 @@
       "dev": true
     },
     "agent-base": {
-      "version": "7.1.0",
-      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz",
-      "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==",
+      "version": "7.1.1",
+      "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz",
+      "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==",
       "requires": {
         "debug": "^4.3.4"
       }
@@ -12078,18 +12083,18 @@
       "dev": true
     },
     "http-proxy-agent": {
-      "version": "7.0.0",
-      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz",
-      "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==",
+      "version": "7.0.2",
+      "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
+      "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
       "requires": {
         "agent-base": "^7.1.0",
         "debug": "^4.3.4"
       }
     },
     "https-proxy-agent": {
-      "version": "7.0.2",
-      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz",
-      "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==",
+      "version": "7.0.5",
+      "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz",
+      "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==",
       "requires": {
         "agent-base": "^7.0.2",
         "debug": "4"
@@ -12608,48 +12613,37 @@
       }
     },
     "jsdom": {
-      "version": "23.1.0",
-      "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-23.1.0.tgz",
-      "integrity": "sha512-wRscu8dBFxi7O65Cvi0jFRDv0Qa7XEHPix8Qg/vlXHLAMQsRWV1EDeQHBermzXf4Dt7JtFgBLbva3iTcBZDXEQ==",
+      "version": "24.1.0",
+      "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.0.tgz",
+      "integrity": "sha512-6gpM7pRXCwIOKxX47cgOyvyQDN/Eh0f1MeKySBV2xGdKtqJBLj8P25eY3EVCWo2mglDDzozR2r2MW4T+JiNUZA==",
       "requires": {
         "cssstyle": "^4.0.1",
         "data-urls": "^5.0.0",
         "decimal.js": "^10.4.3",
         "form-data": "^4.0.0",
         "html-encoding-sniffer": "^4.0.0",
-        "http-proxy-agent": "^7.0.0",
-        "https-proxy-agent": "^7.0.2",
+        "http-proxy-agent": "^7.0.2",
+        "https-proxy-agent": "^7.0.4",
         "is-potential-custom-element-name": "^1.0.1",
-        "nwsapi": "^2.2.7",
+        "nwsapi": "^2.2.10",
         "parse5": "^7.1.2",
-        "rrweb-cssom": "^0.6.0",
+        "rrweb-cssom": "^0.7.0",
         "saxes": "^6.0.0",
         "symbol-tree": "^3.2.4",
-        "tough-cookie": "^4.1.3",
+        "tough-cookie": "^4.1.4",
         "w3c-xmlserializer": "^5.0.0",
         "webidl-conversions": "^7.0.0",
         "whatwg-encoding": "^3.1.1",
         "whatwg-mimetype": "^4.0.0",
         "whatwg-url": "^14.0.0",
-        "ws": "^8.16.0",
+        "ws": "^8.17.0",
         "xml-name-validator": "^5.0.0"
       },
       "dependencies": {
-        "tough-cookie": {
-          "version": "4.1.3",
-          "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
-          "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
-          "requires": {
-            "psl": "^1.1.33",
-            "punycode": "^2.1.1",
-            "universalify": "^0.2.0",
-            "url-parse": "^1.5.3"
-          }
-        },
-        "universalify": {
-          "version": "0.2.0",
-          "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
-          "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg=="
+        "rrweb-cssom": {
+          "version": "0.7.1",
+          "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz",
+          "integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg=="
         }
       }
     },
@@ -13778,9 +13772,9 @@
       }
     },
     "nwsapi": {
-      "version": "2.2.7",
-      "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
-      "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ=="
+      "version": "2.2.10",
+      "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.10.tgz",
+      "integrity": "sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ=="
     },
     "nyc": {
       "version": "15.1.0",
@@ -14721,9 +14715,9 @@
       "dev": true
     },
     "selenium-webdriver": {
-      "version": "4.21.0",
-      "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.21.0.tgz",
-      "integrity": "sha512-WaEJHZjOWNth1QG5FEpxpREER0qptZBMonFU6GtAqdCNLJVxbtC3E7oS/I/+Q1sf1W032Wg0Ebk+m46lANOXyQ==",
+      "version": "4.22.0",
+      "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.22.0.tgz",
+      "integrity": "sha512-GNbrkCHmy249ai885wgXqTfqL2lZnclUH/P8pwTDIqzyFxU3YhDiN7p/c9tMFA4NhgRdEBO2QCG+CWmG7xr/Mw==",
       "requires": {
         "jszip": "^3.10.1",
         "tmp": "^0.2.3",
@@ -15337,6 +15331,24 @@
       "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==",
       "dev": true
     },
+    "tough-cookie": {
+      "version": "4.1.4",
+      "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz",
+      "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==",
+      "requires": {
+        "psl": "^1.1.33",
+        "punycode": "^2.1.1",
+        "universalify": "^0.2.0",
+        "url-parse": "^1.5.3"
+      },
+      "dependencies": {
+        "universalify": {
+          "version": "0.2.0",
+          "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz",
+          "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg=="
+        }
+      }
+    },
     "tr46": {
       "version": "5.0.0",
       "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
diff --git a/package.json b/package.json
index 551f1eca..35df8101 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
 {
   "name": "nightwatch",
   "description": "Easy to use Node.js based end-to-end testing solution for web applications using the W3C WebDriver API.",
-  "version": "3.6.3",
+  "version": "3.6.4",
   "author": "Andrei Rusu",
   "homepage": "https://nightwatchjs.org",
   "main": "./lib/index.js",
@@ -34,7 +34,7 @@
     "ejs": "^3.1.10",
     "envinfo": "7.11.0",
     "glob": "7.2.3",
-    "jsdom": "^23.1.0",
+    "jsdom": "^24.1.0",
     "lodash": "^4.17.21",
     "minimatch": "3.1.2",
     "minimist": "1.2.6",
@@ -43,7 +43,7 @@
     "open": "8.4.2",
     "ora": "5.4.1",
     "piscina": "^4.3.1",
-    "selenium-webdriver": "4.21.0",
+    "selenium-webdriver": "4.22.0",
     "semver": "7.5.4",
     "stacktrace-parser": "0.1.10",
     "strip-ansi": "6.0.1",


Test patch:
diff --git a/examples/tests/selectElement.js b/examples/tests/selectElement.js
index c026cd54..9b42ec12 100644
--- a/examples/tests/selectElement.js
+++ b/examples/tests/selectElement.js
@@ -1,13 +1,18 @@
 const {Select} = require('selenium-webdriver');
 
 module.exports = {
+  before(browser) {
+    browser.url('https://www.selenium.dev/selenium/web/formPage.html');
+  },
+
   async demoTest(browser) {
     const selectElement = browser.element('select[name=selectomatic]');
 
     await browser
-      .url('https://www.selenium.dev/selenium/web/formPage.html')
       .perform(async function() {
-        const select = new Select(selectElement);
+        const selectWebElement = await selectElement; // `Select` class expects a WebElement
+
+        const select = new Select(selectWebElement);
 
         await select.selectByVisibleText('Four');
       })
diff --git a/test/lib/command-mocks.js b/test/lib/command-mocks.js
index 78220abb..f7807689 100644
--- a/test/lib/command-mocks.js
+++ b/test/lib/command-mocks.js
@@ -411,6 +411,7 @@ module.exports = {
     const headlessOpt = headless ? '-headless' : '';
     const options = {
       ['moz:firefoxOptions']: {
+        prefs: {'remote.active-protocols': 3},
         args: [headlessOpt]
       }
     };
diff --git a/test/lib/mocks/mocks-jsonwire.yaml b/test/lib/mocks/mocks-jsonwire.yaml
index f00d294d..a6004f73 100644
--- a/test/lib/mocks/mocks-jsonwire.yaml
+++ b/test/lib/mocks/mocks-jsonwire.yaml
@@ -7,6 +7,9 @@ mocks:
       firstMatch: [{}]
       alwaysMatch:
         browserName: firefox
+        'moz:firefoxOptions':
+          prefs:
+            'remote.active-protocols': 3
   response:
     status: 0
     sessionId: &sessionId '1352110219202'
diff --git a/test/lib/mocks/mocks-w3c.yaml b/test/lib/mocks/mocks-w3c.yaml
index b23cc7c1..77457aa2 100644
--- a/test/lib/mocks/mocks-w3c.yaml
+++ b/test/lib/mocks/mocks-w3c.yaml
@@ -9,6 +9,9 @@ mocks:
       firstMatch: [{}]
       alwaysMatch:
         browserName: firefox
+        'moz:firefoxOptions':
+          prefs:
+            'remote.active-protocols': 3
   response:
     value:
       sessionId: &webdriverSessionId '13521-10219-202'
diff --git a/test/src/core/testCreateSession.js b/test/src/core/testCreateSession.js
index 00d365fe..556dfc74 100644
--- a/test/src/core/testCreateSession.js
+++ b/test/src/core/testCreateSession.js
@@ -164,7 +164,12 @@ describe('test Request With Credentials', function () {
       port: 10195,
       capabilities: {browserName: 'firefox', version: 'TEST', platform: 'TEST'}
     });
-    assert.deepStrictEqual(sessionOptions.get('moz:firefoxOptions'), {args: ['-headless']});
+    assert.deepStrictEqual(sessionOptions.get('moz:firefoxOptions'), {
+      args: ['-headless'],
+      prefs: {
+        'remote.active-protocols': 3
+      }
+    });
   });
 
   it('Test create session with headless mode in Chrome', async function () {
@@ -900,6 +905,11 @@ describe('test Request With Credentials', function () {
             firstMatch: [{}],
             alwaysMatch: {
               browserName: 'firefox',
+              'moz:firefoxOptions': {
+                prefs: {
+                  'remote.active-protocols': 3
+                }
+              },
               'bstack:options': {
                 local: 'false',
                 userName: 'test_user',
@@ -984,6 +994,11 @@ describe('test Request With Credentials', function () {
         firstMatch: [{}],
         alwaysMatch: {
           browserName: 'firefox',
+          'moz:firefoxOptions': {
+            prefs: {
+              'remote.active-protocols': 3
+            }
+          },
           'bstack:options': {
             local: 'false',
             userName: 'test_user',
diff --git a/test/src/index/transport/testFirefoxOptions.js b/test/src/index/transport/testFirefoxOptions.js
index 18c2c0f9..e99159d2 100644
--- a/test/src/index/transport/testFirefoxOptions.js
+++ b/test/src/index/transport/testFirefoxOptions.js
@@ -135,7 +135,8 @@ describe('Firefox driver options', function(){
     assert.ok(options instanceof FirefoxOptions);
     assert.strictEqual(options.get('acceptInsecureCerts'), true);
     assert.deepStrictEqual(options.get('moz:firefoxOptions'), {
-      args: ['--headless']
+      args: ['--headless'],
+      prefs: {'remote.active-protocols': 3}
     });
   });
 
diff --git a/test/src/runner/testRunnerSessionCreate.js b/test/src/runner/testRunnerSessionCreate.js
index b8a886de..cb06d57c 100644
--- a/test/src/runner/testRunnerSessionCreate.js
+++ b/test/src/runner/testRunnerSessionCreate.js
@@ -35,7 +35,11 @@ describe('testRunnerSessionCreate', function () {
       url: '/session',
       statusCode: 500,
       postdata: JSON.stringify({
-        capabilities: {firstMatch: [{}], alwaysMatch: {browserName: 'firefox', 'nightwatch:options': {name: 'test-Name'}}}
+        capabilities: {firstMatch: [{}], alwaysMatch: {
+          browserName: 'firefox',
+          'nightwatch:options': {name: 'test-Name'},
+          'moz:firefoxOptions': {prefs: {'remote.active-protocols': 3}}
+        }}
       }),
       response: JSON.stringify({
         value: {
@@ -49,7 +53,11 @@ describe('testRunnerSessionCreate', function () {
       url: '/session',
       statusCode: 500,
       postdata: JSON.stringify({
-        capabilities: {firstMatch: [{}], alwaysMatch: {browserName: 'firefox', 'nightwatch:options': {name: 'test-Name'}}}
+        capabilities: {firstMatch: [{}], alwaysMatch: {
+          browserName: 'firefox',
+          'nightwatch:options': {name: 'test-Name'},
+          'moz:firefoxOptions': {prefs: {'remote.active-protocols': 3}}
+        }}
       }),
       response: JSON.stringify({
         value: {
@@ -101,7 +109,11 @@ describe('testRunnerSessionCreate', function () {
       url: '/session',
       statusCode: 500,
       postdata: JSON.stringify({
-        capabilities: {firstMatch: [{}], alwaysMatch: {browserName: 'firefox', 'nightwatch:options': {name: 'test-Name'}}}
+        capabilities: {firstMatch: [{}], alwaysMatch: {
+          browserName: 'firefox',
+          'nightwatch:options': {name: 'test-Name'},
+          'moz:firefoxOptions': {prefs: {'remote.active-protocols': 3}}
+        }}
       }),
       response: JSON.stringify({
         value: {
@@ -115,7 +127,11 @@ describe('testRunnerSessionCreate', function () {
       url: '/session',
       statusCode: 500,
       postdata: JSON.stringify({
-        capabilities: {firstMatch: [{}], alwaysMatch: {browserName: 'firefox', 'nightwatch:options': {name: 'test-Name'}}}
+        capabilities: {firstMatch: [{}], alwaysMatch: {
+          browserName: 'firefox',
+          'nightwatch:options': {name: 'test-Name'},
+          'moz:firefoxOptions': {prefs: {'remote.active-protocols': 3}}
+        }}
       }),
       response: JSON.stringify({
         value: {
@@ -170,7 +186,11 @@ describe('testRunnerSessionCreate', function () {
       url: '/session',
       statusCode: 500,
       postdata: JSON.stringify({
-        capabilities: {firstMatch: [{}], alwaysMatch: {browserName: 'firefox', 'nightwatch:options': {name: 'test-Name'}}}
+        capabilities: {firstMatch: [{}], alwaysMatch: {
+          browserName: 'firefox',
+          'nightwatch:options': {name: 'test-Name'},
+          'moz:firefoxOptions': {prefs: {'remote.active-protocols': 3}}
+        }}
       }),
       response: JSON.stringify({
         value: {
@@ -184,7 +204,11 @@ describe('testRunnerSessionCreate', function () {
       url: '/session',
       statusCode: 500,
       postdata: JSON.stringify({
-        capabilities: {firstMatch: [{}], alwaysMatch: {browserName: 'firefox', 'nightwatch:options': {name: 'test-Name'}}}
+        capabilities: {firstMatch: [{}], alwaysMatch: {
+          browserName: 'firefox',
+          'nightwatch:options': {name: 'test-Name'},
+          'moz:firefoxOptions': {prefs: {'remote.active-protocols': 3}}
+        }}
       }),
       response: JSON.stringify({
         value: {