sealights-playwright-plugin 2.0.92

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 (34) hide show
  1. package/README.md +211 -0
  2. package/importReplaceUtility.js +20 -0
  3. package/index.js +3 -0
  4. package/package.json +53 -0
  5. package/tsOutputs/src/fixtures.d.ts +1 -0
  6. package/tsOutputs/src/fixtures.js +55 -0
  7. package/tsOutputs/src/fixtures.js.map +1 -0
  8. package/tsOutputs/src/utils/config.d.ts +20 -0
  9. package/tsOutputs/src/utils/config.js +119 -0
  10. package/tsOutputs/src/utils/config.js.map +1 -0
  11. package/tsOutputs/src/utils/const.d.ts +18 -0
  12. package/tsOutputs/src/utils/const.js +22 -0
  13. package/tsOutputs/src/utils/const.js.map +1 -0
  14. package/tsOutputs/src/utils/coverage.d.ts +3 -0
  15. package/tsOutputs/src/utils/coverage.js +44 -0
  16. package/tsOutputs/src/utils/coverage.js.map +1 -0
  17. package/tsOutputs/src/utils/importReplaceUtility.d.ts +2 -0
  18. package/tsOutputs/src/utils/importReplaceUtility.js +78 -0
  19. package/tsOutputs/src/utils/importReplaceUtility.js.map +1 -0
  20. package/tsOutputs/src/utils/index.d.ts +6 -0
  21. package/tsOutputs/src/utils/index.js +38 -0
  22. package/tsOutputs/src/utils/index.js.map +1 -0
  23. package/tsOutputs/src/utils/logger.d.ts +10 -0
  24. package/tsOutputs/src/utils/logger.js +28 -0
  25. package/tsOutputs/src/utils/logger.js.map +1 -0
  26. package/tsOutputs/src/utils/service.d.ts +23 -0
  27. package/tsOutputs/src/utils/service.js +169 -0
  28. package/tsOutputs/src/utils/service.js.map +1 -0
  29. package/tsOutputs/src/utils/version.d.ts +1 -0
  30. package/tsOutputs/src/utils/version.js +5 -0
  31. package/tsOutputs/src/utils/version.js.map +1 -0
  32. package/tsOutputs/test/importReplaceUtility.spec.d.ts +1 -0
  33. package/tsOutputs/test/importReplaceUtility.spec.js +137 -0
  34. package/tsOutputs/test/importReplaceUtility.spec.js.map +1 -0
