@azure/microsoft-playwright-testing 1.0.0-alpha.20250716.1 → 1.0.0-alpha.20250730.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/constants.js +100 -100
- package/dist/browser/common/constants.js.map +1 -1
- package/dist/browser/common/customerConfig.js +3 -0
- package/dist/browser/common/customerConfig.js.map +1 -1
- package/dist/browser/common/entraIdAccessToken.js +46 -43
- package/dist/browser/common/entraIdAccessToken.js.map +1 -1
- package/dist/browser/common/environmentVariables.js +8 -0
- package/dist/browser/common/environmentVariables.js.map +1 -1
- package/dist/browser/common/executor.js +1 -2
- package/dist/browser/common/executor.js.map +1 -1
- package/dist/browser/common/multimap.js +1 -0
- package/dist/browser/common/multimap.js.map +1 -1
- package/dist/browser/common/playwrightServiceConfig.js +34 -28
- package/dist/browser/common/playwrightServiceConfig.js.map +1 -1
- package/dist/browser/core/playwrightService.js +13 -8
- package/dist/browser/core/playwrightService.js.map +1 -1
- package/dist/browser/core/playwrightServiceEntra.js +36 -33
- package/dist/browser/core/playwrightServiceEntra.js.map +1 -1
- package/dist/browser/model/entraTokenDetails.js +4 -0
- package/dist/browser/model/entraTokenDetails.js.map +1 -1
- package/dist/browser/model/mptTokenDetails.js +8 -0
- package/dist/browser/model/mptTokenDetails.js.map +1 -1
- package/dist/browser/model/shard.js +10 -0
- package/dist/browser/model/shard.js.map +1 -1
- package/dist/browser/model/storageUri.js +4 -0
- package/dist/browser/model/storageUri.js.map +1 -1
- package/dist/browser/model/testResult.js +18 -0
- package/dist/browser/model/testResult.js.map +1 -1
- package/dist/browser/model/testRun.js +8 -3
- package/dist/browser/model/testRun.js.map +1 -1
- package/dist/browser/reporter/mptReporter.js +53 -47
- package/dist/browser/reporter/mptReporter.js.map +1 -1
- package/dist/browser/utils/cIInfoProvider.js +8 -9
- package/dist/browser/utils/cIInfoProvider.js.map +1 -1
- package/dist/browser/utils/packageManager.js +21 -27
- package/dist/browser/utils/packageManager.js.map +1 -1
- package/dist/browser/utils/reporterUtils.js +34 -31
- package/dist/browser/utils/reporterUtils.js.map +1 -1
- package/dist/browser/utils/serviceClient.js +7 -2
- package/dist/browser/utils/serviceClient.js.map +1 -1
- package/dist/browser/utils/utils.js +1 -1
- package/dist/browser/utils/utils.js.map +1 -1
- package/dist/commonjs/common/constants.js +101 -101
- package/dist/commonjs/common/constants.js.map +1 -1
- package/dist/commonjs/common/customerConfig.js +3 -0
- package/dist/commonjs/common/customerConfig.js.map +1 -1
- package/dist/commonjs/common/entraIdAccessToken.js +46 -43
- package/dist/commonjs/common/entraIdAccessToken.js.map +1 -1
- package/dist/commonjs/common/environmentVariables.js +8 -0
- package/dist/commonjs/common/environmentVariables.js.map +1 -1
- package/dist/commonjs/common/executor.js +1 -2
- package/dist/commonjs/common/executor.js.map +1 -1
- package/dist/commonjs/common/multimap.js +1 -0
- package/dist/commonjs/common/multimap.js.map +1 -1
- package/dist/commonjs/common/playwrightServiceConfig.js +34 -28
- package/dist/commonjs/common/playwrightServiceConfig.js.map +1 -1
- package/dist/commonjs/core/playwrightService.js +13 -8
- package/dist/commonjs/core/playwrightService.js.map +1 -1
- package/dist/commonjs/core/playwrightServiceEntra.js +36 -33
- package/dist/commonjs/core/playwrightServiceEntra.js.map +1 -1
- package/dist/commonjs/model/entraTokenDetails.js +4 -0
- package/dist/commonjs/model/entraTokenDetails.js.map +1 -1
- package/dist/commonjs/model/mptTokenDetails.js +8 -0
- package/dist/commonjs/model/mptTokenDetails.js.map +1 -1
- package/dist/commonjs/model/shard.js +10 -0
- package/dist/commonjs/model/shard.js.map +1 -1
- package/dist/commonjs/model/storageUri.js +4 -0
- package/dist/commonjs/model/storageUri.js.map +1 -1
- package/dist/commonjs/model/testResult.js +18 -0
- package/dist/commonjs/model/testResult.js.map +1 -1
- package/dist/commonjs/model/testRun.js +8 -3
- package/dist/commonjs/model/testRun.js.map +1 -1
- package/dist/commonjs/reporter/mptReporter.js +53 -47
- package/dist/commonjs/reporter/mptReporter.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/cIInfoProvider.js +8 -9
- package/dist/commonjs/utils/cIInfoProvider.js.map +1 -1
- package/dist/commonjs/utils/packageManager.js +21 -27
- package/dist/commonjs/utils/packageManager.js.map +1 -1
- package/dist/commonjs/utils/reporterUtils.js +34 -31
- package/dist/commonjs/utils/reporterUtils.js.map +1 -1
- package/dist/commonjs/utils/serviceClient.js +7 -2
- package/dist/commonjs/utils/serviceClient.js.map +1 -1
- package/dist/commonjs/utils/utils.js +1 -1
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/esm/common/constants.js +100 -100
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/customerConfig.js +3 -0
- package/dist/esm/common/customerConfig.js.map +1 -1
- package/dist/esm/common/entraIdAccessToken.js +46 -43
- package/dist/esm/common/entraIdAccessToken.js.map +1 -1
- package/dist/esm/common/environmentVariables.js +8 -0
- package/dist/esm/common/environmentVariables.js.map +1 -1
- package/dist/esm/common/executor.js +1 -2
- package/dist/esm/common/executor.js.map +1 -1
- package/dist/esm/common/multimap.js +1 -0
- package/dist/esm/common/multimap.js.map +1 -1
- package/dist/esm/common/playwrightServiceConfig.js +34 -28
- package/dist/esm/common/playwrightServiceConfig.js.map +1 -1
- package/dist/esm/core/playwrightService.js +13 -8
- package/dist/esm/core/playwrightService.js.map +1 -1
- package/dist/esm/core/playwrightServiceEntra.js +36 -33
- package/dist/esm/core/playwrightServiceEntra.js.map +1 -1
- package/dist/esm/model/entraTokenDetails.js +4 -0
- package/dist/esm/model/entraTokenDetails.js.map +1 -1
- package/dist/esm/model/mptTokenDetails.js +8 -0
- package/dist/esm/model/mptTokenDetails.js.map +1 -1
- package/dist/esm/model/shard.js +10 -0
- package/dist/esm/model/shard.js.map +1 -1
- package/dist/esm/model/storageUri.js +4 -0
- package/dist/esm/model/storageUri.js.map +1 -1
- package/dist/esm/model/testResult.js +18 -0
- package/dist/esm/model/testResult.js.map +1 -1
- package/dist/esm/model/testRun.js +8 -3
- package/dist/esm/model/testRun.js.map +1 -1
- package/dist/esm/reporter/mptReporter.js +53 -47
- package/dist/esm/reporter/mptReporter.js.map +1 -1
- package/dist/esm/utils/cIInfoProvider.js +8 -9
- package/dist/esm/utils/cIInfoProvider.js.map +1 -1
- package/dist/esm/utils/packageManager.js +21 -27
- package/dist/esm/utils/packageManager.js.map +1 -1
- package/dist/esm/utils/reporterUtils.js +34 -31
- package/dist/esm/utils/reporterUtils.js.map +1 -1
- package/dist/esm/utils/serviceClient.js +7 -2
- package/dist/esm/utils/serviceClient.js.map +1 -1
- package/dist/esm/utils/utils.js +1 -1
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/react-native/common/constants.js +100 -100
- package/dist/react-native/common/constants.js.map +1 -1
- package/dist/react-native/common/customerConfig.js +3 -0
- package/dist/react-native/common/customerConfig.js.map +1 -1
- package/dist/react-native/common/entraIdAccessToken.js +46 -43
- package/dist/react-native/common/entraIdAccessToken.js.map +1 -1
- package/dist/react-native/common/environmentVariables.js +8 -0
- package/dist/react-native/common/environmentVariables.js.map +1 -1
- package/dist/react-native/common/executor.js +1 -2
- package/dist/react-native/common/executor.js.map +1 -1
- package/dist/react-native/common/multimap.js +1 -0
- package/dist/react-native/common/multimap.js.map +1 -1
- package/dist/react-native/common/playwrightServiceConfig.js +34 -28
- package/dist/react-native/common/playwrightServiceConfig.js.map +1 -1
- package/dist/react-native/core/playwrightService.js +13 -8
- package/dist/react-native/core/playwrightService.js.map +1 -1
- package/dist/react-native/core/playwrightServiceEntra.js +36 -33
- package/dist/react-native/core/playwrightServiceEntra.js.map +1 -1
- package/dist/react-native/model/entraTokenDetails.js +4 -0
- package/dist/react-native/model/entraTokenDetails.js.map +1 -1
- package/dist/react-native/model/mptTokenDetails.js +8 -0
- package/dist/react-native/model/mptTokenDetails.js.map +1 -1
- package/dist/react-native/model/shard.js +10 -0
- package/dist/react-native/model/shard.js.map +1 -1
- package/dist/react-native/model/storageUri.js +4 -0
- package/dist/react-native/model/storageUri.js.map +1 -1
- package/dist/react-native/model/testResult.js +18 -0
- package/dist/react-native/model/testResult.js.map +1 -1
- package/dist/react-native/model/testRun.js +8 -3
- package/dist/react-native/model/testRun.js.map +1 -1
- package/dist/react-native/reporter/mptReporter.js +53 -47
- package/dist/react-native/reporter/mptReporter.js.map +1 -1
- package/dist/react-native/utils/cIInfoProvider.js +8 -9
- package/dist/react-native/utils/cIInfoProvider.js.map +1 -1
- package/dist/react-native/utils/packageManager.js +21 -27
- package/dist/react-native/utils/packageManager.js.map +1 -1
- package/dist/react-native/utils/reporterUtils.js +34 -31
- package/dist/react-native/utils/reporterUtils.js.map +1 -1
- package/dist/react-native/utils/serviceClient.js +7 -2
- package/dist/react-native/utils/serviceClient.js.map +1 -1
- package/dist/react-native/utils/utils.js +1 -1
- package/dist/react-native/utils/utils.js.map +1 -1
- package/package.json +2 -2
|
@@ -37,111 +37,111 @@ export const API_VERSION = "2023-10-01-preview";
|
|
|
37
37
|
// Do not put an ending slash for the urls,
|
|
38
38
|
// for example use https://www.microsoft.com/en-in and not https://www.microsoft.com/en-in/
|
|
39
39
|
export class Constants {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
Constants.FORBIDDEN_403_ERROR_MESSAGE = `You do not have the required permissions to upload test results. This could be because
|
|
40
|
+
// Config related constants
|
|
41
|
+
static TEST_FRAMEWORK_NAME = "PLAYWRIGHT";
|
|
42
|
+
static TEST_FRAMEWORK_RUNNERNAME = "PLAYWRIGHT";
|
|
43
|
+
static TEST_TYPE = "WebTest";
|
|
44
|
+
static TEST_SDK_LANGUAGE = "JAVASCRIPT";
|
|
45
|
+
// Placeholder version
|
|
46
|
+
static DEFAULT_DASHBOARD_ENDPOINT = "https://playwright.microsoft.com";
|
|
47
|
+
static DEFAULT_SERVICE_ENDPOINT = "https://{region}.reporting.api.playwright-test.io";
|
|
48
|
+
static DEFAULT_REDACTED_MESSAGE = "***REDACTED***";
|
|
49
|
+
static SAS_URI_SEPARATOR = "?";
|
|
50
|
+
static DEFAULT_TEST_RUN_NAME = "MPTReporterTests";
|
|
51
|
+
static TEST_BATCH_SIZE = 50;
|
|
52
|
+
static UPLOAD_MODE = "sdk";
|
|
53
|
+
static GIT_VERSION_COMMAND = "git --version";
|
|
54
|
+
static GIT_REV_PARSE = "git rev-parse --is-inside-work-tree";
|
|
55
|
+
static GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:"%s"';
|
|
56
|
+
static ERROR_MESSAGES_MAX_LENGTH = 100;
|
|
57
|
+
static sevenDaysInMs = 7 * 24 * 60 * 60 * 1000;
|
|
58
|
+
static oneDayInMs = 24 * 60 * 60 * 1000;
|
|
59
|
+
static API_VERSION = "2024-09-01-preview";
|
|
60
|
+
static OS = "Os";
|
|
61
|
+
static NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];
|
|
62
|
+
static SupportedRegions = [
|
|
63
|
+
"eastus",
|
|
64
|
+
"eastasia",
|
|
65
|
+
"westeurope",
|
|
66
|
+
"westus3",
|
|
67
|
+
"centraluseuap",
|
|
68
|
+
"eastus2euap",
|
|
69
|
+
];
|
|
70
|
+
// Error messages
|
|
71
|
+
static CONFLICT_409_ERROR_MESSAGE = "Test run with id {runId} already exists. Provide a unique run id.";
|
|
72
|
+
static FORBIDDEN_403_ERROR_MESSAGE = `You do not have the required permissions to upload test results. This could be because
|
|
74
73
|
|
|
75
74
|
a. Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general
|
|
76
75
|
b. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.
|
|
77
76
|
c. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>
|
|
78
77
|
`;
|
|
79
|
-
// API Endpoints
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
};
|
|
78
|
+
// API Endpoints
|
|
79
|
+
static testRunsEndpoint = "workspaces/{workspaceId}/test-runs";
|
|
80
|
+
static testRunsShardEndpoint = "workspaces/{workspaceId}/test-runs/{testRunId}:updateShardExecutionStatus";
|
|
81
|
+
static storageUriEndpoint = "workspaces/{workspaceId}/test-runs/{testRunId}:createArtifactsUploadBaseUri";
|
|
82
|
+
static testResultsEndpoint = "workspaces/{workspaceId}/test-results/upload-batch";
|
|
83
|
+
static patchTestRun = "patchTestRun";
|
|
84
|
+
static getTestRun = "getTestRun";
|
|
85
|
+
static patchTestRunShardStart = "patchTestRunShardStart";
|
|
86
|
+
static patchTestRunShardEnd = "patchTestRunShardEnd";
|
|
87
|
+
static postTestResults = "postTestResults";
|
|
88
|
+
static getStorageUri = "getStorageUri";
|
|
89
|
+
static ERROR_MESSAGE = {
|
|
90
|
+
patchTestRun: {
|
|
91
|
+
400: "The request made to the server is invalid. Please check the request parameters and try again.",
|
|
92
|
+
401: "The authentication token provided is invalid. Please check the token and try again.",
|
|
93
|
+
500: "An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.",
|
|
94
|
+
429: "You have exceeded the rate limit for the API. Please wait and try again later.",
|
|
95
|
+
504: "The request to the service timed out. Please try again later.",
|
|
96
|
+
503: "The service is currently unavailable. Please check the service status and try again.",
|
|
97
|
+
},
|
|
98
|
+
getTestRun: {
|
|
99
|
+
400: "The request made to the server is invalid. Please check the request parameters and try again.",
|
|
100
|
+
401: "The authentication token provided is invalid. Please check the token and try again.",
|
|
101
|
+
403: "You do not have the required permissions to run tests. Please contact your workspace administrator.",
|
|
102
|
+
500: "An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.",
|
|
103
|
+
429: "You have exceeded the rate limit for the API. Please wait and try again later.",
|
|
104
|
+
504: "The request to the service timed out. Please try again later.",
|
|
105
|
+
503: "The service is currently unavailable. Please check the service status and try again.",
|
|
106
|
+
},
|
|
107
|
+
patchTestRunShardStart: {
|
|
108
|
+
400: "The request made to the server is invalid. Please check the request parameters and try again.",
|
|
109
|
+
401: "The authentication token provided is invalid. Please check the token and try again.",
|
|
110
|
+
403: "You do not have the required permissions to run tests. Please contact your workspace administrator.",
|
|
111
|
+
500: "An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.",
|
|
112
|
+
429: "You have exceeded the rate limit for the API. Please wait and try again later.",
|
|
113
|
+
504: "The request to the service timed out. Please try again later.",
|
|
114
|
+
503: "The service is currently unavailable. Please check the service status and try again.",
|
|
115
|
+
},
|
|
116
|
+
patchTestRunShardEnd: {
|
|
117
|
+
400: "The request made to the server is invalid. Please check the request parameters and try again.",
|
|
118
|
+
401: "The authentication token provided is invalid. Please check the token and try again.",
|
|
119
|
+
403: "You do not have the required permissions to run tests. Please contact your workspace administrator.",
|
|
120
|
+
500: "An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.",
|
|
121
|
+
429: "You have exceeded the rate limit for the API. Please wait and try again later.",
|
|
122
|
+
504: "The request to the service timed out. Please try again later.",
|
|
123
|
+
503: "The service is currently unavailable. Please check the service status and try again.",
|
|
124
|
+
},
|
|
125
|
+
postTestResults: {
|
|
126
|
+
400: "The request made to the server is invalid. Please check the request parameters and try again.",
|
|
127
|
+
401: "The authentication token provided is invalid. Please check the token and try again.",
|
|
128
|
+
403: "You do not have the required permissions to run tests. Please contact your workspace administrator.",
|
|
129
|
+
500: "An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.",
|
|
130
|
+
429: "You have exceeded the rate limit for the API. Please wait and try again later.",
|
|
131
|
+
504: "The request to the service timed out. Please try again later.",
|
|
132
|
+
503: "The service is currently unavailable. Please check the service status and try again.",
|
|
133
|
+
},
|
|
134
|
+
getStorageUri: {
|
|
135
|
+
400: "The request made to the server is invalid. Please check the request parameters and try again.",
|
|
136
|
+
401: "The authentication token provided is invalid. Please check the token and try again.",
|
|
137
|
+
403: "You do not have the required permissions to run tests. Please contact your workspace administrator.",
|
|
138
|
+
500: "An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.",
|
|
139
|
+
429: "You have exceeded the rate limit for the API. Please wait and try again later.",
|
|
140
|
+
504: "The request to the service timed out. Please try again later.",
|
|
141
|
+
503: "The service is currently unavailable. Please check the service status and try again.",
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
145
|
export const TestErrorType = {
|
|
146
146
|
Scalable: "Scalable",
|
|
147
147
|
Reporting: "Reporting",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,+BAA+B,EAAE,iCAAiC;IAClE,sBAAsB,EAAE,wBAAwB;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,eAAe,EAAE,KAAK;IACtB,eAAe,EAAE,CAAC;IAClB,sBAAsB,EAAE,YAAY;IACpC,kBAAkB,EAAE,SAAS,CAAC,KAAK;CACpC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEhD,2CAA2C;AAC3C,2FAA2F;AAE3F,MAAM,OAAO,SAAS;;AACpB,2BAA2B;AACJ,6BAAmB,GAAG,YAAY,CAAC;AACnC,mCAAyB,GAAG,YAAY,CAAC;AACzC,mBAAS,GAAG,SAAS,CAAC;AACtB,2BAAiB,GAA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0BAA0B;QAC/B,OAAO,EACL,mKAAmK;QACrK,OAAO,EAAE,wDAAwD;QACjE,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,yEAAyE;QAClF,OAAO,EAAE,mFAAmF;QAC5F,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,6BAA6B,EAAE,gCAAgC;IAC/D,cAAc,EAAE,iBAAiB;IACjC,yBAAyB,EAAE,4BAA4B;IACvD,uBAAuB,EAAE,0BAA0B;CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ApiErrorMessage } from \"./types.js\";\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Microsoft Playwright Testing cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Microsoft Playwright Testing\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Microsoft Playwright Testing\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n};\n\nexport const API_VERSION = \"2023-10-01-preview\";\n\n// Do not put an ending slash for the urls,\n// for example use https://www.microsoft.com/en-in and not https://www.microsoft.com/en-in/\n\nexport class Constants {\n // Config related constants\n public static readonly TEST_FRAMEWORK_NAME = \"PLAYWRIGHT\";\n public static readonly TEST_FRAMEWORK_RUNNERNAME = \"PLAYWRIGHT\";\n public static readonly TEST_TYPE = \"WebTest\";\n public static readonly TEST_SDK_LANGUAGE = \"JAVASCRIPT\";\n // Placeholder version\n public static readonly DEFAULT_DASHBOARD_ENDPOINT = \"https://playwright.microsoft.com\";\n public static readonly DEFAULT_SERVICE_ENDPOINT =\n \"https://{region}.reporting.api.playwright-test.io\";\n public static readonly DEFAULT_REDACTED_MESSAGE = \"***REDACTED***\";\n public static readonly SAS_URI_SEPARATOR = \"?\";\n public static readonly DEFAULT_TEST_RUN_NAME = \"MPTReporterTests\";\n public static readonly TEST_BATCH_SIZE = 50;\n public static readonly UPLOAD_MODE = \"sdk\";\n public static readonly GIT_VERSION_COMMAND = \"git --version\";\n public static readonly GIT_REV_PARSE = \"git rev-parse --is-inside-work-tree\";\n public static readonly GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:\"%s\"';\n public static readonly ERROR_MESSAGES_MAX_LENGTH = 100;\n public static readonly sevenDaysInMs = 7 * 24 * 60 * 60 * 1000;\n public static readonly oneDayInMs = 24 * 60 * 60 * 1000;\n public static readonly API_VERSION = \"2024-09-01-preview\";\n public static readonly OS = \"Os\";\n public static readonly NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];\n public static readonly SupportedRegions: string[] = [\n \"eastus\",\n \"eastasia\",\n \"westeurope\",\n \"westus3\",\n \"centraluseuap\",\n \"eastus2euap\",\n ];\n // Error messages\n public static readonly CONFLICT_409_ERROR_MESSAGE =\n \"Test run with id {runId} already exists. Provide a unique run id.\";\n public static readonly FORBIDDEN_403_ERROR_MESSAGE = `You do not have the required permissions to upload test results. This could be because\n\n a. Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general\n b. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n c. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>\n `;\n // API Endpoints\n public static readonly testRunsEndpoint: string = \"workspaces/{workspaceId}/test-runs\";\n public static readonly testRunsShardEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:updateShardExecutionStatus\";\n public static readonly storageUriEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:createArtifactsUploadBaseUri\";\n public static readonly testResultsEndpoint: string =\n \"workspaces/{workspaceId}/test-results/upload-batch\";\n public static readonly patchTestRun: string = \"patchTestRun\";\n public static readonly getTestRun: string = \"getTestRun\";\n public static readonly patchTestRunShardStart: string = \"patchTestRunShardStart\";\n public static readonly patchTestRunShardEnd: string = \"patchTestRunShardEnd\";\n public static readonly postTestResults: string = \"postTestResults\";\n public static readonly getStorageUri: string = \"getStorageUri\";\n public static readonly ERROR_MESSAGE: ApiErrorMessage = {\n patchTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardStart: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardEnd: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n postTestResults: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getStorageUri: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n };\n}\n\nexport const TestErrorType = {\n Scalable: \"Scalable\",\n Reporting: \"Reporting\",\n};\n\nexport const TestResultErrorConstants = [\n {\n key: \"401\",\n message: \"The authentication token provided is invalid. Please check the token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*401 Unauthorized)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"NoPermissionOnWorkspace_Scalable\",\n message: `You do not have the required permissions to run tests. This could be because:\n\n a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n b. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>'.\n `,\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*CheckAccess API call with non successful response)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidWorkspace_Scalable\",\n message: \"The specified workspace does not exist. Please verify your workspace settings.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccountOrSubscriptionState)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n pattern: /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccessToken)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessTokenOrUserOrWorkspaceNotFound_Scalable\",\n message:\n \"The data for the user, workspace or access token was not found. Please check the request or create new token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*404 Not Found)(?=[\\s\\S]*NotFound)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessKeyBasedAuthNotSupported_Scalable\",\n message:\n \"Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*AccessKeyBasedAuthNotSupported)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"503\",\n message: \"The service is currently unavailable. Please check the service status and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*503 Service Unavailable)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"504\",\n message: \"The request to the service timed out. Please try again later.\",\n pattern: /(?=.*browserType\\.connect)(?=.*504 Gateway Timeout)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"QuotaLimitError_Scalable\",\n message:\n \"It is possible that the maximum number of concurrent sessions allowed for your workspace has been exceeded. Check the quota at https://aka.ms/mpt/resource-quota.\",\n pattern: /(?=.*browserType\\.connect): (?=.*Timeout .* exceeded)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"BrowserConnectionError_Scalable\",\n message: \"The service is currently unavailable. Please try again after some time.\",\n pattern: /(?=.*browserType\\.connect): (?=.Target page, context or browser has been closed)/i,\n type: TestErrorType.Scalable,\n },\n];\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n MPT_SERVICE_OS: \"_MPT_SERVICE_OS\",\n MPT_SERVICE_REPORTING_URL: \"_MPT_SERVICE_REPORTING_URL\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n};\n\nexport const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = \"1.47.0\";\n"]}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,+BAA+B,EAAE,iCAAiC;IAClE,sBAAsB,EAAE,wBAAwB;CACjD,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,eAAe,EAAE,KAAK;IACtB,eAAe,EAAE,CAAC;IAClB,sBAAsB,EAAE,YAAY;IACpC,kBAAkB,EAAE,SAAS,CAAC,KAAK;CACpC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEhD,2CAA2C;AAC3C,2FAA2F;AAE3F,MAAM,OAAO,SAAS;IACpB,2BAA2B;IACpB,MAAM,CAAU,mBAAmB,GAAG,YAAY,CAAC;IACnD,MAAM,CAAU,yBAAyB,GAAG,YAAY,CAAC;IACzD,MAAM,CAAU,SAAS,GAAG,SAAS,CAAC;IACtC,MAAM,CAAU,iBAAiB,GAAG,YAAY,CAAC;IACxD,sBAAsB;IACf,MAAM,CAAU,0BAA0B,GAAG,kCAAkC,CAAC;IAChF,MAAM,CAAU,wBAAwB,GAC7C,mDAAmD,CAAC;IAC/C,MAAM,CAAU,wBAAwB,GAAG,gBAAgB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E,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,+DAA+D;QACxE,OAAO,EAAE,sDAAsD;QAC/D,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,0BAA0B;QAC/B,OAAO,EACL,mKAAmK;QACrK,OAAO,EAAE,wDAAwD;QACjE,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,yEAAyE;QAClF,OAAO,EAAE,mFAAmF;QAC5F,IAAI,EAAE,aAAa,CAAC,QAAQ;KAC7B;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,6BAA6B,EAAE,gCAAgC;IAC/D,cAAc,EAAE,iBAAiB;IACjC,yBAAyB,EAAE,4BAA4B;IACvD,uBAAuB,EAAE,0BAA0B;CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAAG,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { ApiErrorMessage } from \"./types.js\";\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Microsoft Playwright Testing cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Microsoft Playwright Testing\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Microsoft Playwright Testing\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n};\n\nexport const API_VERSION = \"2023-10-01-preview\";\n\n// Do not put an ending slash for the urls,\n// for example use https://www.microsoft.com/en-in and not https://www.microsoft.com/en-in/\n\nexport class Constants {\n // Config related constants\n public static readonly TEST_FRAMEWORK_NAME = \"PLAYWRIGHT\";\n public static readonly TEST_FRAMEWORK_RUNNERNAME = \"PLAYWRIGHT\";\n public static readonly TEST_TYPE = \"WebTest\";\n public static readonly TEST_SDK_LANGUAGE = \"JAVASCRIPT\";\n // Placeholder version\n public static readonly DEFAULT_DASHBOARD_ENDPOINT = \"https://playwright.microsoft.com\";\n public static readonly DEFAULT_SERVICE_ENDPOINT =\n \"https://{region}.reporting.api.playwright-test.io\";\n public static readonly DEFAULT_REDACTED_MESSAGE = \"***REDACTED***\";\n public static readonly SAS_URI_SEPARATOR = \"?\";\n public static readonly DEFAULT_TEST_RUN_NAME = \"MPTReporterTests\";\n public static readonly TEST_BATCH_SIZE = 50;\n public static readonly UPLOAD_MODE = \"sdk\";\n public static readonly GIT_VERSION_COMMAND = \"git --version\";\n public static readonly GIT_REV_PARSE = \"git rev-parse --is-inside-work-tree\";\n public static readonly GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:\"%s\"';\n public static readonly ERROR_MESSAGES_MAX_LENGTH = 100;\n public static readonly sevenDaysInMs = 7 * 24 * 60 * 60 * 1000;\n public static readonly oneDayInMs = 24 * 60 * 60 * 1000;\n public static readonly API_VERSION = \"2024-09-01-preview\";\n public static readonly OS = \"Os\";\n public static readonly NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];\n public static readonly SupportedRegions: string[] = [\n \"eastus\",\n \"eastasia\",\n \"westeurope\",\n \"westus3\",\n \"centraluseuap\",\n \"eastus2euap\",\n ];\n // Error messages\n public static readonly CONFLICT_409_ERROR_MESSAGE =\n \"Test run with id {runId} already exists. Provide a unique run id.\";\n public static readonly FORBIDDEN_403_ERROR_MESSAGE = `You do not have the required permissions to upload test results. This could be because\n\n a. Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general\n b. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n c. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>\n `;\n // API Endpoints\n public static readonly testRunsEndpoint: string = \"workspaces/{workspaceId}/test-runs\";\n public static readonly testRunsShardEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:updateShardExecutionStatus\";\n public static readonly storageUriEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:createArtifactsUploadBaseUri\";\n public static readonly testResultsEndpoint: string =\n \"workspaces/{workspaceId}/test-results/upload-batch\";\n public static readonly patchTestRun: string = \"patchTestRun\";\n public static readonly getTestRun: string = \"getTestRun\";\n public static readonly patchTestRunShardStart: string = \"patchTestRunShardStart\";\n public static readonly patchTestRunShardEnd: string = \"patchTestRunShardEnd\";\n public static readonly postTestResults: string = \"postTestResults\";\n public static readonly getStorageUri: string = \"getStorageUri\";\n public static readonly ERROR_MESSAGE: ApiErrorMessage = {\n patchTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardStart: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardEnd: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n postTestResults: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getStorageUri: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n };\n}\n\nexport const TestErrorType = {\n Scalable: \"Scalable\",\n Reporting: \"Reporting\",\n};\n\nexport const TestResultErrorConstants = [\n {\n key: \"401\",\n message: \"The authentication token provided is invalid. Please check the token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*401 Unauthorized)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"NoPermissionOnWorkspace_Scalable\",\n message: `You do not have the required permissions to run tests. This could be because:\n\n a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n b. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>'.\n `,\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*CheckAccess API call with non successful response)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidWorkspace_Scalable\",\n message: \"The specified workspace does not exist. Please verify your workspace settings.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccountOrSubscriptionState)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n pattern: /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccessToken)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessTokenOrUserOrWorkspaceNotFound_Scalable\",\n message:\n \"The data for the user, workspace or access token was not found. Please check the request or create new token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*404 Not Found)(?=[\\s\\S]*NotFound)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessKeyBasedAuthNotSupported_Scalable\",\n message:\n \"Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*AccessKeyBasedAuthNotSupported)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"503\",\n message: \"The service is currently unavailable. Please check the service status and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*503 Service Unavailable)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"504\",\n message: \"The request to the service timed out. Please try again later.\",\n pattern: /(?=.*browserType\\.connect)(?=.*504 Gateway Timeout)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"QuotaLimitError_Scalable\",\n message:\n \"It is possible that the maximum number of concurrent sessions allowed for your workspace has been exceeded. Check the quota at https://aka.ms/mpt/resource-quota.\",\n pattern: /(?=.*browserType\\.connect): (?=.*Timeout .* exceeded)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"BrowserConnectionError_Scalable\",\n message: \"The service is currently unavailable. Please try again after some time.\",\n pattern: /(?=.*browserType\\.connect): (?=.Target page, context or browser has been closed)/i,\n type: TestErrorType.Scalable,\n },\n];\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n MPT_SERVICE_OS: \"_MPT_SERVICE_OS\",\n MPT_SERVICE_REPORTING_URL: \"_MPT_SERVICE_REPORTING_URL\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n};\n\nexport const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = \"1.47.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customerConfig.js","sourceRoot":"","sources":["../../../src/common/customerConfig.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,cAAc;
|
|
1
|
+
{"version":3,"file":"customerConfig.js","sourceRoot":"","sources":["../../../src/common/customerConfig.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,cAAc;IACV,MAAM,CAAC,QAAQ,CAAiB;IACjC,WAAW,CAAqB;IAChC,cAAc,CAAqB;IAEnC,MAAM,CAAC,WAAW;QACvB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;YAC7B,cAAc,CAAC,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;QACjD,CAAC;QACD,OAAO,cAAc,CAAC,QAAQ,CAAC;IACjC,CAAC;CACF;AAED,MAAM,cAAc,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AACpD,eAAe,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nclass CustomerConfig {\n private static instance: CustomerConfig;\n public globalSetup?: string | string[];\n public globalTeardown?: string | string[];\n\n public static getInstance(): CustomerConfig {\n if (!CustomerConfig.instance) {\n CustomerConfig.instance = new CustomerConfig();\n }\n return CustomerConfig.instance;\n }\n}\n\nconst customerConfig = CustomerConfig.getInstance();\nexport default customerConfig;\n"]}
|
|
@@ -6,53 +6,38 @@ import { EntraIdAccessTokenConstants, InternalEnvironmentVariables, ServiceEnvir
|
|
|
6
6
|
import { parseJwt } from "../utils/parseJwt.js";
|
|
7
7
|
import { ServiceErrorMessageConstants } from "./messages.js";
|
|
8
8
|
export class EntraIdAccessToken {
|
|
9
|
+
token;
|
|
10
|
+
_expiryTimestamp; // in milliseconds
|
|
11
|
+
_credential;
|
|
9
12
|
constructor(credential) {
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
coreLogger.info("Cached access token is returned, will be retried again.");
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
this.token = accessToken.token;
|
|
23
|
-
this._expiryTimestamp = accessToken.expiresOnTimestamp;
|
|
24
|
-
process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN] = this.token;
|
|
25
|
-
coreLogger.info("Entra id access token fetched and set in environment variable");
|
|
26
|
-
coreLogger.info("Entra id access token expiry:", new Date(this._expiryTimestamp).toISOString());
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
coreLogger.error(err);
|
|
31
|
-
process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = "true";
|
|
32
|
-
throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
this.setEntraIdAccessTokenFromEnvironment = () => {
|
|
36
|
-
try {
|
|
37
|
-
const token = process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];
|
|
38
|
-
if (!token) {
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
const claims = parseJwt(token);
|
|
42
|
-
if (claims.accountId || claims.aid) {
|
|
43
|
-
return;
|
|
44
|
-
} // mpt PAT
|
|
45
|
-
const expiry = new Date(claims.exp * 1000);
|
|
46
|
-
this.token = token;
|
|
47
|
-
this._expiryTimestamp = expiry.getTime();
|
|
13
|
+
this._credential = credential ?? new DefaultAzureCredential();
|
|
14
|
+
this.setEntraIdAccessTokenFromEnvironment();
|
|
15
|
+
}
|
|
16
|
+
fetchEntraIdAccessToken = async () => {
|
|
17
|
+
try {
|
|
18
|
+
coreLogger.info("Fetching entra id access token");
|
|
19
|
+
const accessToken = await this._credential.getToken(EntraIdAccessTokenConstants.SCOPE);
|
|
20
|
+
if (!accessToken) {
|
|
21
|
+
throw new Error("Entra id access token is null");
|
|
48
22
|
}
|
|
49
|
-
|
|
23
|
+
if (accessToken.token === this.token) {
|
|
24
|
+
// azure identity library can fetch the same token again from cache. 10 mins before expiry, it allows token refresh
|
|
25
|
+
coreLogger.info("Cached access token is returned, will be retried again.");
|
|
50
26
|
return;
|
|
51
27
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
28
|
+
this.token = accessToken.token;
|
|
29
|
+
this._expiryTimestamp = accessToken.expiresOnTimestamp;
|
|
30
|
+
process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN] = this.token;
|
|
31
|
+
coreLogger.info("Entra id access token fetched and set in environment variable");
|
|
32
|
+
coreLogger.info("Entra id access token expiry:", new Date(this._expiryTimestamp).toISOString());
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
coreLogger.error(err);
|
|
37
|
+
process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = "true";
|
|
38
|
+
throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
56
41
|
doesEntraIdAccessTokenNeedRotation() {
|
|
57
42
|
if (!this.token) {
|
|
58
43
|
coreLogger.info("Entra id access token not found, needs rotation");
|
|
@@ -64,6 +49,24 @@ export class EntraIdAccessToken {
|
|
|
64
49
|
coreLogger.info("Entra id access token requires rotation:", doesEntraTokenRequireRotation ? "Yes" : "No");
|
|
65
50
|
return doesEntraTokenRequireRotation;
|
|
66
51
|
}
|
|
52
|
+
setEntraIdAccessTokenFromEnvironment = () => {
|
|
53
|
+
try {
|
|
54
|
+
const token = process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];
|
|
55
|
+
if (!token) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const claims = parseJwt(token);
|
|
59
|
+
if (claims.accountId || claims.aid) {
|
|
60
|
+
return;
|
|
61
|
+
} // mpt PAT
|
|
62
|
+
const expiry = new Date(claims.exp * 1000);
|
|
63
|
+
this.token = token;
|
|
64
|
+
this._expiryTimestamp = expiry.getTime();
|
|
65
|
+
}
|
|
66
|
+
catch (_) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
67
70
|
}
|
|
68
71
|
export function createEntraIdAccessToken(credential) {
|
|
69
72
|
return new EntraIdAccessToken(credential);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,OAAO,kBAAkB;
|
|
1
|
+
{"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,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AAC,CAAC;YAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC3C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;QACT,CAAC;IACH,CAAC,CAAC;CACH;AAED,MAAM,UAAU,wBAAwB,CAAC,UAA4B;IACnE,OAAO,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/identity\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\nimport { coreLogger } from \"./logger.js\";\nimport {\n EntraIdAccessTokenConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants.js\";\nimport type { AccessTokenClaims } from \"./types.js\";\nimport { parseJwt } from \"../utils/parseJwt.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nexport class EntraIdAccessToken {\n public token?: string;\n private _expiryTimestamp?: number; // in milliseconds\n private _credential?: TokenCredential;\n\n constructor(credential?: TokenCredential) {\n this._credential = credential ?? new DefaultAzureCredential();\n this.setEntraIdAccessTokenFromEnvironment();\n }\n\n public fetchEntraIdAccessToken = async (): Promise<void> => {\n try {\n coreLogger.info(\"Fetching entra id access token\");\n const accessToken = await this._credential!.getToken(EntraIdAccessTokenConstants.SCOPE);\n if (!accessToken) {\n throw new Error(\"Entra id access token is null\");\n }\n if (accessToken.token === this.token) {\n // azure identity library can fetch the same token again from cache. 10 mins before expiry, it allows token refresh\n coreLogger.info(\"Cached access token is returned, will be retried again.\");\n return;\n }\n this.token = accessToken.token;\n this._expiryTimestamp = accessToken.expiresOnTimestamp;\n process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN] = this.token!;\n coreLogger.info(\"Entra id access token fetched and set in environment variable\");\n coreLogger.info(\n \"Entra id access token expiry:\",\n new Date(this._expiryTimestamp).toISOString(),\n );\n return;\n } catch (err) {\n coreLogger.error(err);\n process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = \"true\";\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);\n }\n };\n\n public doesEntraIdAccessTokenNeedRotation(): boolean {\n if (!this.token) {\n coreLogger.info(\"Entra id access token not found, needs rotation\");\n return true;\n }\n const lifetimeLeft = this._expiryTimestamp! - new Date().getTime();\n const doesEntraTokenRequireRotation =\n lifetimeLeft <\n EntraIdAccessTokenConstants.LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION * 60 * 1000;\n coreLogger.info(\n \"Entra id access token requires rotation:\",\n doesEntraTokenRequireRotation ? \"Yes\" : \"No\",\n );\n return doesEntraTokenRequireRotation;\n }\n\n private setEntraIdAccessTokenFromEnvironment = (): void => {\n try {\n const token = process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n if (!token) {\n return;\n }\n const claims = parseJwt<Partial<AccessTokenClaims>>(token);\n if (claims.accountId || claims.aid) {\n return;\n } // mpt PAT\n const expiry = new Date(claims.exp! * 1000);\n this.token = token;\n this._expiryTimestamp = expiry.getTime();\n } catch (_) {\n return;\n }\n };\n}\n\nexport function createEntraIdAccessToken(credential?: TokenCredential): EntraIdAccessToken {\n return new EntraIdAccessToken(credential);\n}\n"]}
|
|
@@ -6,6 +6,14 @@ export class EnvironmentVariables {
|
|
|
6
6
|
get accessToken() {
|
|
7
7
|
return process.env["PLAYWRIGHT_SERVICE_ACCESS_TOKEN"];
|
|
8
8
|
}
|
|
9
|
+
runId;
|
|
10
|
+
accountId;
|
|
11
|
+
userId;
|
|
12
|
+
userName;
|
|
13
|
+
correlationId;
|
|
14
|
+
shardId;
|
|
15
|
+
region;
|
|
16
|
+
runName;
|
|
9
17
|
constructor() {
|
|
10
18
|
this.runName = process.env["_MPT_SERVICE_RUN_NAME"];
|
|
11
19
|
this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environmentVariables.js","sourceRoot":"","sources":["../../../src/common/environmentVariables.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,OAAO,oBAAoB;IAC/B,IAAI,WAAW;QACb,OAAO,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAE,CAAC;IACzD,CAAC;
|
|
1
|
+
{"version":3,"file":"environmentVariables.js","sourceRoot":"","sources":["../../../src/common/environmentVariables.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,OAAO,oBAAoB;IAC/B,IAAI,WAAW;QACb,OAAO,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAE,CAAC;IACzD,CAAC;IACD,KAAK,CAAS;IACd,SAAS,CAAqB;IAC9B,MAAM,CAAqB;IAC3B,QAAQ,CAAqB;IAC7B,aAAa,CAAqB;IAClC,OAAO,CAAqB;IAC5B,MAAM,CAAqB;IAC3B,OAAO,CAAS;IAChB;QACE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAE,CAAC;QACrD,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,kBAAkB,CAAE,CAAC;QAC3E,IAAI,CAAC,aAAa,GAAG,UAAU,EAAE,CAAC;IACpC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { randomUUID } from \"node:crypto\";\nimport { InternalEnvironmentVariables } from \"./constants.js\";\n\nexport class EnvironmentVariables {\n get accessToken(): string {\n return process.env[\"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\"]!;\n }\n runId: string;\n accountId: string | undefined;\n userId: string | undefined;\n userName: string | undefined;\n correlationId: string | undefined;\n shardId: string | undefined;\n region: string | undefined;\n runName: string;\n constructor() {\n this.runName = process.env[\"_MPT_SERVICE_RUN_NAME\"]!;\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]!;\n this.correlationId = randomUUID();\n }\n}\n"]}
|
|
@@ -64,11 +64,10 @@ const requireOrImportDefaultFunction = async (file) => {
|
|
|
64
64
|
return func;
|
|
65
65
|
};
|
|
66
66
|
export const loadCustomerGlobalFunction = (rootDir, customerFunctionFileName) => {
|
|
67
|
-
var _a;
|
|
68
67
|
if (!customerFunctionFileName) {
|
|
69
68
|
return null;
|
|
70
69
|
}
|
|
71
|
-
const file = path.resolve(rootDir,
|
|
70
|
+
const file = path.resolve(rootDir, resolveFile(customerFunctionFileName, rootDir) ?? "");
|
|
72
71
|
return requireOrImportDefaultFunction(file);
|
|
73
72
|
};
|
|
74
73
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../src/common/executor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAU,EAAE;IACxD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAC9D,IAAI,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC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AAC,KAAK,GAAG,EAAE,CAAC;QACjB,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,OAAe,EACf,wBAAiC,EAC5B,EAAE;IACP,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,wBAAwB,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACzF,OAAO,8BAA8B,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { basename } from \"node:path\";\nimport fs from \"node:fs\";\nimport url from \"url\";\nimport path from \"node:path\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nconst getPackageJsonPath = (folderPath: string): string => {\n const packageJsonPath = path.join(folderPath, \"package.json\");\n if (fs.existsSync(packageJsonPath)) {\n return packageJsonPath;\n }\n\n const parentFolder = path.dirname(folderPath);\n if (folderPath === parentFolder) {\n return \"\";\n }\n\n const result = getPackageJsonPath(parentFolder);\n return result;\n};\n\nconst folderIsModule = (folder: string): boolean => {\n const packageJsonPath = getPackageJsonPath(folder);\n if (!packageJsonPath) return false;\n // Rely on `require` internal caching logic.\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n return require(packageJsonPath).type === \"module\";\n};\n\nconst fileIsModule = (file: string): boolean => {\n if (file.endsWith(\".mjs\") || file.endsWith(\".mts\")) return true;\n if (file.endsWith(\".cjs\") || file.endsWith(\".cts\")) return false;\n const folder = path.dirname(file);\n return folderIsModule(folder);\n};\n\nconst resolveFile = (id: string | undefined, rootDir: string): string | undefined => {\n if (!id) {\n return undefined;\n }\n const localPath = path.resolve(rootDir, id);\n if (fs.existsSync(localPath)) {\n return localPath;\n }\n return require.resolve(id, { paths: [rootDir] });\n};\n\nconst requireOrImportDefaultFunction = async (file: string): Promise<any> => {\n const fileName = basename(file);\n const isModule = fileIsModule(file);\n let func: any;\n if (isModule) func = await eval(`import(${JSON.stringify(url.pathToFileURL(file))})`);\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n else func = require(file);\n if (func && typeof func === \"object\" && \"default\" in func) {\n func = func.default;\n }\n if (typeof func !== \"function\") {\n // match playwright's error style\n const error = new Error(\n `${fileName}: ${ServiceErrorMessageConstants.INVALID_GLOBAL_FUNCTION.message}`,\n );\n error.stack = \"\";\n throw error;\n }\n return func;\n};\n\nexport const loadCustomerGlobalFunction = (\n rootDir: string,\n customerFunctionFileName?: string,\n): any => {\n if (!customerFunctionFileName) {\n return null;\n }\n const file = path.resolve(rootDir, resolveFile(customerFunctionFileName, rootDir) ?? \"\");\n return requireOrImportDefaultFunction(file);\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multimap.js","sourceRoot":"","sources":["../../../src/common/multimap.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,OAAO,QAAQ;
|
|
1
|
+
{"version":3,"file":"multimap.js","sourceRoot":"","sources":["../../../src/common/multimap.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,OAAO,QAAQ;IACX,IAAI,CAAc;IAE1B;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,CAAC;IAED,GAAG,CAAC,GAAM,EAAE,KAAQ;QAClB,IAAI,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,GAAG,EAAE,CAAC;YACZ,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAC7B,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,K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AI,EAAE,CAAC;IAC1B,CAAC;IAED,MAAM;QACJ,MAAM,MAAM,GAAQ,EAAE,CAAC;QACvB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAChC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;IACpB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport class MultiMap<K, V> {\n private _map: Map<K, V[]>;\n\n constructor() {\n this._map = new Map<K, V[]>();\n }\n\n set(key: K, value: V): void {\n let values = this._map.get(key);\n if (!values) {\n values = [];\n this._map.set(key, values);\n }\n values.push(value);\n }\n\n get(key: K): V[] {\n return this._map.get(key) || [];\n }\n\n has(key: K): boolean {\n return this._map.has(key);\n }\n\n delete(key: K, value: V): void {\n const values = this._map.get(key);\n if (!values) {\n return;\n }\n if (values.includes(value)) {\n this._map.set(\n key,\n values.filter((v) => value !== v),\n );\n }\n }\n\n deleteAll(key: K): void {\n this._map.delete(key);\n }\n\n hasValue(key: K, value: V): boolean {\n const values = this._map.get(key);\n if (!values) {\n return false;\n }\n return values.includes(value);\n }\n\n get size(): number {\n return this._map.size;\n }\n\n [Symbol.iterator](): Iterator<[K, V[]]> {\n return this._map[Symbol.iterator]();\n }\n\n keys(): IterableIterator<K> {\n return this._map.keys();\n }\n\n values(): Iterable<V> {\n const result: V[] = [];\n for (const key of this.keys()) {\n result.push(...this.get(key));\n }\n return result;\n }\n\n clear(): void {\n this._map.clear();\n }\n}\n"]}
|