@azure/playwright 1.1.2 → 1.1.3-alpha.20260310.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/common/types.d.ts +1 -1
- package/dist/browser/common/types.d.ts.map +1 -1
- package/dist/browser/common/types.js.map +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/utils/PlaywrightServiceClient.d.ts +1 -1
- package/dist/browser/utils/PlaywrightServiceClient.d.ts.map +1 -1
- package/dist/browser/utils/PlaywrightServiceClient.js.map +1 -1
- package/dist/browser/utils/playwrightReporterStorageManager.d.ts.map +1 -1
- package/dist/browser/utils/playwrightReporterStorageManager.js.map +1 -1
- package/dist/browser/utils/utils.d.ts +2 -2
- package/dist/browser/utils/utils.d.ts.map +1 -1
- package/dist/browser/utils/utils.js.map +1 -1
- package/dist/commonjs/common/constants.js +127 -95
- package/dist/commonjs/common/constants.js.map +7 -1
- package/dist/commonjs/common/customerConfig.js +31 -14
- package/dist/commonjs/common/customerConfig.js.map +7 -1
- package/dist/commonjs/common/entraIdAccessToken.js +106 -83
- package/dist/commonjs/common/entraIdAccessToken.js.map +7 -1
- package/dist/commonjs/common/environmentVariables.js +43 -24
- package/dist/commonjs/common/environmentVariables.js.map +7 -1
- package/dist/commonjs/common/executor.js +88 -67
- package/dist/commonjs/common/executor.js.map +7 -1
- package/dist/commonjs/common/httpService.js +54 -35
- package/dist/commonjs/common/httpService.js.map +7 -1
- package/dist/commonjs/common/logger.js +28 -8
- package/dist/commonjs/common/logger.js.map +7 -1
- package/dist/commonjs/common/messages.js +189 -169
- package/dist/commonjs/common/messages.js.map +7 -1
- package/dist/commonjs/common/playwrightServiceConfig.js +113 -98
- package/dist/commonjs/common/playwrightServiceConfig.js.map +7 -1
- package/dist/commonjs/common/state.js +30 -10
- package/dist/commonjs/common/state.js.map +7 -1
- package/dist/commonjs/common/types.d.ts +1 -1
- package/dist/commonjs/common/types.d.ts.map +1 -1
- package/dist/commonjs/common/types.js +15 -5
- package/dist/commonjs/common/types.js.map +7 -1
- package/dist/commonjs/core/global/playwright-service-global-setup.js +52 -26
- package/dist/commonjs/core/global/playwright-service-global-setup.js.map +7 -1
- package/dist/commonjs/core/global/playwright-service-global-teardown.js +49 -20
- package/dist/commonjs/core/global/playwright-service-global-teardown.js.map +7 -1
- package/dist/commonjs/core/initializePlaywrightServiceTestRun.js +39 -27
- package/dist/commonjs/core/initializePlaywrightServiceTestRun.js.map +7 -1
- package/dist/commonjs/core/playwrightService.js +166 -205
- package/dist/commonjs/core/playwrightService.js.map +7 -1
- package/dist/commonjs/core/playwrightServiceEntra.js +67 -48
- package/dist/commonjs/core/playwrightServiceEntra.js.map +7 -1
- package/dist/commonjs/core/playwrightServiceUtils.d.ts +1 -1
- package/dist/commonjs/core/playwrightServiceUtils.d.ts.map +1 -0
- package/dist/commonjs/core/playwrightServiceUtils.js +44 -11
- package/dist/commonjs/core/playwrightServiceUtils.js.map +7 -0
- package/dist/commonjs/index.d.ts +1 -1
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js +36 -18
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/reporter/index.js +34 -15
- package/dist/commonjs/reporter/index.js.map +7 -1
- package/dist/commonjs/reporter/playwrightReporter.js +222 -216
- package/dist/commonjs/reporter/playwrightReporter.js.map +7 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/commonjs/utils/PlaywrightServiceClient.d.ts +1 -1
- package/dist/commonjs/utils/PlaywrightServiceClient.d.ts.map +1 -1
- package/dist/commonjs/utils/PlaywrightServiceClient.js +140 -91
- package/dist/commonjs/utils/PlaywrightServiceClient.js.map +7 -1
- package/dist/commonjs/utils/cIInfoProvider.js +81 -74
- package/dist/commonjs/utils/cIInfoProvider.js.map +7 -1
- package/dist/commonjs/utils/getPackageVersion.d.ts +1 -1
- package/dist/commonjs/utils/getPackageVersion.d.ts.map +1 -0
- package/dist/commonjs/utils/getPackageVersion.js +50 -19
- package/dist/commonjs/utils/getPackageVersion.js.map +7 -0
- package/dist/commonjs/utils/getPlaywrightVersion.js +42 -21
- package/dist/commonjs/utils/getPlaywrightVersion.js.map +7 -1
- package/dist/commonjs/utils/packageManager.js +59 -40
- package/dist/commonjs/utils/packageManager.js.map +7 -1
- package/dist/commonjs/utils/parseJwt.js +37 -17
- package/dist/commonjs/utils/parseJwt.js.map +7 -1
- package/dist/commonjs/utils/playwrightReporterStorageManager.d.ts.map +1 -1
- package/dist/commonjs/utils/playwrightReporterStorageManager.js +381 -342
- package/dist/commonjs/utils/playwrightReporterStorageManager.js.map +7 -1
- package/dist/commonjs/utils/utils.d.ts +2 -2
- package/dist/commonjs/utils/utils.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.js +417 -369
- package/dist/commonjs/utils/utils.js.map +7 -1
- package/dist/esm/common/constants.js +92 -92
- package/dist/esm/common/constants.js.map +7 -1
- package/dist/esm/common/customerConfig.js +11 -11
- package/dist/esm/common/customerConfig.js.map +7 -1
- package/dist/esm/common/entraIdAccessToken.js +85 -77
- package/dist/esm/common/entraIdAccessToken.js.map +7 -1
- package/dist/esm/common/environmentVariables.js +19 -19
- package/dist/esm/common/environmentVariables.js.map +7 -1
- package/dist/esm/common/executor.js +51 -58
- package/dist/esm/common/executor.js.map +7 -1
- package/dist/esm/common/httpService.js +34 -29
- package/dist/esm/common/httpService.js.map +7 -1
- package/dist/esm/common/logger.js +4 -4
- package/dist/esm/common/logger.js.map +7 -1
- package/dist/esm/common/messages.js +166 -166
- package/dist/esm/common/messages.js.map +7 -1
- package/dist/esm/common/playwrightServiceConfig.js +91 -91
- package/dist/esm/common/playwrightServiceConfig.js.map +7 -1
- package/dist/esm/common/state.js +7 -7
- package/dist/esm/common/state.js.map +7 -1
- package/dist/esm/common/types.d.ts +1 -1
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js +0 -4
- package/dist/esm/common/types.js.map +7 -1
- package/dist/esm/core/global/playwright-service-global-setup.js +17 -17
- package/dist/esm/core/global/playwright-service-global-setup.js.map +7 -1
- package/dist/esm/core/global/playwright-service-global-teardown.js +16 -13
- package/dist/esm/core/global/playwright-service-global-teardown.js.map +7 -1
- package/dist/esm/core/initializePlaywrightServiceTestRun.js +13 -21
- package/dist/esm/core/initializePlaywrightServiceTestRun.js.map +7 -1
- package/dist/esm/core/playwrightService.js +144 -195
- package/dist/esm/core/playwrightService.js.map +7 -1
- package/dist/esm/core/playwrightServiceEntra.js +44 -42
- package/dist/esm/core/playwrightServiceEntra.js.map +7 -1
- package/dist/esm/core/playwrightServiceUtils.js +6 -8
- package/dist/esm/core/playwrightServiceUtils.js.map +7 -1
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +7 -9
- package/dist/esm/index.js.map +7 -1
- package/dist/esm/reporter/index.js +4 -11
- package/dist/esm/reporter/index.js.map +7 -1
- package/dist/esm/reporter/playwrightReporter.js +202 -207
- package/dist/esm/reporter/playwrightReporter.js.map +7 -1
- package/dist/esm/utils/PlaywrightServiceClient.d.ts +1 -1
- package/dist/esm/utils/PlaywrightServiceClient.d.ts.map +1 -1
- package/dist/esm/utils/PlaywrightServiceClient.js +120 -85
- package/dist/esm/utils/PlaywrightServiceClient.js.map +7 -1
- package/dist/esm/utils/cIInfoProvider.js +58 -71
- package/dist/esm/utils/cIInfoProvider.js.map +7 -1
- package/dist/esm/utils/getPackageVersion.js +12 -17
- package/dist/esm/utils/getPackageVersion.js.map +7 -1
- package/dist/esm/utils/getPlaywrightVersion.js +15 -13
- package/dist/esm/utils/getPlaywrightVersion.js.map +7 -1
- package/dist/esm/utils/packageManager.js +37 -37
- package/dist/esm/utils/packageManager.js.map +7 -1
- package/dist/esm/utils/parseJwt.js +15 -14
- package/dist/esm/utils/parseJwt.js.map +7 -1
- package/dist/esm/utils/playwrightReporterStorageManager.d.ts.map +1 -1
- package/dist/esm/utils/playwrightReporterStorageManager.js +358 -333
- package/dist/esm/utils/playwrightReporterStorageManager.js.map +7 -1
- package/dist/esm/utils/utils.d.ts +2 -2
- package/dist/esm/utils/utils.d.ts.map +1 -1
- package/dist/esm/utils/utils.js +377 -350
- package/dist/esm/utils/utils.js.map +7 -1
- package/dist/react-native/common/types.d.ts +1 -1
- package/dist/react-native/common/types.d.ts.map +1 -1
- package/dist/react-native/common/types.js.map +1 -1
- package/dist/react-native/index.d.ts +1 -1
- package/dist/react-native/index.d.ts.map +1 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native/utils/PlaywrightServiceClient.d.ts +1 -1
- package/dist/react-native/utils/PlaywrightServiceClient.d.ts.map +1 -1
- package/dist/react-native/utils/PlaywrightServiceClient.js.map +1 -1
- package/dist/react-native/utils/playwrightReporterStorageManager.d.ts.map +1 -1
- package/dist/react-native/utils/playwrightReporterStorageManager.js.map +1 -1
- package/dist/react-native/utils/utils.d.ts +2 -2
- package/dist/react-native/utils/utils.d.ts.map +1 -1
- package/dist/react-native/utils/utils.js.map +1 -1
- package/package.json +6 -24
- package/dist/commonjs/core/playwrightServiceUtils-cjs.cjs.map +0 -1
- package/dist/commonjs/core/playwrightServiceUtils-cjs.d.cts.map +0 -1
- package/dist/commonjs/utils/getPackageVersion-cjs.cjs.map +0 -1
- package/dist/commonjs/utils/getPackageVersion-cjs.d.cts.map +0 -1
|
@@ -1,105 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var playwrightServiceConfig_exports = {};
|
|
19
|
+
__export(playwrightServiceConfig_exports, {
|
|
20
|
+
PlaywrightServiceConfig: () => PlaywrightServiceConfig
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(playwrightServiceConfig_exports);
|
|
23
|
+
var import_constants = require("./constants.js");
|
|
24
|
+
var import_utils = require("../utils/utils.js");
|
|
25
|
+
var import_cIInfoProvider = require("../utils/cIInfoProvider.js");
|
|
26
|
+
var import_state = require("./state.js");
|
|
27
|
+
var import_messages = require("./messages.js");
|
|
11
28
|
class PlaywrightServiceConfig {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
serviceOs;
|
|
30
|
+
runId;
|
|
31
|
+
connectTimeout;
|
|
32
|
+
slowMo;
|
|
33
|
+
exposeNetwork;
|
|
34
|
+
runName;
|
|
35
|
+
apiVersion;
|
|
36
|
+
_serviceAuthType = import_constants.ServiceAuth.ENTRA_ID;
|
|
37
|
+
credential;
|
|
38
|
+
constructor() {
|
|
39
|
+
this.serviceOs = process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_OS] || import_constants.DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS;
|
|
40
|
+
this.runName = process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || "";
|
|
41
|
+
this.runId = process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || "";
|
|
42
|
+
this.connectTimeout = import_constants.DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;
|
|
43
|
+
this.slowMo = import_constants.DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;
|
|
44
|
+
this.exposeNetwork = import_constants.DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;
|
|
45
|
+
this.apiVersion = process.env[import_constants.InternalEnvironmentVariables.MPT_API_VERSION] || import_constants.Constants.LatestAPIVersion;
|
|
46
|
+
}
|
|
47
|
+
static get instance() {
|
|
48
|
+
if (!import_state.state.playwrightServiceConfig) {
|
|
49
|
+
import_state.state.playwrightServiceConfig = new PlaywrightServiceConfig();
|
|
31
50
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
return import_state.state.playwrightServiceConfig;
|
|
52
|
+
}
|
|
53
|
+
get serviceAuthType() {
|
|
54
|
+
return this._serviceAuthType;
|
|
55
|
+
}
|
|
56
|
+
set serviceAuthType(value) {
|
|
57
|
+
this._serviceAuthType = value;
|
|
58
|
+
}
|
|
59
|
+
async initialize() {
|
|
60
|
+
if (!this.runName) {
|
|
61
|
+
const ciConfigInfo = import_cIInfoProvider.CIInfoProvider.getCIInfo();
|
|
62
|
+
this.runName = await (0, import_utils.getRunName)(ciConfigInfo);
|
|
37
63
|
}
|
|
38
|
-
|
|
39
|
-
|
|
64
|
+
}
|
|
65
|
+
validateOptions = (options) => {
|
|
66
|
+
if (!options) return;
|
|
67
|
+
const isUsingServiceConfig = process.env[import_constants.InternalEnvironmentVariables.USING_SERVICE_CONFIG] === "true";
|
|
68
|
+
if (isUsingServiceConfig) {
|
|
69
|
+
if (options.serviceAuthType || options.runId || options.runName) {
|
|
70
|
+
const errorMessage = import_messages.ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;
|
|
71
|
+
throw new Error(errorMessage);
|
|
72
|
+
}
|
|
73
|
+
return;
|
|
40
74
|
}
|
|
41
|
-
|
|
42
|
-
|
|
75
|
+
};
|
|
76
|
+
setOptions = (options, isGetConnectOptions = false) => {
|
|
77
|
+
if (isGetConnectOptions) {
|
|
78
|
+
this.validateOptions(options);
|
|
43
79
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const ciConfigInfo = cIInfoProvider_js_1.CIInfoProvider.getCIInfo();
|
|
47
|
-
this.runName = await (0, utils_js_1.getRunName)(ciConfigInfo);
|
|
48
|
-
}
|
|
80
|
+
if (options?.exposeNetwork) {
|
|
81
|
+
this.exposeNetwork = options.exposeNetwork;
|
|
49
82
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (!process.env[constants_js_1.InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {
|
|
86
|
-
this.runName = options.runName;
|
|
87
|
-
process.env[constants_js_1.InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;
|
|
88
|
-
}
|
|
89
|
-
if (options?.os) {
|
|
90
|
-
this.serviceOs = options.os;
|
|
91
|
-
process.env[constants_js_1.InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;
|
|
92
|
-
}
|
|
93
|
-
if (options?.slowMo) {
|
|
94
|
-
this.slowMo = options.slowMo;
|
|
95
|
-
}
|
|
96
|
-
if (options?.connectTimeout) {
|
|
97
|
-
this.connectTimeout = options.connectTimeout;
|
|
98
|
-
}
|
|
99
|
-
if (options?.credential) {
|
|
100
|
-
this.credential = options.credential;
|
|
101
|
-
}
|
|
102
|
-
};
|
|
83
|
+
if (options?.apiVersion) {
|
|
84
|
+
if (!process.env[import_constants.InternalEnvironmentVariables.MPT_API_VERSION]) {
|
|
85
|
+
process.env[import_constants.InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;
|
|
86
|
+
}
|
|
87
|
+
this.apiVersion = options.apiVersion;
|
|
88
|
+
}
|
|
89
|
+
if (!process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {
|
|
90
|
+
if (options?.runId) {
|
|
91
|
+
(0, import_utils.ValidateRunID)(options.runId);
|
|
92
|
+
this.runId = options.runId;
|
|
93
|
+
process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;
|
|
94
|
+
} else {
|
|
95
|
+
this.runId = (0, import_utils.getAndSetRunId)();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (!process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {
|
|
99
|
+
this.runName = options.runName;
|
|
100
|
+
process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;
|
|
101
|
+
}
|
|
102
|
+
if (options?.os) {
|
|
103
|
+
this.serviceOs = options.os;
|
|
104
|
+
process.env[import_constants.InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;
|
|
105
|
+
}
|
|
106
|
+
if (options?.slowMo) {
|
|
107
|
+
this.slowMo = options.slowMo;
|
|
108
|
+
}
|
|
109
|
+
if (options?.connectTimeout) {
|
|
110
|
+
this.connectTimeout = options.connectTimeout;
|
|
111
|
+
}
|
|
112
|
+
if (options?.credential) {
|
|
113
|
+
this.credential = options.credential;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
103
116
|
}
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
118
|
+
0 && (module.exports = {
|
|
119
|
+
PlaywrightServiceConfig
|
|
120
|
+
});
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/common/playwrightServiceConfig.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Constants,\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"./constants.js\";\nimport type { PlaywrightServiceAdditionalOptions, OsType } from \"./types.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { getAndSetRunId, getRunName, ValidateRunID } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\nimport { state } from \"./state.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public connectTimeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n public apiVersion: string;\n private _serviceAuthType: string = ServiceAuth.ENTRA_ID;\n public credential?: TokenCredential;\n\n constructor() {\n this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n this.apiVersion =\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;\n }\n\n public static get instance(): PlaywrightServiceConfig {\n if (!state.playwrightServiceConfig) {\n state.playwrightServiceConfig = new PlaywrightServiceConfig();\n }\n return state.playwrightServiceConfig;\n }\n\n public get serviceAuthType(): string {\n return this._serviceAuthType;\n }\n\n public set serviceAuthType(value: string) {\n this._serviceAuthType = value;\n }\n\n public async initialize(): Promise<void> {\n if (!this.runName) {\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n this.runName = await getRunName(ciConfigInfo);\n }\n }\n\n validateOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (!options) return;\n\n const isUsingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n if (isUsingServiceConfig) {\n if (options.serviceAuthType || options.runId || options.runName) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;\n throw new Error(errorMessage);\n }\n return;\n }\n };\n\n setOptions = (\n options?: PlaywrightServiceAdditionalOptions,\n isGetConnectOptions: boolean = false,\n ): void => {\n if (isGetConnectOptions) {\n this.validateOptions(options);\n }\n\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (options?.apiVersion) {\n if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;\n }\n this.apiVersion = options.apiVersion;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n ValidateRunID(options.runId);\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.connectTimeout) {\n this.connectTimeout = options.connectTimeout;\n }\n if (options?.credential) {\n this.credential = options.credential;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAKO;AAGP,mBAA0D;AAC1D,4BAA+B;AAC/B,mBAAsB;AACtB,sBAA6C;AAE7C,MAAM,wBAAwB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACC,mBAA2B,6BAAY;AAAA,EACxC;AAAA,EAEP,cAAc;AACZ,SAAK,YAAa,QAAQ,IAAI,8CAA6B,cAAc,KACvE,gDAA+B;AACjC,SAAK,UAAU,QAAQ,IAAI,8CAA6B,oBAAoB,KAAK;AACjF,SAAK,QAAQ,QAAQ,IAAI,8CAA6B,kBAAkB,KAAK;AAC7E,SAAK,iBAAiB,gDAA+B;AACrD,SAAK,SAAS,gDAA+B;AAC7C,SAAK,gBAAgB,gDAA+B;AACpD,SAAK,aACH,QAAQ,IAAI,8CAA6B,eAAe,KAAK,2BAAU;AAAA,EAC3E;AAAA,EAEA,WAAkB,WAAoC;AACpD,QAAI,CAAC,mBAAM,yBAAyB;AAClC,yBAAM,0BAA0B,IAAI,wBAAwB;AAAA,IAC9D;AACA,WAAO,mBAAM;AAAA,EACf;AAAA,EAEA,IAAW,kBAA0B;AACnC,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,IAAW,gBAAgB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,SAAS,IAAI;AACf,WAAK,YAAY,QAAQ;AACzB,cAAQ,IAAI,8CAA6B,cAAc,IAAI,KAAK;AAAA,IAClE;AACA,QAAI,SAAS,QAAQ;AACnB,WAAK,SAAS,QAAQ;AAAA,IACxB;AACA,QAAI,SAAS,gBAAgB;AAC3B,WAAK,iBAAiB,QAAQ;AAAA,IAChC;AACA,QAAI,SAAS,YAAY;AACvB,WAAK,aAAa,QAAQ;AAAA,IAC5B;AAAA,EACF;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var state_exports = {};
|
|
19
|
+
__export(state_exports, {
|
|
20
|
+
state: () => state
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(state_exports);
|
|
6
23
|
globalThis.state = globalThis.state || {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
24
|
+
playwrightServiceEntra: null,
|
|
25
|
+
customerConfig: null,
|
|
26
|
+
playwrightServiceConfig: null
|
|
10
27
|
};
|
|
11
|
-
|
|
12
|
-
|
|
28
|
+
const state = globalThis.state;
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
state
|
|
32
|
+
});
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/common/state.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n(globalThis as any).state = (globalThis as any).state || {\n playwrightServiceEntra: null,\n customerConfig: null,\n playwrightServiceConfig: null,\n};\nexport const state: Record<string, any> = (globalThis as any).state;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGC,WAAmB,QAAS,WAAmB,SAAS;AAAA,EACvD,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,yBAAyB;AAC3B;AACO,MAAM,QAA8B,WAAmB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ConnectOptions } from "@playwright/test";
|
|
2
2
|
import type { ServiceAuth, ServiceOS, SDKLanguage } from "./constants.js";
|
|
3
3
|
import type { TokenCredential } from "@azure/identity";
|
|
4
|
-
import { CIInfo } from "../utils/cIInfoProvider.js";
|
|
4
|
+
import type { CIInfo } from "../utils/cIInfoProvider.js";
|
|
5
5
|
/**
|
|
6
6
|
* @public
|
|
7
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,E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@@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/common/types.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS, SDKLanguage } from \"./constants.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport type { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Custom token credential for Entra ID authentication. Learn more at {@link https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md | Using Azure Identity}.\n *\n * @defaultValue `DefaultAzureCredential`\n */\n credential?: TokenCredential;\n /**\n * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\n\n /**\n * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n};\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n\nexport type WorkspaceMetaData = {\n id?: string;\n resourceId?: string;\n name?: string;\n state?: string;\n subscriptionId?: string;\n subscriptionState?: string;\n tenantId?: string;\n location?: string;\n regionalAffinity?: string;\n localAuth?: string;\n storageUri?: string;\n reporting?: string;\n};\n\nexport type TenantInfo = {\n tenantId?: string;\n defaultDomain?: string;\n};\n\nexport interface UploadResult {\n success: boolean;\n errorMessage?: string;\n failedFileCount?: number;\n totalFiles?: number;\n failedFiles?: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n partialSuccess?: boolean;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,28 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var playwright_service_global_setup_exports = {};
|
|
29
|
+
__export(playwright_service_global_setup_exports, {
|
|
30
|
+
default: () => playwright_service_global_setup_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(playwright_service_global_setup_exports);
|
|
33
|
+
var import_node_path = require("node:path");
|
|
34
|
+
var import_playwrightServiceEntra = __toESM(require("../playwrightServiceEntra.js"));
|
|
35
|
+
var import_executor = require("../../common/executor.js");
|
|
36
|
+
var import_customerConfig = __toESM(require("../../common/customerConfig.js"));
|
|
37
|
+
var import_playwrightServiceConfig = require("../../common/playwrightServiceConfig.js");
|
|
38
|
+
var import_initializePlaywrightServiceTestRun = require("../initializePlaywrightServiceTestRun.js");
|
|
12
39
|
const playwrightServiceGlobalSetupWrapper = async (config) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
const rootDir = config.configFile ? (0, import_node_path.dirname)(config.configFile) : process.cwd();
|
|
41
|
+
let customerGlobalSetupFunc = null;
|
|
42
|
+
if (import_customerConfig.default.globalSetup && typeof import_customerConfig.default.globalSetup === "string") {
|
|
43
|
+
customerGlobalSetupFunc = await (0, import_executor.loadCustomerGlobalFunction)(rootDir, import_customerConfig.default.globalSetup);
|
|
44
|
+
}
|
|
45
|
+
const serviceAuthType = import_playwrightServiceConfig.PlaywrightServiceConfig.instance.serviceAuthType;
|
|
46
|
+
if (serviceAuthType === "ENTRA_ID") {
|
|
47
|
+
await import_playwrightServiceEntra.default.globalSetup();
|
|
48
|
+
}
|
|
49
|
+
await (0, import_initializePlaywrightServiceTestRun.initializePlaywrightServiceTestRun)(config);
|
|
50
|
+
if (customerGlobalSetupFunc) {
|
|
51
|
+
return customerGlobalSetupFunc(config);
|
|
52
|
+
}
|
|
26
53
|
};
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=playwright-service-global-setup.js.map
|
|
54
|
+
var playwright_service_global_setup_default = playwrightServiceGlobalSetupWrapper;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/core/global/playwright-service-global-setup.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"node:path\";\nimport type { FullConfig } from \"@playwright/test\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra.js\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor.js\";\nimport customerConfig from \"../../common/customerConfig.js\";\nimport { PlaywrightServiceConfig } from \"../../common/playwrightServiceConfig.js\";\nimport { initializePlaywrightServiceTestRun } from \"../initializePlaywrightServiceTestRun.js\";\n\nconst playwrightServiceGlobalSetupWrapper = async (config: FullConfig): Promise<any> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n let customerGlobalSetupFunc: any = null;\n if (customerConfig.globalSetup && typeof customerConfig.globalSetup === \"string\") {\n customerGlobalSetupFunc = await loadCustomerGlobalFunction(rootDir, customerConfig.globalSetup);\n }\n const serviceAuthType = PlaywrightServiceConfig.instance.serviceAuthType;\n if (serviceAuthType === \"ENTRA_ID\") {\n await playwrightServiceEntra.globalSetup();\n }\n await initializePlaywrightServiceTestRun(config);\n if (customerGlobalSetupFunc) {\n return customerGlobalSetupFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalSetupWrapper;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAwB;AAExB,oCAAmC;AACnC,sBAA2C;AAC3C,4BAA2B;AAC3B,qCAAwC;AACxC,gDAAmD;AAEnD,MAAM,sCAAsC,OAAO,WAAqC;AACtF,QAAM,UAAU,OAAO,iBAAa,0BAAQ,OAAO,UAAW,IAAI,QAAQ,IAAI;AAC9E,MAAI,0BAA+B;AACnC,MAAI,sBAAAA,QAAe,eAAe,OAAO,sBAAAA,QAAe,gBAAgB,UAAU;AAChF,8BAA0B,UAAM,4CAA2B,SAAS,sBAAAA,QAAe,WAAW;AAAA,EAChG;AACA,QAAM,kBAAkB,uDAAwB,SAAS;AACzD,MAAI,oBAAoB,YAAY;AAClC,UAAM,8BAAAC,QAAuB,YAAY;AAAA,EAC3C;AACA,YAAM,8EAAmC,MAAM;AAC/C,MAAI,yBAAyB;AAC3B,WAAO,wBAAwB,MAAM;AAAA,EACvC;AACF;AAEA,IAAO,0CAAQ;",
|
|
6
|
+
"names": ["customerConfig", "playwrightServiceEntra"]
|
|
7
|
+
}
|
|
@@ -1,22 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var playwright_service_global_teardown_exports = {};
|
|
29
|
+
__export(playwright_service_global_teardown_exports, {
|
|
30
|
+
default: () => playwright_service_global_teardown_default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(playwright_service_global_teardown_exports);
|
|
33
|
+
var import_node_path = require("node:path");
|
|
34
|
+
var import_playwrightServiceEntra = __toESM(require("../playwrightServiceEntra.js"));
|
|
35
|
+
var import_executor = require("../../common/executor.js");
|
|
36
|
+
var import_customerConfig = __toESM(require("../../common/customerConfig.js"));
|
|
10
37
|
const playwrightServiceGlobalTeardownWrapper = async (config) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
38
|
+
const rootDir = config.configFile ? (0, import_node_path.dirname)(config.configFile) : process.cwd();
|
|
39
|
+
let customerGlobalTeardownFunc = null;
|
|
40
|
+
if (import_customerConfig.default.globalTeardown && typeof import_customerConfig.default.globalTeardown === "string") {
|
|
41
|
+
customerGlobalTeardownFunc = await (0, import_executor.loadCustomerGlobalFunction)(
|
|
42
|
+
rootDir,
|
|
43
|
+
import_customerConfig.default.globalTeardown
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
import_playwrightServiceEntra.default.globalTeardown();
|
|
47
|
+
if (customerGlobalTeardownFunc) {
|
|
48
|
+
await customerGlobalTeardownFunc(config);
|
|
49
|
+
}
|
|
20
50
|
};
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=playwright-service-global-teardown.js.map
|
|
51
|
+
var playwright_service_global_teardown_default = playwrightServiceGlobalTeardownWrapper;
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/core/global/playwright-service-global-teardown.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"node:path\";\nimport type { FullConfig } from \"@playwright/test\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra.js\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor.js\";\nimport customerConfig from \"../../common/customerConfig.js\";\n\nconst playwrightServiceGlobalTeardownWrapper = async (config: FullConfig): Promise<void> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n let customerGlobalTeardownFunc: any = null;\n if (customerConfig.globalTeardown && typeof customerConfig.globalTeardown === \"string\") {\n customerGlobalTeardownFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalTeardown,\n );\n }\n playwrightServiceEntra.globalTeardown();\n if (customerGlobalTeardownFunc) {\n await customerGlobalTeardownFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalTeardownWrapper;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAAwB;AAExB,oCAAmC;AACnC,sBAA2C;AAC3C,4BAA2B;AAE3B,MAAM,yCAAyC,OAAO,WAAsC;AAC1F,QAAM,UAAU,OAAO,iBAAa,0BAAQ,OAAO,UAAW,IAAI,QAAQ,IAAI;AAC9E,MAAI,6BAAkC;AACtC,MAAI,sBAAAA,QAAe,kBAAkB,OAAO,sBAAAA,QAAe,mBAAmB,UAAU;AACtF,iCAA6B,UAAM;AAAA,MACjC;AAAA,MACA,sBAAAA,QAAe;AAAA,IACjB;AAAA,EACF;AACA,gCAAAC,QAAuB,eAAe;AACtC,MAAI,4BAA4B;AAC9B,UAAM,2BAA2B,MAAM;AAAA,EACzC;AACF;AAEA,IAAO,6CAAQ;",
|
|
6
|
+
"names": ["customerConfig", "playwrightServiceEntra"]
|
|
7
|
+
}
|