package/README.md ADDED
@@ -0,0 +1,211 @@
1
+ # Sealights Playwright Plugin
2
+
3
+ ## Overview
4
+
5
+ The Sealights Playwright Plugin integrates Sealights' test intelligence into Playwright tests, providing developers with insights about the tests and coverage tracking, as well as tests skipping using Sealights' TIA. This document guides developers through installation, configuration, and usage to enhance test quality and efficiency.
6
+
7
+ ## Getting Started
8
+
9
+ ### Installation
10
+
11
+ To install the plugin, use npm:
12
+
13
+ ```bash
14
+ npm install sealights-playwright-plugin
15
+ ```
16
+
17
+ ### Environment Variables Setup
18
+
19
+ The plugin requires several environment variables for configuration. Here’s a breakdown of each variable:
20
+
21
+ #### Required Variables
22
+
23
+ - **SL_BUILD_SESSION_ID**: Unique identifier for the build session.
24
+ - **SL_TOKEN**: Authentication token for Sealights.
25
+ - **SL_TEST_STAGE**: Current testing stage (e.g., e2e, development, prod).
26
+
27
+ #### Optional Variables
28
+
29
+ - **SL_LAB_ID**: Identifier for the lab environment (optional).
30
+ - **SL_PROXY**: Proxy settings (optional).
31
+ - **SL_COLLECTOR_URL**: URL for the data collector (optional).
32
+ - **SL_TIA_DISABLED**: Boolean flag to disable TIA recommendations and test skipping (optional; defaults to `false`).
33
+ - **SL_DISABLE**: Disable the plugin entirely to keep the fixtures in place but not receive errors from the plugin due to missing configuration (optional).
34
+
35
+ ### Plugin Usage
36
+
37
+ To use the Sealights Playwright Plugin, follow these steps:
38
+
39
+ 1. **Import the Plugin** in your test files:
40
+
41
+ ```javascript
42
+ const { test } = require('sealights-playwright-plugin');
43
+ ```
44
+
45
+ or
46
+
47
+ ```javascript
48
+ import { test } from 'sealights-playwright-plugin';
49
+ ```
50
+
51
+ Replace your existing test fixture with this import in all your test files where you want Sealights integration.
52
+
53
+ 2. **Configure the Plugin** using the environment variables. You can do this in your test setup or CI/CD environment.
54
+
55
+ 3. **Run Your Tests** as usual. The plugin will automatically track coverage and provide insights during the test execution.
56
+
57
+ ### Example Test File
58
+
59
+ Here’s a basic example of how to structure a test file using the Sealights Playwright Plugin:
60
+
61
+ ```javascript
62
+ const { test } = require('sealights-playwright-plugin');
63
+
64
+ test('my test', async ({ page }) => {
65
+ // Your test logic here
66
+ });
67
+ ```
68
+
69
+ ### Error Handling
70
+
71
+ If any required environment variable is missing, the plugin will throw an error, preventing the tests from running with Sealights but not stopping them from executing on their own. Ensure all required variables are set correctly.
72
+
73
+ ---
74
+
75
+ ## Implementation
76
+
77
+ The Sealights Playwright Plugin is implemented using **Playwright fixtures**, which are the recommended way to register global hooks for each worker and test. This approach ensures that setup and teardown logic is run consistently across tests, and it integrates with Playwright’s built-in hooks like `beforeEach` and `afterEach`.
78
+
79
+ Using fixtures allows us to efficiently integrate Sealights' test intelligence features while maintaining test stability and execution speed. For more details on how Playwright fixtures work, you can refer to the official Playwright documentation on [adding global `beforeEach`/`afterEach` hooks](https://playwright.dev/docs/test-fixtures#adding-global-beforeeachaftereach-hooks).
80
+
81
+ ## Minimal System Requirements
82
+
83
+ The Sealights Playwright Plugin requires the following system configuration to run effectively:
84
+
85
+ - **Node.js**: Version 18 or higher.
86
+ - **Playwright**: Version 1.20 or higher.
87
+
88
+ Please make sure your system meets these requirements before using the plugin. You can refer to the [Playwright system requirements](https://playwright.dev/docs/intro#system-requirements) for further details.
89
+
90
+ ---
91
+
92
+ ### Optional: Using the Import Replacement Utility
93
+
94
+ To simplify the integration process, you can use our utility script to automatically replace your existing imports from `@playwright/test` with imports from `sealights-playwright-plugin`. This utility script can handle the following import/require styles:
95
+
96
+ #### Supported Styles:
97
+
98
+ - **Single Destructured Require Statement with Test Import**:
99
+
100
+ ```javascript
101
+ const { test, expect } = require('@playwright/test');
102
+ ```
103
+
104
+ - **Single Require Statement without Test Import**:
105
+
106
+ ```javascript
107
+ const { expect } = require('@playwright/test');
108
+ ```
109
+
110
+ - **Single Import Statement with Test Import**:
111
+
112
+ ```javascript
113
+ import { test } from '@playwright/test';
114
+ ```
115
+
116
+ - **Single Import Statement without Test Import**:
117
+
118
+ ```javascript
119
+ import { expect } from '@playwright/test';
120
+ ```
121
+
122
+ - **Named Imports with Destructuring in Require**:
123
+
124
+ ```javascript
125
+ const { test, chromium } = require('@playwright/test');
126
+ ```
127
+
128
+ - **Named Imports with Destructuring in Import**:
129
+
130
+ ```javascript
131
+ import { test, chromium } from '@playwright/test';
132
+ ```
133
+
134
+ - **Mixed Imports and Requires**:
135
+
136
+ ```javascript
137
+ const { test, expect } = require('@playwright/test');
138
+ import { chromium } from '@playwright/test';
139
+ ```
140
+
141
+ - **Complex Destructuring in Require with Non-Test Imports**:
142
+
143
+ ```javascript
144
+ const { test, expect, firefox } = require('@playwright/test');
145
+ ```
146
+
147
+ - **Complex Destructuring in Import with Non-Test Imports**:
148
+
149
+ ```javascript
150
+ import { test, expect, firefox } from '@playwright/test';
151
+ ```
152
+
153
+ - **Require with Renamed Import**:
154
+
155
+ ```javascript
156
+ const { test: renamedTest } = require('@playwright/test');
157
+ ```
158
+
159
+ - **Import with Renamed Import**:
160
+
161
+ ```javascript
162
+ import { test as renamedTest } from '@playwright/test';
163
+ ```
164
+
165
+ - **Multiple Requires and Imports**:
166
+
167
+ ```javascript
168
+ const { test, expect } = require('@playwright/test');
169
+ const { firefox, chromium } = require('@playwright/test');
170
+ import { test as renamedTest } from '@playwright/test';
171
+ import { expect } from '@playwright/test';
172
+ ```
173
+
174
+ - **Using Sealights Playwright Plugin**:
175
+ ```javascript
176
+ const { test } = require('sealights-playwright-plugin');
177
+ import { test as renamedTest } from 'sealights-playwright-plugin';
178
+ ```
179
+
180
+ #### Unsupported Styles:
181
+
182
+ - **Default Imports**:
183
+
184
+ ```javascript
185
+ import test from '@playwright/test'; // Not supported
186
+ ```
187
+
188
+ - **Unsupported Mixed Imports**:
189
+ - Be cautious with any combination of imports that do not conform to the supported styles.
190
+
191
+ ---
192
+
193
+ #### How to Use the Import Replacement Utility
194
+
195
+ To use the Import Replacement Utility for replacing imports in your project, follow these steps:
196
+
197
+ 1. **Navigate to Your Project Root**: Open your terminal and navigate to the root of your project where the `node_modules` directory is located.
198
+
199
+ 2. **Run the Utility**: Execute the utility script with the path to the folder containing your test files as the argument. The command should look like this:
200
+
201
+ ```bash
202
+ node node_modules/sealights-playwright-plugin/importReplaceUtility.js <path-to-your-test-folder>
203
+ ```
204
+
205
+ Replace `<path-to-your-test-folder>` with the relative or absolute path to the directory where your Playwright tests are located.
206
+
207
+ 3. **Check the Output**: The utility will process the files in the specified directory and replace the imports from `@playwright/test` with imports from `sealights-playwright-plugin` according to the supported styles. After running the script, verify the changes in your test files.
208
+
209
+ 4. **Proceed with Caution**: Review the modified files to ensure the imports have been replaced correctly. It’s recommended to use version control (e.g., Git) to track changes and revert if necessary.
210
+
211
+ ---
@@ -0,0 +1,20 @@
1
+ const { processDirectory } = require('./tsOutputs/src/utils/importReplaceUtility.js');
2
+
3
+ // Check for CLI argument
4
+ const args = process.argv.slice(2);
5
+
6
+ if (args.length !== 1) {
7
+ console.error('Please provide a path to the folder as an argument.');
8
+ process.exit(1);
9
+ }
10
+
11
+ const dirPath = args[0];
12
+
13
+ // Run the processDirectory method
14
+ try {
15
+ processDirectory(dirPath);
16
+ console.log(`Processed directory: ${dirPath}`);
17
+ } catch (error) {
18
+ console.error(`Error processing directory: ${error.message}`);
19
+ process.exit(1);
20
+ }
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ const { test } = require('./tsOutputs/src/fixtures');
2
+
3
+ exports.test = test;
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "sealights-playwright-plugin",
3
+ "version": "2.0.92",
4
+ "description": "Playwright plugin for Sealights integration.",
5
+ "scripts": {
6
+ "prebuild": "node -p \"'//eslint-disable-next-line quotes\\nexport const version = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/utils/version.ts",
7
+ "build": "tsc",
8
+ "lint": "eslint src/**/*.ts",
9
+ "format": "eslint src/**/*.ts --fix",
10
+ "test": "mocha --require ts-node/register test/**/*.spec.ts"
11
+ },
12
+ "keywords": [
13
+ "playwright",
14
+ "sealights"
15
+ ],
16
+ "author": "Kristijan Stefanoski<kristijan.stefanoski@sealights.io>",
17
+ "license": "ISC",
18
+ "devDependencies": {
19
+ "@playwright/test": "^1.46.1",
20
+ "@types/istanbul-lib-coverage": "^2.0.6",
21
+ "@types/mocha": "^10.0.8",
22
+ "@types/node": "^22.7.2",
23
+ "@types/sinon": "^17.0.3",
24
+ "@types/sinon-chai": "^3.2.12",
25
+ "chai": "^4.5.0",
26
+ "husky": "4.3.8",
27
+ "mocha": "^10.7.3",
28
+ "playwright": "^1.46.1",
29
+ "prettier": "^3.0.2",
30
+ "proxyquire": "^2.1.3",
31
+ "sinon": "^19.0.2",
32
+ "sinon-chai": "^3.7.0",
33
+ "ts-node": "^9.1.1",
34
+ "typescript": "^5.6.2"
35
+ },
36
+ "husky": {
37
+ "hooks": {
38
+ "pre-commit": "npm run lint && prettier --write . && git add -A ."
39
+ }
40
+ },
41
+ "dependencies": {
42
+ "slnodejs": "6.1.912"
43
+ },
44
+ "bugs": {
45
+ "url": "https://github.com/Sealights/SL.OnPremis.Plugins.JavaScript/issues"
46
+ },
47
+ "files": [
48
+ "tsOutputs/*",
49
+ "index.js",
50
+ "importReplaceUtility.js"
51
+ ],
52
+ "main": "index.js"
53
+ }
@@ -0,0 +1 @@
1
+ export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.test = void 0;
4
+ const test_1 = require("@playwright/test");
5
+ const utils_1 = require("./utils");
6
+ const disableSealights = utils_1.SealightsConfig.getEnvVar(utils_1.consts.SL_ENVIRONMENT.DISABLE_SEALIGHTS, true);
7
+ if (disableSealights) {
8
+ utils_1.logger.info('Sealights is disabled, skipping Sealights fixtures initialization. The tests will run without Sealights integration.');
9
+ }
10
+ const DEFAULT_FIXTURE_TIMEOUT = 60 * 1000;
11
+ const sealightsTestService = utils_1.SealightsTestSessionService.getInstance();
12
+ exports.test = disableSealights
13
+ ? test_1.test
14
+ : test_1.test.extend({
15
+ forEachWorker: [
16
+ async ({}, use) => {
17
+ await sealightsTestService.init();
18
+ await sealightsTestService.createTestSession();
19
+ await sealightsTestService.getTestRecommendations();
20
+ await use();
21
+ await sealightsTestService.endTestSession();
22
+ },
23
+ { scope: 'worker', auto: true, timeout: DEFAULT_FIXTURE_TIMEOUT, title: 'Sealights Setup and Teardown' },
24
+ ],
25
+ forEachTest: [
26
+ async ({ page }, use, testInfo) => {
27
+ await page.evaluate(({ consts }) => {
28
+ window[consts.SL_WINDOW] = window[consts.SL_WINDOW] || {};
29
+ window[consts.SL_WINDOW][consts.SL_SKIP_AGENT] = true;
30
+ }, { consts: utils_1.consts });
31
+ const shouldSkipTest = await sealightsTestService.shouldSkipTest(testInfo);
32
+ if (shouldSkipTest) {
33
+ exports.test.skip(true, `Test ${testInfo.title} (${testInfo.titlePath}) is excluded by Sealights TIA recommendation.`);
34
+ }
35
+ await use();
36
+ await sealightsTestService.sendTestEvent(testInfo);
37
+ const componentCoverageData = await page.evaluate(() => {
38
+ const coverageObjectPrefix = '$SealightsCoverage_';
39
+ const keys = Object.keys(window).filter((key) => key.includes(coverageObjectPrefix));
40
+ return keys.map((sealightsCoverageKey) => {
41
+ const componentBsid = sealightsCoverageKey.replace(coverageObjectPrefix, '');
42
+ return { buildSessionId: componentBsid, coverage: window[sealightsCoverageKey] };
43
+ });
44
+ });
45
+ const coverage = componentCoverageData.map((componentCoverage) => ({
46
+ buildSessionId: componentCoverage.buildSessionId,
47
+ coverage: utils_1.coverageUtils.mapIstanbulCoverage(componentCoverage.coverage),
48
+ }));
49
+ utils_1.logger.debug(`Successfully mapped coverage for test ${testInfo.title}, found ${coverage.length} components.`);
50
+ await sealightsTestService.sendCoverage(testInfo.title, coverage);
51
+ },
52
+ { auto: true, timeout: DEFAULT_FIXTURE_TIMEOUT, title: 'Sealights Lifecycle Hooks' },
53
+ ],
54
+ });
55
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/fixtures.ts"],"names":[],"mappings":";;;AAAA,2CAAgD;AAGhD,mCAAsG;AAEtG,MAAM,gBAAgB,GAAG,uBAAe,CAAC,SAAS,CAAC,cAAM,CAAC,cAAc,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;AAClG,IAAI,gBAAgB,EAAE,CAAC;IACrB,cAAM,CAAC,IAAI,CACT,sHAAsH,CACvH,CAAC;AACJ,CAAC;AAED,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,CAAC;AAE1C,MAAM,oBAAoB,GAAG,mCAA2B,CAAC,WAAW,EAAE,CAAC;AAO1D,QAAA,IAAI,GAAG,gBAAgB;IAClC,CAAC,CAAC,WAAI;IACN,CAAC,CAAC,WAAI,CAAC,MAAM,CAAiD;QAC1D,aAAa,EAAE;YACb,KAAK,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;gBAEhB,MAAM,oBAAoB,CAAC,IAAI,EAAE,CAAC;gBAClC,MAAM,oBAAoB,CAAC,iBAAiB,EAAE,CAAC;gBAC/C,MAAM,oBAAoB,CAAC,sBAAsB,EAAE,CAAC;gBAEpD,MAAM,GAAG,EAAE,CAAC;gBAGZ,MAAM,oBAAoB,CAAC,cAAc,EAAE,CAAC;YAC9C,CAAC;YACD,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,8BAA8B,EAAE;SACzG;QACD,WAAW,EAAE;YACX,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE;gBAIhC,MAAM,IAAI,CAAC,QAAQ,CACjB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE;oBACb,MAAM,CAA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E,cAAc,EAAE,iBAAiB,CAAC,cAAc;oBAChD,QAAQ,EAAE,qBAAa,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,QAAQ,CAAC;iBACxE,CAAC,CAAC,CAAC;gBACJ,cAAM,CAAC,KAAK,CAAC,yCAAyC,QAAQ,CAAC,KAAK,WAAW,QAAQ,CAAC,MAAM,cAAc,CAAC,CAAC;gBAC9G,MAAM,oBAAoB,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;YACpE,CAAC;YACD,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,2BAA2B,EAAE;SACrF;KACF,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { ITestRunnerArgs } from 'slnodejs';
2
+ export declare class SealightsConfig {
3
+ private static instance;
4
+ private isInitialized;
5
+ private buildSessionId;
6
+ private token;
7
+ private testStage;
8
+ private labId;
9
+ private proxy;
10
+ private collectorUrl;
11
+ private tiaDisabled;
12
+ private constructor();
13
+ static getInstance(): SealightsConfig;
14
+ init(): void;
15
+ getConfigurationObject(): ITestRunnerArgs;
16
+ private resolveEnvironmentConfig;
17
+ private printDebugConfig;
18
+ static getEnvVar(key: string, optional?: boolean): string | boolean | null;
19
+ }
20
+ export declare function EnsureInitialized(target: any, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ 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;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || function (mod) {
25
+ if (mod && mod.__esModule) return mod;
26
+ var result = {};
27
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
+ __setModuleDefault(result, mod);
29
+ return result;
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.SealightsConfig = void 0;
33
+ exports.EnsureInitialized = EnsureInitialized;
34
+ const logger = __importStar(require("./logger"));
35
+ const const_1 = require("./const");
36
+ class SealightsConfig {
37
+ constructor() {
38
+ this.isInitialized = false;
39
+ this.tiaDisabled = false;
40
+ }
41
+ static getInstance() {
42
+ if (!SealightsConfig.instance) {
43
+ SealightsConfig.instance = new SealightsConfig();
44
+ }
45
+ return SealightsConfig.instance;
46
+ }
47
+ init() {
48
+ logger.debug('Initializing Sealights configuration resolver from environment variables...');
49
+ this.resolveEnvironmentConfig();
50
+ this.printDebugConfig();
51
+ this.isInitialized = true;
52
+ }
53
+ getConfigurationObject() {
54
+ return {
55
+ buildsessionid: this.buildSessionId,
56
+ labid: this.labId,
57
+ token: this.token,
58
+ teststage: this.testStage,
59
+ proxy: this.proxy,
60
+ collectorUrl: this.collectorUrl,
61
+ tiaDisabled: this.tiaDisabled,
62
+ };
63
+ }
64
+ resolveEnvironmentConfig() {
65
+ this.buildSessionId = SealightsConfig.getEnvVar(const_1.SL_ENVIRONMENT.BUILD_SESSION_ID);
66
+ this.token = SealightsConfig.getEnvVar(const_1.SL_ENVIRONMENT.TOKEN);
67
+ this.testStage = SealightsConfig.getEnvVar(const_1.SL_ENVIRONMENT.TEST_STAGE);
68
+ this.labId = SealightsConfig.getEnvVar(const_1.SL_ENVIRONMENT.LAB_ID, true);
69
+ this.proxy = SealightsConfig.getEnvVar(const_1.SL_ENVIRONMENT.PROXY, true);
70
+ this.collectorUrl = SealightsConfig.getEnvVar(const_1.SL_ENVIRONMENT.COLLECTOR_URL, true);
71
+ this.tiaDisabled = SealightsConfig.getEnvVar(const_1.SL_ENVIRONMENT.TIA_DISABLED, true) || false;
72
+ }
73
+ printDebugConfig() {
74
+ logger.debug('Configuration:', {
75
+ buildSessionId: this.buildSessionId,
76
+ token: this.token.slice(0, 3) + '...' + this.token.slice(-3),
77
+ testStage: this.testStage,
78
+ labId: this.labId,
79
+ proxy: this.proxy,
80
+ collectorUrl: this.collectorUrl,
81
+ tiaDisabled: this.tiaDisabled,
82
+ });
83
+ }
84
+ static getEnvVar(key, optional = false) {
85
+ const value = process.env[key];
86
+ if (!value) {
87
+ if (optional) {
88
+ logger.debug(`Optional environment variable ${key} is not set.`);
89
+ return null;
90
+ }
91
+ else {
92
+ const message = `Environment variable ${key} is required but was not found.`;
93
+ logger.error(message);
94
+ throw new Error(message);
95
+ }
96
+ }
97
+ const lowerValue = value.toLowerCase();
98
+ if (lowerValue === 'true')
99
+ return true;
100
+ if (lowerValue === 'false')
101
+ return false;
102
+ return value;
103
+ }
104
+ }
105
+ exports.SealightsConfig = SealightsConfig;
106
+ __decorate([
107
+ EnsureInitialized
108
+ ], SealightsConfig.prototype, "getConfigurationObject", null);
109
+ function EnsureInitialized(target, propertyKey, descriptor) {
110
+ const originalMethod = descriptor.value;
111
+ descriptor.value = function (...args) {
112
+ if (!this.isInitialized) {
113
+ throw new Error(`Cannot call ${propertyKey} before initialization. Please call init() first.`);
114
+ }
115
+ return originalMethod.apply(this, args);
116
+ };
117
+ return descriptor;
118
+ }
119
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/utils/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgGA,8CAWC;AAzGD,iDAAmC;AACnC,mCAAyC;AAEzC,MAAa,eAAe;IAe1B;QAbQ,kBAAa,GAAG,KAAK,CAAC;QAWtB,gBAAW,GAAY,KAAK,CAAC;IAEd,CAAC;IAEjB,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;YAC9B,eAAe,CAAC,QAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;QACnD,CAAC;QACD,OAAO,eAAe,CAAC,QAAQ,CAAC;IAClC,CAAC;IAEM,IAAI;QACT,MAAM,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;QAC5F,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAChC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAGM,sBAAsB;QAC3B,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;SACA,CAAC;IAClC,CAAC;IAEO,wBAAwB;QAC9B,IAAI,CAAC,cAAc,GAAW,eAAe,CAAC,SAAS,CAAC,sBAAc,CAAC,gBAAgB,CAAC,CAAC;QACzF,IAAI,CAAC,KAAK,GAAW,eAAe,CAA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C,iCAAiC,GAAG,cAAc,CAAC,CAAC;gBACjE,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,MAAM,OAAO,GAAG,wBAAwB,GAAG,iCAAiC,CAAC;gBAC7E,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3B,CAAC;QACH,CAAC;QAGD,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;QACvC,IAAI,UAAU,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC;QACvC,IAAI,UAAU,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QAEzC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAzFD,0CAyFC;AAxDQ;IADN,iBAAiB;6DAWjB;AAgDH,SAAgB,iBAAiB,CAAC,MAAW,EAAE,WAAmB,EAAE,UAA8B;IAChG,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;IAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;QACzC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,eAAe,WAAW,mDAAmD,CAAC,CAAC;QACjG,CAAC;QACD,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const SL_ENVIRONMENT: {
2
+ BUILD_SESSION_ID: string;
3
+ TOKEN: string;
4
+ TEST_STAGE: string;
5
+ LAB_ID: string;
6
+ PROXY: string;
7
+ COLLECTOR_URL: string;
8
+ TIA_DISABLED: string;
9
+ DISABLE_SEALIGHTS: string;
10
+ };
11
+ export declare const SL_WINDOW = "$Sealihts";
12
+ export declare const SL_SKIP_AGENT = "skipSlAgent";
13
+ export declare const SL_CONTEXT: {
14
+ TEST_NAME: string;
15
+ TEST_SESSION_ID: string;
16
+ SET_CONTEXT_EVENT: string;
17
+ DELETE_CONTEXT_EVENT: string;
18
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SL_CONTEXT = exports.SL_SKIP_AGENT = exports.SL_WINDOW = exports.SL_ENVIRONMENT = void 0;
4
+ exports.SL_ENVIRONMENT = {
5
+ BUILD_SESSION_ID: 'SL_BUILD_SESSION_ID',
6
+ TOKEN: 'SL_TOKEN',
7
+ TEST_STAGE: 'SL_TEST_STAGE',
8
+ LAB_ID: 'SL_LAB_ID',
9
+ PROXY: 'SL_PROXY',
10
+ COLLECTOR_URL: 'SL_COLLECTOR_URL',
11
+ TIA_DISABLED: 'SL_TIA_DISABLED',
12
+ DISABLE_SEALIGHTS: 'SL_DISABLE',
13
+ };
14
+ exports.SL_WINDOW = '$Sealihts';
15
+ exports.SL_SKIP_AGENT = 'skipSlAgent';
16
+ exports.SL_CONTEXT = {
17
+ TEST_NAME: 'x-sl-test-name',
18
+ TEST_SESSION_ID: 'x-sl-test-session-id',
19
+ SET_CONTEXT_EVENT: 'set:context',
20
+ DELETE_CONTEXT_EVENT: 'delete:context',
21
+ };
22
+ //# sourceMappingURL=const.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const.js","sourceRoot":"","sources":["../../../src/utils/const.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC5B,gBAAgB,EAAE,qBAAqB;IACvC,KAAK,EAAE,UAAU;IACjB,UAAU,EAAE,eAAe;IAC3B,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,UAAU;IACjB,aAAa,EAAE,kBAAkB;IACjC,YAAY,EAAE,iBAAiB;IAC/B,iBAAiB,EAAE,YAAY;CAChC,CAAC;AAEW,QAAA,SAAS,GAAG,WAAW,CAAC;AACxB,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,UAAU,GAAG;IACxB,SAAS,EAAE,gBAAgB;IAC3B,eAAe,EAAE,sBAAsB;IACvC,iBAAiB,EAAE,aAAa;IAChC,oBAAoB,EAAE,gBAAgB;CACvC,CAAC"}
@@ -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":";;AAMA,kDAsBC;AAMD,kDA4BC;AAxDD,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;QAEhF,GAAG,CAAC,YAAY,CAAC,GAAG;YAClB,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;YACrC,SAAS,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,SAAS;YACrD,CAAC,EAAE,iBAAiB,CAAC,CAAC;YACtB,KAAK,EAAE,iBAAiB,CAAC,KAAK;YAC9B,IAAI,EAAQ,kBAAkB,CAAC,YAAY,CAAE,CAAC,IAAI;YAClD,IAAI,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,IAAI;YAC3C,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;YACrC,YAAY,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC,YAAY;YAC3D,eAAe,EAAQ,kBAAkB,CAAC,YAAY,CAAE,CAAC,eAAe;SACzE,CAAC;QAEF,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAMD,SAAgB,mBAAmB,CACjC,sBAA6D;IAE7D,IAAI,EAAE,KAAK,EAAE,GAAG,sBAAsB,CAAC;IACvC,MAAM,EAAE,CAAC,EAAE,GAAG,sBAAsB,CAAC;IAErC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,EAAE,CAAC;IACb,CAAC;IAGD,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;IAGlE,MAAM,WAAW,GAAG;QAClB,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAClC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;YAClB,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC;QACN,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,GAAG,EAAE,GAAG,EAAE,EAAE;YACnB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAAE,CAAC;KACT,CAAC;IAEF,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function processFile(filePath: string): void;
2
+ export declare function processDirectory(dirPath: string): void;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.processFile = processFile;
27
+ exports.processDirectory = processDirectory;
28
+ const fs = __importStar(require("fs"));
29
+ const path = __importStar(require("path"));
30
+ function processFile(filePath) {
31
+ const content = fs.readFileSync(filePath, 'utf8');
32
+ let updatedContent = content;
33
+ const requireRegex = /const\s*\{\s*([^}]+)\s*\}\s*=\s*require\(["']@playwright\/test["']\);/g;
34
+ updatedContent = updatedContent.replace(requireRegex, (match, destructured) => {
35
+ const quotes = match.includes('"') ? '"' : "'";
36
+ const imports = destructured.split(',').map((imp) => imp.trim());
37
+ const nonTestImports = imports.filter((imp) => !imp.startsWith('test'));
38
+ const testImport = imports.find((imp) => imp.startsWith('test'));
39
+ let newRequire = '';
40
+ if (nonTestImports.length > 0) {
41
+ newRequire = `const { ${nonTestImports.join(', ')} } = require(${quotes}@playwright/test${quotes});\n`;
42
+ }
43
+ if (testImport) {
44
+ newRequire += `const { ${testImport} } = require(${quotes}sealights-playwright-plugin${quotes});\n`;
45
+ }
46
+ return newRequire.trim();
47
+ });
48
+ const importRegex = /import\s*\{\s*([^}]+)\s*\}\s*from\s*["']@playwright\/test["'];/g;
49
+ updatedContent = updatedContent.replace(importRegex, (match, destructured) => {
50
+ const quotes = match.includes('"') ? '"' : "'";
51
+ const imports = destructured.split(',').map((imp) => imp.trim());
52
+ const nonTestImports = imports.filter((imp) => !imp.startsWith('test'));
53
+ const testImport = imports.find((imp) => imp.startsWith('test'));
54
+ let newImport = '';
55
+ if (nonTestImports.length > 0) {
56
+ newImport = `import { ${nonTestImports.join(', ')} } from ${quotes}@playwright/test${quotes};\n`;
57
+ }
58
+ if (testImport) {
59
+ newImport += `import { ${testImport} } from ${quotes}sealights-playwright-plugin${quotes};\n`;
60
+ }
61
+ return newImport.trim();
62
+ });
63
+ fs.writeFileSync(filePath, updatedContent);
64
+ }
65
+ function processDirectory(dirPath) {
66
+ const files = fs.readdirSync(dirPath);
67
+ files.forEach((file) => {
68
+ const filePath = path.join(dirPath, file);
69
+ const stat = fs.statSync(filePath);
70
+ if (stat.isDirectory()) {
71
+ processDirectory(filePath);
72
+ }
73
+ else if (filePath.endsWith('.js') || filePath.endsWith('.ts')) {
74
+ processFile(filePath);
75
+ }
76
+ });
77
+ }
78
+ //# sourceMappingURL=importReplaceUtility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importReplaceUtility.js","sourceRoot":"","sources":["../../../src/utils/importReplaceUtility.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGA,kCAmDC;AAED,4CAWC;AAnED,uCAAyB;AACzB,2CAA6B;AAE7B,SAAgB,WAAW,CAAC,QAAgB;IAC1C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClD,IAAI,cAAc,GAAG,OAAO,CAAC;IAI7B,MAAM,YAAY,GAAG,wEAAwE,CAAC;IAC9F,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;QAC5E,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAC/C,MAAM,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,GAA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ightsConfig } from './config';
2
+ export * as consts from './const';
3
+ export * as coverageUtils from './coverage';
4
+ export * as logger from './logger';
5
+ export { SealightsTestSessionService } from './service';
6
+ export * from './version';
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.SealightsTestSessionService = exports.logger = exports.coverageUtils = exports.consts = exports.SealightsConfig = void 0;
30
+ var config_1 = require("./config");
31
+ Object.defineProperty(exports, "SealightsConfig", { enumerable: true, get: function () { return config_1.SealightsConfig; } });
32
+ exports.consts = __importStar(require("./const"));
33
+ exports.coverageUtils = __importStar(require("./coverage"));
34
+ exports.logger = __importStar(require("./logger"));
35
+ var service_1 = require("./service");
36
+ Object.defineProperty(exports, "SealightsTestSessionService", { enumerable: true, get: function () { return service_1.SealightsTestSessionService; } });
37
+ __exportStar(require("./version"), exports);
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AACxB,kDAAkC;AAClC,4DAA4C;AAC5C,mDAAmC;AACnC,qCAAwD;AAA/C,sHAAA,2BAA2B,OAAA;AACpC,4CAA0B"}
@@ -0,0 +1,10 @@
1
+ declare enum LOG_LEVEL {
2
+ INFO = "INFO",
3
+ DEBUG = "DEBUG",
4
+ ERROR = "ERROR"
5
+ }
6
+ export declare function log(LEVEL?: LOG_LEVEL, ...args: any[]): void;
7
+ export declare function info(...args: any[]): void;
8
+ export declare function error(...args: any[]): void;
9
+ export declare function debug(...args: any[]): void;
10
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.log = log;
4
+ exports.info = info;
5
+ exports.error = error;
6
+ exports.debug = debug;
7
+ const SEALIGHTS_PREFIX = 'Sealights Plugin:';
8
+ var LOG_LEVEL;
9
+ (function (LOG_LEVEL) {
10
+ LOG_LEVEL["INFO"] = "INFO";
11
+ LOG_LEVEL["DEBUG"] = "DEBUG";
12
+ LOG_LEVEL["ERROR"] = "ERROR";
13
+ })(LOG_LEVEL || (LOG_LEVEL = {}));
14
+ function log(LEVEL = LOG_LEVEL.INFO, ...args) {
15
+ console.log(`${new Date().toISOString()} ${LEVEL} ${SEALIGHTS_PREFIX}`, ...args);
16
+ }
17
+ function info(...args) {
18
+ log(LOG_LEVEL.INFO, ...args);
19
+ }
20
+ function error(...args) {
21
+ log(LOG_LEVEL.ERROR, ...args);
22
+ }
23
+ function debug(...args) {
24
+ if (process.env.NODE_DEBUG === 'sl') {
25
+ log(LOG_LEVEL.DEBUG, ...args);
26
+ }
27
+ }
28
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../../src/utils/logger.ts"],"names":[],"mappings":";;AAQA,kBAGC;AAED,oBAEC;AAED,sBAEC;AAED,sBAIC;AAzBD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C,IAAK,SAIJ;AAJD,WAAK,SAAS;IACZ,0BAAa,CAAA;IACb,4BAAe,CAAA;IACf,4BAAe,CAAA;AACjB,CAAC,EAJI,SAAS,KAAT,SAAS,QAIb;AAED,SAAgB,GAAG,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI;IAEjD,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,IAAI,KAAK,IAAI,gBAAgB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,IAAI,CAAC,GAAG,IAAI;IAC1B,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,KAAK,CAAC,GAAG,IAAI;IAC3B,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,SAAgB,KAAK,CAAC,GAAG,IAAI;IAC3B,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;QACpC,GAAG,CAAC,SAAS,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;IAChC,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { TestInfo } from '@playwright/test';
2
+ export declare class SealightsTestSessionService {
3
+ private static instance;
4
+ private remoteAgent;
5
+ private configurationError;
6
+ private SLConfig;
7
+ private excludedTests;
8
+ private constructor();
9
+ init(): Promise<void>;
10
+ static getInstance(): SealightsTestSessionService;
11
+ shouldSkipTest(testInfo: TestInfo): boolean;
12
+ getTestSessionId(): string;
13
+ createTestSession(): Promise<void>;
14
+ endTestSession(): Promise<void>;
15
+ getTestRecommendations(): Promise<Record<string, boolean>>;
16
+ sendTestEvent(testInfo: TestInfo): Promise<void>;
17
+ sendCoverage(testName: string, componentCoverageData: {
18
+ buildSessionId: string;
19
+ coverage: any;
20
+ }[]): Promise<void>;
21
+ static runServiceMethodSafe(_: unknown, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
22
+ private static InitSealightsConfig;
23
+ }
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
19
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
20
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
21
+ 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;
22
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
23
+ };
24
+ var __importStar = (this && this.__importStar) || function (mod) {
25
+ if (mod && mod.__esModule) return mod;
26
+ var result = {};
27
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
28
+ __setModuleDefault(result, mod);
29
+ return result;
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.SealightsTestSessionService = void 0;
33
+ const slnodejs_1 = require("slnodejs");
34
+ const logger = __importStar(require("./logger"));
35
+ const config_1 = require("./config");
36
+ const version_1 = require("./version");
37
+ class SealightsTestSessionService {
38
+ constructor() {
39
+ this.configurationError = false;
40
+ this.excludedTests = undefined;
41
+ this.SLConfig = config_1.SealightsConfig.getInstance();
42
+ }
43
+ async init() {
44
+ try {
45
+ const remoteAgentConfig = this.SLConfig.getConfigurationObject();
46
+ logger.debug('Initializing Sealights remote agent creation...');
47
+ this.remoteAgent = await (0, slnodejs_1.createRemoteAgent)(remoteAgentConfig);
48
+ await this.remoteAgent.start({
49
+ tags: [
50
+ {
51
+ name: 'playwright-plugin',
52
+ version: version_1.version,
53
+ },
54
+ ],
55
+ });
56
+ logger.info('Sealights remote agent successfully created.');
57
+ }
58
+ catch (error) {
59
+ this.configurationError = true;
60
+ logger.error('Failed to initialize Sealights test service, the test run will resume without Sealights integration.', error);
61
+ }
62
+ }
63
+ static getInstance() {
64
+ if (!SealightsTestSessionService.instance) {
65
+ SealightsTestSessionService.instance = new SealightsTestSessionService();
66
+ }
67
+ return SealightsTestSessionService.instance;
68
+ }
69
+ shouldSkipTest(testInfo) {
70
+ return this.excludedTests?.[testInfo.title] || false;
71
+ }
72
+ getTestSessionId() {
73
+ return this.remoteAgent.getExecutionData().executionId;
74
+ }
75
+ async createTestSession() {
76
+ const { teststage, buildsessionid, labid } = this.SLConfig.getConfigurationObject();
77
+ logger.debug('Initiating test session creation with parameters: ', {
78
+ testStage: teststage,
79
+ bsid: buildsessionid,
80
+ labid: labid,
81
+ });
82
+ await this.remoteAgent.startExecution();
83
+ logger.info('Test session successfully created.');
84
+ }
85
+ async endTestSession() {
86
+ logger.debug('Initiating test session end...');
87
+ await this.remoteAgent.stop();
88
+ logger.info('Test session successfully ended.');
89
+ }
90
+ async getTestRecommendations() {
91
+ if (this.excludedTests) {
92
+ return this.excludedTests;
93
+ }
94
+ logger.debug('Initiating test recommendation retrieval...');
95
+ this.excludedTests = await this.remoteAgent.getExcludedTests();
96
+ logger.info(`Test recommendation successfully retrieved. ${Object.keys(this.excludedTests).length} tests will be marked for exclusion.`);
97
+ return this.excludedTests;
98
+ }
99
+ async sendTestEvent(testInfo) {
100
+ logger.debug(`Initiating test event send for test ${testInfo.title} with status ${testInfo.status}, duration ${testInfo.duration} and spec titlePath ${testInfo.titlePath}`);
101
+ const testStartTime = Date.now() - testInfo.duration;
102
+ await this.remoteAgent.testStart(testInfo.title, testInfo.titlePath.join(' '), testStartTime);
103
+ logger.debug(`Test start event successfully sent for test ${testInfo.title}`);
104
+ await this.remoteAgent.testEnd(testInfo.title, testInfo.titlePath.join(' '), Date.now(), testInfo.status, undefined);
105
+ logger.debug(`Test end event successfully sent for test ${testInfo.title}`);
106
+ }
107
+ async sendCoverage(testName, componentCoverageData) {
108
+ logger.debug(`Initiating coverage send for test: ${testName}`);
109
+ await this.remoteAgent.sendComponentsTestCoverage(testName, componentCoverageData);
110
+ logger.debug(`Footprints successfully sent for test ${testName}.`);
111
+ }
112
+ static runServiceMethodSafe(_, propertyKey, descriptor) {
113
+ const originalMethod = descriptor.value;
114
+ descriptor.value = async function (...args) {
115
+ try {
116
+ if (this.configurationError ||
117
+ !this.remoteAgent) {
118
+ logger.debug(`Skipping method ${propertyKey} due to configuration error or missing remote agent.`);
119
+ return null;
120
+ }
121
+ return await originalMethod.apply(this, args);
122
+ }
123
+ catch (error) {
124
+ logger.error(`An error occurred in method ${propertyKey}:`, error);
125
+ }
126
+ };
127
+ return descriptor;
128
+ }
129
+ static InitSealightsConfig(_, propertyKey, descriptor) {
130
+ const originalMethod = descriptor.value;
131
+ descriptor.value = async function (...args) {
132
+ try {
133
+ this.SLConfig.init();
134
+ return await originalMethod.apply(this, args);
135
+ }
136
+ catch (error) {
137
+ this.configurationError = true;
138
+ logger.error(`Failed to initialize Sealights configuration before executing ${propertyKey}:`, error);
139
+ }
140
+ };
141
+ return descriptor;
142
+ }
143
+ }
144
+ exports.SealightsTestSessionService = SealightsTestSessionService;
145
+ __decorate([
146
+ SealightsTestSessionService.InitSealightsConfig
147
+ ], SealightsTestSessionService.prototype, "init", null);
148
+ __decorate([
149
+ SealightsTestSessionService.runServiceMethodSafe
150
+ ], SealightsTestSessionService.prototype, "shouldSkipTest", null);
151
+ __decorate([
152
+ SealightsTestSessionService.runServiceMethodSafe
153
+ ], SealightsTestSessionService.prototype, "getTestSessionId", null);
154
+ __decorate([
155
+ SealightsTestSessionService.runServiceMethodSafe
156
+ ], SealightsTestSessionService.prototype, "createTestSession", null);
157
+ __decorate([
158
+ SealightsTestSessionService.runServiceMethodSafe
159
+ ], SealightsTestSessionService.prototype, "endTestSession", null);
160
+ __decorate([
161
+ SealightsTestSessionService.runServiceMethodSafe
162
+ ], SealightsTestSessionService.prototype, "getTestRecommendations", null);
163
+ __decorate([
164
+ SealightsTestSessionService.runServiceMethodSafe
165
+ ], SealightsTestSessionService.prototype, "sendTestEvent", null);
166
+ __decorate([
167
+ SealightsTestSessionService.runServiceMethodSafe
168
+ ], SealightsTestSessionService.prototype, "sendCoverage", null);
169
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","sourceRoot":"","sources":["../../../src/utils/service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA0D;AAG1D,iDAAmC;AACnC,qCAA2C;AAC3C,uCAAoC;AAEpC,MAAa,2BAA2B;IAQtC;QAJQ,uBAAkB,GAAG,KAAK,CAAC;QAE3B,kBAAa,GAA4B,SAAS,CAAC;QAGzD,IAAI,CAAC,QAAQ,GAAG,wBAAe,CAAC,WAAW,EAAE,CAAC;IAChD,CAAC;IAGY,AAAN,KAAK,CAAC,IAAI;QACf,IAAI,CAAC;YACH,MAAM,iBAAiB,GAAG,IAAI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mBAAmB,CAAC,CAAU,EAAE,WAAmB,EAAE,UAA8B;QAChG,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;QAExC,UAAU,CAAC,KAAK,GAAG,KAAK,WAAW,GAAG,IAAe;YACnD,IAAI,CAAC;gBAEH,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAErB,OAAO,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAChD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;gBAC/B,MAAM,CAAC,KAAK,CAAC,iEAAiE,WAAW,GAAG,EAAE,KAAK,CAAC,CAAC;YACvG,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAzKD,kEAyKC;AA5Jc;IADZ,2BAA2B,CAAC,mBAAmB;uDAwB/C;AAUM;IADN,2BAA2B,CAAC,oBAAoB;iEAGhD;AAGM;IADN,2BAA2B,CAAC,oBAAoB;mEAGhD;AAGY;IADZ,2BAA2B,CAAC,oBAAoB;oEAahD;AAGY;IADZ,2BAA2B,CAAC,oBAAoB;iEAMhD;AAGY;IADZ,2BAA2B,CAAC,oBAAoB;yEAiBhD;AAGY;IADZ,2BAA2B,CAAC,oBAAoB;gEAkBhD;AAGY;IADZ,2BAA2B,CAAC,oBAAoB;+DAWhD"}
@@ -0,0 +1 @@
1
+ export declare const version = "2.0.92";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.version = void 0;
4
+ exports.version = "2.0.92";
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/utils/version.ts"],"names":[],"mappings":";;;AACa,QAAA,OAAO,GAAG,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const chai_1 = require("chai");
30
+ const sinon = __importStar(require("sinon"));
31
+ const proxyquire_1 = __importDefault(require("proxyquire"));
32
+ const path = __importStar(require("path"));
33
+ const chai = __importStar(require("chai"));
34
+ const sinon_chai_1 = __importDefault(require("sinon-chai"));
35
+ const fs = __importStar(require("fs"));
36
+ chai.use(sinon_chai_1.default);
37
+ describe('processFile', () => {
38
+ const mockFilePath = path.join(__dirname, 'mockFile.js');
39
+ let readFileSyncStub;
40
+ let writeFileSyncStub;
41
+ const mockFS = {
42
+ readFileSync: (filePath) => readFileSyncStub(filePath),
43
+ writeFileSync: (filePath, content) => writeFileSyncStub(filePath, content),
44
+ };
45
+ const { processFile } = (0, proxyquire_1.default)('../src/utils/importReplaceUtility', {
46
+ fs: mockFS,
47
+ });
48
+ beforeEach(() => {
49
+ readFileSyncStub = sinon.stub();
50
+ writeFileSyncStub = sinon.stub();
51
+ });
52
+ afterEach(() => {
53
+ sinon.restore();
54
+ });
55
+ it('should handle single require with test import', () => {
56
+ const inputContent = 'const { test } = require("@playwright/test");';
57
+ const expectedContent = 'const { test } = require("sealights-playwright-plugin");';
58
+ readFileSyncStub.returns(inputContent);
59
+ processFile(mockFilePath);
60
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
61
+ });
62
+ it('should handle single import with test import', () => {
63
+ const inputContent = 'import { test } from "@playwright/test";';
64
+ const expectedContent = 'import { test } from "sealights-playwright-plugin";';
65
+ readFileSyncStub.returns(inputContent);
66
+ processFile(mockFilePath);
67
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
68
+ });
69
+ it('should handle multiple require destructuring with test', () => {
70
+ const inputContent = "const { test, expect } = require('@playwright/test');";
71
+ const expectedContent = "const { expect } = require('@playwright/test');\nconst { test } = require('sealights-playwright-plugin');";
72
+ readFileSyncStub.returns(inputContent);
73
+ processFile(mockFilePath);
74
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
75
+ });
76
+ it('should handle multiple import destructuring with test', () => {
77
+ const inputContent = 'import { test, expect, chromium } from "@playwright/test";';
78
+ const expectedContent = 'import { expect, chromium } from "@playwright/test";\nimport { test } from "sealights-playwright-plugin";';
79
+ readFileSyncStub.returns(inputContent);
80
+ processFile(mockFilePath);
81
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
82
+ });
83
+ it('should handle named import with test', () => {
84
+ const inputContent = "import { test as newTest } from '@playwright/test';";
85
+ const expectedContent = "import { test as newTest } from 'sealights-playwright-plugin';";
86
+ readFileSyncStub.returns(inputContent);
87
+ processFile(mockFilePath);
88
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
89
+ });
90
+ it('should handle named require with test', () => {
91
+ const inputContent = "const { test: newTest } = require('@playwright/test');";
92
+ const expectedContent = "const { test: newTest } = require('sealights-playwright-plugin');";
93
+ readFileSyncStub.returns(inputContent);
94
+ processFile(mockFilePath);
95
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
96
+ });
97
+ it('should handle complex destructuring with non-test imports (require)', () => {
98
+ const inputContent = "const { test, expect, firefox } = require('@playwright/test');";
99
+ const expectedContent = "const { expect, firefox } = require('@playwright/test');\nconst { test } = require('sealights-playwright-plugin');";
100
+ readFileSyncStub.returns(inputContent);
101
+ processFile(mockFilePath);
102
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
103
+ });
104
+ it('should handle complex destructuring with non-test imports (import)', () => {
105
+ const inputContent = "import { test, expect, webkit } from '@playwright/test';";
106
+ const expectedContent = "import { expect, webkit } from '@playwright/test';\nimport { test } from 'sealights-playwright-plugin';";
107
+ readFileSyncStub.returns(inputContent);
108
+ processFile(mockFilePath);
109
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
110
+ });
111
+ it('should not modify files without test import', () => {
112
+ const inputContent = "import { expect } from '@playwright/test';";
113
+ const expectedContent = inputContent;
114
+ readFileSyncStub.returns(inputContent);
115
+ processFile(mockFilePath);
116
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent);
117
+ });
118
+ it('should handle multiple lines of imports and requires', () => {
119
+ const inputContent = `const { test, expect } = require(\'@playwright/test\');\nconst { firefox } = require(\'@playwright/test\');\nimport { test as renamedTest, chromium } from \'@playwright/test\';
120
+ `;
121
+ const expectedContent = `const { expect } = require('@playwright/test');\nconst { test } = require('sealights-playwright-plugin');\nconst { firefox } = require('@playwright/test');\nimport { chromium } from '@playwright/test';\nimport { test as renamedTest } from 'sealights-playwright-plugin';
122
+ `;
123
+ readFileSyncStub.returns(inputContent.trim());
124
+ processFile(mockFilePath);
125
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(mockFilePath, expectedContent.trim());
126
+ });
127
+ it('should ensure full file processing equals expected result', () => {
128
+ const originalFilePath = path.join(__dirname, 'mocks/import_variations_original.js');
129
+ const expectedFilePath = path.join(__dirname, 'mocks/import_variations_result.js');
130
+ const expectedContent = fs.readFileSync(expectedFilePath, 'utf-8').trim();
131
+ const originalContent = fs.readFileSync(originalFilePath, 'utf-8').trim();
132
+ readFileSyncStub.returns(originalContent);
133
+ processFile(originalFilePath);
134
+ (0, chai_1.expect)(writeFileSyncStub).to.have.been.calledWith(originalFilePath, expectedContent);
135
+ });
136
+ });
137
+ //# sourceMappingURL=importReplaceUtility.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importReplaceUtility.spec.js","sourceRoot":"","sources":["../../test/importReplaceUtility.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA8B;AAC9B,6CAA+B;AAC/B,4DAAoC;AACpC,2CAA6B;AAC7B,2CAA6B;AAC7B,4DAAmC;AACnC,uCAAyB;AAEzB,IAAI,CAAC,GAAG,CAAC,oBAAS,CAAC,CAAC;AAEpB,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAEzD,IAAI,gBAAiC,CAAC;IACtC,IAAI,iBAAkC,CAAC;IAGvC,MAAM,MAAM,GAAG;QACb,YAAY,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QAC9D,aAAa,EAAE,CAAC,QAAgB,EAAE,OAAe,EAAE,EAAE,CAAC,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC;KAC3F,CAAC;IAGF,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,oBAAU,EAAC,mCAAmC,EAA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