@wdio/utils 8.16.10 → 8.16.12
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.
- package/build/driver/index.js +2 -2
- package/build/shim.d.ts.map +1 -1
- package/build/shim.js +22 -1
- package/package.json +3 -3
package/build/driver/index.js
CHANGED
|
@@ -93,7 +93,7 @@ export async function startWebDriver(options) {
|
|
|
93
93
|
geckodriverOptions.customGeckoDriverPath = binary;
|
|
94
94
|
}
|
|
95
95
|
driver = 'GeckoDriver';
|
|
96
|
-
driverProcess = await startGeckodriver({ ...geckodriverOptions, cacheDir, port });
|
|
96
|
+
driverProcess = await startGeckodriver({ ...geckodriverOptions, cacheDir, port, allowHosts: ['0.0.0.0'] });
|
|
97
97
|
}
|
|
98
98
|
else if (isEdge(caps.browserName)) {
|
|
99
99
|
/**
|
|
@@ -104,7 +104,7 @@ export async function startWebDriver(options) {
|
|
|
104
104
|
edgedriverOptions.customEdgeDriverPath = binary;
|
|
105
105
|
}
|
|
106
106
|
driver = 'EdgeDriver';
|
|
107
|
-
driverProcess = await startEdgedriver({ ...edgedriverOptions, cacheDir, port }).catch((err) => {
|
|
107
|
+
driverProcess = await startEdgedriver({ ...edgedriverOptions, cacheDir, port, allowedIps: ['0.0.0.0'] }).catch((err) => {
|
|
108
108
|
log.warn(`Couldn't start EdgeDriver: ${err.message}, retry ...`);
|
|
109
109
|
return startEdgedriver({ ...edgedriverOptions, cacheDir, port });
|
|
110
110
|
});
|
package/build/shim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AASA,UAAU,OAAO;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,OAAO,CAAC,MAAM,CAAC;IAEX,IAAI,WAAW,EAAE,GAAG,CAAA;CACvB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM,CAAC;QACb,UAAU,MAAM;YACZ,MAAM,EAAE,GAAG,CAAA;YACX,WAAW,EAAE,GAAG,CAAA;SACnB;KACJ;CACJ;AAaD,QAAA,MAAM,oBAAoB,YAAqD,GAAG,YAAY,MAAM,UAAS,QAAQ,GAAG,QAAQ,EAAE,SAAa,GAAG,EAAE,2BAsDnJ,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW,mBAAwC,MAAM,MAAM,QAAQ,eAAa,GAAG,
|
|
1
|
+
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AASA,UAAU,OAAO;IACb,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;CACnB;AAED,OAAO,CAAC,MAAM,CAAC;IAEX,IAAI,WAAW,EAAE,GAAG,CAAA;CACvB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,MAAM,CAAC;QACb,UAAU,MAAM;YACZ,MAAM,EAAE,GAAG,CAAA;YACX,WAAW,EAAE,GAAG,CAAA;SACnB;KACJ;CACJ;AAaD,QAAA,MAAM,oBAAoB,YAAqD,GAAG,YAAY,MAAM,UAAS,QAAQ,GAAG,QAAQ,EAAE,SAAa,GAAG,EAAE,2BAsDnJ,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,WAAW,mBAAwC,MAAM,MAAM,QAAQ,eAAa,GAAG,eAmM5F,CAAA;AAED;;;;;;;;GAQG;AACH,iBAAe,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,GAAG,EAAO,EAAE,OAAO,GAAE,MAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAqClI;AAED,OAAO,EACH,oBAAoB,EACpB,WAAW,EACX,YAAY,GACf,CAAA"}
|
package/build/shim.js
CHANGED
|
@@ -194,6 +194,20 @@ const wrapCommand = function wrapCommand(commandName, fn) {
|
|
|
194
194
|
}
|
|
195
195
|
throw new Error(errMsg);
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Jasmine uses `toJSON` to parse the target object for information.
|
|
199
|
+
* Since WebdriverIo doesn't have this method on the Element object
|
|
200
|
+
* we need to mimic it here
|
|
201
|
+
*/
|
|
202
|
+
if (prop === 'toJSON') {
|
|
203
|
+
return { ELEMENT: elem.elementId };
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* provide a better error message than "TypeError: elem[prop] is not a function"
|
|
207
|
+
*/
|
|
208
|
+
if (typeof elem[prop] !== 'function') {
|
|
209
|
+
throw new Error(`Can't call "${prop}" on element with selector "${elem.selector}", it is not a function`);
|
|
210
|
+
}
|
|
197
211
|
return elem[prop](...args);
|
|
198
212
|
});
|
|
199
213
|
}
|
|
@@ -236,14 +250,21 @@ async function executeAsync(fn, retries, args = [], timeout = 20000) {
|
|
|
236
250
|
/**
|
|
237
251
|
* Executes the function with specified timeout and returns the result, or throws an error if the timeout is exceeded.
|
|
238
252
|
*/
|
|
253
|
+
let done = false;
|
|
239
254
|
const result = await Promise.race([
|
|
240
255
|
fn.apply(this, args),
|
|
241
256
|
new Promise((resolve, reject) => {
|
|
242
257
|
setTimeout(() => {
|
|
243
|
-
|
|
258
|
+
if (done) {
|
|
259
|
+
resolve();
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
reject(new Error('Timeout'));
|
|
263
|
+
}
|
|
244
264
|
}, _timeout);
|
|
245
265
|
})
|
|
246
266
|
]);
|
|
267
|
+
done = true;
|
|
247
268
|
if (result && typeof result.finally === 'function') {
|
|
248
269
|
result.catch((err) => err);
|
|
249
270
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "8.16.
|
|
3
|
+
"version": "8.16.12",
|
|
4
4
|
"description": "A WDIO helper utility to provide several utility functions used across the project.",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-utils",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@puppeteer/browsers": "^1.6.0",
|
|
34
34
|
"@wdio/logger": "8.11.0",
|
|
35
|
-
"@wdio/types": "8.16.
|
|
35
|
+
"@wdio/types": "8.16.12",
|
|
36
36
|
"decamelize": "^6.0.0",
|
|
37
37
|
"deepmerge-ts": "^5.1.0",
|
|
38
38
|
"edgedriver": "^5.3.5",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6a010586db579a5019b490172f8ffc3939c9e852"
|
|
52
52
|
}
|