webdriverio 9.7.3 → 9.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,iBAAiB,CAkE5E,CAAA;AAED,eAAO,MAAM,uBAAuB,UAA0E,CAAA;AAE9G,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAA;AAED,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,QAAQ,CAAA;AAClC,eAAO,MAAM,aAAa,UAAU,CAAA;AAEpC,eAAO,MAAM,YAAY,UAKxB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,sCAA6C,CAAA;AAE1E;;GAEG;AACH,eAAO,MAAM,GAAG;IACZ;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DG,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAExD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE5C,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,iBAAiB,CAyE5E,CAAA;AAED,eAAO,MAAM,uBAAuB,UAA0E,CAAA;AAE9G,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAA;AAED,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,QAAQ,CAAA;AAClC,eAAO,MAAM,aAAa,UAAU,CAAA;AAEpC,eAAO,MAAM,YAAY,UAKxB,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB,sCAA6C,CAAA;AAE1E;;GAEG;AACH,eAAO,MAAM,GAAG;IACZ;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0DG,CAAA"}
package/build/index.js CHANGED
@@ -272,7 +272,6 @@ var getElements = function getElements2(selector, elemResponse, props = { isReac
272
272
  };
273
273
 
274
274
  // src/constants.ts
275
- import { resolve } from "import-meta-resolve";
276
275
  import { UNICODE_CHARACTERS, HOOK_DEFINITION } from "@wdio/utils";
277
276
  var WDIO_DEFAULTS = {
278
277
  /**
@@ -285,8 +284,11 @@ var WDIO_DEFAULTS = {
285
284
  if (typeof param !== "string") {
286
285
  throw new Error("automationProtocol should be a string");
287
286
  }
287
+ if (typeof import.meta.resolve !== "function") {
288
+ return;
289
+ }
288
290
  try {
289
- resolve(param, import.meta.url);
291
+ import.meta.resolve(param);
290
292
  } catch (err) {
291
293
  const error = err instanceof Error ? err : new Error("unknown error");
292
294
  throw new Error("Couldn't find automation protocol \"".concat(param, '": ').concat(error.message));
@@ -1110,7 +1112,7 @@ function debug(commandTimeout = 5e3) {
1110
1112
  });
1111
1113
  }
1112
1114
  });
1113
- return new Promise((resolve2) => commandResolve = resolve2);
1115
+ return new Promise((resolve) => commandResolve = resolve);
1114
1116
  }
1115
1117
 
1116
1118
  // src/commands/browser/deleteCookies.ts
@@ -3141,24 +3143,25 @@ var _ContextManager = class _ContextManager extends SessionManager {
3141
3143
  return;
3142
3144
  }
3143
3145
  __privateGet(this, _browser3).on("command", __privateMethod(this, _ContextManager_instances, onCommand_fn2).bind(this));
3144
- __privateGet(this, _browser3).sessionSubscribe({
3145
- events: ["browsingContext.navigationStarted"]
3146
- });
3147
- __privateGet(this, _browser3).on("browsingContext.navigationStarted", async (nav) => {
3148
- if (!__privateGet(this, _currentContext) || nav.context === __privateGet(this, _currentContext)) {
3149
- return;
3150
- }
3151
- const { contexts } = await __privateGet(this, _browser3).browsingContextGetTree({});
3152
- const hasContext = this.findContext(__privateGet(this, _currentContext), contexts, "byContextId");
3153
- const newContext = contexts.find((context) => context.context === nav.context);
3154
- if (!hasContext && newContext) {
3155
- this.setCurrentContext(newContext.context);
3156
- __privateGet(this, _browser3).switchToWindow(__privateGet(this, _currentContext));
3157
- return;
3158
- }
3159
- });
3160
3146
  if (__privateGet(this, _browser3).isMobile) {
3161
3147
  __privateGet(this, _browser3).on("result", __privateMethod(this, _ContextManager_instances, onCommandResultMobile_fn).bind(this));
3148
+ } else {
3149
+ __privateGet(this, _browser3).sessionSubscribe({
3150
+ events: ["browsingContext.navigationStarted"]
3151
+ });
3152
+ __privateGet(this, _browser3).on("browsingContext.navigationStarted", async (nav) => {
3153
+ if (!__privateGet(this, _currentContext) || nav.context === __privateGet(this, _currentContext)) {
3154
+ return;
3155
+ }
3156
+ const { contexts } = await __privateGet(this, _browser3).browsingContextGetTree({});
3157
+ const hasContext = this.findContext(__privateGet(this, _currentContext), contexts, "byContextId");
3158
+ const newContext = contexts.find((context) => context.context === nav.context);
3159
+ if (!hasContext && newContext) {
3160
+ this.setCurrentContext(newContext.context);
3161
+ __privateGet(this, _browser3).switchToWindow(__privateGet(this, _currentContext));
3162
+ return;
3163
+ }
3164
+ });
3162
3165
  }
3163
3166
  }
3164
3167
  removeListeners() {
@@ -3655,8 +3658,8 @@ var Timer = class {
3655
3658
  __publicField(this, "_timeoutId");
3656
3659
  __publicField(this, "_mainTimeoutId");
3657
3660
  __publicField(this, "_lastError");
3658
- __privateSet(this, _retPromise, new Promise((resolve2, reject) => {
3659
- this._resolve = resolve2;
3661
+ __privateSet(this, _retPromise, new Promise((resolve, reject) => {
3662
+ this._resolve = resolve;
3660
3663
  this._reject = reject;
3661
3664
  }));
3662
3665
  this._start();
@@ -4250,7 +4253,7 @@ async function newWindow2(url2, { type = "window", windowName = "", windowFeatur
4250
4253
 
4251
4254
  // src/commands/browser/pause.ts
4252
4255
  function pause(milliseconds = 1e3) {
4253
- return new Promise((resolve2) => setTimeout(resolve2, milliseconds));
4256
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
4254
4257
  }
4255
4258
 
4256
4259
  // src/scripts/resq.ts
@@ -5985,7 +5988,7 @@ async function getCurrentContexts({
5985
5988
  }
5986
5989
  return parsedContexts;
5987
5990
  }
5988
- await new Promise((resolve2) => setTimeout(resolve2, retryInterval));
5991
+ await new Promise((resolve) => setTimeout(resolve, retryInterval));
5989
5992
  }
5990
5993
  throw new Error(
5991
5994
  "The packageName '".concat(packageName, "' ").concat(isPackageNameMissing ? "could not be found!" : "matches, but no webview with pages was loaded in this response: " + JSON.stringify(contexts) + "'")
package/build/node.js CHANGED
@@ -119,8 +119,8 @@ async function uploadFile(localPath) {
119
119
  }
120
120
  const zipData = [];
121
121
  const source = fs5.createReadStream(localPath);
122
- return new Promise((resolve2, reject) => {
123
- archiver("zip").on("error", (err) => reject(err)).on("data", (data) => zipData.push(data)).on("end", () => this.file(Buffer.concat(zipData).toString("base64")).then((localPath2) => resolve2(localPath2), reject)).append(source, { name: path3.basename(localPath) }).finalize();
122
+ return new Promise((resolve, reject) => {
123
+ archiver("zip").on("error", (err) => reject(err)).on("data", (data) => zipData.push(data)).on("end", () => this.file(Buffer.concat(zipData).toString("base64")).then((localPath2) => resolve(localPath2), reject)).append(source, { name: path3.basename(localPath) }).finalize();
124
124
  });
125
125
  }
126
126
 
@@ -267,24 +267,25 @@ var ContextManager = class _ContextManager extends SessionManager {
267
267
  return;
268
268
  }
269
269
  this.#browser.on("command", this.#onCommand.bind(this));
270
- this.#browser.sessionSubscribe({
271
- events: ["browsingContext.navigationStarted"]
272
- });
273
- this.#browser.on("browsingContext.navigationStarted", async (nav) => {
274
- if (!this.#currentContext || nav.context === this.#currentContext) {
275
- return;
276
- }
277
- const { contexts } = await this.#browser.browsingContextGetTree({});
278
- const hasContext = this.findContext(this.#currentContext, contexts, "byContextId");
279
- const newContext = contexts.find((context) => context.context === nav.context);
280
- if (!hasContext && newContext) {
281
- this.setCurrentContext(newContext.context);
282
- this.#browser.switchToWindow(this.#currentContext);
283
- return;
284
- }
285
- });
286
270
  if (this.#browser.isMobile) {
287
271
  this.#browser.on("result", this.#onCommandResultMobile.bind(this));
272
+ } else {
273
+ this.#browser.sessionSubscribe({
274
+ events: ["browsingContext.navigationStarted"]
275
+ });
276
+ this.#browser.on("browsingContext.navigationStarted", async (nav) => {
277
+ if (!this.#currentContext || nav.context === this.#currentContext) {
278
+ return;
279
+ }
280
+ const { contexts } = await this.#browser.browsingContextGetTree({});
281
+ const hasContext = this.findContext(this.#currentContext, contexts, "byContextId");
282
+ const newContext = contexts.find((context) => context.context === nav.context);
283
+ if (!hasContext && newContext) {
284
+ this.setCurrentContext(newContext.context);
285
+ this.#browser.switchToWindow(this.#currentContext);
286
+ return;
287
+ }
288
+ });
288
289
  }
289
290
  }
290
291
  removeListeners() {
@@ -740,7 +741,6 @@ var getElements = function getElements2(selector, elemResponse, props = { isReac
740
741
  };
741
742
 
742
743
  // src/constants.ts
743
- import { resolve } from "import-meta-resolve";
744
744
  import { UNICODE_CHARACTERS, HOOK_DEFINITION } from "@wdio/utils";
745
745
  var WDIO_DEFAULTS = {
746
746
  /**
@@ -753,8 +753,11 @@ var WDIO_DEFAULTS = {
753
753
  if (typeof param !== "string") {
754
754
  throw new Error("automationProtocol should be a string");
755
755
  }
756
+ if (typeof import.meta.resolve !== "function") {
757
+ return;
758
+ }
756
759
  try {
757
- resolve(param, import.meta.url);
760
+ import.meta.resolve(param);
758
761
  } catch (err) {
759
762
  const error = err instanceof Error ? err : new Error("unknown error");
760
763
  throw new Error(`Couldn't find automation protocol "${param}": ${error.message}`);
@@ -1564,7 +1567,7 @@ function debug(commandTimeout = 5e3) {
1564
1567
  });
1565
1568
  }
1566
1569
  });
1567
- return new Promise((resolve2) => commandResolve = resolve2);
1570
+ return new Promise((resolve) => commandResolve = resolve);
1568
1571
  }
1569
1572
 
1570
1573
  // src/commands/browser/deleteCookies.ts
@@ -3793,8 +3796,8 @@ var Timer = class {
3793
3796
  this._timeout = _timeout;
3794
3797
  this._fn = _fn;
3795
3798
  this._leading = _leading;
3796
- this.#retPromise = new Promise((resolve2, reject) => {
3797
- this._resolve = resolve2;
3799
+ this.#retPromise = new Promise((resolve, reject) => {
3800
+ this._resolve = resolve;
3798
3801
  this._reject = reject;
3799
3802
  });
3800
3803
  this._start();
@@ -4373,7 +4376,7 @@ async function newWindow(url2, { type = "window", windowName = "", windowFeature
4373
4376
 
4374
4377
  // src/commands/browser/pause.ts
4375
4378
  function pause(milliseconds = 1e3) {
4376
- return new Promise((resolve2) => setTimeout(resolve2, milliseconds));
4379
+ return new Promise((resolve) => setTimeout(resolve, milliseconds));
4377
4380
  }
4378
4381
 
4379
4382
  // src/commands/browser/react$$.ts
@@ -6020,7 +6023,7 @@ async function getCurrentContexts({
6020
6023
  }
6021
6024
  return parsedContexts;
6022
6025
  }
6023
- await new Promise((resolve2) => setTimeout(resolve2, retryInterval));
6026
+ await new Promise((resolve) => setTimeout(resolve, retryInterval));
6024
6027
  }
6025
6028
  throw new Error(
6026
6029
  `The packageName '${packageName}' ${isPackageNameMissing ? "could not be found!" : "matches, but no webview with pages was loaded in this response: " + JSON.stringify(contexts) + "'"}`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webdriverio",
3
3
  "description": "Next-gen browser and mobile automation test framework for Node.js",
4
- "version": "9.7.3",
4
+ "version": "9.9.0",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -77,12 +77,12 @@
77
77
  "dependencies": {
78
78
  "@types/node": "^20.11.30",
79
79
  "@types/sinonjs__fake-timers": "^8.1.5",
80
- "@wdio/config": "9.7.3",
80
+ "@wdio/config": "9.9.0",
81
81
  "@wdio/logger": "9.4.4",
82
82
  "@wdio/protocols": "9.7.0",
83
83
  "@wdio/repl": "9.4.4",
84
- "@wdio/types": "9.6.3",
85
- "@wdio/utils": "9.7.3",
84
+ "@wdio/types": "9.9.0",
85
+ "@wdio/utils": "9.9.0",
86
86
  "archiver": "^7.0.1",
87
87
  "aria-query": "^5.3.0",
88
88
  "cheerio": "^1.0.0-rc.12",
@@ -90,18 +90,16 @@
90
90
  "css-value": "^0.0.1",
91
91
  "grapheme-splitter": "^1.0.4",
92
92
  "htmlfy": "^0.6.0",
93
- "import-meta-resolve": "^4.0.0",
94
93
  "is-plain-obj": "^4.1.0",
95
94
  "jszip": "^3.10.1",
96
95
  "lodash.clonedeep": "^4.5.0",
97
96
  "lodash.zip": "^4.2.0",
98
- "minimatch": "^9.0.3",
99
97
  "query-selector-shadow-dom": "^1.0.1",
100
98
  "resq": "^1.11.0",
101
99
  "rgb2hex": "0.2.5",
102
100
  "serialize-error": "^11.0.3",
103
101
  "urlpattern-polyfill": "^10.0.0",
104
- "webdriver": "9.7.3"
102
+ "webdriver": "9.9.0"
105
103
  },
106
104
  "peerDependencies": {
107
105
  "puppeteer-core": "^22.3.0"
@@ -111,5 +109,5 @@
111
109
  "optional": true
112
110
  }
113
111
  },
114
- "gitHead": "839ac572881d2b951c5e12feaa828f2b7eb19a96"
112
+ "gitHead": "620e092391d7bcc71cd7cd55ad146ad72e522da9"
115
113
  }