sealights-webdriverio-plugin 0.1.6

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.
Files changed (35) hide show
  1. package/README.md +78 -0
  2. package/package.json +46 -0
  3. package/tsOutputs/src/config.d.ts +3 -0
  4. package/tsOutputs/src/config.js +15 -0
  5. package/tsOutputs/src/config.js.map +1 -0
  6. package/tsOutputs/src/index.d.ts +11 -0
  7. package/tsOutputs/src/index.js +22 -0
  8. package/tsOutputs/src/index.js.map +1 -0
  9. package/tsOutputs/src/launcher.d.ts +6 -0
  10. package/tsOutputs/src/launcher.js +59 -0
  11. package/tsOutputs/src/launcher.js.map +1 -0
  12. package/tsOutputs/src/service.d.ts +22 -0
  13. package/tsOutputs/src/service.js +234 -0
  14. package/tsOutputs/src/service.js.map +1 -0
  15. package/tsOutputs/src/types.d.ts +22 -0
  16. package/tsOutputs/src/types.js +3 -0
  17. package/tsOutputs/src/types.js.map +1 -0
  18. package/tsOutputs/src/utils/coverage.d.ts +3 -0
  19. package/tsOutputs/src/utils/coverage.js +44 -0
  20. package/tsOutputs/src/utils/coverage.js.map +1 -0
  21. package/tsOutputs/src/utils/exclusions.d.ts +3 -0
  22. package/tsOutputs/src/utils/exclusions.js +26 -0
  23. package/tsOutputs/src/utils/exclusions.js.map +1 -0
  24. package/tsOutputs/src/utils/naming.d.ts +2 -0
  25. package/tsOutputs/src/utils/naming.js +34 -0
  26. package/tsOutputs/src/utils/naming.js.map +1 -0
  27. package/tsOutputs/src/utils/results.d.ts +8 -0
  28. package/tsOutputs/src/utils/results.js +37 -0
  29. package/tsOutputs/src/utils/results.js.map +1 -0
  30. package/tsOutputs/src/utils/timing.d.ts +1 -0
  31. package/tsOutputs/src/utils/timing.js +7 -0
  32. package/tsOutputs/src/utils/timing.js.map +1 -0
  33. package/tsOutputs/src/version.d.ts +1 -0
  34. package/tsOutputs/src/version.js +5 -0
  35. package/tsOutputs/src/version.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,78 @@
1
+ # Sealights WebdriverIO Plugin
2
+
3
+ ## Overview
4
+ Integrates SeaLights test intelligence with WebdriverIO (v5+), Mocha only. For WDIO+Cucumber, use [sealights-cucumber-plugin](https://www.npmjs.com/package/sealights-cucumber-plugin).
5
+
6
+ ## Installation
7
+ ```bash
8
+ npm install --save-dev sealights-webdriverio-plugin
9
+ ```
10
+
11
+ ## Quick Start (Service)
12
+ Add the service to your `wdio.conf.js`:
13
+ ```js
14
+ exports.config = {
15
+ framework: 'mocha',
16
+ services: ['sealights-webdriverio-plugin'],
17
+ };
18
+ ```
19
+
20
+ ## Manual Hooks (alternative)
21
+ If you prefer not to use WDIO services, you can import hooks:
22
+ ```js
23
+ const { registerSealightsWdioHooks } = require('sealights-webdriverio-plugin');
24
+
25
+ const hooks = registerSealightsWdioHooks();
26
+ exports.config = { framework: 'mocha', ...hooks };
27
+ ```
28
+
29
+ ## Configuration (CLI and Environment)
30
+ SeaLights configuration can be provided via CLI arguments or environment variables (ENV takes precedence over CLI).
31
+
32
+ ### Command Line Parameters
33
+
34
+ All Sealights parameters use the `--sl-` prefix:
35
+
36
+ | Parameter | Description | Required |
37
+ |-----------|-------------|----------|
38
+ | `--sl-token` | Sealights authentication token | No (defaults to using tokenFile) |
39
+ | `--sl-tokenFile` | Path to file containing the token | No (defaults to 'sltoken.txt') |
40
+ | `--sl-buildSessionId` | Sealights build session ID | No (defaults to using buildSessionIdFile) |
41
+ | `--sl-buildSessionIdFile` | Path to file containing build session ID | No (defaults to 'buildSessionId') |
42
+ | `--sl-testStage` | Name of the test stage | Yes |
43
+ | `--sl-labId` | Pre-defined Sealights lab ID | No |
44
+ | `--sl-proxy` | Proxy server configuration | No |
45
+
46
+ Environment variable equivalents:
47
+ - Required:
48
+ - `SL_BUILDSESSIONID` or `SL_BUILDSESSIONIDFILE` (defaults to `buildSessionId` as file)
49
+ - `SL_TOKEN` or `SL_TOKENFILE` (defaults to `sltoken.txt` as file)
50
+ - `SL_TESTSTAGE`
51
+ - Optional:
52
+ - `SL_PROXY`, `SL_LABID`
53
+
54
+
55
+ ## How It Works
56
+ - Launcher (`onPrepare`): fetches excluded tests once and writes to `.sl/.wdio-excluded-tests.json`.
57
+ - Worker (`before`): starts execution and loads exclusions (falls back to fetching if file missing).
58
+ - Before each test: disables Browser Agent and sends `startTest`.
59
+ - Automatic TIA-based skipping: if the current test is in the exclusions map, the plugin logs and skips it immediately while reporting it as skipped.
60
+ - After each test: collects coverage from the Browser, maps to Istanbul format, and sends `endTest` with result and duration.
61
+ - After all: ends execution and stops agent.
62
+
63
+ ## Cucumber with WDIO
64
+ When `framework: 'cucumber'` is detected, this plugin no-ops and logs guidance.
65
+
66
+ ## Exclusions File
67
+ - Path: `.sl/.wdio-excluded-tests.json`
68
+ - Produced by the launcher and consumed by workers. If missing, workers fall back to fetching from SeaLights.
69
+
70
+ ## Troubleshooting
71
+ - No coverage: ensure your app under test is instrumented with Sealights.
72
+ - Exclusions missing: verify `.sl/.wdio-excluded-tests.json` is produced; ensure launcher ran.
73
+ - Cucumber events duplicated: remove the WDIO service and configure `sealights-cucumber-plugin` via `cucumberOpts.require`.
74
+
75
+ ## Debugging
76
+ - Enable additional logs: `export NODE_DEBUG=sl` (default level: info)
77
+ - Full debug level: `export SL_LOG_LEVEL=debug`
78
+
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "sealights-webdriverio-plugin",
3
+ "version": "0.1.6",
4
+ "description": "WebdriverIO plugin for Sealights integration",
5
+ "main": "tsOutputs/src/index.js",
6
+ "types": "tsOutputs/src/index.d.ts",
7
+ "scripts": {
8
+ "prebuild": "node -p \"'//eslint-disable-next-line quotes\\nexport const version = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
9
+ "build": "tsc -p .",
10
+ "pretest:unit": "npm run build",
11
+ "test": "npm run test:unit && npm run test:integration",
12
+ "test:unit": "mocha --exit ./tsOutputs/test/unit/**/*.spec.js",
13
+ "test:integration": "node ./test/integration/run.js"
14
+ },
15
+ "keywords": [
16
+ "webdriverio",
17
+ "wdio",
18
+ "mocha",
19
+ "sealights"
20
+ ],
21
+ "author": "Sealights",
22
+ "license": "ISC",
23
+ "devDependencies": {
24
+ "@types/chai": "^4.3.11",
25
+ "@types/istanbul-lib-coverage": "^2.0.6",
26
+ "@types/mocha": "^10.0.8",
27
+ "@types/node": "^24.3.0",
28
+ "@types/sinon": "^17.0.3",
29
+ "@wdio/types": "^9.19.1",
30
+ "chai": "^4.3.10",
31
+ "mocha": "^11.7.1",
32
+ "proxyquire": "^2.1.3",
33
+ "sinon": "^21.0.0",
34
+ "ts-node": "^10.9.2",
35
+ "typescript": "^5.6.2"
36
+ },
37
+ "dependencies": {
38
+ "istanbul-lib-coverage": "^3.2.2",
39
+ "sealights-plugins-common": "^2.0.117",
40
+ "slnodejs": "6.1.1085"
41
+ },
42
+ "files": [
43
+ "tsOutputs/src"
44
+ ],
45
+ "gitHead": "0175b1f6ae236fa937e5dce8dc70ef8e6ed4f976"
46
+ }
@@ -0,0 +1,3 @@
1
+ import { ISlPluginConfigProvider } from 'sealights-plugins-common';
2
+ import type { ITestRunnerArgs } from 'slnodejs';
3
+ export declare function buildSlConfigProvider(): Promise<ISlPluginConfigProvider<ITestRunnerArgs>>;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildSlConfigProvider = buildSlConfigProvider;
4
+ const sealights_plugins_common_1 = require("sealights-plugins-common");
5
+ async function buildSlConfigProvider() {
6
+ const cliProvider = new sealights_plugins_common_1.CliSlConfigProvider();
7
+ const envProvider = new sealights_plugins_common_1.EnvSlConfigProvider();
8
+ await cliProvider.init();
9
+ await envProvider.init();
10
+ const combined = new sealights_plugins_common_1.CombinedConfigProvider(cliProvider, envProvider);
11
+ await combined.init();
12
+ sealights_plugins_common_1.logger.debug(`Sealights WebdriverIO plugin config provider initialized with config: ${JSON.stringify(combined.getConfig())}`);
13
+ return combined;
14
+ }
15
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;AASA,sDAeC;AAxBD,uEAMkC;AAG3B,KAAK,UAAU,qBAAqB;IACzC,MAAM,WAAW,GAAG,IAAI,8CAAmB,EAAmB,CAAC;IAC/D,MAAM,WAAW,GAAG,IAAI,8CAAmB,EAAmB,CAAC;IAE/D,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,WAAW,CAAC,IAAI,EAAE,CAAC;IAEzB,MAAM,QAAQ,GAAG,IAAI,iDAAsB,CAAkB,WAAW,EAAE,WAAW,CAAC,CAAC;IACvF,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEtB,iCAAM,CAAC,KAAK,CACV,yEAAyE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAChH,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { SealightsWdioService } from './service';
2
+ export { SealightsWdioService as service } from './service';
3
+ export { SealightsWdioLauncher as launcher } from './launcher';
4
+ export declare function registerSealightsWdioHooks(): {
5
+ before: () => Promise<void>;
6
+ beforeTest: (...args: any[]) => Promise<void>;
7
+ afterTest: (...args: any[]) => Promise<void>;
8
+ after: () => Promise<void>;
9
+ };
10
+ export { version } from './version';
11
+ export default SealightsWdioService;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.version = exports.launcher = exports.service = void 0;
4
+ exports.registerSealightsWdioHooks = registerSealightsWdioHooks;
5
+ const service_1 = require("./service");
6
+ var service_2 = require("./service");
7
+ Object.defineProperty(exports, "service", { enumerable: true, get: function () { return service_2.SealightsWdioService; } });
8
+ var launcher_1 = require("./launcher");
9
+ Object.defineProperty(exports, "launcher", { enumerable: true, get: function () { return launcher_1.SealightsWdioLauncher; } });
10
+ function registerSealightsWdioHooks() {
11
+ const service = new service_1.SealightsWdioService();
12
+ return {
13
+ before: () => service.before?.(),
14
+ beforeTest: (...args) => service.beforeTest?.(...args),
15
+ afterTest: (...args) => service.afterTest?.(...args),
16
+ after: () => service.after?.(),
17
+ };
18
+ }
19
+ var version_1 = require("./version");
20
+ Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_1.version; } });
21
+ exports.default = service_1.SealightsWdioService;
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAQA,gEAQC;AAhBD,uCAAiD;AAGjD,qCAA4D;AAAnD,kGAAA,oBAAoB,OAAW;AAExC,uCAA+D;AAAtD,oGAAA,qBAAqB,OAAY;AAG1C,SAAgB,0BAA0B;IACxC,MAAM,OAAO,GAAG,IAAI,8BAAoB,EAAE,CAAC;IAC3C,OAAO;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE;QAChC,UAAU,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,GAAI,IAAwB,CAAC;QAClF,SAAS,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,GAAI,IAA6B,CAAC;QACrF,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE;KAC/B,CAAC;AACJ,CAAC;AAED,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAGhB,kBAAe,8BAAoB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare class SealightsWdioLauncher {
2
+ private instance;
3
+ private writeExclusions;
4
+ private getExcludedTests;
5
+ onPrepare(): Promise<void>;
6
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SealightsWdioLauncher = void 0;
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const sealights_plugins_common_1 = require("sealights-plugins-common");
10
+ const config_1 = require("./config");
11
+ const exclusions_1 = require("./utils/exclusions");
12
+ const version_1 = require("./version");
13
+ const timing_1 = require("./utils/timing");
14
+ const TAGS = [{ name: 'webdriverio-plugin', version: version_1.version }];
15
+ class SealightsWdioLauncher {
16
+ constructor() {
17
+ this.instance = null;
18
+ }
19
+ writeExclusions(excluded, testSelectionStatus) {
20
+ sealights_plugins_common_1.logger.debug('SealightsWdioLauncher writeExclusions: start');
21
+ const outPath = exclusions_1.DEFAULT_EXCLUSIONS_PATH;
22
+ const dir = path_1.default.dirname(outPath);
23
+ fs_1.default.mkdirSync(dir, { recursive: true });
24
+ const payload = { excluded, testSelectionStatus };
25
+ fs_1.default.writeFileSync(outPath, JSON.stringify(payload), 'utf-8');
26
+ sealights_plugins_common_1.logger.debug('SealightsWdioLauncher writeExclusions: done');
27
+ }
28
+ async getExcludedTests() {
29
+ sealights_plugins_common_1.logger.debug('SealightsWdioLauncher getExcludedTests: start');
30
+ if (!this.instance) {
31
+ throw new Error('SealightsIntegration instance not found');
32
+ }
33
+ const excluded = await Promise.race([
34
+ this.instance.getExcludedTests(),
35
+ (0, timing_1.sleep)(60000, {}).then((fallback) => {
36
+ sealights_plugins_common_1.logger.debug('SealightsWdioLauncher getExcludedTests: timeout after 60000ms; falling back to empty object');
37
+ return fallback;
38
+ }),
39
+ ]);
40
+ sealights_plugins_common_1.logger.debug('SealightsWdioLauncher getExcludedTests: done');
41
+ return excluded;
42
+ }
43
+ async onPrepare() {
44
+ sealights_plugins_common_1.logger.debug('SealightsWdioLauncher onPrepare');
45
+ try {
46
+ const provider = await (0, config_1.buildSlConfigProvider)();
47
+ this.instance = await sealights_plugins_common_1.SealightsIntegration.getInstance(provider, false, TAGS);
48
+ const excluded = await this.getExcludedTests();
49
+ const status = this.instance?.agent?.testRecommendationHandler?.eventsProcess?.testSelectionStatus;
50
+ this.writeExclusions(excluded, status);
51
+ sealights_plugins_common_1.logger.lifecycle(`[SEALIGHTS][WDIO] Wrote exclusions to ${exclusions_1.DEFAULT_EXCLUSIONS_PATH}`);
52
+ }
53
+ catch (e) {
54
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] onPrepare (launcher) failed to write exclusions: ${e?.message || e}`);
55
+ }
56
+ }
57
+ }
58
+ exports.SealightsWdioLauncher = SealightsWdioLauncher;
59
+ //# sourceMappingURL=launcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../src/launcher.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,gDAAwB;AAExB,uEAAwE;AAExE,qCAAiD;AACjD,mDAA6D;AAC7D,uCAAoC;AACpC,2CAAuC;AAEvC,MAAM,IAAI,GAAe,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAP,iBAAO,EAAE,CAAC,CAAC;AAEnE,MAAa,qBAAqB;IAAlC;QACU,aAAQ,GAAgC,IAAI,CAAC;IA0CvD,CAAC;IAxCS,eAAe,CAAC,QAAiC,EAAE,mBAA2B;QACpF,iCAAM,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;QAC7D,MAAM,OAAO,GAAG,oCAAuB,CAAC;QACxC,MAAM,GAAG,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClC,YAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACvC,MAAM,OAAO,GAAQ,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC;QACvD,YAAE,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;QAC5D,iCAAM,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AAC;YAChB,iCAAM,CAAC,KAAK,CAAC,sEAAsE,CAAC,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;QACxG,CAAC;IACH,CAAC;CACF;AA3CD,sDA2CC"}
@@ -0,0 +1,22 @@
1
+ export declare class SealightsWdioService {
2
+ private serviceOptions?;
3
+ private isCucumberFramework;
4
+ private instance;
5
+ private excluded;
6
+ constructor(serviceOptions?: {
7
+ framework: string;
8
+ });
9
+ private setAgentTestSelectionStatus;
10
+ private loadExclusions;
11
+ private fetchExcludedTestsFallback;
12
+ before(): Promise<void>;
13
+ beforeTest(test: Mocha.Test, context: any, browser: any): Promise<void>;
14
+ afterTest(test: Mocha.Test, _context: any, result: any, browser: any): Promise<void>;
15
+ after(): Promise<void>;
16
+ }
17
+ export declare function noopIfCucumber(options?: {
18
+ log?: boolean;
19
+ }): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
20
+ export declare function requiresInstance(options?: {
21
+ log?: boolean;
22
+ }): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.SealightsWdioService = void 0;
10
+ exports.noopIfCucumber = noopIfCucumber;
11
+ exports.requiresInstance = requiresInstance;
12
+ const sealights_plugins_common_1 = require("sealights-plugins-common");
13
+ const config_1 = require("./config");
14
+ const exclusions_1 = require("./utils/exclusions");
15
+ const coverage_1 = require("./utils/coverage");
16
+ const version_1 = require("./version");
17
+ const results_1 = require("./utils/results");
18
+ const timing_1 = require("./utils/timing");
19
+ const SL_TAGS = [{ name: 'webdriverio-plugin', version: version_1.version }];
20
+ class SealightsWdioService {
21
+ constructor(serviceOptions) {
22
+ this.serviceOptions = serviceOptions;
23
+ this.isCucumberFramework = false;
24
+ this.instance = null;
25
+ this.excluded = null;
26
+ this.isCucumberFramework = this.serviceOptions?.framework === 'cucumber';
27
+ }
28
+ setAgentTestSelectionStatus(status) {
29
+ try {
30
+ if (!status) {
31
+ sealights_plugins_common_1.logger.debug('SealightsWdioService setAgentTestSelectionStatusSafe: failed to set status, TIA will not work! Please check the exclusions file contains the test selection status as well.');
32
+ return;
33
+ }
34
+ const agent = this.instance?.agent;
35
+ if (agent?.testRecommendationHandler?.eventsProcess) {
36
+ sealights_plugins_common_1.logger.debug(`SealightsWdioService setAgentTestSelectionStatusSafe: setting status to ${status}`);
37
+ agent.testRecommendationHandler.eventsProcess.testSelectionStatus = status;
38
+ }
39
+ }
40
+ catch (e) {
41
+ sealights_plugins_common_1.logger.debug(`[SEALIGHTS][WDIO] Failed setting agent testSelectionStatus from file: ${e?.message || e}`);
42
+ }
43
+ }
44
+ async loadExclusions() {
45
+ sealights_plugins_common_1.logger.debug('SealightsWdioService before: loadExclusions');
46
+ const testRecommendationResult = await (0, exclusions_1.readExclusionsAndStatusFromFile)();
47
+ if (testRecommendationResult) {
48
+ this.excluded = testRecommendationResult.excluded;
49
+ this.setAgentTestSelectionStatus(testRecommendationResult.testSelectionStatus);
50
+ }
51
+ if (!this.excluded) {
52
+ await this.fetchExcludedTestsFallback();
53
+ }
54
+ sealights_plugins_common_1.logger.debug('SealightsWdioService before: loadExclusions: done');
55
+ }
56
+ async fetchExcludedTestsFallback() {
57
+ sealights_plugins_common_1.logger.debug('SealightsWdioService before: fetchExcludedTestsFallback');
58
+ try {
59
+ this.excluded = await Promise.race([this.instance.getExcludedTests(), (0, timing_1.sleep)(60000, {})]);
60
+ }
61
+ catch (e) {
62
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to get excluded tests in worker: ${e?.message || e}`);
63
+ this.excluded = {};
64
+ }
65
+ sealights_plugins_common_1.logger.debug('SealightsWdioService before: fetchExcludedTestsFallback: done');
66
+ }
67
+ async before() {
68
+ sealights_plugins_common_1.logger.debug('SealightsWdioService before: start');
69
+ const provider = await (0, config_1.buildSlConfigProvider)();
70
+ this.instance = await sealights_plugins_common_1.SealightsIntegration.getInstance(provider, false, SL_TAGS);
71
+ await this.instance.startExecution();
72
+ await this.loadExclusions();
73
+ sealights_plugins_common_1.logger.debug('SealightsWdioService before: done');
74
+ }
75
+ async beforeTest(test, context, browser) {
76
+ sealights_plugins_common_1.logger.debug('SealightsWdioService beforeTest: start');
77
+ try {
78
+ const wdioBrowser = browser ?? globalThis.browser;
79
+ if (wdioBrowser && typeof wdioBrowser.execute === 'function') {
80
+ await wdioBrowser.execute(() => {
81
+ window['$Sealights'] = window['$Sealights'] || {};
82
+ window['$Sealights']['skipSlAgent'] = true;
83
+ });
84
+ }
85
+ }
86
+ catch { }
87
+ const event = (0, results_1.buildStartEvent)(test);
88
+ sealights_plugins_common_1.logger.debug(`SealightsWdioService beforeTest: event: ${JSON.stringify(event)}`);
89
+ try {
90
+ this.instance.startTest(event);
91
+ }
92
+ catch (e) {
93
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to send startTest: ${e?.message || e}`);
94
+ }
95
+ if (this.excluded?.[event.name]) {
96
+ try {
97
+ const endEvent = (0, results_1.buildEndEvent)({
98
+ test,
99
+ result: { skipped: true, duration: 0 },
100
+ coverage: {},
101
+ });
102
+ this.instance.endTest(endEvent);
103
+ test._slSkipHandled = true;
104
+ }
105
+ catch (e) {
106
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to send endTest for skipped test: ${e?.message || e}`);
107
+ }
108
+ sealights_plugins_common_1.logger.lifecycle(`[SEALIGHTS][WDIO] Auto-skipping excluded test (beforeTest): ${event.name}`);
109
+ context.skip();
110
+ }
111
+ sealights_plugins_common_1.logger.debug('SealightsWdioService beforeTest: done');
112
+ }
113
+ async afterTest(test, _context, result, browser) {
114
+ sealights_plugins_common_1.logger.debug('SealightsWdioService afterTest: start');
115
+ if (test._slSkipHandled) {
116
+ sealights_plugins_common_1.logger.debug('SealightsWdioService afterTest: skip already handled in beforeTest');
117
+ return;
118
+ }
119
+ let componentsCoverage = null;
120
+ try {
121
+ const wdioBrowser = browser ?? globalThis.browser;
122
+ if (wdioBrowser && typeof wdioBrowser.execute === 'function') {
123
+ const components = await wdioBrowser.execute(() => {
124
+ const win = window;
125
+ const coverageObjectPrefix = '$SealightsCoverage_';
126
+ const keys = Object.keys(win).filter((key) => key.includes(coverageObjectPrefix));
127
+ return keys.map((sealightsCoverageKey) => {
128
+ const componentBsid = sealightsCoverageKey.replace(coverageObjectPrefix, '');
129
+ return { buildSessionId: componentBsid, coverage: win[sealightsCoverageKey] };
130
+ });
131
+ });
132
+ if (Array.isArray(components) && components.length > 0) {
133
+ componentsCoverage = components.map((component) => ({
134
+ buildSessionId: component.buildSessionId,
135
+ coverage: (0, coverage_1.mapIstanbulCoverage)(component.coverage || {}),
136
+ }));
137
+ }
138
+ }
139
+ }
140
+ catch (e) {
141
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to collect components coverage: ${e?.message || e}`);
142
+ componentsCoverage = null;
143
+ }
144
+ const endEvent = (0, results_1.buildEndEvent)({ test, result, coverage: {} });
145
+ sealights_plugins_common_1.logger.debug(`SealightsWdioService afterTest: endEvent: ${JSON.stringify({
146
+ name: endEvent.name,
147
+ suitename: endEvent.suitename,
148
+ duration: endEvent.duration,
149
+ result: endEvent.result,
150
+ })}`);
151
+ try {
152
+ this.instance.endTest(endEvent);
153
+ }
154
+ catch (e) {
155
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to send endTest: ${e?.message || e}`);
156
+ }
157
+ try {
158
+ if (componentsCoverage && componentsCoverage.length > 0) {
159
+ const agent = this.instance?.agent;
160
+ if (agent && typeof agent.sendComponentsTestCoverage === 'function') {
161
+ await agent.sendComponentsTestCoverage(endEvent.name, componentsCoverage);
162
+ sealights_plugins_common_1.logger.debug(`SealightsWdioService afterTest: sent components coverage for ${componentsCoverage.length} components`);
163
+ }
164
+ }
165
+ }
166
+ catch (e) {
167
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to send components coverage: ${e?.message || e}`);
168
+ }
169
+ sealights_plugins_common_1.logger.debug('SealightsWdioService afterTest: done');
170
+ }
171
+ async after() {
172
+ sealights_plugins_common_1.logger.debug('SealightsWdioService after: start');
173
+ try {
174
+ await this.instance.endExecution();
175
+ }
176
+ catch (e) {
177
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to end execution: ${e?.message || e}`);
178
+ }
179
+ try {
180
+ await this.instance.stopAgent();
181
+ }
182
+ catch (e) {
183
+ sealights_plugins_common_1.logger.error(`[SEALIGHTS][WDIO] Failed to stop agent: ${e?.message || e}`);
184
+ }
185
+ sealights_plugins_common_1.logger.debug('SealightsWdioService after: done');
186
+ }
187
+ }
188
+ exports.SealightsWdioService = SealightsWdioService;
189
+ __decorate([
190
+ noopIfCucumber({ log: true })
191
+ ], SealightsWdioService.prototype, "before", null);
192
+ __decorate([
193
+ noopIfCucumber(),
194
+ requiresInstance({ log: true })
195
+ ], SealightsWdioService.prototype, "beforeTest", null);
196
+ __decorate([
197
+ noopIfCucumber(),
198
+ requiresInstance({ log: true })
199
+ ], SealightsWdioService.prototype, "afterTest", null);
200
+ __decorate([
201
+ noopIfCucumber(),
202
+ requiresInstance({ log: true })
203
+ ], SealightsWdioService.prototype, "after", null);
204
+ function noopIfCucumber(options = {}) {
205
+ return function (_target, _propertyKey, descriptor) {
206
+ const original = descriptor.value;
207
+ descriptor.value = function (...args) {
208
+ if (this.isCucumberFramework) {
209
+ if (options.log) {
210
+ sealights_plugins_common_1.logger.lifecycle('[SEALIGHTS][WDIO] Cucumber framework detected. Please use sealights-cucumber-plugin. WDIO hooks will be disabled.');
211
+ }
212
+ return;
213
+ }
214
+ return original.apply(this, args);
215
+ };
216
+ return descriptor;
217
+ };
218
+ }
219
+ function requiresInstance(options = {}) {
220
+ return function (_target, _propertyKey, descriptor) {
221
+ const original = descriptor.value;
222
+ descriptor.value = function (...args) {
223
+ if (!this.instance) {
224
+ if (options.log) {
225
+ sealights_plugins_common_1.logger.error('[SEALIGHTS][WDIO] Sealights instance is not initialized, WDIO hooks will be disabled, coverage will not be collected and no tests will be reported.');
226
+ }
227
+ return;
228
+ }
229
+ return original.apply(this, args);
230
+ };
231
+ return descriptor;
232
+ };
233
+ }
234
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../src/service.ts"],"names":[],"mappings":";;;;;;;;;AA2NA,wCAgBC;AAED,4CAgBC;AA7PD,uEAAiG;AAGjG,qCAAiD;AACjD,mDAAqE;AACrE,+CAAuD;AACvD,uCAAoC;AACpC,6CAAiE;AAGjE,2CAAuC;AAEvC,MAAM,OAAO,GAAe,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAP,iBAAO,EAAE,CAAC,CAAC;AAEtE,MAAa,oBAAoB;IAK/B,YACU,cAEP;QAFO,mBAAc,GAAd,cAAc,CAErB;QAPK,wBAAmB,GAAG,KAAK,CAAC;QAC5B,aAAQ,GAAgC,IAAI,CAAC;QAC7C,aAAQ,GAAmC,IAAI,CAAC;QAOtD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,SAAS,KAAK,UAAU,CAAC;IAC3E,CAAC;IAEO,2BAA2B,CAAC,MAAe;QACjD,IAAI,CAAC;YACH,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,iCAAM,CAAC,KAAK,CACV,6KAA6K,CAC9K,CAAC;gBACF,OAAO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mBAAmB,EAAE,CAAC;gBACtC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;oBAChB,iCAAM,CAAC,SAAS,CACd,mHAAmH,CACpH,CAAC;gBACJ,CAAC;gBACD,OAAO;YACT,CAAC;YACD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,gBAAgB,CAAC,UAA6B,EAAE;IAC9D,OAAO,UAAU,OAAY,EAAE,YAAoB,EAAE,UAA8B;QACjF,MAAM,QAAQ,GAAG,UAAU,CAAC,KAAK,CAAC;QAClC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;YACzC,IAAI,CAAE,IAAY,CAAC,QAAQ,EAAE,CAAC;gBAC5B,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;oBAChB,iCAAM,CAAC,KAAK,CACV,qJAAqJ,CACtJ,CAAC;gBACJ,CAAC;gBACD,OAAO;YACT,CAAC;YACD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpC,CAAC,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { FileCoverageData } from 'istanbul-lib-coverage';
2
+ import { TestResult } from '@wdio/types/build/Frameworks';
3
+ export interface TestResultParams {
4
+ passed?: boolean;
5
+ skipped?: boolean;
6
+ duration?: number;
7
+ test?: Mocha.Test;
8
+ }
9
+ export interface TestEndEventParams {
10
+ test: Mocha.Test;
11
+ result: Partial<TestResult & {
12
+ skipped?: boolean;
13
+ }>;
14
+ coverage?: Record<string, FileCoverageData>;
15
+ }
16
+ export interface SealightsTest extends Mocha.Test {
17
+ _slSkipHandled?: boolean;
18
+ }
19
+ export interface IWdioExclusionsFile {
20
+ excluded: Record<string, boolean>;
21
+ testSelectionStatus?: string;
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { FileCoverageData } from 'istanbul-lib-coverage';
2
+ export declare function mapIstanbulCoverage(allCoverageObjects: Record<string, FileCoverageData>): Record<string, FileCoverageData>;
3
+ export declare function filterAndRemoveKeys(functionMapAndCoverage: Pick<FileCoverageData, 'f' | 'fnMap'>): Pick<FileCoverageData, 'f' | 'fnMap'>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapIstanbulCoverage = mapIstanbulCoverage;
4
+ exports.filterAndRemoveKeys = filterAndRemoveKeys;
5
+ function mapIstanbulCoverage(allCoverageObjects) {
6
+ const mappedFileCoverage = Object.keys(allCoverageObjects).reduce((acc, coveragePath) => {
7
+ const functionsCoverage = filterAndRemoveKeys(allCoverageObjects[coveragePath]);
8
+ acc[coveragePath] = {
9
+ b: allCoverageObjects[coveragePath].b,
10
+ branchMap: allCoverageObjects[coveragePath].branchMap,
11
+ f: functionsCoverage.f,
12
+ fnMap: functionsCoverage.fnMap,
13
+ hash: allCoverageObjects[coveragePath].hash,
14
+ path: allCoverageObjects[coveragePath].path,
15
+ s: allCoverageObjects[coveragePath].s,
16
+ statementMap: allCoverageObjects[coveragePath].statementMap,
17
+ _coverageSchema: allCoverageObjects[coveragePath]._coverageSchema,
18
+ };
19
+ return acc;
20
+ }, {});
21
+ return mappedFileCoverage;
22
+ }
23
+ function filterAndRemoveKeys(functionMapAndCoverage) {
24
+ let { fnMap } = functionMapAndCoverage;
25
+ const { f } = functionMapAndCoverage;
26
+ if (!fnMap) {
27
+ fnMap = {};
28
+ }
29
+ const filteredKeys = Object.keys(f || {}).filter((key) => f[key] !== 0);
30
+ const filteredObj = {
31
+ f: filteredKeys.reduce((acc, key) => {
32
+ acc[key] = f[key];
33
+ return acc;
34
+ }, {}),
35
+ fnMap: Object.keys(fnMap)
36
+ .filter((key) => filteredKeys.includes(key))
37
+ .reduce((acc, key) => {
38
+ acc[key] = fnMap[key];
39
+ return acc;
40
+ }, {}),
41
+ };
42
+ return filteredObj;
43
+ }
44
+ //# sourceMappingURL=coverage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coverage.js","sourceRoot":"","sources":["../../../src/utils/coverage.ts"],"names":[],"mappings":";;AAOA,kDAsBC;AAED,kDAyBC;AAjDD,SAAgB,mBAAmB,CACjC,kBAAoD;IAEpD,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE;QACtF,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;QAE/E,GAAW,CAAC,YAAY,CAAC,GAAG;YAC3B,CAAC,EAAG,kBAA0B,CAAC,YAAY,CAAC,CAAC,CAAC;YAC9C,SAAS,EAAG,kBAA0B,CAAC,YAAY,CAAC,CAAC,SAAS;YAC9D,CAAC,EAAG,iBAAyB,CAAC,CAAC;YAC/B,KAAK,EAAG,iBAAyB,CAAC,KAAK;YACvC,IAAI,EAAG,kBAA0B,CAAC,YAAY,CAAC,CAAC,IAAI;YACpD,IAAI,EAAG,kBAA0B,CAAC,YAAY,CAAC,CAAC,IAAI;YACpD,CAAC,EAAG,kBAA0B,CAAC,YAAY,CAAC,CAAC,CAAC;YAC9C,YAAY,EAAG,kBAA0B,CAAC,YAAY,CAAC,CAAC,YAAY;YACpE,eAAe,EAAG,kBAA0B,CAAC,YAAY,CAAC,CAAC,eAAe;SACpE,CAAC;QAET,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAsC,CAAC,CAAC;IAE3C,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,SAAgB,mBAAmB,CACjC,sBAA6D;IAE7D,IAAI,EAAE,KAAK,EAAE,GAAG,sBAA6B,CAAC;IAC9C,MAAM,EAAE,CAAC,EAAE,GAAG,sBAA6B,CAAC;IAC5C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,EAAS,CAAC;IACpB,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,CAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAEjF,MAAM,WAAW,GAAG;QAClB,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAW,EAAE,EAAE;YAC/C,GAAG,CAAC,GAAG,CAAC,GAAI,CAAS,CAAC,GAAG,CAAC,CAAC;YAC3B,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAS,CAAC;QACb,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;aACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;aAC3C,MAAM,CAAC,CAAC,GAAQ,EAAE,GAAW,EAAE,EAAE;YAChC,GAAG,CAAC,GAAG,CAAC,GAAI,KAAa,CAAC,GAAG,CAAC,CAAC;YAC/B,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAS,CAAC;KACT,CAAC;IAET,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { IWdioExclusionsFile } from '../types';
2
+ export declare const DEFAULT_EXCLUSIONS_PATH: string;
3
+ export declare function readExclusionsAndStatusFromFile(filePath?: string): Promise<IWdioExclusionsFile | null>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DEFAULT_EXCLUSIONS_PATH = void 0;
7
+ exports.readExclusionsAndStatusFromFile = readExclusionsAndStatusFromFile;
8
+ const fs_1 = require("fs");
9
+ const path_1 = __importDefault(require("path"));
10
+ const sealights_plugins_common_1 = require("sealights-plugins-common");
11
+ exports.DEFAULT_EXCLUSIONS_PATH = path_1.default.resolve(process.cwd(), '.sl/.wdio-excluded-tests.json');
12
+ async function readExclusionsAndStatusFromFile(filePath = exports.DEFAULT_EXCLUSIONS_PATH) {
13
+ try {
14
+ const buffer = await fs_1.promises.readFile(filePath, 'utf-8');
15
+ const parsed = JSON.parse(buffer);
16
+ if (parsed && typeof parsed === 'object') {
17
+ return parsed;
18
+ }
19
+ return null;
20
+ }
21
+ catch (error) {
22
+ sealights_plugins_common_1.logger.error(`Error reading exclusions file: ${error}`);
23
+ return null;
24
+ }
25
+ }
26
+ //# sourceMappingURL=exclusions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exclusions.js","sourceRoot":"","sources":["../../../src/utils/exclusions.ts"],"names":[],"mappings":";;;;;;AAQA,0EAcC;AAtBD,2BAAoC;AACpC,gDAAwB;AAExB,uEAAkD;AAGrC,QAAA,uBAAuB,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,+BAA+B,CAAC,CAAC;AAE7F,KAAK,UAAU,+BAA+B,CACnD,WAAmB,+BAAuB;IAE1C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,aAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YACzC,OAAO,MAA6B,CAAC;QACvC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,iCAAM,CAAC,KAAK,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function buildSuiteName(test: Mocha.Test): string;
2
+ export declare function buildTestName(suiteName: string, testTitle: string): string;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildSuiteName = buildSuiteName;
4
+ exports.buildTestName = buildTestName;
5
+ function buildSuiteName(test) {
6
+ const parent = test?.parent;
7
+ if (typeof parent === 'string') {
8
+ return parent;
9
+ }
10
+ if (parent?.title) {
11
+ return parent.title;
12
+ }
13
+ const fromCtxRunnable = test?.ctx?._runnable?.parent?.title;
14
+ if (fromCtxRunnable) {
15
+ return fromCtxRunnable;
16
+ }
17
+ const fromCtxTest = test?.ctx?.test?.parent?.title;
18
+ if (fromCtxTest) {
19
+ return fromCtxTest;
20
+ }
21
+ const titles = [];
22
+ let node = parent;
23
+ while (node && node.title) {
24
+ titles.unshift(node.title);
25
+ node = node.parent;
26
+ }
27
+ return titles.join(' ').trim();
28
+ }
29
+ function buildTestName(suiteName, testTitle) {
30
+ const s = (suiteName || '').trim();
31
+ const t = (testTitle || '').trim();
32
+ return s && t ? `${s} - ${t}` : `${s}${t}`;
33
+ }
34
+ //# sourceMappingURL=naming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.js","sourceRoot":"","sources":["../../../src/utils/naming.ts"],"names":[],"mappings":";;AAAA,wCA2BC;AAED,sCAIC;AAjCD,SAAgB,cAAc,CAAC,IAAgB;IAC7C,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC;IAE5B,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,MAAM,EAAE,KAAK,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,MAAM,eAAe,GAAI,IAAY,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC;IACrE,IAAI,eAAe,EAAE,CAAC;QACpB,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,MAAM,WAAW,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC;IACnD,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,IAAI,GAAG,MAAM,CAAC;IAClB,OAAO,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QAC1B,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC;AAED,SAAgB,aAAa,CAAC,SAAiB,EAAE,SAAiB;IAChE,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { TestResult, TestEvent, TestEndEvent } from 'sealights-plugins-common';
2
+ import { TestResultParams, TestEndEventParams } from '../types';
3
+ export declare function mapWdioAfterTestResult(params: TestResultParams): {
4
+ result: TestResult;
5
+ duration: number;
6
+ };
7
+ export declare function buildStartEvent(test: any): TestEvent;
8
+ export declare function buildEndEvent(params: TestEndEventParams): TestEndEvent;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapWdioAfterTestResult = mapWdioAfterTestResult;
4
+ exports.buildStartEvent = buildStartEvent;
5
+ exports.buildEndEvent = buildEndEvent;
6
+ const sealights_plugins_common_1 = require("sealights-plugins-common");
7
+ const naming_1 = require("./naming");
8
+ function mapWdioAfterTestResult(params) {
9
+ const { passed, skipped } = params;
10
+ const duration = Math.max(0, Number(params.duration ?? params.test?.duration ?? 0));
11
+ const result = skipped ? sealights_plugins_common_1.TestResult.SKIPPED : passed ? sealights_plugins_common_1.TestResult.PASSED : sealights_plugins_common_1.TestResult.FAILED;
12
+ return { result, duration };
13
+ }
14
+ function buildStartEvent(test) {
15
+ const suiteName = (0, naming_1.buildSuiteName)(test);
16
+ const name = (0, naming_1.buildTestName)(suiteName, test?.title);
17
+ return { name, suitename: suiteName };
18
+ }
19
+ function buildEndEvent(params) {
20
+ const { test, result } = params;
21
+ const suiteName = (0, naming_1.buildSuiteName)(test);
22
+ const name = (0, naming_1.buildTestName)(suiteName, test?.title);
23
+ const mapped = mapWdioAfterTestResult({
24
+ passed: result?.passed,
25
+ skipped: result?.skipped,
26
+ duration: result?.duration,
27
+ test,
28
+ });
29
+ return {
30
+ name,
31
+ suitename: suiteName,
32
+ duration: mapped.duration,
33
+ result: mapped.result,
34
+ coverage: params.coverage ?? {},
35
+ };
36
+ }
37
+ //# sourceMappingURL=results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.js","sourceRoot":"","sources":["../../../src/utils/results.ts"],"names":[],"mappings":";;AAIA,wDAKC;AAED,0CAIC;AAED,sCAiBC;AAlCD,uEAA+E;AAC/E,qCAAyD;AAGzD,SAAgB,sBAAsB,CAAC,MAAwB;IAC7D,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CA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: T): Promise<T>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sleep = sleep;
4
+ function sleep(ms, value) {
5
+ return new Promise((resolve) => setTimeout(() => resolve(value), ms));
6
+ }
7
+ //# sourceMappingURL=timing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timing.js","sourceRoot":"","sources":["../../../src/utils/timing.ts"],"names":[],"mappings":";;AAAA,sBAEC;AAFD,SAAgB,KAAK,CAAI,EAAU,EAAE,KAAQ;IAC3C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const version = "0.1.6";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.version = void 0;
4
+ exports.version = "0.1.6";
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AACa,QAAA,OAAO,GAAG,OAAO,CAAC"}