@azure/microsoft-playwright-testing 1.0.0-alpha.20240919.1 → 1.0.0-alpha.20240924.2
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/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +4 -4
- package/dist/common/constants.js.map +1 -1
- package/dist/common/entraIdAccessToken.d.ts.map +1 -1
- package/dist/common/entraIdAccessToken.js +2 -1
- package/dist/common/entraIdAccessToken.js.map +1 -1
- package/dist/common/executor.d.ts.map +1 -1
- package/dist/common/executor.js +1 -1
- package/dist/common/executor.js.map +1 -1
- package/dist/common/messages.d.ts +28 -6
- package/dist/common/messages.d.ts.map +1 -1
- package/dist/common/messages.js +28 -6
- package/dist/common/messages.js.map +1 -1
- package/dist/common/types.d.ts +1 -0
- package/dist/common/types.d.ts.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/core/playwrightService.d.ts.map +1 -1
- package/dist/core/playwrightService.js +1 -1
- package/dist/core/playwrightService.js.map +1 -1
- package/dist/reporter/mptReporter.d.ts +1 -0
- package/dist/reporter/mptReporter.d.ts.map +1 -1
- package/dist/reporter/mptReporter.js +11 -2
- package/dist/reporter/mptReporter.js.map +1 -1
- package/dist/utils/cIInfoProvider.d.ts.map +1 -1
- package/dist/utils/cIInfoProvider.js +10 -10
- package/dist/utils/cIInfoProvider.js.map +1 -1
- package/dist/utils/reporterUtils.d.ts +0 -4
- package/dist/utils/reporterUtils.d.ts.map +1 -1
- package/dist/utils/reporterUtils.js +0 -14
- package/dist/utils/reporterUtils.js.map +1 -1
- package/dist/utils/utils.d.ts +12 -2
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +28 -8
- package/dist/utils/utils.js.map +1 -1
- package/package.json +2 -2
- package/types/reporter/microsoft-playwright-testing.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":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AAE,CAO/C;IAEF,gBAAuB,0BAA0B,uEACqB;IACtE,gBAAuB,2BAA2B,uOACoL;IAEtO,gBAAuB,gBAAgB,EAAE,MAAM,CAAwC;IACvF,gBAAuB,qBAAqB,EAAE,MAAM,CAC0B;IAC9E,gBAAuB,kBAAkB,EAAE,MAAM,CAC+B;IAChF,gBAAuB,mBAAmB,EAAE,MAAM,CACK;IACvD,gBAAuB,YAAY,EAAE,MAAM,CAAkB;IAC7D,gBAAuB,UAAU,EAAE,MAAM,CAAgB;IACzD,gBAAuB,sBAAsB,EAAE,MAAM,CAA4B;IACjF,gBAAuB,oBAAoB,EAAE,MAAM,CAA0B;IAC7E,gBAAuB,eAAe,EAAE,MAAM,CAAqB;IACnE,gBAAuB,aAAa,EAAE,MAAM,CAAmB;IAC/D,gBAAuB,aAAa,EAAE,eAAe,CAsDnD;CACH;AAED,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;GAwEpC,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;CAIxC,CAAC;AAEF,eAAO,MAAM,oCAAoC,WAAW,CAAC"}
|
package/dist/common/constants.js
CHANGED
|
@@ -149,7 +149,7 @@ exports.TestErrorType = {
|
|
|
149
149
|
};
|
|
150
150
|
exports.TestResultErrorConstants = [
|
|
151
151
|
{
|
|
152
|
-
key: "
|
|
152
|
+
key: "401",
|
|
153
153
|
message: "The authentication token provided is invalid. Please check the token and try again.",
|
|
154
154
|
pattern: /(?=.*browserType\.connect)(?=.*401 Unauthorized)/i,
|
|
155
155
|
type: exports.TestErrorType.Scalable,
|
|
@@ -171,7 +171,7 @@ exports.TestResultErrorConstants = [
|
|
|
171
171
|
type: exports.TestErrorType.Scalable,
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
|
-
key: "
|
|
174
|
+
key: "InvalidAccessToken",
|
|
175
175
|
message: "The provided access token does not match the specified workspace URL. Please verify that both values are correct.",
|
|
176
176
|
pattern: /(?=.*browserType\.connect)(?=.*403 Forbidden)(?=[\s\S]*InvalidAccessToken)/i,
|
|
177
177
|
type: exports.TestErrorType.Scalable,
|
|
@@ -189,13 +189,13 @@ exports.TestResultErrorConstants = [
|
|
|
189
189
|
type: exports.TestErrorType.Scalable,
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
key: "
|
|
192
|
+
key: "503",
|
|
193
193
|
message: "The service is currently unavailable. Please check the service status and try again.",
|
|
194
194
|
pattern: /(?=.*browserType\.connect)(?=.*503 Service Unavailable)/i,
|
|
195
195
|
type: exports.TestErrorType.Scalable,
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
|
-
key: "
|
|
198
|
+
key: "504",
|
|
199
199
|
message: "The request to the service timed out. Please try again later.",
|
|
200
200
|
pattern: /(?=.*browserType\.connect)(?=.*504 Gateway Timeout)/i,
|
|
201
201
|
type: exports.TestErrorType.Scalable,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,qBAAqB,EAAE,uBAAuB;IAC9C,yBAAyB,EAAE,2BAA2B;IACtD,sDAAsD,EAAE,mCAAmC;IAC3F,+BAA+B,EAAE,iCAAiC;IAClE,sBAAsB,EAAE,wBAAwB;IAChD,gCAAgC,EAAE,kCAAkC;CACrE,CAAC;AAEW,QAAA,8BAA8B,GAAG;IAC5C,eAAe,EAAE,K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nE,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,yBAAyB;QAC9B,OAAO,EAAE,+DAA+D;QACxE,OAAO,EAAE,sDAAsD;QAC/D,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,0BAA0B;QAC/B,OAAO,EACL,mKAAmK;QACrK,OAAO,EAAE,2CAA2C;QACpD,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,yEAAyE;QAClF,OAAO,EAAE,uEAAuE;QAChF,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;CACF,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,6BAA6B,EAAE,gCAAgC;CAChE,CAAC;AAEW,QAAA,oCAAoC,GAAG,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ApiErrorMessage } from \"./types\";\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_OS: \"PLAYWRIGHT_SERVICE_OS\",\n PLAYWRIGHT_SERVICE_RUN_ID: \"PLAYWRIGHT_SERVICE_RUN_ID\",\n PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: \"PLAYWRIGHT_SERVICE_EXPOSE_NETWORK\",\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n PLAYWRIGHT_SERVICE_REPORTING_URL: \"PLAYWRIGHT_SERVICE_REPORTING_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 REPORTER_PACKAGE_VERSION = \"1.0.0-beta.3\";\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 API_VERSION = \"2024-09-01-preview\";\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 =\n \"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 // 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\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: \"Unauthorized_Scalable\",\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_Scalable\",\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: \"ServiceUnavailable_Scalable\",\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: \"GatewayTimeout_Scalable\",\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_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\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,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ApiErrorMessage } from \"./types\";\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_OS: \"PLAYWRIGHT_SERVICE_OS\",\n PLAYWRIGHT_SERVICE_RUN_ID: \"PLAYWRIGHT_SERVICE_RUN_ID\",\n PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: \"PLAYWRIGHT_SERVICE_EXPOSE_NETWORK\",\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n PLAYWRIGHT_SERVICE_REPORTING_URL: \"PLAYWRIGHT_SERVICE_REPORTING_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 REPORTER_PACKAGE_VERSION = \"1.0.0-beta.3\";\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 API_VERSION = \"2024-09-01-preview\";\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 =\n \"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 // 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_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n};\n\nexport const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = \"1.47.0\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entraIdAccessToken.d.ts","sourceRoot":"","sources":["../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0B,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAW1E,cAAM,kBAAkB;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,WAAW,CAAC,CAAkB;gBAE1B,UAAU,CAAC,EAAE,eAAe;IAKjC,uBAAuB,QAAa,OAAO,CAAC,IAAI,CAAC,CA0BtD;IAEK,kCAAkC,IAAI,OAAO;IAgBpD,OAAO,CAAC,oCAAoC,
|
|
1
|
+
{"version":3,"file":"entraIdAccessToken.d.ts","sourceRoot":"","sources":["../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAGA,OAAO,EAA0B,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAW1E,cAAM,kBAAkB;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,WAAW,CAAC,CAAkB;gBAE1B,UAAU,CAAC,EAAE,eAAe;IAKjC,uBAAuB,QAAa,OAAO,CAAC,IAAI,CAAC,CA0BtD;IAEK,kCAAkC,IAAI,OAAO;IAgBpD,OAAO,CAAC,oCAAoC,CAiB1C;CACH;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -32,7 +32,7 @@ class EntraIdAccessToken {
|
|
|
32
32
|
catch (err) {
|
|
33
33
|
logger_1.coreLogger.error(err);
|
|
34
34
|
process.env[constants_1.InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = "true";
|
|
35
|
-
throw new Error(messages_1.ServiceErrorMessageConstants.NO_AUTH_ERROR);
|
|
35
|
+
throw new Error(messages_1.ServiceErrorMessageConstants.NO_AUTH_ERROR.message);
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
this.setEntraIdAccessTokenFromEnvironment = () => {
|
|
@@ -48,6 +48,7 @@ class EntraIdAccessToken {
|
|
|
48
48
|
const expiry = new Date(claims.exp * 1000);
|
|
49
49
|
this.token = token;
|
|
50
50
|
this._expiryTimestamp = expiry.getTime();
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
52
|
}
|
|
52
53
|
catch (_) {
|
|
53
54
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,8CAA0E;AAC1E,qCAAsC;AACtC,2CAIqB;AAErB,0CAA0C;AAC1C,yCAA0D;AAE1D,MAAM,kBAAkB;IAKtB,YAAY,UAA4B;QAKjC,4BAAuB,GAAG,KAAK,IAAmB,EAAE;YACzD,IAAI,CAAC;gBACH,mBAAU,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;gBAClD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,WAAY,CAAC,QAAQ,CAAC,uCAA2B,CAAC,KAAK,CAAC,CAAC;gBACxF,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,MAAM,IAAI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CAAC,CAAC;gBAC3D,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;oBACnC,OAAO;gBACT,CAAC,CAAC,UAAU;gBACZ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,GAAI,GAAG,IAAI,CAAC,CAAC;gBAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnB,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;gBACzC,6DAA6D;YAC/D,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,OAAO;YACT,CAAC;QACH,CAAC,CAAC;QAjEA,IAAI,CAAC,WAAW,GAAG,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,IAAI,iCAAsB,EAAE,CAAC;QAC9D,IAAI,CAAC,oCAAoC,EAAE,CAAC;IAC9C,CAAC;IA8BM,kCAAkC;QACvC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,mBAAU,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,YAAY,GAAG,IAAI,CAAC,gBAAiB,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QACnE,MAAM,6BAA6B,GACjC,YAAY;YACZ,uCAA2B,CAAC,+CAA+C,GAAG,EAAE,GAAG,IAAI,CAAC;QAC1F,mBAAU,CAAC,IAAI,CACb,0CAA0C,EAC1C,6BAA6B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAC7C,CAAC;QACF,OAAO,6BAA6B,CAAC;IACvC,CAAC;CAoBF;AAEQ,gDAAkB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DefaultAzureCredential, TokenCredential } from \"@azure/identity\";\nimport { coreLogger } from \"./logger\";\nimport {\n EntraIdAccessTokenConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants\";\nimport { AccessTokenClaims } from \"./types\";\nimport { parseJwt } from \"../utils/utils\";\nimport { ServiceErrorMessageConstants } from \"./messages\";\n\nclass EntraIdAccessToken {\n public token?: string;\n private _expiryTimestamp?: number; // in milli seconds\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (_) {\n return;\n }\n };\n}\n\nexport { EntraIdAccessToken };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/common/executor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../src/common/executor.ts"],"names":[],"mappings":"AAuEA,eAAO,MAAM,0BAA0B,YAC5B,MAAM,6BACY,MAAM,KAChC,GAMF,CAAC"}
|
package/dist/common/executor.js
CHANGED
|
@@ -61,7 +61,7 @@ const requireOrImportDefaultFunction = async (file) => {
|
|
|
61
61
|
}
|
|
62
62
|
if (typeof func !== "function") {
|
|
63
63
|
// match playwright's error style
|
|
64
|
-
const error = new Error(`${fileName}: ${messages_1.ServiceErrorMessageConstants.INVALID_GLOBAL_FUNCTION}`);
|
|
64
|
+
const error = new Error(`${fileName}: ${messages_1.ServiceErrorMessageConstants.INVALID_GLOBAL_FUNCTION.message}`);
|
|
65
65
|
error.stack = "";
|
|
66
66
|
throw error;
|
|
67
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../src/common/executor.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,+BAAgC;AAChC,oDAAoB;AACpB,sDAAsB;AACtB,wDAAwB;AACxB,yCAA0D;AAE1D,MAAM,kBAAkB,GAAG,CAAC,UAAkB,EAAU,EAAE;IACxD,MAAM,eAAe,GAAG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OAAO,CAAC,OAAO,EAAE,MAAA,WAAW,CAAC,wBAAwB,EAAE,OAAO,CAAC,mCAAI,EAAE,CAAC,CAAC;IACzF,OAAO,8BAA8B,CAAC,IAAI,CAAC,CAAC;AAC9C,CAAC,CAAC;AATW,QAAA,0BAA0B,8BASrC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { basename } from \"path\";\nimport fs from \"fs\";\nimport url from \"url\";\nimport path from \"path\";\nimport { ServiceErrorMessageConstants } from \"./messages\";\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,9 +1,31 @@
|
|
|
1
1
|
export declare const ServiceErrorMessageConstants: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
INVALID_GLOBAL_FUNCTION:
|
|
7
|
-
|
|
2
|
+
NO_SERVICE_URL_ERROR: {
|
|
3
|
+
key: string;
|
|
4
|
+
message: string;
|
|
5
|
+
};
|
|
6
|
+
INVALID_GLOBAL_FUNCTION: {
|
|
7
|
+
key: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
INVALID_PLAYWRIGHT_VERSION_ERROR: {
|
|
11
|
+
key: string;
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
WORKSPACE_MISMATCH_ERROR: {
|
|
15
|
+
key: string;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
NO_AUTH_ERROR: {
|
|
19
|
+
key: string;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
INVALID_MPT_PAT_ERROR: {
|
|
23
|
+
key: string;
|
|
24
|
+
message: string;
|
|
25
|
+
};
|
|
26
|
+
EXPIRED_MPT_PAT_ERROR: {
|
|
27
|
+
key: string;
|
|
28
|
+
message: string;
|
|
29
|
+
};
|
|
8
30
|
};
|
|
9
31
|
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCxC,CAAC"}
|
package/dist/common/messages.js
CHANGED
|
@@ -4,11 +4,33 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.ServiceErrorMessageConstants = void 0;
|
|
6
6
|
exports.ServiceErrorMessageConstants = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
INVALID_GLOBAL_FUNCTION:
|
|
12
|
-
|
|
7
|
+
NO_SERVICE_URL_ERROR: {
|
|
8
|
+
key: "NoServiceUrlError",
|
|
9
|
+
message: "The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.",
|
|
10
|
+
},
|
|
11
|
+
INVALID_GLOBAL_FUNCTION: {
|
|
12
|
+
key: "InvalidGlobalFunction",
|
|
13
|
+
message: "File must export a single function.",
|
|
14
|
+
},
|
|
15
|
+
INVALID_PLAYWRIGHT_VERSION_ERROR: {
|
|
16
|
+
key: "InvalidPlaywrightVersionError",
|
|
17
|
+
message: "The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/mpt/supported-versions.",
|
|
18
|
+
},
|
|
19
|
+
WORKSPACE_MISMATCH_ERROR: {
|
|
20
|
+
key: "InvalidAccessToken",
|
|
21
|
+
message: "The provided access token does not match the specified workspace URL. Please verify that both values are correct.",
|
|
22
|
+
},
|
|
23
|
+
NO_AUTH_ERROR: {
|
|
24
|
+
key: "NoAuthError",
|
|
25
|
+
message: "Could not authenticate with the service. Please refer to https://aka.ms/mpt/authentication for more information.",
|
|
26
|
+
},
|
|
27
|
+
INVALID_MPT_PAT_ERROR: {
|
|
28
|
+
key: "InvalidMptPatError",
|
|
29
|
+
message: "The authentication token provided is invalid. Check the token and try again.",
|
|
30
|
+
},
|
|
31
|
+
EXPIRED_MPT_PAT_ERROR: {
|
|
32
|
+
key: "ExpiredMptPatError",
|
|
33
|
+
message: "Your authentication token has expired. Create a new token.",
|
|
34
|
+
},
|
|
13
35
|
};
|
|
14
36
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/common/messages.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,4BAA4B,GAAG;IAC1C,
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../src/common/messages.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,4BAA4B,GAAG;IAC1C,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EACL,8GAA8G;KACjH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,qCAAqC;KAC/C;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,qIAAqI;KACxI;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,mHAAmH;KACtH;IACD,aAAa,EAAE;QACb,GAAG,EAAE,aAAa;QAClB,OAAO,EACL,kHAAkH;KACrH;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,8EAA8E;KACxF;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,4DAA4D;KACtE;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const ServiceErrorMessageConstants = {\n NO_SERVICE_URL_ERROR: {\n key: \"NoServiceUrlError\",\n message:\n \"The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.\",\n },\n INVALID_GLOBAL_FUNCTION: {\n key: \"InvalidGlobalFunction\",\n message: \"File must export a single function.\",\n },\n INVALID_PLAYWRIGHT_VERSION_ERROR: {\n key: \"InvalidPlaywrightVersionError\",\n message:\n \"The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/mpt/supported-versions.\",\n },\n WORKSPACE_MISMATCH_ERROR: {\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 },\n NO_AUTH_ERROR: {\n key: \"NoAuthError\",\n message:\n \"Could not authenticate with the service. Please refer to https://aka.ms/mpt/authentication for more information.\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message: \"The authentication token provided is invalid. Check the token and try again.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"Your authentication token has expired. Create a new token.\",\n },\n};\n"]}
|
package/dist/common/types.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Location, TestStep } from "@playwright/test/reporter";
|
|
|
2
2
|
import { ServiceAuth, ServiceOS } from "./constants";
|
|
3
3
|
import type { TokenCredential } from "@azure/identity";
|
|
4
4
|
export type JwtPayload = {
|
|
5
|
+
aid?: string;
|
|
5
6
|
iss?: string;
|
|
6
7
|
sub?: string;
|
|
7
8
|
aud?: string[] | string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG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B"}
|
package/dist/common/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Location, TestStep } from \"@playwright/test/reporter\";\nimport { ServiceAuth, ServiceOS } from \"./constants\";\nimport type { TokenCredential } from \"@azure/identity\";\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 aid?: string;\n accountId?: string;\n};\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 * Connect options for the service.\n */\nexport type ConnectOptions = {\n /**\n * @public\n *\n * Additional HTTP headers to be sent with web socket connect request.\n */\n headers?: { [key: string]: string };\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 * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n timeout?: 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/**\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/microsoft-playwright-testing\";\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 * Base playwright configuration inputs required for generating the service config.\n */\nexport type PlaywrightConfigInput = {\n /**\n * @public\n *\n * Path to the global setup file. This file will be required and run before all the tests. It must export a single\n * function that takes a [`TestConfig`] argument.\n *\n * Learn more about {@link https://playwright.dev/docs/test-global-setup-teardown | global setup and teardown}.\n */\n globalSetup?: string;\n\n /**\n * @public\n *\n * Path to the global teardown file. This file will be required and run after all the tests. It must export a single\n * function. See also\n * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-teardown | testConfig.globalTeardown}.\n *\n * Learn more about {@link https://playwright.dev/docs/test-global-setup-teardown | global setup and teardown}.\n */\n globalTeardown?: string;\n};\n\n/**\n * @public\n *\n * Playwright configuration integrated with Microsoft Playwright Testing.\n *\n * @remarks\n *\n * GlobalSetup and globalTeardown wraps around any existing global setup\n * and teardown present in the base playwright configuration and runs it.\n */\nexport type PlaywrightConfig = {\n use?: {\n connectOptions: BrowserConnectOptions;\n };\n globalSetup?: string;\n globalTeardown?: string;\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 Microsoft Playwright Testing.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Microsoft Playwright Testing.\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 timeout?: 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 * Use cloud hosted browsers.\n *\n * @defaultValue `false`\n */\n useCloudHostedBrowsers?: boolean;\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\n/**\n * @public\n *\n * OS Types supported by Microsoft Playwright Testing.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Microsoft Playwright Testing.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\nexport type ErrorDetails = {\n message: string;\n location?: Location;\n};\nexport type ApiErrorMessage = {\n [key: string]: {\n [key: number]: string;\n };\n};\n/**\n * @public\n *\n * Optional configuration for MPT Reporter.\n *\n * @example\n *\n * ```\n * import { defineConfig } from \"@playwright/test\";\n *\n * export default defineConfig({\n * reporter: [[\"@azure/microsoft-playwright-testing/reporter\", {\n * enableGitHubSummary: true\n * }]],\n * });\n * ```\n */\nexport interface MPTReporterConfig {\n /**\n * @public\n *\n * Enable GitHub Actions annotations to diagnose test failures and deep link to MPT Portal.\n *\n * @defaultValue `true`\n */\n enableGitHubSummary?: boolean;\n\n /**\n * @public\n *\n * Enable result publishing for the test run. This will upload the test result and artifacts to the MPT Portal.\n *\n * @defaultValue `true`\n */\n enableResultPublish?: boolean;\n}\nexport type DedupedStep = { step: TestStep; count: number; duration: number };\n\nexport type RawTestStep = {\n title: string;\n category: string;\n startTime: string;\n duration: number;\n error?: string;\n steps: RawTestStep[];\n location?: Location;\n snippet?: string;\n count: number;\n};\n\nexport type IBackOffOptions = {\n numOfAttempts: number;\n retry: (e: any, attemptNumber: number) => boolean | Promise<boolean>;\n jitter: JitterType;\n};\n\nexport type JitterType = \"full\" | \"none\";\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\n// Playwright OSS Types\n\nexport interface FullConfig {\n configFile?: string;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/common/types.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Location, TestStep } from \"@playwright/test/reporter\";\nimport { ServiceAuth, ServiceOS } from \"./constants\";\nimport type { TokenCredential } from \"@azure/identity\";\n\nexport type JwtPayload = {\n aid?: string;\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 aid?: string;\n accountId?: string;\n};\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 * Connect options for the service.\n */\nexport type ConnectOptions = {\n /**\n * @public\n *\n * Additional HTTP headers to be sent with web socket connect request.\n */\n headers?: { [key: string]: string };\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 * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n timeout?: 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/**\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/microsoft-playwright-testing\";\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 * Base playwright configuration inputs required for generating the service config.\n */\nexport type PlaywrightConfigInput = {\n /**\n * @public\n *\n * Path to the global setup file. This file will be required and run before all the tests. It must export a single\n * function that takes a [`TestConfig`] argument.\n *\n * Learn more about {@link https://playwright.dev/docs/test-global-setup-teardown | global setup and teardown}.\n */\n globalSetup?: string;\n\n /**\n * @public\n *\n * Path to the global teardown file. This file will be required and run after all the tests. It must export a single\n * function. See also\n * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-teardown | testConfig.globalTeardown}.\n *\n * Learn more about {@link https://playwright.dev/docs/test-global-setup-teardown | global setup and teardown}.\n */\n globalTeardown?: string;\n};\n\n/**\n * @public\n *\n * Playwright configuration integrated with Microsoft Playwright Testing.\n *\n * @remarks\n *\n * GlobalSetup and globalTeardown wraps around any existing global setup\n * and teardown present in the base playwright configuration and runs it.\n */\nexport type PlaywrightConfig = {\n use?: {\n connectOptions: BrowserConnectOptions;\n };\n globalSetup?: string;\n globalTeardown?: string;\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 Microsoft Playwright Testing.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Microsoft Playwright Testing.\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 timeout?: 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 * Use cloud hosted browsers.\n *\n * @defaultValue `false`\n */\n useCloudHostedBrowsers?: boolean;\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\n/**\n * @public\n *\n * OS Types supported by Microsoft Playwright Testing.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Microsoft Playwright Testing.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\nexport type ErrorDetails = {\n message: string;\n location?: Location;\n};\nexport type ApiErrorMessage = {\n [key: string]: {\n [key: number]: string;\n };\n};\n/**\n * @public\n *\n * Optional configuration for MPT Reporter.\n *\n * @example\n *\n * ```\n * import { defineConfig } from \"@playwright/test\";\n *\n * export default defineConfig({\n * reporter: [[\"@azure/microsoft-playwright-testing/reporter\", {\n * enableGitHubSummary: true\n * }]],\n * });\n * ```\n */\nexport interface MPTReporterConfig {\n /**\n * @public\n *\n * Enable GitHub Actions annotations to diagnose test failures and deep link to MPT Portal.\n *\n * @defaultValue `true`\n */\n enableGitHubSummary?: boolean;\n\n /**\n * @public\n *\n * Enable result publishing for the test run. This will upload the test result and artifacts to the MPT Portal.\n *\n * @defaultValue `true`\n */\n enableResultPublish?: boolean;\n}\nexport type DedupedStep = { step: TestStep; count: number; duration: number };\n\nexport type RawTestStep = {\n title: string;\n category: string;\n startTime: string;\n duration: number;\n error?: string;\n steps: RawTestStep[];\n location?: Location;\n snippet?: string;\n count: number;\n};\n\nexport type IBackOffOptions = {\n numOfAttempts: number;\n retry: (e: any, attemptNumber: number) => boolean | Promise<boolean>;\n jitter: JitterType;\n};\n\nexport type JitterType = \"full\" | \"none\";\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\n// Playwright OSS Types\n\nexport interface FullConfig {\n configFile?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../src/core/playwrightService.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kCAAkC,EAClC,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../src/core/playwrightService.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,kCAAkC,EAClC,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAYzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,QAAA,MAAM,gBAAgB,WACZ,qBAAqB,YACnB,kCAAkC,KAC3C,gBAqDF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,iBAAiB,aACX,IAAI,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,KACpE,OAAO,CAAC,qBAAqB,CAmB/B,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -57,7 +57,7 @@ const getServiceConfig = (config, options) => {
|
|
|
57
57
|
const globalFunctions = {};
|
|
58
58
|
if ((options === null || options === void 0 ? void 0 : options.serviceAuthType) === constants_1.ServiceAuth.ACCESS_TOKEN) {
|
|
59
59
|
// mpt PAT requested and set by the customer, no need to setup entra lifecycle handlers
|
|
60
|
-
(0, utils_1.validateMptPAT)();
|
|
60
|
+
(0, utils_1.validateMptPAT)(utils_1.exitWithFailureMessage);
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
63
|
globalFunctions.globalSetup = require.resolve("./global/playwright-service-global-setup");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightService.js","sourceRoot":"","sources":["../../src/core/playwrightService.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,mDAAgF;AAChF,sFAAsD;AACtD,+EAA4E;AAC5E,8FAA8D;AAO9D,
|
|
1
|
+
{"version":3,"file":"playwrightService.js","sourceRoot":"","sources":["../../src/core/playwrightService.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,mDAAgF;AAChF,sFAAsD;AACtD,+EAA4E;AAC5E,8FAA8D;AAO9D,0CASwB;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,gBAAgB,GAAG,CACvB,MAA6B,EAC7B,OAA4C,EAC1B,EAAE;IACpB,IAAA,iCAAyB,GAAE,CAAC;IAC5B,IAAA,0BAAkB,GAAE,CAAC;IACrB,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,EAAE,CAAC;QACxB,gCAAsB,CAAC,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;IACjE,CAAC;IACD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;QACvB,wBAAc,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IAClD,CAAC;IACD,IAAI,MAAM,CAAC,cAAc,EAAE,CAAC;QAC1B,wBAAc,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IACxD,CAAC;IAED,MAAM,uBAAuB,GAAG,IAAI,iD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;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,iBAAiB,GAAG,KAAK,EAC7B,OAAqE,EACrC,EAAE;IAClC,MAAM,uBAAuB,GAAG,IAAI,iDAAuB,EAAE,CAAC;IAC9D,uBAAuB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAE5C,MAAM,KAAK,GAAG,MAAM,IAAA,kCAA0B,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,CAAC,CAAC;IACpE,OAAO;QACL,UAAU,EAAE,IAAA,4BAAoB,EAC9B,uBAAuB,CAAC,KAAK,EAC7B,uBAAuB,CAAC,SAAS,CAClC;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;aACjC;YACD,OAAO,EAAE,uBAAuB,CAAC,OAAO;YACxC,aAAa,EAAE,uBAAuB,CAAC,aAAa;YACpD,MAAM,EAAE,uBAAuB,CAAC,MAAM;SACvC;KACF,CAAC;AACJ,CAAC,CAAC;AAEyB,8CAAiB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { InternalEnvironmentVariables, ServiceAuth } from \"../common/constants\";\nimport customerConfig from \"../common/customerConfig\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig\";\nimport playwrightServiceEntra from \"./playwrightServiceEntra\";\nimport {\n PlaywrightServiceAdditionalOptions,\n PlaywrightConfig,\n PlaywrightConfigInput,\n BrowserConnectOptions,\n} from \"../common/types\";\nimport {\n emitReportingUrl,\n fetchOrValidateAccessToken,\n getAccessToken,\n getServiceWSEndpoint,\n validateMptPAT,\n validatePlaywrightVersion,\n validateServiceUrl,\n exitWithFailureMessage,\n} from \"../utils/utils\";\n\n/**\n * @public\n *\n * Generate playwright configuration integrated with Microsoft Playwright Testing.\n *\n * @param config - base playwright configuration\n * @param options - additional options for the service\n * @returns PlaywrightConfig\n *\n * @example\n * ```\n * import { defineConfig } from \"playwright/test\";\n * import { getServiceConfig } from \"@azure/microsoft-playwright-testing\";\n * import playwrightConfig from \"./playwright.config\";\n *\n * export default defineConfig(playwrightConfig, getServiceConfig(playwrightConfig));\n * ```\n *\n * @example\n * ```\n * import { defineConfig } from \"playwright/test\";\n * import { getServiceConfig, ServiceOS } from \"@azure/microsoft-playwright-testing\";\n * import playwrightConfig from \"./playwright.config\";\n *\n * export default defineConfig(playwrightConfig, getServiceConfig(playwrightConfig, {\n * runId: \"custom run id\",\n * os: ServiceOS.WINDOWS\n * }));\n * ```\n */\nconst getServiceConfig = (\n config: PlaywrightConfigInput,\n options?: PlaywrightServiceAdditionalOptions,\n): PlaywrightConfig => {\n validatePlaywrightVersion();\n validateServiceUrl();\n if (options?.credential) {\n playwrightServiceEntra.entraIdAccessToken = options.credential;\n }\n if (config.globalSetup) {\n customerConfig.globalSetup = config.globalSetup;\n }\n if (config.globalTeardown) {\n customerConfig.globalTeardown = config.globalTeardown;\n }\n\n const playwrightServiceConfig = new PlaywrightServiceConfig();\n playwrightServiceConfig.setOptions(options);\n emitReportingUrl();\n\n const globalFunctions: any = {};\n if (options?.serviceAuthType === ServiceAuth.ACCESS_TOKEN) {\n // mpt PAT requested and set by the customer, no need to setup entra lifecycle handlers\n validateMptPAT(exitWithFailureMessage);\n } else {\n globalFunctions.globalSetup = require.resolve(\"./global/playwright-service-global-setup\");\n globalFunctions.globalTeardown = require.resolve(\"./global/playwright-service-global-teardown\");\n }\n\n if (options?.useCloudHostedBrowsers === false) {\n return {\n ...globalFunctions,\n };\n }\n if (!process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED]) {\n process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] = \"true\";\n console.log(\"\\nRunning tests using Microsoft Playwright Testing service.\");\n }\n\n return {\n use: {\n connectOptions: {\n wsEndpoint: getServiceWSEndpoint(\n playwrightServiceConfig.runId,\n playwrightServiceConfig.serviceOs,\n ),\n headers: {\n Authorization: `Bearer ${getAccessToken()}`,\n },\n timeout: playwrightServiceConfig.timeout,\n exposeNetwork: playwrightServiceConfig.exposeNetwork,\n slowMo: playwrightServiceConfig.slowMo,\n },\n },\n ...globalFunctions,\n };\n};\n\n/**\n * @public\n *\n * Get connect options required to connect to Microsoft Playwright Testing's cloud hosted browsers.\n *\n * @param options - additional options for the service\n * @returns BrowserConnectOptions\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions } from \"@azure/microsoft-playwright-testing\";\n *\n * test('has title', async ({ browserName }) => {\n * const { wsEndpoint, options } = 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 */\nconst getConnectOptions = async (\n options?: Omit<PlaywrightServiceAdditionalOptions, \"serviceAuthType\">,\n): Promise<BrowserConnectOptions> => {\n const playwrightServiceConfig = new PlaywrightServiceConfig();\n playwrightServiceConfig.setOptions(options);\n\n const token = await fetchOrValidateAccessToken(options?.credential);\n return {\n wsEndpoint: getServiceWSEndpoint(\n playwrightServiceConfig.runId,\n playwrightServiceConfig.serviceOs,\n ),\n options: {\n headers: {\n Authorization: `Bearer ${token}`,\n },\n timeout: playwrightServiceConfig.timeout,\n exposeNetwork: playwrightServiceConfig.exposeNetwork,\n slowMo: playwrightServiceConfig.slowMo,\n },\n };\n};\n\nexport { getServiceConfig, getConnectOptions };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mptReporter.d.ts","sourceRoot":"","sources":["../../src/reporter/mptReporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,UAAU,EACV,QAAQ,EACR,KAAK,EACN,MAAM,2BAA2B,CAAC;AAmBnC,OAAO,EAAE,i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F,OAAO,CAAC,uBAAuB,CAM7B;IACF;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAgB/C;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAsBnD;;;;;;;;;;;;;;OAcG;IACG,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;YA4ChC,QAAQ;YAgCR,UAAU;YAoCV,MAAM;YAmBN,4BAA4B;IA6C1C,OAAO,CAAC,qBAAqB;IAsD7B,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,iBAAiB;IAsBzB;;;;;OAKG;IACH,aAAa,IAAI,OAAO;CAGzB;AACD,eAAe,WAAW,CAAC"}
|
|
@@ -13,6 +13,7 @@ const reporterUtils_1 = tslib_1.__importDefault(require("../utils/reporterUtils"
|
|
|
13
13
|
const serviceClient_1 = require("../utils/serviceClient");
|
|
14
14
|
const storageClient_1 = require("../utils/storageClient");
|
|
15
15
|
const messages_1 = require("../common/messages");
|
|
16
|
+
const utils_1 = require("../utils/utils");
|
|
16
17
|
/**
|
|
17
18
|
* @public
|
|
18
19
|
*
|
|
@@ -60,6 +61,13 @@ class MPTReporter {
|
|
|
60
61
|
this._isInformationMessagePresent = (key) => {
|
|
61
62
|
return this.processedErrorMessageKeys.includes(key);
|
|
62
63
|
};
|
|
64
|
+
this._reporterFailureHandler = (error) => {
|
|
65
|
+
if (!this._isInformationMessagePresent(error.key)) {
|
|
66
|
+
this._addKeyToInformationMessage(error.key);
|
|
67
|
+
this._addInformationalMessage(error.message);
|
|
68
|
+
}
|
|
69
|
+
this.isTokenValid = false;
|
|
70
|
+
};
|
|
63
71
|
if ((config === null || config === void 0 ? void 0 : config.enableGitHubSummary) !== undefined) {
|
|
64
72
|
this.enableGitHubSummary = config.enableGitHubSummary;
|
|
65
73
|
}
|
|
@@ -286,11 +294,11 @@ class MPTReporter {
|
|
|
286
294
|
}
|
|
287
295
|
logger_1.reporterLogger.info(`Reporting url - ${process.env["PLAYWRIGHT_SERVICE_REPORTING_URL"]}`);
|
|
288
296
|
if (this.envVariables.accessToken === undefined || this.envVariables.accessToken === "") {
|
|
289
|
-
process.stdout.write(`\n${messages_1.ServiceErrorMessageConstants.NO_AUTH_ERROR}`);
|
|
297
|
+
process.stdout.write(`\n${messages_1.ServiceErrorMessageConstants.NO_AUTH_ERROR.message}`);
|
|
290
298
|
this.isTokenValid = false;
|
|
291
299
|
}
|
|
292
300
|
else if (reporterUtils_1.default.hasAudienceClaim(this.envVariables.accessToken)) {
|
|
293
|
-
const result =
|
|
301
|
+
const result = (0, utils_1.populateValuesFromServiceUrl)();
|
|
294
302
|
this.envVariables.region = result.region;
|
|
295
303
|
this.envVariables.accountId = result.accountId;
|
|
296
304
|
const entraTokenDetails = reporterUtils_1.default.getTokenDetails(this.envVariables.accessToken, mptTokenDetails_1.TokenType.ENTRA);
|
|
@@ -299,6 +307,7 @@ class MPTReporter {
|
|
|
299
307
|
}
|
|
300
308
|
else {
|
|
301
309
|
const mptTokenDetails = reporterUtils_1.default.getTokenDetails(this.envVariables.accessToken, mptTokenDetails_1.TokenType.MPT);
|
|
310
|
+
(0, utils_1.validateMptPAT)(this._reporterFailureHandler);
|
|
302
311
|
this.envVariables.accountId = mptTokenDetails.aid;
|
|
303
312
|
this.envVariables.userId = mptTokenDetails.oid;
|
|
304
313
|
this.envVariables.userName = mptTokenDetails.userName;
|