From 66bf74f5b22e433be5344c9403216381be42a5ff Mon Sep 17 00:00:00 2001 From: Bill Glesias Date: Tue, 11 Feb 2025 12:57:28 -0500 Subject: [PATCH] chore: Revert "chore: update wdio dependencies to latest for firefox (#30822)" (#31074) This reverts commit 33eb6c818e159cdc5ecfef4ba7c926fa7eb2d554. --- .circleci/cache-version.txt | 2 +- package.json | 1 + packages/server/lib/browsers/firefox.ts | 3 + packages/server/package.json | 6 +- ....7.0.patch => @wdio+protocols+9.0.0.patch} | 4 +- .../server/patches/@wdio+utils+9.0.0.patch | 31 +++ .../server/patches/@wdio+utils+9.7.3.patch | 40 ---- ...ver+6.1.1.patch => edgedriver+5.6.1.patch} | 12 +- ...er+5.0.0.patch => geckodriver+4.5.1.patch} | 97 ++++++++- packages/server/patches/webdriver+9.0.0.patch | 199 ++++++++++++++++++ yarn.lock | 133 ++++++------ 11 files changed, 401 insertions(+), 127 deletions(-) rename packages/server/patches/{@wdio+protocols+9.7.0.patch => @wdio+protocols+9.0.0.patch} (97%) create mode 100644 packages/server/patches/@wdio+utils+9.0.0.patch delete mode 100644 packages/server/patches/@wdio+utils+9.7.3.patch rename packages/server/patches/{edgedriver+6.1.1.patch => edgedriver+5.6.1.patch} (97%) rename packages/server/patches/{geckodriver+5.0.0.patch => geckodriver+4.5.1.patch} (71%) create mode 100644 packages/server/patches/webdriver+9.0.0.patch diff --git a/.circleci/cache-version.txt b/.circleci/cache-version.txt index 06965ef46473..5088b327d716 100644 --- a/.circleci/cache-version.txt +++ b/.circleci/cache-version.txt @@ -1,3 +1,3 @@ # Bump this version to force CI to re-create the cache from scratch. -2-10-25 +1-17-24 diff --git a/package.json b/package.json index 48dd5bd5b9d4..caae93cfe33c 100644 --- a/package.json +++ b/package.json @@ -271,6 +271,7 @@ "resolutions": { "**/@types/cheerio": "0.22.21", "**/@types/enzyme": "3.10.5", + "**/@wdio/logger": "9.0.0", "**/jquery": "3.7.1", "**/pretty-format": "26.4.0", "**/sharp": "0.29.3", diff --git a/packages/server/lib/browsers/firefox.ts b/packages/server/lib/browsers/firefox.ts index 2c6c42f57db3..d493409f4321 100644 --- a/packages/server/lib/browsers/firefox.ts +++ b/packages/server/lib/browsers/firefox.ts @@ -635,6 +635,9 @@ export async function open (browser: Browser, url: string, options: BrowserLaunc }, // @see https://firefox-source-docs.mozilla.org/testing/geckodriver/Capabilities.html#moz-debuggeraddress // we specify the debugger address option for Webdriver, which will return us the CDP address when the capability is returned. + // NOTE: this typing is fixed in @wdio/types 9.1.0 https://github.com/webdriverio/webdriverio/commit/ed14717ac4269536f9e7906e4d1612f74650b09b + // Once we have a node engine that can support the package (i.e., electron 32+ update) we can update the package + // @ts-expect-error 'moz:debuggerAddress': true, // @see https://webdriver.io/docs/capabilities/#wdiogeckodriveroptions // webdriver starts geckodriver with the correct options on behalf of Cypress diff --git a/packages/server/package.json b/packages/server/package.json index dabe75afbb0a..e9dcf86f1f67 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -64,7 +64,7 @@ "debug": "^4.3.4", "dirt-simple-file-cache": "^0.4.0", "duplexify": "4.1.3", - "edgedriver": "6.1.1", + "edgedriver": "5.6.1", "electron-context-menu": "3.6.1", "errorhandler": "1.5.1", "evil-dns": "0.2.0", @@ -75,7 +75,7 @@ "firefox-profile": "4.7.0", "fluent-ffmpeg": "2.1.2", "fs-extra": "9.1.0", - "geckodriver": "5.0.0", + "geckodriver": "4.5.1", "get-port": "5.1.1", "getos": "3.2.1", "glob": "7.1.3", @@ -133,7 +133,7 @@ "url-parse": "1.5.10", "uuid": "8.3.2", "wait-port": "1.1.0", - "webdriver": "9.7.3", + "webdriver": "9.0.0", "webpack-virtual-modules": "0.5.0", "widest-line": "3.1.0" }, diff --git a/packages/server/patches/@wdio+protocols+9.7.0.patch b/packages/server/patches/@wdio+protocols+9.0.0.patch similarity index 97% rename from packages/server/patches/@wdio+protocols+9.7.0.patch rename to packages/server/patches/@wdio+protocols+9.0.0.patch index d0b00d5de815..f07bd7459da8 100644 --- a/packages/server/patches/@wdio+protocols+9.7.0.patch +++ b/packages/server/patches/@wdio+protocols+9.0.0.patch @@ -60,10 +60,10 @@ index eea42bf..0000000 - -For more information on WebdriverIO see the [homepage](https://webdriver.io). diff --git a/node_modules/@wdio/protocols/build/index.js b/node_modules/@wdio/protocols/build/index.js -index b33b8bd..0f7da3a 100644 +index 05e55cc..9ea546e 100644 --- a/node_modules/@wdio/protocols/build/index.js +++ b/node_modules/@wdio/protocols/build/index.js -@@ -5166,9 +5166,11 @@ var gecko_default = { +@@ -5165,9 +5165,11 @@ var gecko_default = { ], parameters: [ { diff --git a/packages/server/patches/@wdio+utils+9.0.0.patch b/packages/server/patches/@wdio+utils+9.0.0.patch new file mode 100644 index 000000000000..9e1f8eac9b56 --- /dev/null +++ b/packages/server/patches/@wdio+utils+9.0.0.patch @@ -0,0 +1,31 @@ +diff --git a/node_modules/@wdio/utils/README.md b/node_modules/@wdio/utils/README.md +deleted file mode 100644 +index 3e8048a..0000000 +--- a/node_modules/@wdio/utils/README.md ++++ /dev/null +@@ -1,4 +0,0 @@ +-WDIO Repl +-========= +- +-> A WDIO helper utility to provide a repl interface WebdriverIO +diff --git a/node_modules/@wdio/utils/build/index.js b/node_modules/@wdio/utils/build/index.js +index 1540cb6..07bd02e 100644 +--- a/node_modules/@wdio/utils/build/index.js ++++ b/node_modules/@wdio/utils/build/index.js +@@ -571,6 +571,7 @@ import cp2 from "node:child_process"; + import getPort from "get-port"; + import waitPort from "wait-port"; + import logger3 from "@wdio/logger"; ++import debugModule from 'debug' + import split2 from "split2"; + import { deepmerge } from "deepmerge-ts"; + import { start as startSafaridriver } from "safaridriver"; +@@ -681,6 +682,8 @@ var init_startWebDriver = __esm({ + init_utils(); + init_constants(); + log2 = logger3("@wdio/utils"); ++ // wrap in cypress debugger statement to avoid extraneous messages to the console ++ log2.setLevel(debugModule.enabled('cypress-verbose:server:browsers:webdriver') ? 'info' : 'silent') + DRIVER_WAIT_TIMEOUT = 10 * 1e3; + } + }); diff --git a/packages/server/patches/@wdio+utils+9.7.3.patch b/packages/server/patches/@wdio+utils+9.7.3.patch deleted file mode 100644 index 49e9db3439d5..000000000000 --- a/packages/server/patches/@wdio+utils+9.7.3.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/node_modules/@wdio/utils/README.md b/node_modules/@wdio/utils/README.md -deleted file mode 100644 -index 3e8048a..0000000 ---- a/node_modules/@wdio/utils/README.md -+++ /dev/null -@@ -1,4 +0,0 @@ --WDIO Repl --========= -- --> A WDIO helper utility to provide a repl interface WebdriverIO -diff --git a/node_modules/@wdio/utils/build/node.js b/node_modules/@wdio/utils/build/node.js -index 9c003aa..53cc9d7 100644 ---- a/node_modules/@wdio/utils/build/node.js -+++ b/node_modules/@wdio/utils/build/node.js -@@ -5,6 +5,7 @@ import cp2 from "node:child_process"; - import getPort from "get-port"; - import waitPort from "wait-port"; - import logger2 from "@wdio/logger"; -+import debugModule from 'debug'; - import split2 from "split2"; - import { deepmerge } from "deepmerge-ts"; - import { start as startSafaridriver } from "safaridriver"; -@@ -32,6 +33,8 @@ import { download as downloadGeckodriver } from "geckodriver"; - import { download as downloadEdgedriver } from "edgedriver"; - import { locateChrome, locateFirefox, locateApp } from "locate-app"; - var log = logger("webdriver"); -+// wrap in cypress debugger statement to avoid extraneous messages to the console -+log.setLevel(debugModule.enabled('cypress-verbose:server:browsers:webdriver') ? 'info' : 'silent') - var EXCLUDED_PARAMS = ["version", "help"]; - var canAccess = (file) => { - if (!file) { -@@ -283,6 +286,8 @@ function isEdge(browserName) { - - // src/node/startWebDriver.ts - var log2 = logger2("@wdio/utils"); -+// wrap in cypress debugger statement to avoid extraneous messages to the console -+log2.setLevel(debugModule.enabled('cypress-verbose:server:browsers:webdriver') ? 'info' : 'silent') - var DRIVER_WAIT_TIMEOUT = 10 * 1e3; - async function startWebDriver(options) { - if (process.env.WDIO_SKIP_DRIVER_SETUP) { diff --git a/packages/server/patches/edgedriver+6.1.1.patch b/packages/server/patches/edgedriver+5.6.1.patch similarity index 97% rename from packages/server/patches/edgedriver+6.1.1.patch rename to packages/server/patches/edgedriver+5.6.1.patch index b030c8427715..ec35c3a94c95 100644 --- a/packages/server/patches/edgedriver+6.1.1.patch +++ b/packages/server/patches/edgedriver+5.6.1.patch @@ -1,9 +1,9 @@ diff --git a/node_modules/edgedriver/README.md b/node_modules/edgedriver/README.md deleted file mode 100644 -index 112cae9..0000000 +index 3b361a7..0000000 --- a/node_modules/edgedriver/README.md +++ /dev/null -@@ -1,222 +0,0 @@ +@@ -1,218 +0,0 @@ -EdgeDriver [![CI](https://github.com/webdriverio-community/node-edgedriver/actions/workflows/ci.yml/badge.svg)](https://github.com/webdriverio-community/node-edgedriver/actions/workflows/ci.yml) [![Audit](https://github.com/webdriverio-community/node-edgedriver/actions/workflows/audit.yml/badge.svg)](https://github.com/webdriverio-community/node-edgedriver/actions/workflows/audit.yml) -========== - @@ -37,10 +37,6 @@ index 112cae9..0000000 -Microsoft Edge WebDriver 105.0.1343.33 (4122bb4646b33f33bca5d269490b9caadfc452b2) -``` - --# Setting a PROXY URL -- --Use `HTTPS_PROXY` or `HTTP_PROXY` to set your proxy URL. -- -# Programmatic Interface - -You can import this package with Node.js and start the driver as part of your script and use it e.g. with [WebdriverIO](https://webdriver.io). @@ -227,10 +223,10 @@ index 112cae9..0000000 - -For more information on WebdriverIO see the [homepage](https://webdriver.io). diff --git a/node_modules/edgedriver/dist/install.js b/node_modules/edgedriver/dist/install.js -index c02351f..e1c4c71 100644 +index 99730a0..30e63c0 100644 --- a/node_modules/edgedriver/dist/install.js +++ b/node_modules/edgedriver/dist/install.js -@@ -215,6 +215,9 @@ function sanitizeVersion(version) { +@@ -205,6 +205,9 @@ function sanitizeVersion(version) { * download on install */ if (process.argv[1] && process.argv[1].endsWith('/dist/install.js') && Boolean(process.env.EDGEDRIVER_AUTO_INSTALL)) { diff --git a/packages/server/patches/geckodriver+5.0.0.patch b/packages/server/patches/geckodriver+4.5.1.patch similarity index 71% rename from packages/server/patches/geckodriver+5.0.0.patch rename to packages/server/patches/geckodriver+4.5.1.patch index 2cd54b55bca0..f8c6b8cd0132 100644 --- a/packages/server/patches/geckodriver+5.0.0.patch +++ b/packages/server/patches/geckodriver+4.5.1.patch @@ -1,3 +1,9 @@ +diff --git a/node_modules/geckodriver/AUTHORS b/node_modules/geckodriver/AUTHORS +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/LICENSE b/node_modules/geckodriver/LICENSE +old mode 100644 +new mode 100755 diff --git a/node_modules/geckodriver/README.md b/node_modules/geckodriver/README.md deleted file mode 100644 index 95e3ef0..0000000 @@ -243,14 +249,58 @@ index 95e3ef0..0000000 ---- - -For more information on WebdriverIO see the [homepage](https://webdriver.io). +diff --git a/node_modules/geckodriver/dist/cjs/index.d.ts b/node_modules/geckodriver/dist/cjs/index.d.ts +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/cjs/index.d.ts.map b/node_modules/geckodriver/dist/cjs/index.d.ts.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/cjs/index.js b/node_modules/geckodriver/dist/cjs/index.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/cjs/index.js.map b/node_modules/geckodriver/dist/cjs/index.js.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/cli.d.ts b/node_modules/geckodriver/dist/cli.d.ts +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/cli.d.ts.map b/node_modules/geckodriver/dist/cli.d.ts.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/cli.js b/node_modules/geckodriver/dist/cli.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/cli.js.map b/node_modules/geckodriver/dist/cli.js.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/constants.d.ts b/node_modules/geckodriver/dist/constants.d.ts +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/constants.d.ts.map b/node_modules/geckodriver/dist/constants.d.ts.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/constants.js b/node_modules/geckodriver/dist/constants.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/constants.js.map b/node_modules/geckodriver/dist/constants.js.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/index.d.ts b/node_modules/geckodriver/dist/index.d.ts +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/index.d.ts.map b/node_modules/geckodriver/dist/index.d.ts.map +old mode 100644 +new mode 100755 diff --git a/node_modules/geckodriver/dist/index.js b/node_modules/geckodriver/dist/index.js -index 2edc6d2..a24617e 100644 +old mode 100644 +new mode 100755 +index 2edc6d2..d0b456e --- a/node_modules/geckodriver/dist/index.js +++ b/node_modules/geckodriver/dist/index.js @@ -1,10 +1,14 @@ import cp from 'node:child_process'; import logger from '@wdio/logger'; -+import debugModule from 'debug'; ++import debugModule from 'debug' import { download as downloadDriver } from './install.js'; import { hasAccess, parseParams } from './utils.js'; import { DEFAULT_HOSTNAME } from './constants.js'; @@ -262,8 +312,19 @@ index 2edc6d2..a24617e 100644 const { cacheDir, customGeckoDriverPath, spawnOpts, ...startArgs } = params; let geckoDriverPath = (customGeckoDriverPath || process.env.GECKODRIVER_PATH || +diff --git a/node_modules/geckodriver/dist/index.js.map b/node_modules/geckodriver/dist/index.js.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/install.d.ts b/node_modules/geckodriver/dist/install.d.ts +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/install.d.ts.map b/node_modules/geckodriver/dist/install.d.ts.map +old mode 100644 +new mode 100755 diff --git a/node_modules/geckodriver/dist/install.js b/node_modules/geckodriver/dist/install.js -index c27c805..ac53518 100644 +old mode 100644 +new mode 100755 +index c27c805..ac53518 --- a/node_modules/geckodriver/dist/install.js +++ b/node_modules/geckodriver/dist/install.js @@ -70,6 +70,8 @@ async function downloadZip(res, cacheDir) { @@ -277,3 +338,33 @@ index c27c805..ac53518 100644 } //# sourceMappingURL=install.js.map \ No newline at end of file +diff --git a/node_modules/geckodriver/dist/install.js.map b/node_modules/geckodriver/dist/install.js.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/types.d.ts b/node_modules/geckodriver/dist/types.d.ts +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/types.d.ts.map b/node_modules/geckodriver/dist/types.d.ts.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/types.js b/node_modules/geckodriver/dist/types.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/types.js.map b/node_modules/geckodriver/dist/types.js.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/utils.d.ts b/node_modules/geckodriver/dist/utils.d.ts +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/utils.d.ts.map b/node_modules/geckodriver/dist/utils.d.ts.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/utils.js b/node_modules/geckodriver/dist/utils.js +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/dist/utils.js.map b/node_modules/geckodriver/dist/utils.js.map +old mode 100644 +new mode 100755 +diff --git a/node_modules/geckodriver/tsconfig.tsbuildinfo b/node_modules/geckodriver/tsconfig.tsbuildinfo +old mode 100644 +new mode 100755 diff --git a/packages/server/patches/webdriver+9.0.0.patch b/packages/server/patches/webdriver+9.0.0.patch new file mode 100644 index 000000000000..658561f221b4 --- /dev/null +++ b/packages/server/patches/webdriver+9.0.0.patch @@ -0,0 +1,199 @@ +diff --git a/node_modules/webdriver/README.md b/node_modules/webdriver/README.md +deleted file mode 100644 +index c3ed38d..0000000 +--- a/node_modules/webdriver/README.md ++++ /dev/null +@@ -1,170 +0,0 @@ +-WebDriver +-========= +- +-> A lightweight, non-opinionated implementation of the [WebDriver](https://w3c.github.io/webdriver/webdriver-spec.html) and [WebDriver BiDi](https://w3c.github.io/webdriver-bidi/) specification including mobile commands supported by [Appium](http://appium.io/) +- +-There are [tons](https://github.com/christian-bromann/awesome-selenium#javascript) of Selenium and WebDriver binding implementations in the Node.js world. Every one of them has an opinionated API and recommended way to use it. This binding is the most non-opinionated you will find as it just represents the [WebDriver specification](https://w3c.github.io/webdriver/webdriver-spec.html) and doesn't come with any extra or higher-level abstraction. It is lightweight and comes with support for the [WebDriver specification](https://w3c.github.io/webdriver/webdriver-spec.html) and Appium's [Mobile JSONWire Protocol](https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md). +- +-The package supports the following protocols: +- +-- [WebDriver](https://w3c.github.io/webdriver/) +-- [WebDriver Bidi](https://w3c.github.io/webdriver-bidi/) +-- [Appium](http://appium.io/) +-- [Chromium](http://chromedriver.chromium.org/) (additional Chromedriver specific commands) +-- [Selenium](https://www.selenium.dev/) (additional Selenium WebDriver specific commands) +-- [Sauce Labs](https://saucelabs.com/) (Sauce Labs specific WebDriver extensions) +-- [JSONWireProtocol](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol) (depcrecated) +-- [Mobile JSONWireProtocol](https://github.com/SeleniumHQ/mobile-spec/blob/master/spec-draft.md) (depcrecated) +- +-Commands are added to the client's protocol based on assumptions of provided capabilities. You can find more details about the commands by checking out the [`@wdio/protocols`](https://www.npmjs.com/package/@wdio/protocols) package. All commands come with TypeScript support. +- +-## Install +- +-To install this package from NPM run: +- +-```sh +-npm i webdriver +-``` +- +-## WebDriver Example +- +-The following example demonstrates a simple Google Search scenario: +- +-```js +-import WebDriver from 'webdriver'; +- +-const client = await WebDriver.newSession({ +- path: '/', +- capabilities: { browserName: 'firefox' } +-}) +- +-await client.navigateTo('https://www.google.com/ncr') +- +-const searchInput = await client.findElement('css selector', '#lst-ib') +-await client.elementSendKeys(searchInput['element-6066-11e4-a52e-4f735466cecf'], 'WebDriver') +- +-const searchBtn = await client.findElement('css selector', 'input[value="Google Search"]') +-await client.elementClick(searchBtn['element-6066-11e4-a52e-4f735466cecf']) +- +-console.log(await client.getTitle()) // outputs "WebDriver - Google Search" +- +-await client.deleteSession() +-``` +- +-## WebDriver Bidi Example +- +-To connect to the WebDriver Bidi protocol you have to send along a `webSocketUrl` flag to tell the browser driver to opt-in to the protocol: +- +-```js +-import WebDriver from 'webdriver' +- +-const browser = await WebDriver.newSession({ +- capabilities: { +- webSocketUrl: true, +- browserName: 'firefox' +- } +-}) +- +-await browser.sessionSubscribe({ events: ['log.entryAdded'] }) +- +-/** +- * returns: {"type":"console","method":"log","realm":null,"args":[{"type":"string","value":"Hello Bidi"}],"level":"info","text":"Hello Bidi","timestamp":1657282076037} +- */ +-browser.on('log.entryAdded', (entryAdded) => console.log('received %s', entryAdded)) +- +-await browser.executeScript('console.log("Hello Bidi")', []) +-await browser.deleteSession() +-``` +- +-# Configuration +- +-To create a WebDriver session call the `newSession` method on the `WebDriver` class and pass in your configurations: +- +-```js +-import WebDriver from 'webdriver' +-const client = await WebDriver.newSession(options) +-``` +- +-The following options are available: +- +-### capabilities +-Defines the [capabilities](https://w3c.github.io/webdriver/webdriver-spec.html#capabilities) you want to run in your WebDriver session. Note: by default, it will automatically set the `webSocketUrl` to establish a [WebDriver Bidi](https://w3c.github.io/webdriver-bidi/) session, if you don't want this, make sure to set `'wdio:enforceWebDriverClassic': true` in your capabilities. +- +-Type: `Object`
+-Required: `true` +- +-### logLevel +-Level of logging verbosity. +- +-Type: `String`
+-Default: *info*
+-Options: *trace* | *debug* | *info* | *warn* | *error* | *silent* +- +-### protocol +-Protocol to use when communicating with the Selenium standalone server (or driver). +- +-Type: `String`
+-Default: *http* +-Options: *http* | *https* +- +-### hostname +-Host of your WebDriver server. +- +-Type: `String`
+-Default: *localhost* +- +-### port +-Port your WebDriver server is on. +- +-Type: `Number`
+-Default: `undefined` +- +-### path +-Path to WebDriver endpoint or grid server. +- +-Type: `String`
+-Default: */* +- +-### queryParams +-Query parameters that are propagated to the driver server. +- +-Type: `Object` +-Default: `undefined` +- +-### connectionRetryTimeout +-Timeout for any WebDriver request to a driver or grid. +- +-Type: `Number`
+-Default: *120000* +- +-### connectionRetryCount +-Count of request retries to the Selenium server. +- +-Type: `Number`
+-Default: *3* +- +-### agent +- +-Allows you to use a custom` http`/`https`/`http2` [agent](https://www.npmjs.com/package/got#agent) to make requests. +- +-Type: `Object`
+-Default: +- +-```js +-{ +- http: new http.Agent({ keepAlive: true }), +- https: new https.Agent({ keepAlive: true }) +-} +-``` +- +-### transformRequest +-Function intercepting [HTTP request options](https://github.com/sindresorhus/got#options) before a WebDriver request is made to a driver. +- +-Type: `(RequestOptions) => RequestOptions`
+-Default: *none* +- +-### transformResponse +-Function intercepting HTTP response objects after a WebDriver response has arrived. +- +-Type: `(Response, RequestOptions) => Response`
+-Default: *none* +diff --git a/node_modules/webdriver/build/index.js b/node_modules/webdriver/build/index.js +index 3be438a..ecad188 100644 +--- a/node_modules/webdriver/build/index.js ++++ b/node_modules/webdriver/build/index.js +@@ -41,6 +41,10 @@ import { CAPABILITY_KEYS } from "@wdio/protocols"; + // src/bidi/core.ts + import logger from "@wdio/logger"; + ++// removing the await here as packherd cannot bundle with a top-level await. ++// Since we are using the package in a node context, we can just import 'ws' ++import socket_default from 'ws' ++ + // src/bidi/socket.ts + var BrowserSocket = class { + #callbacks = /* @__PURE__ */ new Set(); +@@ -78,7 +82,6 @@ var BrowserSocket = class { + this.#ws.close(); + } + }; +-var socket_default = globalThis.window ? BrowserSocket : (await import("ws")).default; + + // src/bidi/core.ts + var log = logger("webdriver"); diff --git a/yarn.lock b/yarn.lock index f1e0b436f127..1e8e9a1aa487 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9233,56 +9233,57 @@ dependencies: vue-demi "*" -"@wdio/config@9.7.3": - version "9.7.3" - resolved "https://registry.npmjs.org/@wdio/config/-/config-9.7.3.tgz#fb612cdee5acba250f536f90d25bc4e2910080e8" - integrity sha512-rWiGR0WMcUpGTTMn3XP9OzNW3WH64AcNK93b9kSwq9WzVGVIzMBCZK8LPXpdQ+pFwizq/ExIXTx/Z39kc0LCyw== - dependencies: - "@wdio/logger" "9.4.4" - "@wdio/types" "9.6.3" - "@wdio/utils" "9.7.3" +"@wdio/config@9.0.0": + version "9.0.0" + resolved "https://registry.npmjs.org/@wdio/config/-/config-9.0.0.tgz#4022e996928e3f1b29436c1a3a446a464c319a39" + integrity sha512-OeRSEO3fTDMeKcGWoS39YO5lrMNT8qn+/E7ZcsG6NAbXu2o0ZfLDgDh1Guhe/a8s3LKc6dck5GxgFEuAylwlAw== + dependencies: + "@wdio/logger" "9.0.0" + "@wdio/types" "9.0.0" + "@wdio/utils" "9.0.0" + decamelize "^6.0.0" deepmerge-ts "^7.0.3" glob "^10.2.2" import-meta-resolve "^4.0.0" -"@wdio/logger@9.4.4", "@wdio/logger@^9.1.3": - version "9.4.4" - resolved "https://registry.npmjs.org/@wdio/logger/-/logger-9.4.4.tgz#e4851256a076e2b9401f45caaa7a34d6f0278d4a" - integrity sha512-BXx8RXFUW2M4dcO6t5Le95Hi2ZkTQBRsvBQqLekT2rZ6Xmw8ZKZBPf0FptnoftFGg6dYmwnDidYv/0+4PiHjpQ== +"@wdio/logger@9.0.0", "@wdio/logger@^8.38.0", "@wdio/logger@^9.0.0": + version "9.0.0" + resolved "https://registry.npmjs.org/@wdio/logger/-/logger-9.0.0.tgz#f13ebacfce2903f31b8c6894bb152407de3cba79" + integrity sha512-DmmkVjxcCFUCFJVymca4/gQF4uTtevG4AF+jCzPUA4NByTnyjVtg8x83K0sG3/YX5SOxgc+JUhSdH8g5wceWSA== dependencies: chalk "^5.1.2" loglevel "^1.6.0" loglevel-plugin-prefix "^0.8.4" strip-ansi "^7.1.0" -"@wdio/protocols@9.7.0": - version "9.7.0" - resolved "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.7.0.tgz#2f2c0a7e371d65305e0d64980f63caa98ba5a4de" - integrity sha512-5DI8cqJqT9K6oQn8UpaSTmcGAl4ufkUWC5FoPT3oXdLjILfxvweZDf/2XNBCbGMk4+VOMKqB2ofOqKhDIB2nAg== +"@wdio/protocols@9.0.0": + version "9.0.0" + resolved "https://registry.npmjs.org/@wdio/protocols/-/protocols-9.0.0.tgz#bda1a6c02770711f5cf429b800da0af991b117e1" + integrity sha512-qM+TwCvFjmomX8oi0Ns8LXfG5dvXiqQKLaJt9Nj+JXxczSh6XsLnFTLQAcG9ynnU7uz2v1TqM11M5enj74WEAA== -"@wdio/types@9.6.3": - version "9.6.3" - resolved "https://registry.npmjs.org/@wdio/types/-/types-9.6.3.tgz#2fbbb5fcdec32f9d9953ee9d73c659052c0fb6b1" - integrity sha512-K3Lu7K5g5bsUcQV6/95XaS3jMwcGUn2pDdryYibKZafklhHjVt3o/xnw6Vgd/JzoSneCKHdwj941n+yDpTJHAw== +"@wdio/types@9.0.0": + version "9.0.0" + resolved "https://registry.npmjs.org/@wdio/types/-/types-9.0.0.tgz#0bc2e3dcc3a718a9042779ecbf953f30882a9bc8" + integrity sha512-XDqIjNCw2ftWKXWn8vTqqZAMtjSxwJwO8IAEQczgRB0fUCvvipkeT3ZobT5Z4Mo5uvLLTaOqJxb4nwPXOfVt/A== dependencies: "@types/node" "^20.1.0" -"@wdio/utils@9.7.3": - version "9.7.3" - resolved "https://registry.npmjs.org/@wdio/utils/-/utils-9.7.3.tgz#9b1d59e3cfb8e14cb541d28a0f790fee0e2e32aa" - integrity sha512-gScYudyuq/aOmiPTz7vTvEhWtmiUMdrrzkOSQqGCQk0AMy7WpAzKM19NESPe9iPTN96i11jLJnpLOXwm2j+6LQ== +"@wdio/utils@9.0.0": + version "9.0.0" + resolved "https://registry.npmjs.org/@wdio/utils/-/utils-9.0.0.tgz#4613dcd01944165a5c6004bb557ef20a51acde5b" + integrity sha512-MGtMGHf/rbMChD/qtPLpnZuF685W5gBnMhP5b8hNzB+riDJIFbl/e41Jqhf4scrkpXHtjBM8kdvXZEI6SW3AuA== dependencies: "@puppeteer/browsers" "^2.2.0" - "@wdio/logger" "9.4.4" - "@wdio/types" "9.6.3" + "@wdio/logger" "9.0.0" + "@wdio/types" "9.0.0" decamelize "^6.0.0" deepmerge-ts "^7.0.3" - edgedriver "^6.1.1" - geckodriver "^5.0.0" + edgedriver "^5.6.1" + geckodriver "^4.3.3" get-port "^7.0.0" import-meta-resolve "^4.0.0" locate-app "^2.2.24" - safaridriver "^1.0.0" + safaridriver "^0.1.2" split2 "^4.2.0" wait-port "^1.1.0" @@ -9721,10 +9722,10 @@ resolved "https://registry.yarnpkg.com/@zeit/schemas/-/schemas-2.36.0.tgz#7a1b53f4091e18d0b404873ea3e3c83589c765f2" integrity sha512-7kjMwcChYEzMKjeex9ZFXkt1AyNov9R5HZtjBKVsmVpw7pa7ZtlCGvCBC2vnnXctaYN+aRI61HjIqeetZW5ROg== -"@zip.js/zip.js@^2.7.53": - version "2.7.54" - resolved "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.54.tgz#ef0f46644b1a084155473b0d7710c80a892c2687" - integrity sha512-qMrJVg2hoEsZJjMJez9yI2+nZlBUxgYzGV3mqcb2B/6T1ihXp0fWBDYlVHlHquuorgNUQP5a8qSmX6HF5rFJNg== +"@zip.js/zip.js@^2.7.48": + version "2.7.52" + resolved "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.7.52.tgz#bc11de93b41f09e03155bc178e7f9c2e2612671d" + integrity sha512-+5g7FQswvrCHwYKNMd/KFxZSObctLSsQOgqBSi0LzwHo3li9Eh1w5cF5ndjQw9Zbr3ajVnd2+XyiX85gAetx1Q== "@zkochan/js-yaml@0.0.7": version "0.0.7" @@ -14863,20 +14864,18 @@ edge-paths@^3.0.5: "@types/which" "^2.0.1" which "^2.0.2" -edgedriver@6.1.1, edgedriver@^6.1.1: - version "6.1.1" - resolved "https://registry.npmjs.org/edgedriver/-/edgedriver-6.1.1.tgz#9374160a0aa1bab48d3ed21dc7af8f6fe2c3103f" - integrity sha512-/dM/PoBf22Xg3yypMWkmRQrBKEnSyNaZ7wHGCT9+qqT14izwtFT+QvdR89rjNkMfXwW+bSFoqOfbcvM+2Cyc7w== +edgedriver@5.6.1, edgedriver@^5.6.1: + version "5.6.1" + resolved "https://registry.npmjs.org/edgedriver/-/edgedriver-5.6.1.tgz#36971f000aee8756c11f3fb1dc5273f109e860d5" + integrity sha512-3Ve9cd5ziLByUdigw6zovVeWJjVs8QHVmqOB0sJ0WNeVPcwf4p18GnxMmVvlFmYRloUwf5suNuorea4QzwBIOA== dependencies: - "@wdio/logger" "^9.1.3" - "@zip.js/zip.js" "^2.7.53" + "@wdio/logger" "^8.38.0" + "@zip.js/zip.js" "^2.7.48" decamelize "^6.0.0" edge-paths "^3.0.5" - fast-xml-parser "^4.5.0" - http-proxy-agent "^7.0.2" - https-proxy-agent "^7.0.5" + fast-xml-parser "^4.4.1" node-fetch "^3.3.2" - which "^5.0.0" + which "^4.0.0" editorconfig@^1.0.4: version "1.0.4" @@ -16673,7 +16672,7 @@ fast-xml-parser@4.2.5: dependencies: strnum "^1.0.5" -fast-xml-parser@^4.5.0, fast-xml-parser@^4.5.1: +fast-xml-parser@^4.4.1, fast-xml-parser@^4.5.1: version "4.5.1" resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.5.1.tgz#a7e665ff79b7919100a5202f23984b6150f9b31e" integrity sha512-y655CeyUQ+jj7KBbYMc4FG01V8ZQqjN+gDYGJ50RtfsUB8iG9AmwmwoAgeKLJdmueKKMrH1RJ7yXHTSoczdv5w== @@ -17534,19 +17533,19 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -geckodriver@5.0.0, geckodriver@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/geckodriver/-/geckodriver-5.0.0.tgz#88437f3812075988bb05b5e19dc4aaa42d200577" - integrity sha512-vn7TtQ3b9VMJtVXsyWtQQl1fyBVFhQy7UvJF96kPuuJ0or5THH496AD3eUyaDD11+EqCxH9t6V+EP9soZQk4YQ== +geckodriver@4.5.1, geckodriver@^4.3.3: + version "4.5.1" + resolved "https://registry.npmjs.org/geckodriver/-/geckodriver-4.5.1.tgz#624fc01815c1aa498dd3f717f7bd4c6cca0c57b8" + integrity sha512-lGCRqPMuzbRNDWJOQcUqhNqPvNsIFu6yzXF8J/6K3WCYFd2r5ckbeF7h1cxsnjA7YLSEiWzERCt6/gjZ3tW0ug== dependencies: - "@wdio/logger" "^9.1.3" - "@zip.js/zip.js" "^2.7.53" + "@wdio/logger" "^9.0.0" + "@zip.js/zip.js" "^2.7.48" decamelize "^6.0.0" http-proxy-agent "^7.0.2" https-proxy-agent "^7.0.5" node-fetch "^3.3.2" tar-fs "^3.0.6" - which "^5.0.0" + which "^4.0.0" gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -27795,10 +27794,10 @@ rxjs@^6.3.3, rxjs@^6.4.0, rxjs@^6.6.0, rxjs@^6.6.3: dependencies: tslib "^1.9.0" -safaridriver@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/safaridriver/-/safaridriver-1.0.0.tgz#bccb5edf9df13b75ca08f23081420f3025ae83ed" - integrity sha512-J92IFbskyo7OYB3Dt4aTdyhag1GlInrfbPCmMteb7aBK7PwlnGz1HI0+oyNN97j7pV9DqUAVoVgkNRMrfY47mQ== +safaridriver@^0.1.2: + version "0.1.2" + resolved "https://registry.npmjs.org/safaridriver/-/safaridriver-0.1.2.tgz#166571d5881c7d6f884900d92d51ee1309c05aa4" + integrity sha512-4R309+gWflJktzPXBQCobbWEHlzC4aK3a+Ov3tz2Ib2aBxiwd11phkdIBH1l0EO22x24CJMUQkpKFumRriCSRg== safe-array-concat@^1.1.2: version "1.1.2" @@ -31347,11 +31346,6 @@ undici-types@~6.20.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== -undici@^6.20.1: - version "6.21.0" - resolved "https://registry.npmjs.org/undici/-/undici-6.21.0.tgz#4b3d3afaef984e07b48e7620c34ed8a285ed4cd4" - integrity sha512-BUgJXc752Kou3oOIuU1i+yZZypyZRqNPW0vqoMPl8VaoalSfeR0D8/t4iAS3yirs79SSMTxTag+ZC86uswv+Cw== - unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" @@ -32339,20 +32333,19 @@ web-streams-polyfill@^3.0.3: resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== -webdriver@9.7.3: - version "9.7.3" - resolved "https://registry.npmjs.org/webdriver/-/webdriver-9.7.3.tgz#faaa212b891a29cf15c2102d8c9daa5c518540d2" - integrity sha512-Mpi277WKw37Yg5xZ0MT2BcG/Q/5Y5reYA0wDXOMldVI1nLxA7eOzAvsBA8NpjPbi/+yZijZhNMrXRAtQ5Eu8NQ== +webdriver@9.0.0: + version "9.0.0" + resolved "https://registry.npmjs.org/webdriver/-/webdriver-9.0.0.tgz#9e07c1c5f963c09131c9ab3dbc5551cacb03d905" + integrity sha512-wcysboeZ1Ax6K7WPTF/vCNzegcdg+f453GOJd86ARE+wf3xRSQsvCZDwnEO8/7wvj/3xV9KMYPeuhPJ6b5VFvw== dependencies: "@types/node" "^20.1.0" "@types/ws" "^8.5.3" - "@wdio/config" "9.7.3" - "@wdio/logger" "9.4.4" - "@wdio/protocols" "9.7.0" - "@wdio/types" "9.6.3" - "@wdio/utils" "9.7.3" + "@wdio/config" "9.0.0" + "@wdio/logger" "9.0.0" + "@wdio/protocols" "9.0.0" + "@wdio/types" "9.0.0" + "@wdio/utils" "9.0.0" deepmerge-ts "^7.0.3" - undici "^6.20.1" ws "^8.8.0" webextension-polyfill@0.4.0: