@wdio/shared-store-service 8.16.17 → 8.16.19
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/constants.d.ts +2 -0
- package/build/constants.d.ts.map +1 -0
- package/build/constants.js +1 -0
- package/build/launcher.d.ts +3 -3
- package/build/launcher.d.ts.map +1 -1
- package/build/launcher.js +13 -2
- package/build/service.d.ts +3 -4
- package/build/service.d.ts.map +1 -1
- package/build/service.js +21 -8
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,gCAAgC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const CUSTOM_CAP = 'wdio:sharedStoreServicePort';
|
package/build/launcher.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export default class SharedStoreLauncher {
|
|
1
|
+
import type { Capabilities, Services } from '@wdio/types';
|
|
2
|
+
export default class SharedStoreLauncher implements Services.HookFunctions {
|
|
3
3
|
private _app?;
|
|
4
|
-
onPrepare(_: never, capabilities:
|
|
4
|
+
onPrepare(_: never, capabilities: Capabilities.RemoteCapabilities): Promise<void>;
|
|
5
5
|
onComplete(): Promise<void>;
|
|
6
6
|
}
|
|
7
7
|
//# sourceMappingURL=launcher.d.ts.map
|
package/build/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAUzD,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,QAAQ,CAAC,aAAa;IACtE,OAAO,CAAC,IAAI,CAAC,CAAe;IAEtB,SAAS,CAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,kBAAkB;IA6BlE,UAAU;CAQnB"}
|
package/build/launcher.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logger from '@wdio/logger';
|
|
2
2
|
import { setPort } from './client.js';
|
|
3
|
+
import { CUSTOM_CAP } from './constants.js';
|
|
3
4
|
const log = logger('@wdio/shared-store-service');
|
|
4
5
|
let server;
|
|
5
6
|
export default class SharedStoreLauncher {
|
|
@@ -12,9 +13,19 @@ export default class SharedStoreLauncher {
|
|
|
12
13
|
const { port, app } = await server.startServer();
|
|
13
14
|
this._app = app;
|
|
14
15
|
setPort(port);
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
const capsList = Array.isArray(capabilities)
|
|
17
|
+
? capabilities
|
|
18
|
+
: Object.values(capabilities).map((multiremoteOption) => multiremoteOption.capabilities);
|
|
19
|
+
const caps = capsList.flatMap((c) => {
|
|
20
|
+
const multiremote = c;
|
|
21
|
+
if (!multiremote.browserName && multiremote[Object.keys(multiremote)[0]].capabilities) {
|
|
22
|
+
return Object.values(multiremote).map((options) => options.capabilities?.alwaysMatch ||
|
|
23
|
+
options.capabilities);
|
|
24
|
+
}
|
|
25
|
+
const w3cCaps = c;
|
|
26
|
+
return w3cCaps.alwaysMatch || c;
|
|
17
27
|
});
|
|
28
|
+
caps.forEach((c) => { c[CUSTOM_CAP] = port; });
|
|
18
29
|
log.info(`Started shared server on port ${port}`);
|
|
19
30
|
}
|
|
20
31
|
async onComplete() {
|
package/build/service.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Services } from '@wdio/types';
|
|
2
|
-
import type { SharedStoreServiceCapabilities } from './types.js';
|
|
1
|
+
import type { Services, Capabilities } from '@wdio/types';
|
|
3
2
|
export default class SharedStoreService implements Services.ServiceInstance {
|
|
4
3
|
private _browser?;
|
|
5
|
-
constructor(_: never, caps:
|
|
6
|
-
before(caps: never, specs: never,
|
|
4
|
+
constructor(_: never, caps: Capabilities.RemoteCapability);
|
|
5
|
+
before(caps: never, specs: never, _browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser): void;
|
|
7
6
|
}
|
|
8
7
|
//# sourceMappingURL=service.d.ts.map
|
package/build/service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiC,QAAQ,EAAa,
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiC,QAAQ,EAAa,YAAY,EAAE,MAAM,aAAa,CAAA;AAOnG,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,QAAQ,CAAC,eAAe;IACvE,OAAO,CAAC,QAAQ,CAAC,CAAsD;gBAE3D,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,CAAC,gBAAgB;IAczD,MAAM,CACF,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB;CA0CrE"}
|
package/build/service.js
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
import { getValue, setValue, setPort, setResourcePool, getValueFromPool, addValueToPool } from './client.js';
|
|
2
|
+
import { CUSTOM_CAP } from './constants.js';
|
|
2
3
|
export default class SharedStoreService {
|
|
3
4
|
_browser;
|
|
4
5
|
constructor(_, caps) {
|
|
5
|
-
|
|
6
|
+
const port = (caps[CUSTOM_CAP] ||
|
|
7
|
+
caps.alwaysMatch?.[CUSTOM_CAP] ||
|
|
8
|
+
(Object.values(caps)[0]?.capabilities)[CUSTOM_CAP]);
|
|
9
|
+
if (!port) {
|
|
10
|
+
throw new Error('SharedStoreService: port not found in capabilities');
|
|
11
|
+
}
|
|
12
|
+
setPort(port);
|
|
6
13
|
}
|
|
7
|
-
before(caps, specs,
|
|
8
|
-
this._browser =
|
|
14
|
+
before(caps, specs, _browser) {
|
|
15
|
+
this._browser = _browser;
|
|
9
16
|
const sharedStore = Object.create({}, {
|
|
10
17
|
get: {
|
|
11
|
-
value: (key) =>
|
|
18
|
+
value: (key) => getValue(key)
|
|
12
19
|
},
|
|
13
20
|
set: {
|
|
14
|
-
value: (key, value) =>
|
|
21
|
+
value: (key, value) => setValue(key, value)
|
|
15
22
|
},
|
|
16
23
|
setResourcePool: {
|
|
17
|
-
value: (key, value) =>
|
|
24
|
+
value: (key, value) => setResourcePool(key, value)
|
|
18
25
|
},
|
|
19
26
|
getValueFromPool: {
|
|
20
|
-
value: (key, options) =>
|
|
27
|
+
value: (key, options) => getValueFromPool(key, options)
|
|
21
28
|
},
|
|
22
29
|
addValueToPool: {
|
|
23
|
-
value: (key, value) =>
|
|
30
|
+
value: (key, value) => addValueToPool(key, value)
|
|
24
31
|
}
|
|
25
32
|
});
|
|
26
33
|
this._browser.sharedStore = sharedStore;
|
|
34
|
+
const browser = this._browser;
|
|
35
|
+
if (!this._browser.capabilities && browser.instances) {
|
|
36
|
+
browser.instances.forEach((browserName) => {
|
|
37
|
+
browser.getInstance(browserName).sharedStore = sharedStore;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
27
40
|
}
|
|
28
41
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/shared-store-service",
|
|
3
|
-
"version": "8.16.
|
|
3
|
+
"version": "8.16.19",
|
|
4
4
|
"description": "A WebdriverIO service to exchange data across processes",
|
|
5
5
|
"author": "Mykola Grybyk <mykola.grybyk@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-shared-store-service",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"@wdio/types": "8.16.12",
|
|
45
45
|
"got": "^ 12.6.1",
|
|
46
46
|
"polka": "^0.5.2",
|
|
47
|
-
"webdriverio": "8.16.
|
|
47
|
+
"webdriverio": "8.16.19"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@wdio/globals": "8.16.
|
|
50
|
+
"@wdio/globals": "8.16.19"
|
|
51
51
|
},
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "d05091c0a00cbe739f68ad8fd1fdcf577855002a"
|
|
56
56
|
}
|