@wdio/native-core 1.3.1 → 2.0.0-next.1
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/dist/cjs/browserMode.d.ts +18 -0
- package/dist/cjs/browserMode.d.ts.map +1 -1
- package/dist/cjs/cmdLine.d.ts +4 -0
- package/dist/cjs/cmdLine.d.ts.map +1 -0
- package/dist/cjs/devServerProcess.d.ts.map +1 -1
- package/dist/cjs/driverPool.d.ts.map +1 -1
- package/dist/cjs/driverProcess.d.ts +2 -0
- package/dist/cjs/driverProcess.d.ts.map +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +294 -27
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/instanceFailures.d.ts +15 -0
- package/dist/cjs/instanceFailures.d.ts.map +1 -0
- package/dist/cjs/instances.d.ts +57 -0
- package/dist/cjs/instances.d.ts.map +1 -0
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/processTree.d.ts +3 -0
- package/dist/cjs/processTree.d.ts.map +1 -0
- package/dist/esm/browserMode.d.ts +18 -0
- package/dist/esm/browserMode.d.ts.map +1 -1
- package/dist/esm/cmdLine.d.ts +4 -0
- package/dist/esm/cmdLine.d.ts.map +1 -0
- package/dist/esm/devServerProcess.d.ts.map +1 -1
- package/dist/esm/driverPool.d.ts.map +1 -1
- package/dist/esm/driverProcess.d.ts +2 -0
- package/dist/esm/driverProcess.d.ts.map +1 -1
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +287 -29
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instanceFailures.d.ts +15 -0
- package/dist/esm/instanceFailures.d.ts.map +1 -0
- package/dist/esm/instances.d.ts +57 -0
- package/dist/esm/instances.d.ts.map +1 -0
- package/dist/esm/package.json +1 -1
- package/dist/esm/processTree.d.ts +3 -0
- package/dist/esm/processTree.d.ts.map +1 -0
- package/package.json +9 -9
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/** The capabilities shapes WebdriverIO hands a launcher hook. */
|
|
2
|
+
export type LauncherCapabilities<C> = C | C[] | Record<string, {
|
|
3
|
+
capabilities: C;
|
|
4
|
+
}>;
|
|
5
|
+
/** The object WebdriverIO reads an instance's connection params from. */
|
|
6
|
+
export interface ConnectionTarget {
|
|
7
|
+
hostname?: string;
|
|
8
|
+
port?: number;
|
|
9
|
+
}
|
|
10
|
+
/** One instance's capabilities, as flattened by {@link normaliseInstanceCaps}. */
|
|
11
|
+
export interface InstanceCaps<C> {
|
|
12
|
+
/** The multiremote instance name; undefined outside multiremote. */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** The instance's capabilities. */
|
|
15
|
+
caps: C;
|
|
16
|
+
/** Where to set `hostname` and `port` so WebdriverIO connects this instance to a server the launcher started. */
|
|
17
|
+
connectionTarget: ConnectionTarget;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Flatten the capabilities a launcher hook receives (an array, one capabilities object, or a
|
|
21
|
+
* multiremote record) into one entry per instance, holding the caller's objects by reference.
|
|
22
|
+
*
|
|
23
|
+
* A single session's `connectionTarget` is its caps object, which WebdriverIO hoists `hostname` and
|
|
24
|
+
* `port` out of. A multiremote instance's is its outer `{ capabilities }` entry, because WebdriverIO
|
|
25
|
+
* reads multiremote connection params only from there and ignores them inside the caps.
|
|
26
|
+
*/
|
|
27
|
+
export declare function normaliseInstanceCaps<C extends object>(capabilities: LauncherCapabilities<C>): InstanceCaps<C>[];
|
|
28
|
+
/** What {@link forEachInstance} passes its callback besides the instance. */
|
|
29
|
+
export interface InstanceContext {
|
|
30
|
+
/** The multiremote instance name; undefined outside multiremote. */
|
|
31
|
+
name?: string;
|
|
32
|
+
/** The capabilities the instance's session was requested with. */
|
|
33
|
+
caps: WebdriverIO.Capabilities | undefined;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Run `callback` on each session in turn: every instance of a multiremote browser, or the browser
|
|
37
|
+
* itself.
|
|
38
|
+
*
|
|
39
|
+
* Pass the worker `before` hook's `capabilities` for the callback to get each instance's caps. A
|
|
40
|
+
* single session gets `capabilities` as is. A multiremote instance gets the caps its session was
|
|
41
|
+
* requested with, with a W3C `alwaysMatch` unwrapped, or else its entry in `capabilities`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function forEachInstance(browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, callback: (instance: WebdriverIO.Browser, context: InstanceContext) => unknown, capabilities?: unknown): Promise<void>;
|
|
44
|
+
/** Get the multiremote instance named `name`, throwing if the browser has none by that name. */
|
|
45
|
+
export declare function requireInstance(browser: WebdriverIO.MultiRemoteBrowser, name: string): WebdriverIO.Browser;
|
|
46
|
+
/**
|
|
47
|
+
* An error message if two instances in one multiremote group share the object a launcher writes
|
|
48
|
+
* to, or undefined if none do. Launchers write each instance's debugging port to that object, so
|
|
49
|
+
* instances sharing it all get the last port and drive one app.
|
|
50
|
+
*
|
|
51
|
+
* `target` returns the object the launcher writes to, or undefined for an instance it leaves alone.
|
|
52
|
+
* It defaults to the instance's capabilities.
|
|
53
|
+
*/
|
|
54
|
+
export declare function sharedInstanceCapsError<C extends object>(capabilities: LauncherCapabilities<C> | Array<Record<string, {
|
|
55
|
+
capabilities: C;
|
|
56
|
+
}>>, target?: (caps: C) => object | undefined): string | undefined;
|
|
57
|
+
//# sourceMappingURL=instances.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/instances.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,YAAY,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEpF,yEAAyE;AACzE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,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AM,GAAG,SAAS,CAwBpB"}
|
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"emit-package-json-esm","type":"module","dependencies":{"@wdio/
|
|
1
|
+
{"name":"emit-package-json-esm","type":"module","dependencies":{"@wdio/native-types":"workspace:*","@wdio/native-utils":"workspace:*","debug":"^4.4.3","get-port":"^7.1.0","tslib":"^2.9.1"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processTree.d.ts","sourceRoot":"","sources":["../../src/processTree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAK9D,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAE/D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/native-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-next.1",
|
|
4
4
|
"description": "Shared launcher, driver lifecycle, log capture, and port management for WebdriverIO native desktop services",
|
|
5
5
|
"homepage": "https://github.com/webdriverio/desktop-mobile/tree/main/packages/native-core",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,24 +24,24 @@
|
|
|
24
24
|
]
|
|
25
25
|
},
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=22.23.4 <23 || >=24.22.1 <25 || >=26.12.1"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@wdio/
|
|
31
|
-
"@wdio/native-
|
|
32
|
-
"@wdio/native-utils": "2.8.1",
|
|
30
|
+
"@wdio/native-types": "3.0.0-next.1",
|
|
31
|
+
"@wdio/native-utils": "3.0.0-next.1",
|
|
33
32
|
"debug": "^4.4.3",
|
|
34
33
|
"get-port": "^7.1.0",
|
|
35
|
-
"tslib": "^2.
|
|
34
|
+
"tslib": "^2.9.1"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
37
|
+
"@repo/test-utils": "0.0.0",
|
|
38
38
|
"@types/debug": "^4.1.12",
|
|
39
|
-
"@types/node": "^26.6.
|
|
40
|
-
"@vitest/coverage-v8": "^5.
|
|
39
|
+
"@types/node": "^26.6.11",
|
|
40
|
+
"@vitest/coverage-v8": "^5.1.2",
|
|
41
41
|
"@wdio/bundler": "0.0.0",
|
|
42
42
|
"shx": "^0.4.0",
|
|
43
43
|
"typescript": "^6.0.3",
|
|
44
|
-
"vitest": "^5.
|
|
44
|
+
"vitest": "^5.1.2"
|
|
45
45
|
},
|
|
46
46
|
"files": [
|
|
47
47
|
"dist",
|