@wdio/shared-store-service 7.19.2 → 7.19.5

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,7 +1,6 @@
1
+ import type { SharedStoreServiceCapabilities } from './types';
1
2
  export default class SharedStoreLauncher {
2
- pidFile: string;
3
- constructor();
4
- onPrepare(): Promise<void>;
3
+ onPrepare(_: never, capabilities: SharedStoreServiceCapabilities[]): Promise<void>;
5
4
  onComplete(): Promise<void>;
6
5
  }
7
6
  //# sourceMappingURL=launcher.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACpC,OAAO,EAAE,MAAM,CAAA;;IAMT,SAAS;IAST,UAAU;CAInB"}
1
+ {"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAA;AAM7D,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAC9B,SAAS,CAAE,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,8BAA8B,EAAE;IASnE,UAAU;CAGnB"}
package/build/launcher.js CHANGED
@@ -4,25 +4,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const logger_1 = __importDefault(require("@wdio/logger"));
7
- const utils_1 = require("./utils");
8
7
  const client_1 = require("./client");
9
8
  const log = (0, logger_1.default)('@wdio/shared-store-service');
10
9
  let server;
11
10
  class SharedStoreLauncher {
12
- constructor() {
13
- // current process pid
14
- this.pidFile = (0, utils_1.getPidPath)(process.pid);
15
- }
16
- async onPrepare() {
11
+ async onPrepare(_, capabilities) {
17
12
  server = require('./server').default;
18
13
  const result = await server.startServer();
19
14
  (0, client_1.setPort)(result.port);
15
+ capabilities.forEach(capability => { capability['wdio:sharedStoreServicePort'] = result.port; });
20
16
  log.info(`Started shared server on port ${result.port}`);
21
- await (0, utils_1.writeFile)(this.pidFile, result.port.toString());
22
17
  }
23
18
  async onComplete() {
24
19
  await server.stopServer();
25
- await (0, utils_1.deleteFile)(this.pidFile);
26
20
  }
27
21
  }
28
22
  exports.default = SharedStoreLauncher;
@@ -1,6 +1,7 @@
1
1
  import { Browser } from 'webdriverio';
2
2
  import { BrowserExtension } from './index';
3
3
  import type { Services } from '@wdio/types';
4
+ import type { SharedStoreServiceCapabilities } from './types';
4
5
  /**
5
6
  * ToDo(Christian): make this public accessible
6
7
  */
@@ -8,7 +9,7 @@ interface ServiceBrowser extends Browser<'async'>, BrowserExtension {
8
9
  }
9
10
  export default class SharedStoreService implements Services.ServiceInstance {
10
11
  private _browser?;
11
- beforeSession(): Promise<void>;
12
+ constructor(_: never, caps: SharedStoreServiceCapabilities);
12
13
  before(caps: unknown, specs: unknown, browser: ServiceBrowser): void;
13
14
  }
14
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAI1C,OAAO,KAAK,EAAiC,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE1E;;GAEG;AACH,UAAU,cAAe,SAAQ,OAAO,CAAC,OAAO,CAAC,EAAE,gBAAgB;CAAI;AAEvE,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,QAAQ,CAAC,eAAe;IACvE,OAAO,CAAC,QAAQ,CAAC,CAAgB;IAE3B,aAAa;IASnB,MAAM,CACF,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,cAAc;CAiB9B"}
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAG1C,OAAO,KAAK,EAAiC,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC1E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAA;AAE7D;;GAEG;AACH,UAAU,cAAe,SAAQ,OAAO,CAAC,OAAO,CAAC,EAAE,gBAAgB;CAAI;AAEvE,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,QAAQ,CAAC,eAAe;IACvE,OAAO,CAAC,QAAQ,CAAC,CAAgB;gBAErB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,8BAA8B;IAI1D,MAAM,CACF,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,cAAc;CAiB9B"}
package/build/service.js CHANGED
@@ -1,14 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const utils_1 = require("./utils");
4
3
  const client_1 = require("./client");
5
4
  class SharedStoreService {
6
- async beforeSession() {
7
- /**
8
- * get port from parent's pid file saved in `onPrepare` hook
9
- */
10
- const port = await (0, utils_1.readFile)((0, utils_1.getPidPath)(process.ppid));
11
- (0, client_1.setPort)(port.toString());
5
+ constructor(_, caps) {
6
+ (0, client_1.setPort)(caps['wdio:sharedStoreServicePort']);
12
7
  }
13
8
  before(caps, specs, browser) {
14
9
  this._browser = browser;
@@ -0,0 +1,5 @@
1
+ import { Capabilities } from '@wdio/types';
2
+ export interface SharedStoreServiceCapabilities extends Capabilities.Capabilities {
3
+ 'wdio:sharedStoreServicePort': string;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,MAAM,WAAW,8BAA+B,SAAQ,YAAY,CAAC,YAAY;IAC7E,6BAA6B,EAAE,MAAM,CAAA;CACxC"}
package/build/types.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wdio/shared-store-service",
3
- "version": "7.19.2",
3
+ "version": "7.19.5",
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",
@@ -25,14 +25,14 @@
25
25
  "dependencies": {
26
26
  "@polka/parse": "^1.0.0-next.0",
27
27
  "@wdio/logger": "7.19.0",
28
- "@wdio/types": "7.19.1",
28
+ "@wdio/types": "7.19.5",
29
29
  "got": "^11.0.2",
30
30
  "polka": "^0.5.2",
31
- "webdriverio": "7.19.2"
31
+ "webdriverio": "7.19.5"
32
32
  },
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
36
  "types": "./build/index.d.ts",
37
- "gitHead": "71fb35a12db8691194b346ab5abd2acf84829385"
37
+ "gitHead": "75af233cbaecf1aaf6a6168dfb4225f56dd21daf"
38
38
  }
package/build/utils.d.ts DELETED
@@ -1,7 +0,0 @@
1
- /// <reference types="node" />
2
- import { readFile as readFileCb, writeFile as writeFileCb, unlink } from 'fs';
3
- export declare const readFile: typeof readFileCb.__promisify__;
4
- export declare const writeFile: typeof writeFileCb.__promisify__;
5
- export declare const deleteFile: typeof unlink.__promisify__;
6
- export declare const getPidPath: (pid: number) => string;
7
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,SAAS,IAAI,WAAW,EAAE,MAAM,EAAG,MAAM,IAAI,CAAA;AAE9E,eAAO,MAAM,QAAQ,iCAAwB,CAAA;AAC7C,eAAO,MAAM,SAAS,kCAAyB,CAAA;AAC/C,eAAO,MAAM,UAAU,6BAAoB,CAAA;AAE3C,eAAO,MAAM,UAAU,QAAS,MAAM,WAAuC,CAAA"}
package/build/utils.js DELETED
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPidPath = exports.deleteFile = exports.writeFile = exports.readFile = void 0;
4
- const path_1 = require("path");
5
- const util_1 = require("util");
6
- const fs_1 = require("fs");
7
- exports.readFile = (0, util_1.promisify)(fs_1.readFile);
8
- exports.writeFile = (0, util_1.promisify)(fs_1.writeFile);
9
- exports.deleteFile = (0, util_1.promisify)(fs_1.unlink);
10
- const getPidPath = (pid) => (0, path_1.join)(__dirname, `/${pid}.pid`);
11
- exports.getPidPath = getPidPath;