@wdio/utils 9.0.0-alpha.115 → 9.0.0-alpha.321
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/envDetector.d.ts +3 -3
- package/build/envDetector.d.ts.map +1 -1
- package/build/envDetector.js +19 -29
- package/build/initializeServices.d.ts +3 -3
- package/build/initializeServices.d.ts.map +1 -1
- package/build/initializeServices.js +1 -1
- package/build/monad.d.ts.map +1 -1
- package/build/node/manager.d.ts +2 -2
- package/build/node/manager.d.ts.map +1 -1
- package/build/node/manager.js +6 -4
- package/build/node/startWebDriver.d.ts +2 -2
- package/build/node/startWebDriver.d.ts.map +1 -1
- package/build/node/startWebDriver.js +9 -4
- package/build/shim.d.ts.map +1 -1
- package/build/shim.js +10 -0
- package/build/startWebDriver.d.ts +2 -2
- package/build/startWebDriver.d.ts.map +1 -1
- package/build/utils.d.ts.map +1 -1
- package/package.json +6 -6
package/build/envDetector.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Capabilities } from '@wdio/types';
|
|
|
4
4
|
* @param {Object} capabilities caps of session response
|
|
5
5
|
* @return {Boolean} true if W3C (browser)
|
|
6
6
|
*/
|
|
7
|
-
export declare function isW3C(capabilities?: Capabilities
|
|
7
|
+
export declare function isW3C(capabilities?: WebdriverIO.Capabilities): boolean;
|
|
8
8
|
/**
|
|
9
9
|
* returns information about the environment before the session is created
|
|
10
10
|
* @param {Object} capabilities caps provided by user
|
|
@@ -27,8 +27,8 @@ export declare function capabilitiesEnvironmentDetector(capabilities: WebdriverI
|
|
|
27
27
|
* @return {Object} object with environment flags
|
|
28
28
|
*/
|
|
29
29
|
export declare function sessionEnvironmentDetector({ capabilities, requestedCapabilities }: {
|
|
30
|
-
capabilities: Capabilities
|
|
31
|
-
requestedCapabilities: Capabilities.
|
|
30
|
+
capabilities: WebdriverIO.Capabilities;
|
|
31
|
+
requestedCapabilities: Capabilities.RequestedStandaloneCapabilities;
|
|
32
32
|
}): {
|
|
33
33
|
isW3C: boolean;
|
|
34
34
|
isChrome: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"envDetector.d.ts","sourceRoot":"","sources":["../src/envDetector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAS/C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"envDetector.d.ts","sourceRoot":"","sources":["../src/envDetector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAS/C;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,YAAY,CAAC,EAAE,WAAW,CAAC,YAAY,WAqC5D;AA+LD;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,WAAW,CAAC,YAAY;;;;;;;;;EAWrF;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACvC,YAAY,EACZ,qBAAqB,EACxB,EAAE;IACC,YAAY,EAAE,WAAW,CAAC,YAAY,CAAC;IACvC,qBAAqB,EAAE,YAAY,CAAC,+BAA+B,CAAA;CACtE;;;;;;;;;;;EAaA"}
|
package/build/envDetector.js
CHANGED
|
@@ -23,12 +23,9 @@ export function isW3C(capabilities) {
|
|
|
23
23
|
* (https://w3c.github.io/webdriver/#dfn-new-sessions)
|
|
24
24
|
* - it is an Appium session (since Appium is full W3C compliant)
|
|
25
25
|
*/
|
|
26
|
-
const isAppium = Boolean(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
capabilities['appium:automationName'] ||
|
|
30
|
-
capabilities.deviceName ||
|
|
31
|
-
capabilities.appiumVersion);
|
|
26
|
+
const isAppium = Boolean(capabilities['appium:automationName'] ||
|
|
27
|
+
capabilities['appium:deviceName'] ||
|
|
28
|
+
capabilities['appium:appiumVersion']);
|
|
32
29
|
const hasW3CCaps = Boolean(
|
|
33
30
|
/**
|
|
34
31
|
* safari docker image may not provide a platformName therefore
|
|
@@ -39,8 +36,7 @@ export function isW3C(capabilities) {
|
|
|
39
36
|
* local safari and BrowserStack don't provide platformVersion therefore
|
|
40
37
|
* check also if setWindowRect is provided
|
|
41
38
|
*/
|
|
42
|
-
(capabilities
|
|
43
|
-
capabilities['appium:platformVersion'] ||
|
|
39
|
+
(capabilities['appium:platformVersion'] ||
|
|
44
40
|
Object.prototype.hasOwnProperty.call(capabilities, 'setWindowRect')));
|
|
45
41
|
const hasWebdriverFlag = Boolean(capabilities['ms:experimental-webdriver']);
|
|
46
42
|
return Boolean(hasW3CCaps || isAppium || hasWebdriverFlag);
|
|
@@ -54,7 +50,7 @@ function isChrome(capabilities) {
|
|
|
54
50
|
if (!capabilities) {
|
|
55
51
|
return false;
|
|
56
52
|
}
|
|
57
|
-
return Boolean(capabilities
|
|
53
|
+
return Boolean(capabilities['goog:chromeOptions'] && capabilities.browserName === 'chrome');
|
|
58
54
|
}
|
|
59
55
|
/**
|
|
60
56
|
* check if session is run by Edgedriver
|
|
@@ -130,7 +126,7 @@ function isIOS(capabilities) {
|
|
|
130
126
|
return false;
|
|
131
127
|
}
|
|
132
128
|
return Boolean((capabilities.platformName && capabilities.platformName.match(/iOS/i)) ||
|
|
133
|
-
(capabilities
|
|
129
|
+
(capabilities['appium:deviceName'] && capabilities['appium:deviceName'].match(/(iPad|iPhone)/i)) ||
|
|
134
130
|
(/iOS/i.test(bsOptions.platformName || '')) ||
|
|
135
131
|
(/(iPad|iPhone)/i.test(bsOptions.deviceName || '')));
|
|
136
132
|
}
|
|
@@ -158,12 +154,11 @@ function isSauce(capabilities) {
|
|
|
158
154
|
if (!capabilities) {
|
|
159
155
|
return false;
|
|
160
156
|
}
|
|
161
|
-
const caps = capabilities
|
|
157
|
+
const caps = 'alwaysMatch' in capabilities
|
|
162
158
|
? capabilities.alwaysMatch
|
|
163
159
|
: capabilities;
|
|
164
|
-
return Boolean(caps
|
|
165
|
-
|
|
166
|
-
caps['sauce:options'].extendedDebugging));
|
|
160
|
+
return Boolean(caps['sauce:options'] &&
|
|
161
|
+
caps['sauce:options'].extendedDebugging);
|
|
167
162
|
}
|
|
168
163
|
/**
|
|
169
164
|
* detects if session has support for WebDriver Bidi
|
|
@@ -174,10 +169,7 @@ function isBidi(capabilities) {
|
|
|
174
169
|
if (!capabilities) {
|
|
175
170
|
return false;
|
|
176
171
|
}
|
|
177
|
-
|
|
178
|
-
? capabilities.alwaysMatch
|
|
179
|
-
: capabilities;
|
|
180
|
-
return Boolean(caps.webSocketUrl);
|
|
172
|
+
return Boolean(capabilities.webSocketUrl);
|
|
181
173
|
}
|
|
182
174
|
/**
|
|
183
175
|
* detects if session is run using Selenium Standalone server
|
|
@@ -192,6 +184,7 @@ function isSeleniumStandalone(capabilities) {
|
|
|
192
184
|
/**
|
|
193
185
|
* Selenium v3 and below
|
|
194
186
|
*/
|
|
187
|
+
// @ts-expect-error outdated JSONWP capabilities
|
|
195
188
|
Boolean(capabilities['webdriver.remote.sessionid']) ||
|
|
196
189
|
/**
|
|
197
190
|
* Selenium v4 and up
|
|
@@ -233,19 +226,16 @@ export function capabilitiesEnvironmentDetector(capabilities) {
|
|
|
233
226
|
* @return {Object} object with environment flags
|
|
234
227
|
*/
|
|
235
228
|
export function sessionEnvironmentDetector({ capabilities, requestedCapabilities }) {
|
|
236
|
-
const cap = 'alwaysMatch' in capabilities
|
|
237
|
-
? capabilities.alwaysMatch
|
|
238
|
-
: capabilities;
|
|
239
229
|
return {
|
|
240
|
-
isW3C: isW3C(
|
|
241
|
-
isChrome: isChrome(
|
|
242
|
-
isFirefox: isFirefox(
|
|
243
|
-
isMobile: isMobile(
|
|
244
|
-
isIOS: isIOS(
|
|
245
|
-
isAndroid: isAndroid(
|
|
230
|
+
isW3C: isW3C(capabilities),
|
|
231
|
+
isChrome: isChrome(capabilities),
|
|
232
|
+
isFirefox: isFirefox(capabilities),
|
|
233
|
+
isMobile: isMobile(capabilities),
|
|
234
|
+
isIOS: isIOS(capabilities),
|
|
235
|
+
isAndroid: isAndroid(capabilities),
|
|
246
236
|
isSauce: isSauce(requestedCapabilities),
|
|
247
|
-
isSeleniumStandalone: isSeleniumStandalone(
|
|
237
|
+
isSeleniumStandalone: isSeleniumStandalone(capabilities),
|
|
248
238
|
isBidi: isBidi(capabilities),
|
|
249
|
-
isChromium: isChromium(
|
|
239
|
+
isChromium: isChromium(capabilities)
|
|
250
240
|
};
|
|
251
241
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Services, Options, Capabilities } from '@wdio/types';
|
|
2
2
|
/**
|
|
3
3
|
* initialize service for launcher process
|
|
4
4
|
* @param {Object} config wdio config
|
|
@@ -7,7 +7,7 @@ import type { Capabilities, Services, Options } from '@wdio/types';
|
|
|
7
7
|
* as a list of services that don't need to be
|
|
8
8
|
* required in the worker
|
|
9
9
|
*/
|
|
10
|
-
export declare function initializeLauncherService(config: Omit<Options.Testrunner, 'capabilities' | keyof Services.HookFunctions>, caps: Capabilities.
|
|
10
|
+
export declare function initializeLauncherService(config: Omit<Options.Testrunner, 'capabilities' | keyof Services.HookFunctions>, caps: Capabilities.TestrunnerCapabilities): Promise<{
|
|
11
11
|
ignoredWorkerServices: string[];
|
|
12
12
|
launcherServices: Services.ServiceInstance[];
|
|
13
13
|
}>;
|
|
@@ -19,5 +19,5 @@ export declare function initializeLauncherService(config: Omit<Options.Testrunne
|
|
|
19
19
|
* as they don't export a service for it
|
|
20
20
|
* @return {Object[]} list if worker initiated worker services
|
|
21
21
|
*/
|
|
22
|
-
export declare function initializeWorkerService(config: Options.Testrunner, caps: Capabilities
|
|
22
|
+
export declare function initializeWorkerService(config: Options.Testrunner, caps: WebdriverIO.Capabilities, ignoredWorkerServices?: string[]): Promise<Services.ServiceInstance[]>;
|
|
23
23
|
//# sourceMappingURL=initializeServices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeServices.d.ts","sourceRoot":"","sources":["../src/initializeServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"initializeServices.d.ts","sourceRoot":"","sources":["../src/initializeServices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAqFlE;;;;;;;GAOG;AACH,wBAAsB,yBAAyB,CAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,sBAAsB;;;GAmD1K;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CACzC,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,IAAI,EAAE,WAAW,CAAC,YAAY,EAC9B,qBAAqB,GAAE,MAAM,EAAO,GACrC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE,CAAC,CA+BrC"}
|
package/build/monad.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monad.d.ts","sourceRoot":"","sources":["../src/monad.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"monad.d.ts","sourceRoot":"","sources":["../src/monad.ts"],"names":[],"mappings":"AAWA,UAAU,gBAAgB;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,kBAAkB,CAAA;CAC7C;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,EAAE,gBAAgB,GAAE,gBAAqB;WAkBpG,IAAI,aAAa,MAAM,mBAAmB,QAAQ;IA2IvE;;;;;;OAMG;eACyB,MAAM,QAAQ,QAAQ,SAAS,OAAO,MAAM,EAAE,GAAG,CAAC,gBAAgB,QAAQ;EA8CzG"}
|
package/build/node/manager.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Options, Capabilities } from '@wdio/types';
|
|
2
|
-
export declare function setupDriver(options: Omit<Options.WebDriver, 'capabilities'>, caps: Capabilities.
|
|
3
|
-
export declare function setupBrowser(options: Omit<Options.WebDriver, 'capabilities'>, caps: Capabilities.
|
|
2
|
+
export declare function setupDriver(options: Omit<Options.WebDriver, 'capabilities'>, caps: Capabilities.TestrunnerCapabilities): Promise<unknown[] | undefined>;
|
|
3
|
+
export declare function setupBrowser(options: Omit<Options.WebDriver, 'capabilities'>, caps: Capabilities.TestrunnerCapabilities): Promise<unknown[]> | undefined;
|
|
4
4
|
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/node/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/node/manager.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAwGxD,wBAAsB,WAAW,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,sBAAsB,kCAe7H;AAED,wBAAgB,YAAY,CAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,cAAc,CAAC,EAAE,IAAI,EAAE,YAAY,CAAC,sBAAsB,kCAYxH"}
|
package/build/node/manager.js
CHANGED
|
@@ -13,11 +13,13 @@ function mapCapabilities(options, caps, task, taskItemLabel) {
|
|
|
13
13
|
? caps.map((cap) => {
|
|
14
14
|
const w3cCaps = cap;
|
|
15
15
|
const multiremoteCaps = cap;
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
18
|
-
return Object.values(multiremoteCaps).map((c) => c.capabilities
|
|
16
|
+
const multiremoteInstanceNames = Object.keys(multiremoteCaps);
|
|
17
|
+
if (typeof multiremoteCaps[multiremoteInstanceNames[0]] === 'object' && 'capabilities' in multiremoteCaps[multiremoteInstanceNames[0]]) {
|
|
18
|
+
return Object.values(multiremoteCaps).map((c) => ('alwaysMatch' in c.capabilities
|
|
19
|
+
? c.capabilities.alwaysMatch
|
|
20
|
+
: c.capabilities));
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
if (w3cCaps.alwaysMatch) {
|
|
21
23
|
return w3cCaps.alwaysMatch;
|
|
22
24
|
}
|
|
23
25
|
return cap;
|
|
@@ -4,7 +4,7 @@ import { type SafaridriverOptions as SafaridriverParameters } from 'safaridriver
|
|
|
4
4
|
import { type GeckodriverParameters } from 'geckodriver';
|
|
5
5
|
import { type EdgedriverParameters } from 'edgedriver';
|
|
6
6
|
import type { InstallOptions } from '@puppeteer/browsers';
|
|
7
|
-
import type {
|
|
7
|
+
import type { Capabilities } from '@wdio/types';
|
|
8
8
|
export type ChromedriverParameters = Partial<InstallOptions> & Omit<EdgedriverParameters, 'port' | 'edgeDriverVersion' | 'customEdgeDriverPath'>;
|
|
9
9
|
declare global {
|
|
10
10
|
namespace WebdriverIO {
|
|
@@ -18,5 +18,5 @@ declare global {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
export declare function startWebDriver(options:
|
|
21
|
+
export declare function startWebDriver(options: Capabilities.RemoteConfig): Promise<cp.ChildProcess | undefined>;
|
|
22
22
|
//# sourceMappingURL=startWebDriver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startWebDriver.d.ts","sourceRoot":"","sources":["../../src/node/startWebDriver.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"startWebDriver.d.ts","sourceRoot":"","sources":["../../src/node/startWebDriver.ts"],"names":[],"mappings":";AAEA,OAAO,EAAyB,MAAM,oBAAoB,CAAA;AAQ1D,OAAO,EAA8B,KAAK,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,cAAc,CAAA;AAC7G,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAA0C,KAAK,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAC9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,GAAG,mBAAmB,GAAG,sBAAsB,CAAC,CAAA;AAChJ,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,WAAW,CAAC;QAClB,UAAU,mBAAoB,SAAQ,sBAAsB;SAAG;QAC/D,UAAU,kBAAmB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC;SAAG;QAC3E,UAAU,iBAAkB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;SAAG;QACzE,UAAU,mBAAoB,SAAQ,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC;SAAG;KAChF;CACJ;AAKD,wBAAsB,cAAc,CAAE,OAAO,EAAE,YAAY,CAAC,YAAY,wCAkJvE"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
-
import os from 'node:os';
|
|
3
2
|
import path from 'node:path';
|
|
4
3
|
import cp from 'node:child_process';
|
|
5
4
|
import getPort from 'get-port';
|
|
@@ -46,9 +45,14 @@ export async function startWebDriver(options) {
|
|
|
46
45
|
* Chrome
|
|
47
46
|
*/
|
|
48
47
|
const chromedriverOptions = caps['wdio:chromedriverOptions'] || {};
|
|
48
|
+
/**
|
|
49
|
+
* support for custom chromedriver path via environment variable like
|
|
50
|
+
* other drivers do as well
|
|
51
|
+
*/
|
|
52
|
+
const chromedriverBinary = chromedriverOptions.binary || process.env.CHROMEDRIVER_PATH;
|
|
49
53
|
const { executablePath: chromeExecuteablePath, browserVersion } = await setupPuppeteerBrowser(cacheDir, caps);
|
|
50
|
-
const { executablePath: chromedriverExcecuteablePath } =
|
|
51
|
-
? { executablePath:
|
|
54
|
+
const { executablePath: chromedriverExcecuteablePath } = chromedriverBinary
|
|
55
|
+
? { executablePath: chromedriverBinary }
|
|
52
56
|
: await setupChromedriver(cacheDir, browserVersion);
|
|
53
57
|
caps['goog:chromeOptions'] = deepmerge({ binary: chromeExecuteablePath }, caps['goog:chromeOptions'] || {});
|
|
54
58
|
chromedriverOptions.allowedOrigins = chromedriverOptions.allowedOrigins || ['*'];
|
|
@@ -107,9 +111,10 @@ export async function startWebDriver(options) {
|
|
|
107
111
|
/**
|
|
108
112
|
* on Linux set the path to the Edge binary if not already set
|
|
109
113
|
*/
|
|
110
|
-
if (!caps['ms:edgeOptions']?.binary
|
|
114
|
+
if (!caps['ms:edgeOptions']?.binary) {
|
|
111
115
|
caps['ms:edgeOptions'] = caps['ms:edgeOptions'] || {};
|
|
112
116
|
caps['ms:edgeOptions'].binary = findEdgePath();
|
|
117
|
+
log.info(`Found Edge binary at ${caps['ms:edgeOptions'].binary}`);
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
120
|
else {
|
package/build/shim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAuB7C,wBAAsB,oBAAoB,CAAC,CAAC,EAAG,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,QAAQ,GAAG,QAAQ,EAAO,EAAE,IAAI,GAAE,GAAG,EAAO,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,CA4DvJ;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,CA4N9F;AAED;;;;;;;;GAQG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,WAAW,EAAE,IAAI,GAAE,GAAG,EAAO,EAAE,OAAO,GAAE,MAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CA2CxJ"}
|
package/build/shim.js
CHANGED
|
@@ -14,6 +14,7 @@ const ELEMENT_PROPS = [
|
|
|
14
14
|
];
|
|
15
15
|
const ACTION_COMMANDS = ['action', 'actions'];
|
|
16
16
|
const PROMISE_METHODS = ['then', 'catch', 'finally'];
|
|
17
|
+
const ELEMENT_RETURN_COMMANDS = ['getElement', 'getElements'];
|
|
17
18
|
const TIME_BUFFER = 3;
|
|
18
19
|
export async function executeHooksWithArgs(hookName, hooks = [], args = []) {
|
|
19
20
|
/**
|
|
@@ -202,6 +203,15 @@ export function wrapCommand(commandName, fn) {
|
|
|
202
203
|
if (PROMISE_METHODS.includes(prop)) {
|
|
203
204
|
return target[prop].bind(target);
|
|
204
205
|
}
|
|
206
|
+
/**
|
|
207
|
+
* Convenience methods to get the element promise. Technically we could just
|
|
208
|
+
* await an `ChainablePromiseElement` directly but this causes bad DX when
|
|
209
|
+
* chaining commands and e.g. VS Code tries to wrap promises around thenable
|
|
210
|
+
* objects.
|
|
211
|
+
*/
|
|
212
|
+
if (ELEMENT_RETURN_COMMANDS.includes(prop)) {
|
|
213
|
+
return () => target;
|
|
214
|
+
}
|
|
205
215
|
/**
|
|
206
216
|
* call a command on an element query, e.g.:
|
|
207
217
|
* ```js
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
import type {
|
|
3
|
-
export declare function startWebDriver(options:
|
|
2
|
+
import type { Capabilities } from '@wdio/types';
|
|
3
|
+
export declare function startWebDriver(options: Capabilities.RemoteConfig): Promise<import("child_process").ChildProcess | undefined>;
|
|
4
4
|
//# sourceMappingURL=startWebDriver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startWebDriver.d.ts","sourceRoot":"","sources":["../src/startWebDriver.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"startWebDriver.d.ts","sourceRoot":"","sources":["../src/startWebDriver.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAM/C,wBAAsB,cAAc,CAAE,OAAO,EAAE,YAAY,CAAC,YAAY,6DAkBvE"}
|
package/build/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAepD,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,WAGnC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,gBAAgB,EAAE;IAAE,sBAAsB,CAAC,EAAE;QAAE,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,QAwCzH;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,MAAM,UAAQ,UA+BrF;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAE,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE;;;EAapF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,WA8B/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAE,GAAG,EAAE,GAAG,wGAExC;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAAG,UAAU,EAAE,MAAM,EAAE,WAAW,SAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAW5F;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,aAAa,GAAG,IAAI,CAAC,CAgEtF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAE,EAAE,EAAE,QAAQ,WAE5C;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAE,IAAI,EAAE,GAAG,EAAE,SAE1C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,WAenC;AAED;;;GAGG;AACH,eAAO,MAAM,KAAK,mCAAoD,CAAA;AAEtE;;;;;EAKE;AACF,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,CAAC,YAAY,GAAG,OAAO,CAM1E;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC,WAQ/H;AAED,wBAAgB,QAAQ,CAAE,WAAW,CAAC,EAAE,MAAM,WAE7C;AACD,wBAAgB,QAAQ,CAAE,WAAW,CAAC,EAAE,MAAM,WAE7C;AACD,wBAAgB,SAAS,CAAE,WAAW,CAAC,EAAE,MAAM,WAE9C;AACD,wBAAgB,MAAM,CAAE,WAAW,CAAC,EAAE,MAAM,WAE3C;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,YAAY,GAAG,WAAW,CAAC,OAAO,CAGjI;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.321+63953a607",
|
|
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",
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@puppeteer/browsers": "^2.2.0",
|
|
41
|
-
"@wdio/logger": "9.0.0-alpha.
|
|
42
|
-
"@wdio/types": "9.0.0-alpha.
|
|
41
|
+
"@wdio/logger": "9.0.0-alpha.321+63953a607",
|
|
42
|
+
"@wdio/types": "9.0.0-alpha.321+63953a607",
|
|
43
43
|
"decamelize": "^6.0.0",
|
|
44
|
-
"deepmerge-ts": "^
|
|
45
|
-
"edgedriver": "^5.
|
|
44
|
+
"deepmerge-ts": "^7.0.3",
|
|
45
|
+
"edgedriver": "^5.5.0",
|
|
46
46
|
"geckodriver": "^4.3.3",
|
|
47
47
|
"get-port": "^7.0.0",
|
|
48
48
|
"import-meta-resolve": "^4.0.0",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "63953a6079023cb390a113fe5ce1c1b01b8e4bb6"
|
|
58
58
|
}
|