@azure/microsoft-playwright-testing 1.0.0-alpha.20241029.1 → 1.0.0-alpha.20241030.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/common/constants.d.ts +1 -1
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/entraIdAccessToken.d.ts +1 -1
- package/dist/common/entraIdAccessToken.d.ts.map +1 -1
- package/dist/common/entraIdAccessToken.js.map +1 -1
- package/dist/common/httpService.d.ts +1 -1
- package/dist/common/httpService.d.ts.map +1 -1
- package/dist/common/httpService.js.map +1 -1
- package/dist/common/playwrightServiceConfig.d.ts +1 -1
- package/dist/common/playwrightServiceConfig.d.ts.map +1 -1
- package/dist/common/playwrightServiceConfig.js.map +1 -1
- package/dist/common/types.d.ts +1 -1
- package/dist/common/types.d.ts.map +1 -1
- package/dist/common/types.js.map +1 -1
- package/dist/core/global/playwright-service-global-setup.d.ts +1 -1
- package/dist/core/global/playwright-service-global-setup.d.ts.map +1 -1
- package/dist/core/global/playwright-service-global-setup.js.map +1 -1
- package/dist/core/global/playwright-service-global-teardown.d.ts +1 -1
- package/dist/core/global/playwright-service-global-teardown.d.ts.map +1 -1
- package/dist/core/global/playwright-service-global-teardown.js.map +1 -1
- package/dist/core/playwrightService.d.ts +1 -1
- package/dist/core/playwrightService.d.ts.map +1 -1
- package/dist/core/playwrightService.js.map +1 -1
- package/dist/model/testResult.d.ts +1 -1
- package/dist/model/testResult.d.ts.map +1 -1
- package/dist/model/testResult.js.map +1 -1
- package/dist/model/testRun.d.ts +1 -1
- package/dist/model/testRun.d.ts.map +1 -1
- package/dist/model/testRun.js.map +1 -1
- package/dist/reporter/mptReporter.d.ts +1 -1
- package/dist/reporter/mptReporter.d.ts.map +1 -1
- package/dist/reporter/mptReporter.js.map +1 -1
- package/dist/utils/packageManager.d.ts +1 -1
- package/dist/utils/packageManager.d.ts.map +1 -1
- package/dist/utils/packageManager.js.map +1 -1
- package/dist/utils/reporterUtils.d.ts +8 -6
- package/dist/utils/reporterUtils.d.ts.map +1 -1
- package/dist/utils/reporterUtils.js.map +1 -1
- package/dist/utils/serviceClient.d.ts +7 -7
- package/dist/utils/serviceClient.d.ts.map +1 -1
- package/dist/utils/serviceClient.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,2BAA2B;;;;CAIvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;CAMtC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;CAK1C,CAAC;AAEF,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAKhD,qBAAa,SAAS;IAEpB,gBAAuB,mBAAmB,gBAAgB;IAC1D,gBAAuB,yBAAyB,gBAAgB;IAChE,gBAAuB,SAAS,aAAa;IAC7C,gBAAuB,iBAAiB,gBAAgB;IAExD,gBAAuB,wBAAwB,kBAAkB;IACjE,gBAAuB,0BAA0B,sCAAsC;IACvF,gBAAuB,wBAAwB,uDACO;IACtD,gBAAuB,wBAAwB,oBAAoB;IACnE,gBAAuB,iBAAiB,OAAO;IAC/C,gBAAuB,qBAAqB,sBAAsB;IAClE,gBAAuB,eAAe,MAAM;IAC5C,gBAAuB,WAAW,SAAS;IAC3C,gBAAuB,mBAAmB,mBAAmB;IAC7D,gBAAuB,aAAa,yCAAyC;IAC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,EAAE,mEAAmE;QAC5E,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EACL,kHAAkH;QACpH,OAAO,EACL,yFAAyF;QAC3F,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,KAAK;QACV,OAAO,EAAE,sFAAsF;QAC/F,OAAO,EAAE,0DAA0D;QACnE,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,KAAK;QACV,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,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,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_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_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};\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,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,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,KAAK;IACtB,eAAe,EAAE,CAAC;IAClB,sBAAsB,EAAE,YAAY;IACpC,kBAAkB,EAAE,iBAAS,CAAC,KAAK;CACpC,CAAC;AAEW,QAAA,WAAW,GAAG,oBAAoB,CAAC;AAEhD,2CAA2C;AAC3C,2FAA2F;AAE3F,MAAa,SAAS;;AAAtB,8BAwGC;AAvGC,2BAA2B;AACJ,6BAAmB,GAAG,YAAY,CAAC;AACnC,mCAAyB,GAAG,YAAY,CAAC;AACzC,mBAAS,GAAG,SAAS,CAAC;AACtB,2BAAiB,GAAG,YAAY,CAAC;AACxD,sBAA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AuE;QAChF,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;CACF,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,6BAA6B,EAAE,gCAAgC;CAChE,CAAC;AAEW,QAAA,oCAAoC,GAAG,QAAQ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { 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_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_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};\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,
|
|
1
|
+
{"version":3,"file":"entraIdAccessToken.d.ts","sourceRoot":"","sources":["../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAYvD,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,8CAAyD;AACzD,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,KAAK,CAAC,+BAA+B,CAAC,CAAC;gBACnD,CAAC;gBACD,IAAI,WAAW,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EAAE,CAAC;oBACrC,mHAAmH;oBACnH,mBAAU,CAAC,IAAI,CAAC,yDAAyD,CAAC,CAAC;oBAC3E,OAAO;gBACT,CAAC;gBACD,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC;gBAC/B,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC,kBAAkB,CAAC;gBACvD,OAAO,CAAC,GAAG,CAAC,sCAA0B,CAAC,+BAA+B,CAAC,GAAG,I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AC;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 type { TokenCredential } from \"@azure/identity\";\nimport { DefaultAzureCredential } from \"@azure/identity\";\nimport { coreLogger } from \"./logger\";\nimport {\n EntraIdAccessTokenConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants\";\nimport type { 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,4 +1,4 @@
|
|
|
1
|
-
import { PipelineResponse, HttpMethods } from "@azure/core-rest-pipeline";
|
|
1
|
+
import type { PipelineResponse, HttpMethods } from "@azure/core-rest-pipeline";
|
|
2
2
|
export declare class HttpService {
|
|
3
3
|
callAPI(method: HttpMethods, url: string, data: any | null, token: string, contentType: string, correlationId: string): Promise<PipelineResponse>;
|
|
4
4
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpService.d.ts","sourceRoot":"","sources":["../../src/common/httpService.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"httpService.d.ts","sourceRoot":"","sources":["../../src/common/httpService.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAW/E,qBAAa,WAAW;IACT,OAAO,CAClB,MAAM,EAAE,WAAW,EACnB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,GAAG,GAAG,IAAI,EAChB,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,gBAAgB,CAAC;CA0B7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpService.js","sourceRoot":"","sources":["../../src/common/httpService.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,mCAAoC;
|
|
1
|
+
{"version":3,"file":"httpService.js","sourceRoot":"","sources":["../../src/common/httpService.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,mCAAoC;AAEpC,kEAKmC;AACnC,qCAA0C;AAE1C,MAAM,iBAAiB,GAAG,KAAK,CAAC;AAEhC,MAAa,WAAW;IACf,KAAK,CAAC,OAAO,CAClB,MAAmB,EACnB,GAAW,EACX,IAAgB,EAChB,KAAa,EACb,WAAmB,EACnB,aAAqB;QAErB,MAAM,QAAQ,GAAG,IAAA,8CAAyB,EAAC;YACzC,cAAc,EAAE;gBACd,MAAM,EAAE,uBAAc,CAAC,IAAI;aAC5B;SACF,CAAC,CAAC;QAEH,MAAM,UAAU,GAAG,IAAA,4CAAuB,GAAE,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAA,0CAAqB,EAAC;YACpC,GAAG;YACH,MAAM;YACN,OAAO,EAAE,IAAA,sCAAiB,EAAC;gBACzB,cAAc,EAAE,WAAW;gBAC3B,MAAM,EAAE,KAAK;gBACb,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,wBAAwB,EAAE,GAAG,IAAA,mBAAU,GAAE,EAAE;gBAC3C,kBAAkB,EAAE,aAAa;aAClC,CAAC;YACF,OAAO,EAAE,iBAAiB;SAC3B,CAAC,CAAC;QAEH,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;QACtB,CAAC;QACD,OAAO,QAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;CACF;AAlCD,kCAkCC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { randomUUID } from \"crypto\";\nimport type { PipelineResponse, HttpMethods } from \"@azure/core-rest-pipeline\";\nimport {\n createDefaultHttpClient,\n createHttpHeaders,\n createPipelineRequest,\n createPipelineFromOptions,\n} from \"@azure/core-rest-pipeline\";\nimport { reporterLogger } from \"./logger\";\n\nconst HTTP_CALL_TIMEOUT = 70000;\n\nexport class HttpService {\n public async callAPI(\n method: HttpMethods,\n url: string,\n data: any | null,\n token: string,\n contentType: string,\n correlationId: string,\n ): Promise<PipelineResponse> {\n const pipeline = createPipelineFromOptions({\n loggingOptions: {\n logger: reporterLogger.info,\n },\n });\n\n const httpClient = createDefaultHttpClient();\n const request = createPipelineRequest({\n url,\n method,\n headers: createHttpHeaders({\n \"Content-Type\": contentType,\n Accept: \"*/*\",\n Authorization: `Bearer ${token}`,\n \"x-ms-client-request-id\": `${randomUUID()}`,\n \"x-correlation-id\": correlationId,\n }),\n timeout: HTTP_CALL_TIMEOUT,\n });\n\n if (data) {\n request.body = data;\n }\n return pipeline.sendRequest(httpClient, request);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,kCAAkC,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAG1E,cAAM,uBAAuB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;;IAWvB,UAAU,aAAc,kCAAkC,KAAG,IAAI,CA0B/D;CACH;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,2CAIqB;AAErB,0CAAgD;AAEhD,MAAM,uBAAuB;IAO3B;QAUA,eAAU,GAAG,CAAC,OAA4C,EAAQ,EAAE;YAClE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,EAAE,CAAC;gBAC3B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;YAC7C,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wCAA4B,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBAClE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE,CAAC;oBACnB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC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E,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,wCAA4B,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QAChF,IAAI,CAAC,OAAO,GAAG,0CAA8B,CAAC,eAAe,CAAC;QAC9D,IAAI,CAAC,MAAM,GAAG,0CAA8B,CAAC,eAAe,CAAC;QAC7D,IAAI,CAAC,aAAa,GAAG,0CAA8B,CAAC,sBAAsB,CAAC;IAC7E,CAAC;CA6BF;AAEQ,0DAAuB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants\";\nimport { PlaywrightServiceAdditionalOptions, OsType } from \"./types\";\nimport { getAndSetRunId } from \"../utils/utils\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public timeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n constructor() {\n this.serviceOs = (process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.timeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n }\n\n setOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.timeout) {\n this.timeout = options.timeout;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"]}
|
|
1
|
+
{"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,2CAIqB;AAErB,0CAAgD;AAEhD,MAAM,uBAAuB;IAO3B;QAUA,eAAU,GAAG,CAAC,OAA4C,EAAQ,EAAE;YAClE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,EAAE,CAAC;gBAC3B,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;YAC7C,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wCAA4B,CAAC,kBAAkB,CAAC,EAAE,CAAC;gBAClE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE,CAAC;oBACnB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;oBAC3B,OAAO,CAAC,GAAG,CAAC,wCAA4B,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;gBAC5E,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,KAAK,GAAG,IAAA,sBAAc,GAAE,CAAC;gBAChC,CAAC;YACH,CAAC;YACD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,wCAA4B,CAAC,oBAAoB,CAAC,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants\";\nimport type { PlaywrightServiceAdditionalOptions, OsType } from \"./types\";\nimport { getAndSetRunId } from \"../utils/utils\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public timeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n constructor() {\n this.serviceOs = (process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.timeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n }\n\n setOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.timeout) {\n this.timeout = options.timeout;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"]}
|
package/dist/common/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Location, TestStep } from "@playwright/test/reporter";
|
|
2
|
-
import { ServiceAuth, ServiceOS } from "./constants";
|
|
2
|
+
import type { ServiceAuth, ServiceOS } from "./constants";
|
|
3
3
|
import type { TokenCredential } from "@azure/identity";
|
|
4
4
|
export type JwtPayload = {
|
|
5
5
|
aid?: 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;
|
|
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,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,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,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG;IAC3C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,M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E,WAAW,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrE,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACtD,oBAAoB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD,CAAC;AAIF,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
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 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 * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\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 type { 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 * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\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,4 +1,4 @@
|
|
|
1
|
-
import { FullConfig } from "../../common/types";
|
|
1
|
+
import type { FullConfig } from "../../common/types";
|
|
2
2
|
declare const playwrightServiceGlobalSetupWrapper: (config: FullConfig) => Promise<any>;
|
|
3
3
|
export default playwrightServiceGlobalSetupWrapper;
|
|
4
4
|
//# sourceMappingURL=playwright-service-global-setup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-service-global-setup.d.ts","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-setup.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"playwright-service-global-setup.d.ts","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-setup.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,QAAA,MAAM,mCAAmC,WAAkB,UAAU,KAAG,OAAO,CAAC,GAAG,CAWlF,CAAC;AAEF,eAAe,mCAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-service-global-setup.js","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-setup.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,+BAA+B;AAE/B,+FAA+D;AAC/D,oDAAmE;AACnE,yFAAyD;AAEzD,MAAM,mCAAmC,GAAG,KAAK,EAAE,MAAkB,EAAgB,EAAE;IACrF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAChF,MAAM,uBAAuB,GAAG,MAAM,IAAA,qCAA0B,EAC9D,OAAO,EACP,wBAAc,CAAC,WAAW,CAC3B,CAAC;IAEF,MAAM,gCAAsB,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,uBAAuB,EAAE,CAAC;QAC5B,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,mCAAmC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"path\";\nimport { FullConfig } from \"../../common/types\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor\";\nimport customerConfig from \"../../common/customerConfig\";\n\nconst playwrightServiceGlobalSetupWrapper = async (config: FullConfig): Promise<any> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n const customerGlobalSetupFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalSetup,\n );\n\n await playwrightServiceEntra.globalSetup();\n if (customerGlobalSetupFunc) {\n return customerGlobalSetupFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalSetupWrapper;\n"]}
|
|
1
|
+
{"version":3,"file":"playwright-service-global-setup.js","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-setup.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,+BAA+B;AAE/B,+FAA+D;AAC/D,oDAAmE;AACnE,yFAAyD;AAEzD,MAAM,mCAAmC,GAAG,KAAK,EAAE,MAAkB,EAAgB,EAAE;IACrF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAChF,MAAM,uBAAuB,GAAG,MAAM,IAAA,qCAA0B,EAC9D,OAAO,EACP,wBAAc,CAAC,WAAW,CAC3B,CAAC;IAEF,MAAM,gCAAsB,CAAC,WAAW,EAAE,CAAC;IAC3C,IAAI,uBAAuB,EAAE,CAAC;QAC5B,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,mCAAmC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"path\";\nimport type { FullConfig } from \"../../common/types\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor\";\nimport customerConfig from \"../../common/customerConfig\";\n\nconst playwrightServiceGlobalSetupWrapper = async (config: FullConfig): Promise<any> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n const customerGlobalSetupFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalSetup,\n );\n\n await playwrightServiceEntra.globalSetup();\n if (customerGlobalSetupFunc) {\n return customerGlobalSetupFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalSetupWrapper;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FullConfig } from "../../common/types";
|
|
1
|
+
import type { FullConfig } from "../../common/types";
|
|
2
2
|
declare const playwrightServiceGlobalTeardownWrapper: (config: FullConfig) => Promise<void>;
|
|
3
3
|
export default playwrightServiceGlobalTeardownWrapper;
|
|
4
4
|
//# sourceMappingURL=playwright-service-global-teardown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-service-global-teardown.d.ts","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-teardown.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"playwright-service-global-teardown.d.ts","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-teardown.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,QAAA,MAAM,sCAAsC,WAAkB,UAAU,KAAG,OAAO,CAAC,IAAI,CAWtF,CAAC;AAEF,eAAe,sCAAsC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-service-global-teardown.js","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-teardown.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,+BAA+B;AAE/B,+FAA+D;AAC/D,oDAAmE;AACnE,yFAAyD;AAEzD,MAAM,sCAAsC,GAAG,KAAK,EAAE,MAAkB,EAAiB,EAAE;IACzF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAChF,MAAM,0BAA0B,GAAG,MAAM,IAAA,qCAA0B,EACjE,OAAO,EACP,wBAAc,CAAC,cAAc,CAC9B,CAAC;IAEF,gCAAsB,CAAC,cAAc,EAAE,CAAC;IACxC,IAAI,0BAA0B,EAAE,CAAC;QAC/B,MAAM,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,sCAAsC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"path\";\nimport { FullConfig } from \"../../common/types\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor\";\nimport customerConfig from \"../../common/customerConfig\";\n\nconst playwrightServiceGlobalTeardownWrapper = async (config: FullConfig): Promise<void> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n const customerGlobalTeardownFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalTeardown,\n );\n\n playwrightServiceEntra.globalTeardown();\n if (customerGlobalTeardownFunc) {\n await customerGlobalTeardownFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalTeardownWrapper;\n"]}
|
|
1
|
+
{"version":3,"file":"playwright-service-global-teardown.js","sourceRoot":"","sources":["../../../src/core/global/playwright-service-global-teardown.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,+BAA+B;AAE/B,+FAA+D;AAC/D,oDAAmE;AACnE,yFAAyD;AAEzD,MAAM,sCAAsC,GAAG,KAAK,EAAE,MAAkB,EAAiB,EAAE;IACzF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAChF,MAAM,0BAA0B,GAAG,MAAM,IAAA,qCAA0B,EACjE,OAAO,EACP,wBAAc,CAAC,cAAc,CAC9B,CAAC;IAEF,gCAAsB,CAAC,cAAc,EAAE,CAAC;IACxC,IAAI,0BAA0B,EAAE,CAAC;QAC/B,MAAM,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC,CAAC;AAEF,kBAAe,sCAAsC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"path\";\nimport type { FullConfig } from \"../../common/types\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor\";\nimport customerConfig from \"../../common/customerConfig\";\n\nconst playwrightServiceGlobalTeardownWrapper = async (config: FullConfig): Promise<void> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n const customerGlobalTeardownFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalTeardown,\n );\n\n playwrightServiceEntra.globalTeardown();\n if (customerGlobalTeardownFunc) {\n await customerGlobalTeardownFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalTeardownWrapper;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlaywrightServiceAdditionalOptions, PlaywrightConfig, PlaywrightConfigInput, BrowserConnectOptions } from "../common/types";
|
|
1
|
+
import type { PlaywrightServiceAdditionalOptions, PlaywrightConfig, PlaywrightConfigInput, BrowserConnectOptions } from "../common/types";
|
|
2
2
|
/**
|
|
3
3
|
* @public
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../src/core/playwrightService.ts"],"names":[],"mappings":"AAOA,OAAO,
|
|
1
|
+
{"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../src/core/playwrightService.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,kCAAkC,EAClC,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAYzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,QAAA,MAAM,gBAAgB,WACZ,qBAAqB,YACnB,kCAAkC,KAC3C,gBAsDF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,iBAAiB,aACX,IAAI,CAAC,kCAAkC,EAAE,iBAAiB,CAAC,KACpE,OAAO,CAAC,qBAAqB,CAoB/B,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -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,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,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c,EAAE;gBACd,UAAU,EAAE,IAAA,4BAAoB,EAC9B,uBAAuB,CAAC,KAAK,EAC7B,uBAAuB,CAAC,OAAO,EAC/B,uBAAuB,CAAC,SAAS,CAClC;gBACD,OAAO,EAAE;oBACP,aAAa,EAAE,UAAU,IAAA,sBAAc,GAAE,EAAE;iBAC5C;gBACD,OAAO,EAAE,uBAAuB,CAAC,OAAO;gBACxC,aAAa,EAAE,uBAAuB,CAAC,aAAa;gBACpD,MAAM,EAAE,uBAAuB,CAAC,MAAM;aACvC;SACF,IACE,eAAe,EAClB;AACJ,CAAC,CAAC;AAsDO,4CAAgB;AApDzB;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAO,EAC/B,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.runName,\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.runName,\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
|
+
{"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,iDAAuB,EAAE,CAAC;IAC9D,uBAAuB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAA,wBAAgB,GAAE,CAAC;IAEnB,MAAM,eAAe,GAAQ,EAAE,CAAC;IAChC,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,MAAK,uBAAW,CAAC,YAAY,EAAE,CAAC;QAC1D,uFAAuF;QAC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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,OAAO,EAC/B,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 type {\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.runName,\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.runName,\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":"testResult.d.ts","sourceRoot":"","sources":["../../src/model/testResult.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"testResult.d.ts","sourceRoot":"","sources":["../../src/model/testResult.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,qBAAa,UAAU;IACrB,MAAM,EAAG,MAAM,CAAC;IAChB,eAAe,EAAG,MAAM,CAAC;IACzB,iBAAiB,EAAG,MAAM,CAAC;IAC3B,KAAK,EAAG,MAAM,CAAC;IACf,OAAO,EAAG,MAAM,CAAC;IACjB,SAAS,EAAG,MAAM,CAAC;IACnB,OAAO,EAAG,MAAM,CAAC;IACjB,SAAS,EAAG,MAAM,CAAC;IACnB,UAAU,EAAG,MAAM,CAAC;IACpB,QAAQ,EAAG,MAAM,CAAC;IAClB,UAAU,EAAG,MAAM,CAAC;IACpB,KAAK,EAAG,MAAM,CAAC;IACf,MAAM,EAAG,MAAM,CAAC;IAChB,IAAI,EAAG,MAAM,EAAE,CAAC;IAChB,WAAW,EAAG,MAAM,EAAE,CAAC;IACvB,aAAa,EAAG,aAAa,CAAC;IAC9B,cAAc,EAAG,kBAAkB,CAAC;IACpC,aAAa,EAAG,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testResult.js","sourceRoot":"","sources":["../../src/model/testResult.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,MAAa,UAAU;CAmBtB;AAnBD,gCAmBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { RawTestStep } from \"../common/types\";\n\nexport class TestResult {\n testId!: string;\n testExecutionId!: string;\n testCombinationId!: string;\n runId!: string;\n shardId!: string;\n accountId!: string;\n suiteId!: string;\n testTitle!: string;\n suiteTitle!: string;\n fileName!: string;\n lineNumber!: number;\n retry!: number;\n status!: string;\n tags!: string[];\n annotations!: string[];\n webTestConfig!: WebTestConfig;\n resultsSummary!: TestResultsSummary;\n artifactsPath!: string[];\n}\n\nexport type WebTestConfig = {\n jobName: string;\n projectName: string;\n browserType?: string;\n os: string;\n};\n\nexport type TestResultsSummary = {\n status: string;\n duration: number;\n startTime: string;\n attachmentsMetadata: string;\n};\n\nexport type RawTestResult = {\n steps?: RawTestStep[];\n errors?: string;\n stdErr?: string;\n stdOut?: string;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"testResult.js","sourceRoot":"","sources":["../../src/model/testResult.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,MAAa,UAAU;CAmBtB;AAnBD,gCAmBC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { RawTestStep } from \"../common/types\";\n\nexport class TestResult {\n testId!: string;\n testExecutionId!: string;\n testCombinationId!: string;\n runId!: string;\n shardId!: string;\n accountId!: string;\n suiteId!: string;\n testTitle!: string;\n suiteTitle!: string;\n fileName!: string;\n lineNumber!: number;\n retry!: number;\n status!: string;\n tags!: string[];\n annotations!: string[];\n webTestConfig!: WebTestConfig;\n resultsSummary!: TestResultsSummary;\n artifactsPath!: string[];\n}\n\nexport type WebTestConfig = {\n jobName: string;\n projectName: string;\n browserType?: string;\n os: string;\n};\n\nexport type TestResultsSummary = {\n status: string;\n duration: number;\n startTime: string;\n attachmentsMetadata: string;\n};\n\nexport type RawTestResult = {\n steps?: RawTestStep[];\n errors?: string;\n stdErr?: string;\n stdOut?: string;\n};\n"]}
|
package/dist/model/testRun.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testRun.d.ts","sourceRoot":"","sources":["../../src/model/testRun.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"testRun.d.ts","sourceRoot":"","sources":["../../src/model/testRun.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,OAAO;IAClB,SAAS,EAAG,MAAM,CAAC;IACnB,WAAW,EAAG,MAAM,CAAC;IACrB,SAAS,EAAG,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,EAAG,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAU;CACxC;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,aAAa,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testRun.js","sourceRoot":"","sources":["../../src/model/testRun.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,MAAa,OAAO;IAApB;QAQE,0BAAqB,GAAW,MAAM,CAAC,CAAC,8BAA8B;IACxE,CAAC;CAAA;AATD,0BASC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ShardInfo } from \"./shard\";\n\nexport class TestRun {\n testRunId!: string;\n displayName!: string;\n creatorId!: string;\n creatorName?: string;\n startTime!: string;\n ciConfig?: CIConfig;\n testRunConfig?: TestRunConfig;\n cloudReportingEnabled: string = \"true\"; // Default value set to 'true'\n}\n\nexport type CIConfig = {\n ciProviderName: string;\n branch: string;\n author: string;\n commitId: string;\n revisionUrl: string;\n};\n\nexport type TestRunConfig = {\n workers: number;\n pwVersion: string;\n timeout: number;\n shards: ShardInfo;\n retries?: number;\n repeatEach?: number;\n testFramework: TestFramework;\n testType: string;\n testSdkLanguage: string;\n reporterPackageVersion: string;\n};\n\nexport type TestFramework = {\n name: string;\n version: string;\n runnerName: string;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"testRun.js","sourceRoot":"","sources":["../../src/model/testRun.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,MAAa,OAAO;IAApB;QAQE,0BAAqB,GAAW,MAAM,CAAC,CAAC,8BAA8B;IACxE,CAAC;CAAA;AATD,0BASC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ShardInfo } from \"./shard\";\n\nexport class TestRun {\n testRunId!: string;\n displayName!: string;\n creatorId!: string;\n creatorName?: string;\n startTime!: string;\n ciConfig?: CIConfig;\n testRunConfig?: TestRunConfig;\n cloudReportingEnabled: string = \"true\"; // Default value set to 'true'\n}\n\nexport type CIConfig = {\n ciProviderName: string;\n branch: string;\n author: string;\n commitId: string;\n revisionUrl: string;\n};\n\nexport type TestRunConfig = {\n workers: number;\n pwVersion: string;\n timeout: number;\n shards: ShardInfo;\n retries?: number;\n repeatEach?: number;\n testFramework: TestFramework;\n testType: string;\n testSdkLanguage: string;\n reporterPackageVersion: string;\n};\n\nexport type TestFramework = {\n name: string;\n version: string;\n runnerName: string;\n};\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;
|
|
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;AAqBnC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAIzD;;;;;;;;;;;;;;;;GAgBG;AACH,cAAM,WAAY,YAAW,QAAQ;IACnC,OAAO,CAAC,YAAY,CAAiB;IACrC,OAAO,CAAC,mBAAmB,CAAQ;IACnC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,qBAAqB,CAAkB;IAC/C,OAAO,CAAC,MAAM,CAAsC;IACpD,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,cAAc,CAAoB;IAC1C,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,eAAe,CAAgD;IACvE,OAAO,CAAC,aAAa,CAAgB;I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AAK,EAAE,EAAE;gBAC9B,oCAAwB,CAAC,OAAO,CAAC,CAAC,uBAAuB,EAAE,EAAE;oBAC3D,IAAI,IAAI,CAAC,yBAAyB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,CAAC;wBACzE,OAAO;oBACT,CAAC;oBACD,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC;oBACnC,IAAI,CAAC,YAAY;wBAAE,OAAO;oBAC1B,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBAClE,IAAI,KAAK,EAAE,CAAC;wBACV,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;wBACjE,IAAI,CAAC,wBAAwB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,aAAa;QACX,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AACD,kBAAe,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n TestCase,\n TestResult,\n FullConfig,\n Reporter,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { reporterLogger } from \"../common/logger\";\nimport {\n Constants,\n InternalEnvironmentVariables,\n TestResultErrorConstants,\n} from \"../common/constants\";\nimport { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { MultiMap } from \"../common/multimap\";\nimport { EntraTokenDetails } from \"../model/entraTokenDetails\";\nimport { MPTTokenDetails, TokenType } from \"../model/mptTokenDetails\";\nimport { Shard, UploadMetadata } from \"../model/shard\";\nimport { StorageUri } from \"../model/storageUri\";\nimport { TestResult as MPTTestResult, RawTestResult } from \"../model/testResult\";\nimport { TestRun } from \"../model/testRun\";\nimport { CIInfo, CIInfoProvider } from \"../utils/cIInfoProvider\";\nimport ReporterUtils from \"../utils/reporterUtils\";\nimport { ServiceClient } from \"../utils/serviceClient\";\nimport { StorageClient } from \"../utils/storageClient\";\nimport { MPTReporterConfig } from \"../common/types\";\nimport { ServiceErrorMessageConstants } from \"../common/messages\";\nimport { validateMptPAT, populateValuesFromServiceUrl } from \"../utils/utils\";\n\n/**\n * @public\n *\n * Extends Playwright's Reporter class to enable Microsoft Playwright Testing's Reporting\n * feature to publish test results and related artifacts and\n * view them in the service portal for faster and easier troubleshooting.\n *\n * @example\n *\n * ```\n * import { defineConfig } from \"@playwright/test\";\n *\n * export default defineConfig({\n * reporter: [[\"@azure/microsoft-playwright-testing/reporter\"]]\n * });\n * ```\n */\nclass MPTReporter implements Reporter {\n private isTokenValid: boolean = true;\n private enableGitHubSummary = true;\n private isRegionValid: boolean = true;\n private shard!: Shard;\n private isTestRunStartSuccess: boolean = false;\n private ciInfo: CIInfo = CIInfoProvider.getCIInfo();\n private serviceClient!: ServiceClient;\n private storageClient!: StorageClient;\n private reporterUtils!: ReporterUtils;\n private envVariables!: EnvironmentVariables;\n private testRawResults = new MultiMap<string, string>();\n private promiseOnBegin!: Promise<boolean>;\n private _testEndPromises: Promise<void>[] = [];\n private testResultBatch: Set<MPTTestResult> = new Set<MPTTestResult>();\n private errorMessages: string[] = [];\n private informationalMessages: string[] = [];\n private processedErrorMessageKeys: string[] = [];\n private sasUri!: StorageUri;\n private uploadMetadata: UploadMetadata = {\n numTestResults: 0,\n numTotalAttachments: 0,\n sizeTotalAttachments: 0,\n };\n private numWorkers: number = -1;\n private testRunUrl: string = \"\";\n private enableResultPublish: boolean = true;\n\n constructor(config: Partial<MPTReporterConfig>) {\n if (config?.enableGitHubSummary !== undefined) {\n this.enableGitHubSummary = config.enableGitHubSummary;\n }\n if (config?.enableResultPublish !== undefined) {\n this.enableResultPublish = config.enableResultPublish;\n }\n }\n private _addError(errorMessage: string): void {\n if (this.errorMessages.length < Constants.ERROR_MESSAGES_MAX_LENGTH) {\n this.errorMessages.push(this.reporterUtils.redactAccessToken(errorMessage));\n }\n }\n\n private _addInformationalMessage = (message: string): void => {\n this.informationalMessages.push(message);\n };\n\n private _addKeyToInformationMessage = (key: string): void => {\n this.processedErrorMessageKeys.push(key);\n };\n\n private _isInformationMessagePresent = (key: string): boolean => {\n return this.processedErrorMessageKeys.includes(key);\n };\n private _reporterFailureHandler = (error: { key: string; message: string }): void => {\n if (!this._isInformationMessagePresent(error.key)) {\n this._addKeyToInformationMessage(error.key);\n this._addInformationalMessage(error.message);\n }\n this.isTokenValid = false;\n };\n /**\n * @public\n *\n * Called once before running tests.\n *\n * @param config - Resolved configuration.\n * @param suite - The root suite that contains all projects, files and test cases.\n */\n onBegin(config: FullConfig, suite: Suite): void {\n if (!this.enableResultPublish) return;\n this.initializeMPTReporter();\n this.reporterUtils = new ReporterUtils(this.envVariables, config, suite);\n if (this.isTokenValid && this.isRegionValid) {\n this.serviceClient = new ServiceClient(\n this.envVariables,\n this.reporterUtils,\n this._addInformationalMessage,\n this._isInformationMessagePresent,\n this._addKeyToInformationMessage,\n );\n this.promiseOnBegin = this._onBegin();\n }\n }\n\n /**\n * @public\n *\n * Called after a test has been finished in the worker process.\n *\n * @param test - Test that has been finished.\n * @param result - Result of the test run.\n */\n onTestEnd(test: TestCase, result: TestResult): void {\n this.numWorkers = Math.max(this.numWorkers, result.parallelIndex + 1);\n this.processTestResult(result);\n if (!this.enableResultPublish) return;\n // Process test result\n this._onTestEnd(test, result);\n // Upload the test results batch\n try {\n if (this.testResultBatch.size >= Constants.TEST_BATCH_SIZE) {\n const currResultBatch: MPTTestResult[] = [...this.testResultBatch];\n if (this.isTestRunStartSuccess) {\n this._testEndPromises.push(this.serviceClient.postTestResults(currResultBatch));\n reporterLogger.info(`\\nAdded test results batch for upload.`);\n this.testResultBatch.clear();\n }\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test results: ${err.message}.`);\n }\n }\n\n /**\n * @public\n *\n * Called after all tests have been run, or testing has been interrupted. Note that this method may return a [Promise]\n * and Playwright Test will await it. Reporter is allowed to override the status and hence affect the exit code of the\n * test runner.\n *\n * @param result - Result of the full test run, `status` can be one of:\n * - `'passed'` - Everything went as expected.\n * - `'failed'` - Any test has failed.\n * - `'timedout'` - The\n * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout | testConfig.globalTimeout} has\n * been reached.\n * - `'interrupted'` - Interrupted by the user.\n */\n async onEnd(result: FullResult): Promise<void> {\n if (this.enableResultPublish) {\n await this._onEnd(result);\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n } else {\n let count: number = 0;\n process.stdout.write(\"\\nUploading test results.\");\n await Promise.allSettled(this._testEndPromises).then((values) => {\n values.forEach((value) => {\n if (value.status === \"fulfilled\") {\n count++;\n this.reporterUtils.progressBar(count, this._testEndPromises.length);\n }\n return value.status;\n });\n reporterLogger.info(`\\nTest result processing completed.`);\n return values;\n });\n try {\n await this.serviceClient.postTestRunShardEnd(\n result,\n this.shard,\n this.errorMessages,\n this.uploadMetadata,\n this.numWorkers,\n );\n reporterLogger.info(`\\nTest run successfully uploaded.`);\n\n if (this.enableGitHubSummary) {\n this.reporterUtils.generateMarkdownSummary(this.testRunUrl);\n }\n\n process.stdout.write(`\\nTest report: ${this.testRunUrl}\\n`);\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in completing test run: ${err.message}`);\n process.stdout.write(`\\nUnable to complete test results upload.`);\n }\n }\n }\n this.displayAdditionalInformation();\n }\n\n private async _onBegin(): Promise<boolean> {\n process.stdout.write(`\\n`);\n try {\n const testRunResponse: TestRun | undefined = await this.serviceClient.patchTestRun(\n this.ciInfo,\n );\n reporterLogger.info(\n `\\nTest run report successfully initialized: ${testRunResponse?.displayName}.`,\n );\n process.stdout.write(\n `Initializing reporting for this test run. You can view the results at: https://playwright.microsoft.com/workspaces/${encodeURIComponent(this.envVariables.accountId!)}/runs/${encodeURIComponent(this.envVariables.runId!)}\\n`,\n );\n const shardResponse = await this.serviceClient.postTestRunShardStart();\n this.shard = shardResponse;\n // Set test report link as environment variable. If/else to check if environment variable defined or not.\n if (\n Constants.DEFAULT_SERVICE_ENDPOINT &&\n this.envVariables.accountId &&\n this.envVariables.runId\n ) {\n this.testRunUrl = `${Constants.DEFAULT_DASHBOARD_ENDPOINT}/workspaces/${encodeURIComponent(\n this.envVariables.accountId,\n )}/runs/${encodeURIComponent(this.envVariables.runId)}`;\n }\n return true;\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in initializing test run report: ${err.message}.`);\n return false;\n }\n }\n\n private async _onTestEnd(test: TestCase, result: TestResult): Promise<undefined> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n this.uploadMetadata.numTestResults++;\n const testResultObject: MPTTestResult = this.reporterUtils.getTestResultObject(\n test,\n result,\n this.ciInfo.jobId!,\n );\n this.testResultBatch.add(testResultObject);\n // Store test attachments in array\n const testAttachments: string[] = [];\n for (const attachment of result.attachments) {\n if (attachment.path !== undefined && attachment.path !== \"\") {\n testAttachments.push(attachment.path);\n this.uploadMetadata.numTotalAttachments++;\n this.uploadMetadata.sizeTotalAttachments += ReporterUtils.getFileSize(attachment.path);\n }\n }\n\n // Get raw result object and store it in map\n const rawTestResult: RawTestResult = this.reporterUtils.getRawTestResultObject(result);\n this.testRawResults.set(testResultObject.testExecutionId, JSON.stringify(rawTestResult));\n this._testEndPromises.push(\n this._uploadTestResultAttachments(testResultObject.testExecutionId, testAttachments),\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in processing test result: ${err.message}.`);\n }\n }\n\n private async _onEnd(_: FullResult): Promise<void> {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n try {\n // Upload the remaining test results\n if (this.testResultBatch.size > 0) {\n await this.serviceClient.postTestResults([...this.testResultBatch]);\n reporterLogger.info(`\\nUploaded test results batch successfully.`);\n this.testResultBatch.clear();\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test run information: ${err.message}`);\n }\n }\n\n private async _uploadTestResultAttachments(\n testExecutionId: string,\n testAttachments: string[],\n ): Promise<void> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n for (const attachmentPath of testAttachments) {\n const fileRelativePath = `${testExecutionId}/${ReporterUtils.getFileRelativePath(\n attachmentPath,\n )}`;\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n // Renew the sas uri\n this.sasUri = await this.serviceClient.createStorageUri();\n reporterLogger.info(\n `\\nFetched SAS URI with validity: ${this.sasUri.expiresAt} and access: ${this.sasUri.accessLevel}.`,\n );\n }\n this.storageClient.uploadFile(this.sasUri.uri, attachmentPath, fileRelativePath);\n }\n const rawTestResult = this.testRawResults.get(testExecutionId);\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n // Renew the sas uri\n this.sasUri = await this.serviceClient.createStorageUri();\n }\n this.storageClient.uploadBuffer(\n this.sasUri.uri,\n rawTestResult[0]!,\n `${testExecutionId}/rawTestResult.json`,\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test result attachments: ${err.message}`);\n }\n }\n\n private initializeMPTReporter(): void {\n this.envVariables = new EnvironmentVariables();\n if (process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] === \"true\") {\n this.isTokenValid = false;\n return;\n }\n if (!process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]) {\n process.stdout.write(\"\\nReporting service url not found.\");\n this.isTokenValid = false;\n return;\n }\n reporterLogger.info(`Reporting url - ${process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]}`);\n if (this.envVariables.accessToken === undefined || this.envVariables.accessToken === \"\") {\n process.stdout.write(`\\n${ServiceErrorMessageConstants.NO_AUTH_ERROR.message}`);\n this.isTokenValid = false;\n } else if (ReporterUtils.hasAudienceClaim(this.envVariables.accessToken)) {\n const result = populateValuesFromServiceUrl();\n this.envVariables.region = result!.region;\n this.envVariables.accountId = result!.accountId;\n const entraTokenDetails: EntraTokenDetails = ReporterUtils.getTokenDetails<EntraTokenDetails>(\n this.envVariables.accessToken,\n TokenType.ENTRA,\n );\n this.envVariables.userId = entraTokenDetails.oid;\n this.envVariables.userName = entraTokenDetails.name;\n } else {\n const mptTokenDetails: MPTTokenDetails = ReporterUtils.getTokenDetails<MPTTokenDetails>(\n this.envVariables.accessToken,\n TokenType.MPT,\n );\n validateMptPAT(this._reporterFailureHandler);\n this.envVariables.accountId = mptTokenDetails.aid;\n this.envVariables.userId = mptTokenDetails.oid;\n this.envVariables.userName = mptTokenDetails.userName;\n this.envVariables.region = ReporterUtils.getRegionFromAccountID(this.envVariables.accountId!);\n }\n this.storageClient = new StorageClient();\n if (\n this.envVariables.region &&\n !Constants.SupportedRegions.includes(this.envVariables.region!) &&\n this.isTokenValid\n ) {\n process.stdout.write(\n `\\nUnsupported region's workspace used to generate the input Access Token; the supported regions are ${Constants.SupportedRegions.join(\n \", \",\n )}`,\n );\n this.isRegionValid = false;\n }\n if (this.envVariables.runId === undefined || this.envVariables.runId === \"\") {\n this.envVariables.runId = ReporterUtils.getRunId(this.ciInfo);\n }\n }\n\n private displayAdditionalInformation(): void {\n if (this.informationalMessages.length > 0) console.info(); // Add a new line before displaying the messages\n this.informationalMessages.forEach((message, index) => {\n console.info(`${index + 1}. ${message}`);\n });\n }\n\n private processTestResult(result: TestResult): void {\n if (\n process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] &&\n result.status !== \"passed\"\n ) {\n result.errors.forEach((error) => {\n TestResultErrorConstants.forEach((testResultErrorParseObj) => {\n if (this.processedErrorMessageKeys.includes(testResultErrorParseObj.key)) {\n return;\n }\n const errorMessage = error.message;\n if (!errorMessage) return;\n const match = errorMessage.match(testResultErrorParseObj.pattern);\n if (match) {\n this.processedErrorMessageKeys.push(testResultErrorParseObj.key);\n this._addInformationalMessage(testResultErrorParseObj.message);\n }\n });\n });\n }\n }\n\n /**\n * @public\n *\n * Whether this reporter uses stdio for reporting. When it does not, Playwright Test could add some output to enhance\n * user experience. If your reporter does not print to the terminal, it is strongly recommended to return `false`.\n */\n printsToStdio(): boolean {\n return true;\n }\n}\nexport default MPTReporter;\n"]}
|
|
1
|
+
{"version":3,"file":"mptReporter.js","sourceRoot":"","sources":["../../src/reporter/mptReporter.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAUlC,6CAAkD;AAClD,mDAI6B;AAC7B,yEAAsE;AACtE,iDAA8C;AAG9C,8DAAqD;AAMrD,4DAAyD;AACzD,mFAAmD;AACnD,0DAAuD;AACvD,0DAAuD;AAEvD,iDAAkE;AAClE,0CAA8E;AAE9E;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW;IA4Bf,YAAY,MAAkC;QA3BtC,iBAAY,GAAY,IAAI,CAAC;QAC7B,wBAAmB,GAAG,IAAI,CAAC;QAC3B,kBAAa,GAAY,IAAI,CAAC;QAE9B,0BAAqB,GAAY,KAAK,CAAC;QACvC,WAAM,GAAW,+BAAc,CAAC,SAAS,EAAE,CAAC;QAK5C,mBAAc,GAAG,IAAI,mBAAQ,EAAkB,CAAC;QAEhD,q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AG,YAAY,CAAC,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBAClE,IAAI,KAAK,EAAE,CAAC;wBACV,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC;wBACjE,IAAI,CAAC,wBAAwB,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;oBACjE,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,aAAa;QACX,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AACD,kBAAe,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n TestCase,\n TestResult,\n FullConfig,\n Reporter,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { reporterLogger } from \"../common/logger\";\nimport {\n Constants,\n InternalEnvironmentVariables,\n TestResultErrorConstants,\n} from \"../common/constants\";\nimport { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { MultiMap } from \"../common/multimap\";\nimport type { EntraTokenDetails } from \"../model/entraTokenDetails\";\nimport type { MPTTokenDetails } from \"../model/mptTokenDetails\";\nimport { TokenType } from \"../model/mptTokenDetails\";\nimport type { Shard, UploadMetadata } from \"../model/shard\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport type { TestResult as MPTTestResult, RawTestResult } from \"../model/testResult\";\nimport type { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"../utils/cIInfoProvider\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider\";\nimport ReporterUtils from \"../utils/reporterUtils\";\nimport { ServiceClient } from \"../utils/serviceClient\";\nimport { StorageClient } from \"../utils/storageClient\";\nimport type { MPTReporterConfig } from \"../common/types\";\nimport { ServiceErrorMessageConstants } from \"../common/messages\";\nimport { validateMptPAT, populateValuesFromServiceUrl } from \"../utils/utils\";\n\n/**\n * @public\n *\n * Extends Playwright's Reporter class to enable Microsoft Playwright Testing's Reporting\n * feature to publish test results and related artifacts and\n * view them in the service portal for faster and easier troubleshooting.\n *\n * @example\n *\n * ```\n * import { defineConfig } from \"@playwright/test\";\n *\n * export default defineConfig({\n * reporter: [[\"@azure/microsoft-playwright-testing/reporter\"]]\n * });\n * ```\n */\nclass MPTReporter implements Reporter {\n private isTokenValid: boolean = true;\n private enableGitHubSummary = true;\n private isRegionValid: boolean = true;\n private shard!: Shard;\n private isTestRunStartSuccess: boolean = false;\n private ciInfo: CIInfo = CIInfoProvider.getCIInfo();\n private serviceClient!: ServiceClient;\n private storageClient!: StorageClient;\n private reporterUtils!: ReporterUtils;\n private envVariables!: EnvironmentVariables;\n private testRawResults = new MultiMap<string, string>();\n private promiseOnBegin!: Promise<boolean>;\n private _testEndPromises: Promise<void>[] = [];\n private testResultBatch: Set<MPTTestResult> = new Set<MPTTestResult>();\n private errorMessages: string[] = [];\n private informationalMessages: string[] = [];\n private processedErrorMessageKeys: string[] = [];\n private sasUri!: StorageUri;\n private uploadMetadata: UploadMetadata = {\n numTestResults: 0,\n numTotalAttachments: 0,\n sizeTotalAttachments: 0,\n };\n private numWorkers: number = -1;\n private testRunUrl: string = \"\";\n private enableResultPublish: boolean = true;\n\n constructor(config: Partial<MPTReporterConfig>) {\n if (config?.enableGitHubSummary !== undefined) {\n this.enableGitHubSummary = config.enableGitHubSummary;\n }\n if (config?.enableResultPublish !== undefined) {\n this.enableResultPublish = config.enableResultPublish;\n }\n }\n private _addError(errorMessage: string): void {\n if (this.errorMessages.length < Constants.ERROR_MESSAGES_MAX_LENGTH) {\n this.errorMessages.push(this.reporterUtils.redactAccessToken(errorMessage));\n }\n }\n\n private _addInformationalMessage = (message: string): void => {\n this.informationalMessages.push(message);\n };\n\n private _addKeyToInformationMessage = (key: string): void => {\n this.processedErrorMessageKeys.push(key);\n };\n\n private _isInformationMessagePresent = (key: string): boolean => {\n return this.processedErrorMessageKeys.includes(key);\n };\n private _reporterFailureHandler = (error: { key: string; message: string }): void => {\n if (!this._isInformationMessagePresent(error.key)) {\n this._addKeyToInformationMessage(error.key);\n this._addInformationalMessage(error.message);\n }\n this.isTokenValid = false;\n };\n /**\n * @public\n *\n * Called once before running tests.\n *\n * @param config - Resolved configuration.\n * @param suite - The root suite that contains all projects, files and test cases.\n */\n onBegin(config: FullConfig, suite: Suite): void {\n if (!this.enableResultPublish) return;\n this.initializeMPTReporter();\n this.reporterUtils = new ReporterUtils(this.envVariables, config, suite);\n if (this.isTokenValid && this.isRegionValid) {\n this.serviceClient = new ServiceClient(\n this.envVariables,\n this.reporterUtils,\n this._addInformationalMessage,\n this._isInformationMessagePresent,\n this._addKeyToInformationMessage,\n );\n this.promiseOnBegin = this._onBegin();\n }\n }\n\n /**\n * @public\n *\n * Called after a test has been finished in the worker process.\n *\n * @param test - Test that has been finished.\n * @param result - Result of the test run.\n */\n onTestEnd(test: TestCase, result: TestResult): void {\n this.numWorkers = Math.max(this.numWorkers, result.parallelIndex + 1);\n this.processTestResult(result);\n if (!this.enableResultPublish) return;\n // Process test result\n this._onTestEnd(test, result);\n // Upload the test results batch\n try {\n if (this.testResultBatch.size >= Constants.TEST_BATCH_SIZE) {\n const currResultBatch: MPTTestResult[] = [...this.testResultBatch];\n if (this.isTestRunStartSuccess) {\n this._testEndPromises.push(this.serviceClient.postTestResults(currResultBatch));\n reporterLogger.info(`\\nAdded test results batch for upload.`);\n this.testResultBatch.clear();\n }\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test results: ${err.message}.`);\n }\n }\n\n /**\n * @public\n *\n * Called after all tests have been run, or testing has been interrupted. Note that this method may return a [Promise]\n * and Playwright Test will await it. Reporter is allowed to override the status and hence affect the exit code of the\n * test runner.\n *\n * @param result - Result of the full test run, `status` can be one of:\n * - `'passed'` - Everything went as expected.\n * - `'failed'` - Any test has failed.\n * - `'timedout'` - The\n * {@link https://playwright.dev/docs/api/class-testconfig#test-config-global-timeout | testConfig.globalTimeout} has\n * been reached.\n * - `'interrupted'` - Interrupted by the user.\n */\n async onEnd(result: FullResult): Promise<void> {\n if (this.enableResultPublish) {\n await this._onEnd(result);\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n } else {\n let count: number = 0;\n process.stdout.write(\"\\nUploading test results.\");\n await Promise.allSettled(this._testEndPromises).then((values) => {\n values.forEach((value) => {\n if (value.status === \"fulfilled\") {\n count++;\n this.reporterUtils.progressBar(count, this._testEndPromises.length);\n }\n return value.status;\n });\n reporterLogger.info(`\\nTest result processing completed.`);\n return values;\n });\n try {\n await this.serviceClient.postTestRunShardEnd(\n result,\n this.shard,\n this.errorMessages,\n this.uploadMetadata,\n this.numWorkers,\n );\n reporterLogger.info(`\\nTest run successfully uploaded.`);\n\n if (this.enableGitHubSummary) {\n this.reporterUtils.generateMarkdownSummary(this.testRunUrl);\n }\n\n process.stdout.write(`\\nTest report: ${this.testRunUrl}\\n`);\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in completing test run: ${err.message}`);\n process.stdout.write(`\\nUnable to complete test results upload.`);\n }\n }\n }\n this.displayAdditionalInformation();\n }\n\n private async _onBegin(): Promise<boolean> {\n process.stdout.write(`\\n`);\n try {\n const testRunResponse: TestRun | undefined = await this.serviceClient.patchTestRun(\n this.ciInfo,\n );\n reporterLogger.info(\n `\\nTest run report successfully initialized: ${testRunResponse?.displayName}.`,\n );\n process.stdout.write(\n `Initializing reporting for this test run. You can view the results at: https://playwright.microsoft.com/workspaces/${encodeURIComponent(this.envVariables.accountId!)}/runs/${encodeURIComponent(this.envVariables.runId!)}\\n`,\n );\n const shardResponse = await this.serviceClient.postTestRunShardStart();\n this.shard = shardResponse;\n // Set test report link as environment variable. If/else to check if environment variable defined or not.\n if (\n Constants.DEFAULT_SERVICE_ENDPOINT &&\n this.envVariables.accountId &&\n this.envVariables.runId\n ) {\n this.testRunUrl = `${Constants.DEFAULT_DASHBOARD_ENDPOINT}/workspaces/${encodeURIComponent(\n this.envVariables.accountId,\n )}/runs/${encodeURIComponent(this.envVariables.runId)}`;\n }\n return true;\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in initializing test run report: ${err.message}.`);\n return false;\n }\n }\n\n private async _onTestEnd(test: TestCase, result: TestResult): Promise<undefined> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n this.uploadMetadata.numTestResults++;\n const testResultObject: MPTTestResult = this.reporterUtils.getTestResultObject(\n test,\n result,\n this.ciInfo.jobId!,\n );\n this.testResultBatch.add(testResultObject);\n // Store test attachments in array\n const testAttachments: string[] = [];\n for (const attachment of result.attachments) {\n if (attachment.path !== undefined && attachment.path !== \"\") {\n testAttachments.push(attachment.path);\n this.uploadMetadata.numTotalAttachments++;\n this.uploadMetadata.sizeTotalAttachments += ReporterUtils.getFileSize(attachment.path);\n }\n }\n\n // Get raw result object and store it in map\n const rawTestResult: RawTestResult = this.reporterUtils.getRawTestResultObject(result);\n this.testRawResults.set(testResultObject.testExecutionId, JSON.stringify(rawTestResult));\n this._testEndPromises.push(\n this._uploadTestResultAttachments(testResultObject.testExecutionId, testAttachments),\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in processing test result: ${err.message}.`);\n }\n }\n\n private async _onEnd(_: FullResult): Promise<void> {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n try {\n // Upload the remaining test results\n if (this.testResultBatch.size > 0) {\n await this.serviceClient.postTestResults([...this.testResultBatch]);\n reporterLogger.info(`\\nUploaded test results batch successfully.`);\n this.testResultBatch.clear();\n }\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test run information: ${err.message}`);\n }\n }\n\n private async _uploadTestResultAttachments(\n testExecutionId: string,\n testAttachments: string[],\n ): Promise<void> {\n try {\n this.isTestRunStartSuccess = await this.promiseOnBegin;\n if (!this.isTestRunStartSuccess) {\n this._addError(`\\nUnable to initialize test run report.`);\n return;\n }\n for (const attachmentPath of testAttachments) {\n const fileRelativePath = `${testExecutionId}/${ReporterUtils.getFileRelativePath(\n attachmentPath,\n )}`;\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n // Renew the sas uri\n this.sasUri = await this.serviceClient.createStorageUri();\n reporterLogger.info(\n `\\nFetched SAS URI with validity: ${this.sasUri.expiresAt} and access: ${this.sasUri.accessLevel}.`,\n );\n }\n this.storageClient.uploadFile(this.sasUri.uri, attachmentPath, fileRelativePath);\n }\n const rawTestResult = this.testRawResults.get(testExecutionId);\n if (\n this.sasUri === undefined ||\n !ReporterUtils.isTimeGreaterThanCurrentPlus10Minutes(this.sasUri)\n ) {\n // Renew the sas uri\n this.sasUri = await this.serviceClient.createStorageUri();\n }\n this.storageClient.uploadBuffer(\n this.sasUri.uri,\n rawTestResult[0]!,\n `${testExecutionId}/rawTestResult.json`,\n );\n } catch (err: any) {\n this._addError(`Name: ${err.name}, Message: ${err.message}, Stack: ${err.stack}`);\n reporterLogger.error(`\\nError in uploading test result attachments: ${err.message}`);\n }\n }\n\n private initializeMPTReporter(): void {\n this.envVariables = new EnvironmentVariables();\n if (process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] === \"true\") {\n this.isTokenValid = false;\n return;\n }\n if (!process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]) {\n process.stdout.write(\"\\nReporting service url not found.\");\n this.isTokenValid = false;\n return;\n }\n reporterLogger.info(`Reporting url - ${process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]}`);\n if (this.envVariables.accessToken === undefined || this.envVariables.accessToken === \"\") {\n process.stdout.write(`\\n${ServiceErrorMessageConstants.NO_AUTH_ERROR.message}`);\n this.isTokenValid = false;\n } else if (ReporterUtils.hasAudienceClaim(this.envVariables.accessToken)) {\n const result = populateValuesFromServiceUrl();\n this.envVariables.region = result!.region;\n this.envVariables.accountId = result!.accountId;\n const entraTokenDetails: EntraTokenDetails = ReporterUtils.getTokenDetails<EntraTokenDetails>(\n this.envVariables.accessToken,\n TokenType.ENTRA,\n );\n this.envVariables.userId = entraTokenDetails.oid;\n this.envVariables.userName = entraTokenDetails.name;\n } else {\n const mptTokenDetails: MPTTokenDetails = ReporterUtils.getTokenDetails<MPTTokenDetails>(\n this.envVariables.accessToken,\n TokenType.MPT,\n );\n validateMptPAT(this._reporterFailureHandler);\n this.envVariables.accountId = mptTokenDetails.aid;\n this.envVariables.userId = mptTokenDetails.oid;\n this.envVariables.userName = mptTokenDetails.userName;\n this.envVariables.region = ReporterUtils.getRegionFromAccountID(this.envVariables.accountId!);\n }\n this.storageClient = new StorageClient();\n if (\n this.envVariables.region &&\n !Constants.SupportedRegions.includes(this.envVariables.region!) &&\n this.isTokenValid\n ) {\n process.stdout.write(\n `\\nUnsupported region's workspace used to generate the input Access Token; the supported regions are ${Constants.SupportedRegions.join(\n \", \",\n )}`,\n );\n this.isRegionValid = false;\n }\n if (this.envVariables.runId === undefined || this.envVariables.runId === \"\") {\n this.envVariables.runId = ReporterUtils.getRunId(this.ciInfo);\n }\n }\n\n private displayAdditionalInformation(): void {\n if (this.informationalMessages.length > 0) console.info(); // Add a new line before displaying the messages\n this.informationalMessages.forEach((message, index) => {\n console.info(`${index + 1}. ${message}`);\n });\n }\n\n private processTestResult(result: TestResult): void {\n if (\n process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] &&\n result.status !== \"passed\"\n ) {\n result.errors.forEach((error) => {\n TestResultErrorConstants.forEach((testResultErrorParseObj) => {\n if (this.processedErrorMessageKeys.includes(testResultErrorParseObj.key)) {\n return;\n }\n const errorMessage = error.message;\n if (!errorMessage) return;\n const match = errorMessage.match(testResultErrorParseObj.pattern);\n if (match) {\n this.processedErrorMessageKeys.push(testResultErrorParseObj.key);\n this._addInformationalMessage(testResultErrorParseObj.message);\n }\n });\n });\n }\n }\n\n /**\n * @public\n *\n * Whether this reporter uses stdio for reporting. When it does not, Playwright Test could add some output to enhance\n * user experience. If your reporter does not print to the terminal, it is strongly recommended to return `false`.\n */\n printsToStdio(): boolean {\n return true;\n }\n}\nexport default MPTReporter;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageManager.d.ts","sourceRoot":"","sources":["../../src/utils/packageManager.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"packageManager.d.ts","sourceRoot":"","sources":["../../src/utils/packageManager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,qBAAa,GAAI,YAAW,cAAc;IACxC,UAAU,YAAa,MAAM,QAAQ,MAAM,KAAG,MAAM,CAElD;IACF,oBAAoB,WAAY,MAAM,KAAG,MAAM,CAG7C;CACH;AAED,qBAAa,IAAK,YAAW,cAAc;IACzC,UAAU,YAAa,MAAM,QAAQ,MAAM,KAAG,MAAM,CAElD;IACF,oBAAoB,WAAY,MAAM,KAAG,MAAM,CAG7C;CACH;AAED,qBAAa,IAAK,YAAW,cAAc;IACzC,UAAU,YAAa,MAAM,QAAQ,MAAM,KAAG,MAAM,CAElD;IACF,oBAAoB,WAAY,MAAM,KAAG,MAAM,CAG7C;CACH;AAGD,eAAO,MAAM,iBAAiB,QAAO,cAOpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageManager.js","sourceRoot":"","sources":["../../src/utils/packageMan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AA;AARD,oBAQC;AAED,8HAA8H;AACvH,MAAM,iBAAiB,GAAG,GAAmB,EAAE;IACpD,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACvD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,IAAI,EAAE,CAAC;QAClD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,IAAI,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,GAAG,EAAE,CAAC;AACnB,CAAC,CAAC;AAPW,QAAA,iBAAiB,qBAO5B","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PackageManager } from \"../common/types\";\n\nexport class NPM implements PackageManager {\n runCommand = (command: string, args: string): string => {\n return `npx ${command} ${args}`;\n };\n getVersionFromStdout = (stdout: string): string => {\n const match = stdout.match(/Version\\s(\\d+\\.\\d+\\.\\d+(-\\w+-\\d{4}-\\d{2}-\\d{2})?)/);\n return match ? match[1] : \"Unknown version\";\n };\n}\n\nexport class PNPM implements PackageManager {\n runCommand = (command: string, args: string): string => {\n return `pnpm ${command} ${args}`;\n };\n getVersionFromStdout = (stdout: string): string => {\n const match = stdout.match(/Version\\s(\\d+\\.\\d+\\.\\d+(-\\w+-\\d{4}-\\d{2}-\\d{2})?)/);\n return match ? match[1] : \"Unknown version\";\n };\n}\n\nexport class Yarn implements PackageManager {\n runCommand = (command: string, args: string): string => {\n return `yarn ${command} ${args}`;\n };\n getVersionFromStdout = (stdout: string): string => {\n const match = stdout.match(/Version\\s(\\d+\\.\\d+\\.\\d+(-\\w+-\\d{4}-\\d{2}-\\d{2})?)/);\n return match ? match[1] : \"Unknown version\";\n };\n}\n\n// https://stackoverflow.com/questions/68133683/is-there-a-cross-platform-way-to-get-the-name-of-the-parent-process-in-node-js\nexport const getPackageManager = (): PackageManager => {\n if (process.env[\"npm_config_user_agent\"]) {\n const userAgent = process.env[\"npm_config_user_agent\"];\n if (userAgent.includes(\"yarn\")) return new Yarn();\n if (userAgent.includes(\"pnpm\")) return new PNPM();\n }\n return new NPM();\n};\n"]}
|
|
1
|
+
{"version":3,"file":"packageManager.js","sourceRoot":"","sources":["../../src/utils/packageManager.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAIlC,MAAa,GAAG;IAAhB;QACE,eAAU,GAAG,CAAC,OAAe,EAAE,IAAY,EAAU,EAAE;YACrD,OAAO,OAAO,OAAO,IAAI,IAAI,EAAE,CAAC;QAClC,CAAC,CAAC;QACF,yBAAoB,GAAG,CAAC,MAAc,EAAU,EAAE;YAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YAChF,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC9C,CAAC,CAAC;IACJ,CAAC;CAAA;AARD,kBAQC;AAED,MAAa,IAAI;IAAjB;QACE,eAAU,GAAG,CAAC,OAAe,EAAE,IAAY,EAAU,EAAE;YACrD,OAAO,QAAQ,OAAO,IAAI,IAAI,EAAE,CAAC;QACnC,CAAC,CAAC;QACF,yBAAoB,GAAG,CAAC,MAAc,EAAU,EAAE;YAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YAChF,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC9C,CAAC,CAAC;IACJ,CAAC;CAAA;AARD,oBAQC;AAED,MAAa,IAAI;IAAjB;QACE,eAAU,GAAG,CAAC,OAAe,EAAE,IAAY,EAAU,EAAE;YACrD,OAAO,QAAQ,OAAO,IAAI,IAAI,EAAE,CAAC;QACnC,CAAC,CAAC;QACF,yBAAoB,GAAG,CAAC,MAAc,EAAU,EAAE;YAChD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YAChF,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC9C,CAAC,CAAC;IACJ,CAAC;CAAA;AARD,oBAQC;AAED,8HAA8H;AACvH,MAAM,iBAAiB,GAAG,GAAmB,EAAE;IACpD,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACvD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,IAAI,EAAE,CAAC;QAClD,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC;YAAE,OAAO,IAAI,IAAI,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,IAAI,GAAG,EAAE,CAAC;AACnB,CAAC,CAAC;AAPW,QAAA,iBAAiB,qBAO5B","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { PackageManager } from \"../common/types\";\n\nexport class NPM implements PackageManager {\n runCommand = (command: string, args: string): string => {\n return `npx ${command} ${args}`;\n };\n getVersionFromStdout = (stdout: string): string => {\n const match = stdout.match(/Version\\s(\\d+\\.\\d+\\.\\d+(-\\w+-\\d{4}-\\d{2}-\\d{2})?)/);\n return match ? match[1] : \"Unknown version\";\n };\n}\n\nexport class PNPM implements PackageManager {\n runCommand = (command: string, args: string): string => {\n return `pnpm ${command} ${args}`;\n };\n getVersionFromStdout = (stdout: string): string => {\n const match = stdout.match(/Version\\s(\\d+\\.\\d+\\.\\d+(-\\w+-\\d{4}-\\d{2}-\\d{2})?)/);\n return match ? match[1] : \"Unknown version\";\n };\n}\n\nexport class Yarn implements PackageManager {\n runCommand = (command: string, args: string): string => {\n return `yarn ${command} ${args}`;\n };\n getVersionFromStdout = (stdout: string): string => {\n const match = stdout.match(/Version\\s(\\d+\\.\\d+\\.\\d+(-\\w+-\\d{4}-\\d{2}-\\d{2})?)/);\n return match ? match[1] : \"Unknown version\";\n };\n}\n\n// https://stackoverflow.com/questions/68133683/is-there-a-cross-platform-way-to-get-the-name-of-the-parent-process-in-node-js\nexport const getPackageManager = (): PackageManager => {\n if (process.env[\"npm_config_user_agent\"]) {\n const userAgent = process.env[\"npm_config_user_agent\"];\n if (userAgent.includes(\"yarn\")) return new Yarn();\n if (userAgent.includes(\"pnpm\")) return new PNPM();\n }\n return new NPM();\n};\n"]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { FullResult, TestCase, TestResult, FullConfig, Suite } from "@playwright/test/reporter";
|
|
2
|
-
import { IBackOffOptions } from "../common/types";
|
|
3
|
-
import { EnvironmentVariables } from "../common/environmentVariables";
|
|
2
|
+
import type { IBackOffOptions } from "../common/types";
|
|
3
|
+
import type { EnvironmentVariables } from "../common/environmentVariables";
|
|
4
4
|
import { TokenType } from "../model/mptTokenDetails";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import type { UploadMetadata } from "../model/shard";
|
|
6
|
+
import { Shard } from "../model/shard";
|
|
7
|
+
import type { RawTestResult } from "../model/testResult";
|
|
8
|
+
import { TestResult as MPTTestResult } from "../model/testResult";
|
|
7
9
|
import { TestRun } from "../model/testRun";
|
|
8
|
-
import { CIInfo } from "./cIInfoProvider";
|
|
9
|
-
import { StorageUri } from "../model/storageUri";
|
|
10
|
+
import type { CIInfo } from "./cIInfoProvider";
|
|
11
|
+
import type { StorageUri } from "../model/storageUri";
|
|
10
12
|
declare class ReporterUtils {
|
|
11
13
|
private envVariables;
|
|
12
14
|
private config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reporterUtils.d.ts","sourceRoot":"","sources":["../../src/utils/reporterUtils.ts"],"names":[],"mappings":"AAG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M,CAAC,KAAK,CAAC,CAAC;oBACd,OAAO;gBACT,CAAC;gBACD,IAAI,MAAM,EAAE,CAAC;oBACX,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,OAAO;gBACT,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,GAA8B;QACxD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAEO,SAAS;QACf,MAAM,MAAM,GAAG,YAAE,CAAC,IAAI,EAAE,CAAC;QACzB,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,KAAK,CAAC;YACf,KAAK,OAAO;gBACV,OAAO,OAAO,CAAC;YACjB,KAAK,YAAY;gBACf,OAAO,SAAS,CAAC;YACnB;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;;AApTa,uCAAyB,GAA6B;IAClE,aAAa,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,IAAI,qBAAS,CAAC,0BAA0B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1D,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AA2SJ,kBAAe,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n Location,\n TestCase,\n TestResult,\n TestStep,\n FullConfig,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { exec } from \"child_process\";\nimport { reporterLogger } from \"../common/logger\";\nimport { createHash, randomUUID } from \"crypto\";\nimport { IBackOffOptions } from \"../common/types\";\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\nimport { Constants } from \"../common/constants\";\nimport { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { DedupedStep, RawTestStep } from \"../common/types\";\nimport { TokenType } from \"../model/mptTokenDetails\";\nimport { Shard, TestRunStatus, UploadMetadata } from \"../model/shard\";\nimport { TestResult as MPTTestResult, RawTestResult } from \"../model/testResult\";\nimport { TestRun, TestRunConfig } from \"../model/testRun\";\nimport { CIInfo, CI_PROVIDERS } from \"./cIInfoProvider\";\nimport { CIInfoProvider } from \"./cIInfoProvider\";\nimport { StorageUri } from \"../model/storageUri\";\n\nclass ReporterUtils {\n private envVariables: EnvironmentVariables;\n\n private config: FullConfig;\n totalTests: number;\n failedTests: number;\n skippedTests: number;\n passedTests: number;\n flakyTests: number;\n startTime: number;\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n constructor(envVariables: EnvironmentVariables, config: FullConfig, _: Suite) {\n this.config = config;\n this.envVariables = envVariables;\n this.startTime = Date.now();\n\n this.totalTests = 0;\n this.failedTests = 0;\n this.skippedTests = 0;\n this.passedTests = 0;\n this.flakyTests = 0;\n }\n\n public async getTestRunObject(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = new TestRun();\n const runName = this.envVariables.runName || (await this.getRunName(ciInfo));\n testRun.testRunId = this.envVariables.runId;\n testRun.displayName = ReporterUtils.isNullOrEmpty(runName) ? this.envVariables.runId : runName;\n testRun.creatorName = this.envVariables.userName;\n testRun.creatorId = this.envVariables.userId!;\n testRun.startTime = ReporterUtils.timestampToRFC3339(this.startTime);\n testRun.ciConfig = {\n ciProviderName: ciInfo.provider!,\n branch: ciInfo.branch!,\n author: ciInfo.author!,\n commitId: ciInfo.commitId!,\n revisionUrl: ciInfo.revisionUrl!,\n };\n testRun.testRunConfig = this.getTestRunConfig();\n testRun.cloudReportingEnabled = \"true\";\n return testRun;\n }\n\n public getTestRunShardStartObject(): Shard {\n const shard = new Shard();\n if (this.config.shard !== null && this.config.shard !== undefined) {\n this.envVariables.shardId = this.config.shard.current.toString();\n } else {\n this.envVariables.shardId = \"1\";\n }\n shard.shardId = this.envVariables.shardId;\n shard.summary = {\n startTime: ReporterUtils.timestampToRFC3339(this.startTime),\n };\n shard.uploadCompleted = false;\n return shard;\n }\n\n public getTestRunShardEndObject(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Shard {\n shard.shardId = this.envVariables.shardId ?? \"1\";\n shard.summary.totalTime = result.duration;\n shard.summary.endTime = ReporterUtils.timestampToRFC3339(Date.now());\n shard.summary.status = TestRunStatus.CLIENT_COMPLETE;\n shard.summary.errorMessages = errorMessages;\n shard.summary.uploadMetadata = attachmentMetadata;\n shard.uploadCompleted = true;\n shard.workers = workers;\n return shard;\n }\n\n public getTestResultObject(test: TestCase, result: TestResult, jobName: string): MPTTestResult {\n switch (test.outcome()) {\n case \"skipped\":\n this.skippedTests++;\n this.totalTests++;\n break;\n case \"expected\":\n this.passedTests++;\n this.totalTests++;\n break;\n case \"unexpected\":\n if (result.retry === test.retries) {\n this.failedTests++;\n this.totalTests++;\n }\n break;\n case \"flaky\":\n this.totalTests++;\n this.flakyTests++;\n break;\n default:\n break;\n }\n\n let browserName = test.parent.project()!.use.browserName?.toLowerCase();\n if (!browserName) {\n browserName = test.parent.project()!.use.defaultBrowserType?.toLowerCase();\n }\n const testResult = new MPTTestResult();\n testResult.runId = this.envVariables.runId;\n testResult.shardId = this.envVariables.runId + \"_\" + this.envVariables.shardId;\n testResult.accountId = this.envVariables.accountId!;\n testResult.suiteId = ReporterUtils.calculateSha1(`${test.parent.title}-${test.location.file}`);\n testResult.testId = testResult.suiteId.concat(`-${ReporterUtils.calculateSha1(test.title)}`);\n testResult.testCombinationId = test.id;\n testResult.testExecutionId = randomUUID();\n testResult.testTitle = test.title;\n testResult.suiteTitle = this.extractRootParentTitle(test.parent)!;\n testResult.fileName = test.location.file;\n testResult.status = this.getTestStatus(test, result);\n testResult.lineNumber = test.location.line;\n testResult.retry = result.retry ? result.retry : 0;\n testResult.webTestConfig = {\n jobName: jobName,\n projectName: test.parent.project()!.name,\n browserType: browserName ? browserName.toUpperCase() : \"\",\n os: this.getOsName(),\n };\n testResult.annotations = this.extractTestAnnotations(test.annotations);\n testResult.tags = this.extractTestTags(test);\n testResult.resultsSummary = {\n status: result.status.toUpperCase(),\n duration: result.duration,\n startTime: result.startTime.toISOString().replace(/\\.\\d+Z$/, \"Z\"),\n attachmentsMetadata: this.getAttachmentStatus(result),\n };\n testResult.artifactsPath = result.attachments\n .filter((attachment) => attachment?.path !== null && attachment?.path !== undefined) // Filter attachments with defined and non-null path property\n .map(\n (attachment) =>\n `${testResult.testExecutionId}/${ReporterUtils.getFileRelativePath(attachment.path!)}`,\n );\n return testResult;\n }\n\n public generateMarkdownSummary(testRunUrl: string): void {\n try {\n if (CIInfoProvider.getCIProvider() === CI_PROVIDERS.GITHUB) {\n const markdownContent = `\n#### Microsoft Playwright Testing run summary\n\n#### Results:\n \n **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: result.errors ? JSON.stringify(result.errors, null, 2) : \"\",\n stdErr: result.stderr ? JSON.stringify(result.stderr, null, 2) : \"\",\n stdOut: result.stdout ? JSON.stringify(result.stdout, null, 2) : \"\",\n };\n return rawTestResult;\n }\n\n public static getRunId(cIInfo: CIInfo): string {\n if (cIInfo === null || cIInfo.provider === CI_PROVIDERS.DEFAULT) {\n return randomUUID();\n }\n\n const concatString = `${cIInfo.provider}-${cIInfo.repo}-${cIInfo.runId}-${cIInfo.runAttempt}`;\n const runId = ReporterUtils.calculateSha1(concatString);\n return runId;\n }\n\n public static calculateSha1(buffer: Buffer | string): string {\n const hash = createHash(\"sha1\");\n hash.update(buffer);\n return hash.digest(\"hex\");\n }\n\n /*\n public static getTokenDetails(accessToken: string) {\n let tokenDetails = new MPTTokenDetails();\n try {\n const token = accessToken.split('.')[1];\n const _token = Buffer.from(token, 'base64');\n tokenDetails = JSON.parse(_token.toString());\n } catch (err) {\n throw err;\n }\n return tokenDetails;\n }\n */\n\n public static getTokenDetails<T>(accessToken: string, tokenType: TokenType): T {\n const token = accessToken.split(\".\")[1]!;\n const _token = Buffer.from(token, \"base64\");\n const tokenDetails = JSON.parse(_token.toString());\n\n switch (tokenType) {\n case TokenType.MPT:\n return tokenDetails as T;\n case TokenType.ENTRA:\n return tokenDetails as T;\n default:\n throw new Error(\"Unsupported token type\");\n }\n }\n\n public static hasAudienceClaim(token: string): boolean {\n try {\n // Split the token into its three parts\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"Invalid token format\");\n }\n\n // Base64 decode the payload\n const payload = parts[1]!;\n const decodedPayload = Buffer.from(payload, \"base64\");\n\n // Parse the decoded payload as JSON\n const payloadObject = JSON.parse(decodedPayload.toString());\n\n // Check if the payload has an 'aud' claim\n return \"aud\" in payloadObject;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return false;\n }\n }\n\n public static timestampToRFC3339(timestamp: number): string {\n const date = new Date(timestamp);\n const dateString = date.toISOString().replace(/\\.\\d+Z$/, \"Z\");\n return dateString;\n }\n\n public static getFileRelativePath(filePath: string): string {\n if (filePath) {\n let parts = filePath.split(\"/\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n\n parts = filePath.split(\"\\\\\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n }\n\n return filePath;\n }\n\n public static getReporterBackOffOptions: Partial<IBackOffOptions> = {\n numOfAttempts: 3,\n jitter: \"full\",\n retry: (error) => {\n if (error.response) {\n const status = error.response.status;\n if (Constants.NON_RETRYABLE_STATUS_CODES.includes(status)) {\n return false;\n }\n }\n return true;\n },\n };\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n public static isTimeGreaterThanCurrentPlus10Minutes(sasUri: StorageUri): boolean {\n try {\n const url = new URL(sasUri.uri);\n const params = new URLSearchParams(url.search);\n const expiryTime = params.get(\"se\"); // 'se' is the query parameter for the expiry time\n if (expiryTime) {\n const timestampFromIsoString = new Date(expiryTime).getTime();\n const currentTimestampPlus10Minutes = Date.now() + 10 * 60 * 1000;\n const isSasValidityGreaterThanCurrentTimePlus10Minutes =\n timestampFromIsoString > currentTimestampPlus10Minutes;\n if (!isSasValidityGreaterThanCurrentTimePlus10Minutes) {\n reporterLogger.info(\n `Sas rotation required because close to expiry, SasUriValidTillTime: ${timestampFromIsoString}, CurrentTime: ${currentTimestampPlus10Minutes}`,\n );\n }\n return isSasValidityGreaterThanCurrentTimePlus10Minutes;\n }\n reporterLogger.error(`Sas rotation required because expiry param not found.`);\n return false;\n } catch (error) {\n reporterLogger.error(`Sas rotation required because of ${error}.`);\n return false;\n }\n }\n\n public static getFileSize(attachmentPath: string): number {\n try {\n const stats = fs.statSync(attachmentPath);\n return stats.size;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return 0;\n }\n }\n public redactAccessToken(info: string | undefined): string {\n if (!info || ReporterUtils.isNullOrEmpty(this.envVariables.accessToken)) {\n return \"\";\n }\n const accessTokenRegex = new RegExp(this.envVariables.accessToken, \"g\");\n return info.replace(accessTokenRegex, Constants.DEFAULT_REDACTED_MESSAGE);\n }\n public static getRegionFromAccountID(accountId: string): string | undefined {\n if (accountId.includes(\"_\")) {\n return accountId.split(\"_\")[0]!;\n } else {\n return;\n } // Handling for older workspaces without region in id\n }\n\n public progressBar(current: number, total: number): void {\n const width = 40;\n const percent = current / total;\n const completed = Math.round(width * percent);\n const remaining = width - completed;\n\n process.stdout.write(\"\\r\");\n process.stdout.write(\n `[${\"=\".repeat(completed)}${\" \".repeat(remaining)}] ${Math.round(percent * 100)}%`,\n );\n }\n\n private getTestRunConfig(): TestRunConfig {\n const testRunConfig: TestRunConfig = {\n workers: this.config.workers,\n pwVersion: this.config.version,\n timeout: this.config.globalTimeout,\n repeatEach: this.config.projects[0].repeatEach,\n retries: this.config.projects[0].retries,\n shards: this.config.shard ? this.config.shard : { total: 1 },\n testFramework: {\n name: Constants.TEST_FRAMEWORK_NAME,\n version: this.config.version,\n runnerName: Constants.TEST_FRAMEWORK_RUNNERNAME,\n },\n testType: Constants.TEST_TYPE,\n testSdkLanguage: Constants.TEST_SDK_LANGUAGE,\n reporterPackageVersion: Constants.REPORTER_PACKAGE_VERSION,\n };\n return testRunConfig;\n }\n\n private relativeLocation(location: Location | undefined): Location | undefined {\n if (!location) {\n return undefined;\n }\n const file = this.toPosixPath(path.relative(this.config.rootDir, location.file));\n return {\n file,\n line: location.line,\n column: location.column,\n };\n }\n\n private extractTestTags(input: TestCase): string[] {\n let tags: string[] = [];\n if (\"tags\" in input && Array.isArray(input.tags) && input.tags.length > 0) {\n tags = input.tags.map((tag) => tag.slice(1));\n return tags;\n }\n\n // Check if the input string contains tags directly\n const regex = /@(\\w+)/g;\n const matches = input.title.match(regex);\n if (matches) {\n tags = tags.concat(matches.map((match) => match.slice(1)));\n }\n\n // Try parsing the input string as a JavaScript object\n try {\n const obj = JSON.parse(`{${input}}`);\n if (obj.tag && Array.isArray(obj.tag)) {\n tags = tags.concat(obj.tag);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n // Ignore parsing errors\n }\n return tags;\n }\n\n private extractTestAnnotations(annotations: TestCase[\"annotations\"]): string[] {\n const result = annotations.map((annotation) => {\n if (annotation.type && annotation.description) {\n return `${annotation.type}: ${annotation.description}`;\n }\n return annotation.type;\n });\n return result;\n }\n\n private toPosixPath(aPath: string): string {\n return aPath.split(path.sep).join(path.posix.sep);\n }\n\n private getAttachmentStatus(testResult: TestResult): string {\n let attachmentStatus: string = \"\";\n for (const attachment of testResult.attachments) {\n if (attachment.contentType.includes(\"image\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"image\";\n } else if (attachment.contentType.includes(\"video\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"video\";\n } else if (attachment.contentType === \"application/zip\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"trace\";\n }\n }\n return attachmentStatus;\n }\n\n private dedupeSteps(steps: TestStep[]): DedupedStep[] {\n const result: DedupedStep[] = [];\n let lastResult = undefined;\n for (const step of steps) {\n const canDedupe =\n !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;\n const lastStep = lastResult?.step;\n if (\n canDedupe &&\n lastResult &&\n lastStep &&\n step.category === lastStep.category &&\n step.title === lastStep.title &&\n step.location?.file === lastStep.location?.file &&\n step.location?.line === lastStep.location?.line &&\n step.location?.column === lastStep.location?.column\n ) {\n ++lastResult.count;\n lastResult.duration += step.duration;\n continue;\n }\n lastResult = { step, count: 1, duration: step.duration };\n result.push(lastResult);\n if (!canDedupe) {\n lastResult = undefined;\n }\n }\n return result;\n }\n\n private serializeTestStep(dedupedStep: DedupedStep): RawTestStep {\n const { step, duration, count } = dedupedStep;\n const result: RawTestStep = {\n title: step.title,\n category: step.category,\n startTime: step.startTime.toISOString(),\n duration,\n error: step.error ? step.error.message : undefined,\n location: this.relativeLocation(step.location),\n steps: this.dedupeSteps(step.steps).map((subStep) => this.serializeTestStep(subStep)),\n count: count,\n };\n return result;\n }\n\n private getTestStatus(test: TestCase, result: TestResult): string {\n if (test.expectedStatus === result.status) {\n if (result.status === \"skipped\") {\n return \"SKIPPED\";\n } else {\n return \"PASSED\";\n }\n } else if (result.status === \"interrupted\") {\n return \"SKIPPED\";\n } else {\n return \"FAILED\";\n }\n }\n\n private extractRootParentTitle(suite: Suite): string | undefined {\n // Traverse through the parent properties until reaching the root parent\n let currentSuite: Suite | undefined = suite;\n let depthCount: number = 0;\n let suiteTitle: string = currentSuite.title;\n const projectName = currentSuite.project()!.name;\n while (currentSuite?.parent && !ReporterUtils.isNullOrEmpty(currentSuite.parent.title)) {\n if (depthCount > 10 || currentSuite.parent.title === projectName) {\n break;\n }\n suiteTitle = suiteTitle + \" > \" + currentSuite.parent.title;\n currentSuite = currentSuite.parent;\n depthCount++;\n }\n return suiteTitle;\n }\n\n private async getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.provider === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n let gitCommitMessage: string | null = null;\n try {\n const gitVersion = await this.runCommand(Constants.GIT_VERSION_COMMAND);\n if (ReporterUtils.isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await this.runCommand(Constants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n gitCommitMessage = await this.runCommand(Constants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n reporterLogger.error(`\\nError in getting git commit message: ${err}.`);\n return \"\";\n }\n }\n\n private async runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n }\n\n public static isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n }\n\n private getOsName(): string {\n const osType = os.type();\n switch (osType) {\n case \"Darwin\":\n return \"MAC\";\n case \"Linux\":\n return \"LINUX\";\n case \"Windows_NT\":\n return \"WINDOWS\";\n default:\n return \"UNKNOWN\";\n }\n }\n}\n\nexport default ReporterUtils;\n"]}
|
|
1
|
+
{"version":3,"file":"reporterUtils.js","sourceRoot":"","sources":["../../src/utils/reporterUtils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAWlC,iDAAqC;AACrC,6CAAkD;AAClD,mCAAgD;AAEhD,oDAAoB;AACpB,oDAAoB;AACpB,wDAAwB;AACxB,mDAAgD;AAGhD,8DAAqD;AAErD,0CAAsD;AAEtD,oDAAkE;AAElE,8CAA2C;AAE3C,qDAAgD;AAChD,qDAAkD;AAGlD,MAAM,aAAa;IAWjB,wEAAwE;IACxE,YAAY,YAAkC,EAAE,MAAkB,EAAE,CAAQ;QAC1E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAE5B,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC;QACtB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;IAEM,KAAK,CAAC,gBAAgB,CAAC,MAAc;QAC1C,MAAM,OAAO,GAAG,IAAI,iBAAO,EAAE,CAAC;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC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AM,EAAE,CAAC;oBACX,MAAM,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;oBAC1B,OAAO;gBACT,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,GAA8B;QACxD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnC,CAAC;IAEO,SAAS;QACf,MAAM,MAAM,GAAG,YAAE,CAAC,IAAI,EAAE,CAAC;QACzB,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,QAAQ;gBACX,OAAO,KAAK,CAAC;YACf,KAAK,OAAO;gBACV,OAAO,OAAO,CAAC;YACjB,KAAK,YAAY;gBACf,OAAO,SAAS,CAAC;YACnB;gBACE,OAAO,SAAS,CAAC;QACrB,CAAC;IACH,CAAC;;AApTa,uCAAyB,GAA6B;IAClE,aAAa,EAAE,CAAC;IAChB,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;QACf,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrC,IAAI,qBAAS,CAAC,0BAA0B,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1D,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC;AA2SJ,kBAAe,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n FullResult,\n Location,\n TestCase,\n TestResult,\n TestStep,\n FullConfig,\n Suite,\n} from \"@playwright/test/reporter\";\nimport { exec } from \"child_process\";\nimport { reporterLogger } from \"../common/logger\";\nimport { createHash, randomUUID } from \"crypto\";\nimport type { IBackOffOptions } from \"../common/types\";\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\nimport { Constants } from \"../common/constants\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables\";\nimport type { DedupedStep, RawTestStep } from \"../common/types\";\nimport { TokenType } from \"../model/mptTokenDetails\";\nimport type { UploadMetadata } from \"../model/shard\";\nimport { Shard, TestRunStatus } from \"../model/shard\";\nimport type { RawTestResult } from \"../model/testResult\";\nimport { TestResult as MPTTestResult } from \"../model/testResult\";\nimport type { TestRunConfig } from \"../model/testRun\";\nimport { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"./cIInfoProvider\";\nimport { CI_PROVIDERS } from \"./cIInfoProvider\";\nimport { CIInfoProvider } from \"./cIInfoProvider\";\nimport type { StorageUri } from \"../model/storageUri\";\n\nclass ReporterUtils {\n private envVariables: EnvironmentVariables;\n\n private config: FullConfig;\n totalTests: number;\n failedTests: number;\n skippedTests: number;\n passedTests: number;\n flakyTests: number;\n startTime: number;\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n constructor(envVariables: EnvironmentVariables, config: FullConfig, _: Suite) {\n this.config = config;\n this.envVariables = envVariables;\n this.startTime = Date.now();\n\n this.totalTests = 0;\n this.failedTests = 0;\n this.skippedTests = 0;\n this.passedTests = 0;\n this.flakyTests = 0;\n }\n\n public async getTestRunObject(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = new TestRun();\n const runName = this.envVariables.runName || (await this.getRunName(ciInfo));\n testRun.testRunId = this.envVariables.runId;\n testRun.displayName = ReporterUtils.isNullOrEmpty(runName) ? this.envVariables.runId : runName;\n testRun.creatorName = this.envVariables.userName;\n testRun.creatorId = this.envVariables.userId!;\n testRun.startTime = ReporterUtils.timestampToRFC3339(this.startTime);\n testRun.ciConfig = {\n ciProviderName: ciInfo.provider!,\n branch: ciInfo.branch!,\n author: ciInfo.author!,\n commitId: ciInfo.commitId!,\n revisionUrl: ciInfo.revisionUrl!,\n };\n testRun.testRunConfig = this.getTestRunConfig();\n testRun.cloudReportingEnabled = \"true\";\n return testRun;\n }\n\n public getTestRunShardStartObject(): Shard {\n const shard = new Shard();\n if (this.config.shard !== null && this.config.shard !== undefined) {\n this.envVariables.shardId = this.config.shard.current.toString();\n } else {\n this.envVariables.shardId = \"1\";\n }\n shard.shardId = this.envVariables.shardId;\n shard.summary = {\n startTime: ReporterUtils.timestampToRFC3339(this.startTime),\n };\n shard.uploadCompleted = false;\n return shard;\n }\n\n public getTestRunShardEndObject(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Shard {\n shard.shardId = this.envVariables.shardId ?? \"1\";\n shard.summary.totalTime = result.duration;\n shard.summary.endTime = ReporterUtils.timestampToRFC3339(Date.now());\n shard.summary.status = TestRunStatus.CLIENT_COMPLETE;\n shard.summary.errorMessages = errorMessages;\n shard.summary.uploadMetadata = attachmentMetadata;\n shard.uploadCompleted = true;\n shard.workers = workers;\n return shard;\n }\n\n public getTestResultObject(test: TestCase, result: TestResult, jobName: string): MPTTestResult {\n switch (test.outcome()) {\n case \"skipped\":\n this.skippedTests++;\n this.totalTests++;\n break;\n case \"expected\":\n this.passedTests++;\n this.totalTests++;\n break;\n case \"unexpected\":\n if (result.retry === test.retries) {\n this.failedTests++;\n this.totalTests++;\n }\n break;\n case \"flaky\":\n this.totalTests++;\n this.flakyTests++;\n break;\n default:\n break;\n }\n\n let browserName = test.parent.project()!.use.browserName?.toLowerCase();\n if (!browserName) {\n browserName = test.parent.project()!.use.defaultBrowserType?.toLowerCase();\n }\n const testResult = new MPTTestResult();\n testResult.runId = this.envVariables.runId;\n testResult.shardId = this.envVariables.runId + \"_\" + this.envVariables.shardId;\n testResult.accountId = this.envVariables.accountId!;\n testResult.suiteId = ReporterUtils.calculateSha1(`${test.parent.title}-${test.location.file}`);\n testResult.testId = testResult.suiteId.concat(`-${ReporterUtils.calculateSha1(test.title)}`);\n testResult.testCombinationId = test.id;\n testResult.testExecutionId = randomUUID();\n testResult.testTitle = test.title;\n testResult.suiteTitle = this.extractRootParentTitle(test.parent)!;\n testResult.fileName = test.location.file;\n testResult.status = this.getTestStatus(test, result);\n testResult.lineNumber = test.location.line;\n testResult.retry = result.retry ? result.retry : 0;\n testResult.webTestConfig = {\n jobName: jobName,\n projectName: test.parent.project()!.name,\n browserType: browserName ? browserName.toUpperCase() : \"\",\n os: this.getOsName(),\n };\n testResult.annotations = this.extractTestAnnotations(test.annotations);\n testResult.tags = this.extractTestTags(test);\n testResult.resultsSummary = {\n status: result.status.toUpperCase(),\n duration: result.duration,\n startTime: result.startTime.toISOString().replace(/\\.\\d+Z$/, \"Z\"),\n attachmentsMetadata: this.getAttachmentStatus(result),\n };\n testResult.artifactsPath = result.attachments\n .filter((attachment) => attachment?.path !== null && attachment?.path !== undefined) // Filter attachments with defined and non-null path property\n .map(\n (attachment) =>\n `${testResult.testExecutionId}/${ReporterUtils.getFileRelativePath(attachment.path!)}`,\n );\n return testResult;\n }\n\n public generateMarkdownSummary(testRunUrl: string): void {\n try {\n if (CIInfoProvider.getCIProvider() === CI_PROVIDERS.GITHUB) {\n const markdownContent = `\n#### Microsoft Playwright Testing run summary\n\n#### Results:\n \n **Passed:** ${this.passedTests}\n \n **Failed:** ${this.failedTests}\n \n **Flaky:** ${this.flakyTests}\n \n **Skipped:** ${this.skippedTests}\n \n#### For more details, visit the [service dashboard](${testRunUrl}).\n `;\n fs.writeFileSync(process.env[\"GITHUB_STEP_SUMMARY\"]!, markdownContent);\n }\n } catch (err) {\n reporterLogger.error(`\\nCould not generate markdown summary - ${err}`);\n }\n }\n\n public getRawTestResultObject(result: TestResult): RawTestResult {\n const rawTestResult: RawTestResult = {\n steps: this.dedupeSteps(result.steps).map((step) => this.serializeTestStep(step)),\n errors: result.errors ? JSON.stringify(result.errors, null, 2) : \"\",\n stdErr: result.stderr ? JSON.stringify(result.stderr, null, 2) : \"\",\n stdOut: result.stdout ? JSON.stringify(result.stdout, null, 2) : \"\",\n };\n return rawTestResult;\n }\n\n public static getRunId(cIInfo: CIInfo): string {\n if (cIInfo === null || cIInfo.provider === CI_PROVIDERS.DEFAULT) {\n return randomUUID();\n }\n\n const concatString = `${cIInfo.provider}-${cIInfo.repo}-${cIInfo.runId}-${cIInfo.runAttempt}`;\n const runId = ReporterUtils.calculateSha1(concatString);\n return runId;\n }\n\n public static calculateSha1(buffer: Buffer | string): string {\n const hash = createHash(\"sha1\");\n hash.update(buffer);\n return hash.digest(\"hex\");\n }\n\n /*\n public static getTokenDetails(accessToken: string) {\n let tokenDetails = new MPTTokenDetails();\n try {\n const token = accessToken.split('.')[1];\n const _token = Buffer.from(token, 'base64');\n tokenDetails = JSON.parse(_token.toString());\n } catch (err) {\n throw err;\n }\n return tokenDetails;\n }\n */\n\n public static getTokenDetails<T>(accessToken: string, tokenType: TokenType): T {\n const token = accessToken.split(\".\")[1]!;\n const _token = Buffer.from(token, \"base64\");\n const tokenDetails = JSON.parse(_token.toString());\n\n switch (tokenType) {\n case TokenType.MPT:\n return tokenDetails as T;\n case TokenType.ENTRA:\n return tokenDetails as T;\n default:\n throw new Error(\"Unsupported token type\");\n }\n }\n\n public static hasAudienceClaim(token: string): boolean {\n try {\n // Split the token into its three parts\n const parts = token.split(\".\");\n if (parts.length !== 3) {\n throw new Error(\"Invalid token format\");\n }\n\n // Base64 decode the payload\n const payload = parts[1]!;\n const decodedPayload = Buffer.from(payload, \"base64\");\n\n // Parse the decoded payload as JSON\n const payloadObject = JSON.parse(decodedPayload.toString());\n\n // Check if the payload has an 'aud' claim\n return \"aud\" in payloadObject;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return false;\n }\n }\n\n public static timestampToRFC3339(timestamp: number): string {\n const date = new Date(timestamp);\n const dateString = date.toISOString().replace(/\\.\\d+Z$/, \"Z\");\n return dateString;\n }\n\n public static getFileRelativePath(filePath: string): string {\n if (filePath) {\n let parts = filePath.split(\"/\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n\n parts = filePath.split(\"\\\\\");\n\n if (parts.length > 1) {\n return parts[parts.length - 1]!;\n }\n }\n\n return filePath;\n }\n\n public static getReporterBackOffOptions: Partial<IBackOffOptions> = {\n numOfAttempts: 3,\n jitter: \"full\",\n retry: (error) => {\n if (error.response) {\n const status = error.response.status;\n if (Constants.NON_RETRYABLE_STATUS_CODES.includes(status)) {\n return false;\n }\n }\n return true;\n },\n };\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n public static isTimeGreaterThanCurrentPlus10Minutes(sasUri: StorageUri): boolean {\n try {\n const url = new URL(sasUri.uri);\n const params = new URLSearchParams(url.search);\n const expiryTime = params.get(\"se\"); // 'se' is the query parameter for the expiry time\n if (expiryTime) {\n const timestampFromIsoString = new Date(expiryTime).getTime();\n const currentTimestampPlus10Minutes = Date.now() + 10 * 60 * 1000;\n const isSasValidityGreaterThanCurrentTimePlus10Minutes =\n timestampFromIsoString > currentTimestampPlus10Minutes;\n if (!isSasValidityGreaterThanCurrentTimePlus10Minutes) {\n reporterLogger.info(\n `Sas rotation required because close to expiry, SasUriValidTillTime: ${timestampFromIsoString}, CurrentTime: ${currentTimestampPlus10Minutes}`,\n );\n }\n return isSasValidityGreaterThanCurrentTimePlus10Minutes;\n }\n reporterLogger.error(`Sas rotation required because expiry param not found.`);\n return false;\n } catch (error) {\n reporterLogger.error(`Sas rotation required because of ${error}.`);\n return false;\n }\n }\n\n public static getFileSize(attachmentPath: string): number {\n try {\n const stats = fs.statSync(attachmentPath);\n return stats.size;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return 0;\n }\n }\n public redactAccessToken(info: string | undefined): string {\n if (!info || ReporterUtils.isNullOrEmpty(this.envVariables.accessToken)) {\n return \"\";\n }\n const accessTokenRegex = new RegExp(this.envVariables.accessToken, \"g\");\n return info.replace(accessTokenRegex, Constants.DEFAULT_REDACTED_MESSAGE);\n }\n public static getRegionFromAccountID(accountId: string): string | undefined {\n if (accountId.includes(\"_\")) {\n return accountId.split(\"_\")[0]!;\n } else {\n return;\n } // Handling for older workspaces without region in id\n }\n\n public progressBar(current: number, total: number): void {\n const width = 40;\n const percent = current / total;\n const completed = Math.round(width * percent);\n const remaining = width - completed;\n\n process.stdout.write(\"\\r\");\n process.stdout.write(\n `[${\"=\".repeat(completed)}${\" \".repeat(remaining)}] ${Math.round(percent * 100)}%`,\n );\n }\n\n private getTestRunConfig(): TestRunConfig {\n const testRunConfig: TestRunConfig = {\n workers: this.config.workers,\n pwVersion: this.config.version,\n timeout: this.config.globalTimeout,\n repeatEach: this.config.projects[0].repeatEach,\n retries: this.config.projects[0].retries,\n shards: this.config.shard ? this.config.shard : { total: 1 },\n testFramework: {\n name: Constants.TEST_FRAMEWORK_NAME,\n version: this.config.version,\n runnerName: Constants.TEST_FRAMEWORK_RUNNERNAME,\n },\n testType: Constants.TEST_TYPE,\n testSdkLanguage: Constants.TEST_SDK_LANGUAGE,\n reporterPackageVersion: Constants.REPORTER_PACKAGE_VERSION,\n };\n return testRunConfig;\n }\n\n private relativeLocation(location: Location | undefined): Location | undefined {\n if (!location) {\n return undefined;\n }\n const file = this.toPosixPath(path.relative(this.config.rootDir, location.file));\n return {\n file,\n line: location.line,\n column: location.column,\n };\n }\n\n private extractTestTags(input: TestCase): string[] {\n let tags: string[] = [];\n if (\"tags\" in input && Array.isArray(input.tags) && input.tags.length > 0) {\n tags = input.tags.map((tag) => tag.slice(1));\n return tags;\n }\n\n // Check if the input string contains tags directly\n const regex = /@(\\w+)/g;\n const matches = input.title.match(regex);\n if (matches) {\n tags = tags.concat(matches.map((match) => match.slice(1)));\n }\n\n // Try parsing the input string as a JavaScript object\n try {\n const obj = JSON.parse(`{${input}}`);\n if (obj.tag && Array.isArray(obj.tag)) {\n tags = tags.concat(obj.tag);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n // Ignore parsing errors\n }\n return tags;\n }\n\n private extractTestAnnotations(annotations: TestCase[\"annotations\"]): string[] {\n const result = annotations.map((annotation) => {\n if (annotation.type && annotation.description) {\n return `${annotation.type}: ${annotation.description}`;\n }\n return annotation.type;\n });\n return result;\n }\n\n private toPosixPath(aPath: string): string {\n return aPath.split(path.sep).join(path.posix.sep);\n }\n\n private getAttachmentStatus(testResult: TestResult): string {\n let attachmentStatus: string = \"\";\n for (const attachment of testResult.attachments) {\n if (attachment.contentType.includes(\"image\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"image\";\n } else if (attachment.contentType.includes(\"video\")) {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"video\";\n } else if (attachment.contentType === \"application/zip\") {\n if (attachmentStatus !== \"\") {\n attachmentStatus += \",\";\n }\n attachmentStatus += \"trace\";\n }\n }\n return attachmentStatus;\n }\n\n private dedupeSteps(steps: TestStep[]): DedupedStep[] {\n const result: DedupedStep[] = [];\n let lastResult = undefined;\n for (const step of steps) {\n const canDedupe =\n !step.error && step.duration >= 0 && step.location?.file && !step.steps.length;\n const lastStep = lastResult?.step;\n if (\n canDedupe &&\n lastResult &&\n lastStep &&\n step.category === lastStep.category &&\n step.title === lastStep.title &&\n step.location?.file === lastStep.location?.file &&\n step.location?.line === lastStep.location?.line &&\n step.location?.column === lastStep.location?.column\n ) {\n ++lastResult.count;\n lastResult.duration += step.duration;\n continue;\n }\n lastResult = { step, count: 1, duration: step.duration };\n result.push(lastResult);\n if (!canDedupe) {\n lastResult = undefined;\n }\n }\n return result;\n }\n\n private serializeTestStep(dedupedStep: DedupedStep): RawTestStep {\n const { step, duration, count } = dedupedStep;\n const result: RawTestStep = {\n title: step.title,\n category: step.category,\n startTime: step.startTime.toISOString(),\n duration,\n error: step.error ? step.error.message : undefined,\n location: this.relativeLocation(step.location),\n steps: this.dedupeSteps(step.steps).map((subStep) => this.serializeTestStep(subStep)),\n count: count,\n };\n return result;\n }\n\n private getTestStatus(test: TestCase, result: TestResult): string {\n if (test.expectedStatus === result.status) {\n if (result.status === \"skipped\") {\n return \"SKIPPED\";\n } else {\n return \"PASSED\";\n }\n } else if (result.status === \"interrupted\") {\n return \"SKIPPED\";\n } else {\n return \"FAILED\";\n }\n }\n\n private extractRootParentTitle(suite: Suite): string | undefined {\n // Traverse through the parent properties until reaching the root parent\n let currentSuite: Suite | undefined = suite;\n let depthCount: number = 0;\n let suiteTitle: string = currentSuite.title;\n const projectName = currentSuite.project()!.name;\n while (currentSuite?.parent && !ReporterUtils.isNullOrEmpty(currentSuite.parent.title)) {\n if (depthCount > 10 || currentSuite.parent.title === projectName) {\n break;\n }\n suiteTitle = suiteTitle + \" > \" + currentSuite.parent.title;\n currentSuite = currentSuite.parent;\n depthCount++;\n }\n return suiteTitle;\n }\n\n private async getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.provider === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n let gitCommitMessage: string | null = null;\n try {\n const gitVersion = await this.runCommand(Constants.GIT_VERSION_COMMAND);\n if (ReporterUtils.isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await this.runCommand(Constants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n gitCommitMessage = await this.runCommand(Constants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n reporterLogger.error(`\\nError in getting git commit message: ${err}.`);\n return \"\";\n }\n }\n\n private async runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n }\n\n public static isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n }\n\n private getOsName(): string {\n const osType = os.type();\n switch (osType) {\n case \"Darwin\":\n return \"MAC\";\n case \"Linux\":\n return \"LINUX\";\n case \"Windows_NT\":\n return \"WINDOWS\";\n default:\n return \"UNKNOWN\";\n }\n }\n}\n\nexport default ReporterUtils;\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { FullResult } from "@playwright/test/reporter";
|
|
2
|
-
import { EnvironmentVariables } from "../common/environmentVariables";
|
|
3
|
-
import { Shard, UploadMetadata } from "../model/shard";
|
|
4
|
-
import { StorageUri } from "../model/storageUri";
|
|
5
|
-
import { TestResult } from "../model/testResult";
|
|
6
|
-
import { TestRun } from "../model/testRun";
|
|
7
|
-
import { CIInfo } from "./cIInfoProvider";
|
|
8
|
-
import ReporterUtils from "./reporterUtils";
|
|
2
|
+
import type { EnvironmentVariables } from "../common/environmentVariables";
|
|
3
|
+
import type { Shard, UploadMetadata } from "../model/shard";
|
|
4
|
+
import type { StorageUri } from "../model/storageUri";
|
|
5
|
+
import type { TestResult } from "../model/testResult";
|
|
6
|
+
import type { TestRun } from "../model/testRun";
|
|
7
|
+
import type { CIInfo } from "./cIInfoProvider";
|
|
8
|
+
import type ReporterUtils from "./reporterUtils";
|
|
9
9
|
export declare class ServiceClient {
|
|
10
10
|
private httpService;
|
|
11
11
|
private readonly envVariables;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serviceClient.d.ts","sourceRoot":"","sources":["../../src/utils/serviceClient.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;
|
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AU,GAAG,QAAQ,CAAC,MAAM,CAAC;QACnC,MAAM,YAAY,GAAG,MAAA,MAAA,qBAAS,CAAC,aAAa,CAAC,MAAM,CAAC,0CAAG,UAAU,CAAC,mCAAI,wBAAwB,CAAC;QAC/F,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,IAAI,CAAC,CAAC;IAC5C,CAAC;CACF;AAxKD,sCAwKC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullResult } from \"@playwright/test/reporter\";\nimport { Constants } from \"../common/constants\";\nimport { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { HttpService } from \"../common/httpService\";\nimport { Shard, UploadMetadata } from \"../model/shard\";\nimport { StorageUri } from \"../model/storageUri\";\nimport { TestResult } from \"../model/testResult\";\nimport { TestRun } from \"../model/testRun\";\nimport { CIInfo } from \"./cIInfoProvider\";\nimport ReporterUtils from \"./reporterUtils\";\nimport { PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { reporterLogger } from \"../common/logger\";\n\nexport class ServiceClient {\n private httpService: HttpService;\n private readonly envVariables: EnvironmentVariables;\n private readonly reporterUtils: ReporterUtils;\n private readonly addInformationalMessage: (errorMessage: string) => void;\n private isInformationMessagePresent: (key: string) => boolean;\n private addKeyToInformationMessage: (key: string) => void;\n constructor(\n /* eslint-disable @azure/azure-sdk/ts-use-interface-parameters */\n envVariables: EnvironmentVariables,\n reporterUtils: ReporterUtils,\n /* eslint-enable @azure/azure-sdk/ts-use-interface-parameters */\n addErrorInformation: (errorMessage: string) => void,\n isInformationMessagePresent: (key: string) => boolean,\n addKeyToInformationMessage: (key: string) => void,\n ) {\n this.httpService = new HttpService();\n this.envVariables = envVariables;\n this.reporterUtils = reporterUtils;\n this.addInformationalMessage = addErrorInformation;\n this.isInformationMessagePresent = isInformationMessagePresent;\n this.addKeyToInformationMessage = addKeyToInformationMessage;\n }\n\n async patchTestRun(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = await this.reporterUtils.getTestRunObject(ciInfo);\n\n // Escape the runId to avoid issues with special characters\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"PATCH\",\n `${this.getServiceEndpoint()}/${Constants.testRunsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}/${escapedRunId}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(testRun),\n this.envVariables.accessToken,\n \"application/merge-patch+json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n } else if (response.status === 409) {\n const errorMessage = Constants.CONFLICT_409_ERROR_MESSAGE.replace(\n \"{runId}\",\n this.envVariables.runId,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else if (response.status === 403) {\n const errorMessage = Constants.FORBIDDEN_403_ERROR_MESSAGE.replace(\n new RegExp(\"{workspaceId}\", \"g\"),\n this.envVariables.accountId!,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else {\n this.handleErrorResponse(response, Constants.patchTestRun);\n }\n throw new Error(`Received status ${response.status} from service from PATCH TestRun call.`);\n }\n\n async postTestRunShardStart(): Promise<Shard> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardStartObject();\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as Shard;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardStart);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard Start call.`,\n );\n }\n\n async postTestRunShardEnd(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Promise<TestRun> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardEndObject(\n result,\n shard,\n errorMessages,\n attachmentMetadata,\n workers,\n );\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardEnd);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard End call.`,\n );\n }\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n async postTestResults(testResults: TestResult[]): Promise<void> {\n try {\n const payload: any = {\n value: testResults,\n };\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testResultsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(payload),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return;\n }\n this.handleErrorResponse(response, Constants.postTestResults);\n } catch (error) {\n reporterLogger.error(`Error occurred while posting test results: ${error}`);\n }\n }\n\n async createStorageUri(): Promise<StorageUri> {\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.storageUriEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}?api-version=${Constants.API_VERSION}`,\n null,\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as StorageUri;\n }\n this.handleErrorResponse(response, Constants.getStorageUri);\n\n throw new Error(`Received status ${response.status} from service from GET StorageUri call.`);\n }\n\n private getServiceEndpoint(): string {\n return process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]!;\n }\n\n private handleErrorResponse(response: PipelineResponse, action: string): void {\n const statusCode = response.status;\n const errorMessage = Constants.ERROR_MESSAGE[action]?.[statusCode] ?? \"Unknown error occured.\";\n if (!this.isInformationMessagePresent(statusCode.toString())) {\n this.addKeyToInformationMessage(statusCode.toString());\n this.addInformationalMessage(errorMessage);\n }\n process.stdout.write(`${errorMessage}\\n`);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"serviceClient.js","sourceRoot":"","sources":["../../src/utils/serviceClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAGlC,mDAAgD;AAEhD,uDAAoD;AAQpD,6CAAkD;AAElD,MAAa,aAAa;IAOxB;IACE,iEAAiE;IACjE,YAAkC,EAClC,aAA4B;IAC5B,gEAAgE;IAChE,mBAAmD,EACnD,2BAAqD,EACrD,0BAAiD;QAEjD,IAAI,CAAC,WAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;QACrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,uBAAuB,GAAG,mBAA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CAAC,YAAY,CAAC,aAAc,CACjC,CAAC;QACF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAW,CAAe,CAAC;QACxD,CAAC;QACD,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,qBAAS,CAAC,aAAa,CAAC,CAAC;QAE5D,MAAM,IAAI,KAAK,CAAC,mBAAmB,QAAQ,CAAC,MAAM,yCAAyC,CAAC,CAAC;IAC/F,CAAC;IAEO,kBAAkB;QACxB,OAAO,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAE,CAAC;IAC1D,CAAC;IAEO,mBAAmB,CAAC,QAA0B,EAAE,MAAc;;QACpE,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;QACnC,MAAM,YAAY,GAAG,MAAA,MAAA,qBAAS,CAAC,aAAa,CAAC,MAAM,CAAC,0CAAG,UAAU,CAAC,mCAAI,wBAAwB,CAAC;QAC/F,IAAI,CAAC,IAAI,CAAC,2BAA2B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,uBAAuB,CAAC,YAAY,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,YAAY,IAAI,CAAC,CAAC;IAC5C,CAAC;CACF;AAxKD,sCAwKC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullResult } from \"@playwright/test/reporter\";\nimport { Constants } from \"../common/constants\";\nimport type { EnvironmentVariables } from \"../common/environmentVariables\";\nimport { HttpService } from \"../common/httpService\";\nimport type { Shard, UploadMetadata } from \"../model/shard\";\nimport type { StorageUri } from \"../model/storageUri\";\nimport type { TestResult } from \"../model/testResult\";\nimport type { TestRun } from \"../model/testRun\";\nimport type { CIInfo } from \"./cIInfoProvider\";\nimport type ReporterUtils from \"./reporterUtils\";\nimport type { PipelineResponse } from \"@azure/core-rest-pipeline\";\nimport { reporterLogger } from \"../common/logger\";\n\nexport class ServiceClient {\n private httpService: HttpService;\n private readonly envVariables: EnvironmentVariables;\n private readonly reporterUtils: ReporterUtils;\n private readonly addInformationalMessage: (errorMessage: string) => void;\n private isInformationMessagePresent: (key: string) => boolean;\n private addKeyToInformationMessage: (key: string) => void;\n constructor(\n /* eslint-disable @azure/azure-sdk/ts-use-interface-parameters */\n envVariables: EnvironmentVariables,\n reporterUtils: ReporterUtils,\n /* eslint-enable @azure/azure-sdk/ts-use-interface-parameters */\n addErrorInformation: (errorMessage: string) => void,\n isInformationMessagePresent: (key: string) => boolean,\n addKeyToInformationMessage: (key: string) => void,\n ) {\n this.httpService = new HttpService();\n this.envVariables = envVariables;\n this.reporterUtils = reporterUtils;\n this.addInformationalMessage = addErrorInformation;\n this.isInformationMessagePresent = isInformationMessagePresent;\n this.addKeyToInformationMessage = addKeyToInformationMessage;\n }\n\n async patchTestRun(ciInfo: CIInfo): Promise<TestRun> {\n const testRun = await this.reporterUtils.getTestRunObject(ciInfo);\n\n // Escape the runId to avoid issues with special characters\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"PATCH\",\n `${this.getServiceEndpoint()}/${Constants.testRunsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}/${escapedRunId}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(testRun),\n this.envVariables.accessToken,\n \"application/merge-patch+json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n } else if (response.status === 409) {\n const errorMessage = Constants.CONFLICT_409_ERROR_MESSAGE.replace(\n \"{runId}\",\n this.envVariables.runId,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else if (response.status === 403) {\n const errorMessage = Constants.FORBIDDEN_403_ERROR_MESSAGE.replace(\n new RegExp(\"{workspaceId}\", \"g\"),\n this.envVariables.accountId!,\n );\n this.addInformationalMessage(errorMessage);\n process.stdout.write(`\\n${errorMessage}`);\n } else {\n this.handleErrorResponse(response, Constants.patchTestRun);\n }\n throw new Error(`Received status ${response.status} from service from PATCH TestRun call.`);\n }\n\n async postTestRunShardStart(): Promise<Shard> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardStartObject();\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as Shard;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardStart);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard Start call.`,\n );\n }\n\n async postTestRunShardEnd(\n result: FullResult,\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n shard: Shard,\n errorMessages: string[],\n attachmentMetadata: UploadMetadata,\n workers: number,\n ): Promise<TestRun> {\n const postTestRunShardObject = this.reporterUtils.getTestRunShardEndObject(\n result,\n shard,\n errorMessages,\n attachmentMetadata,\n workers,\n );\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testRunsShardEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}/?api-version=${Constants.API_VERSION}`,\n JSON.stringify(postTestRunShardObject),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as TestRun;\n }\n this.handleErrorResponse(response, Constants.patchTestRunShardEnd);\n\n throw new Error(\n `Received status ${response.status} from service from PATCH TestRun Shard End call.`,\n );\n }\n\n // eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\n async postTestResults(testResults: TestResult[]): Promise<void> {\n try {\n const payload: any = {\n value: testResults,\n };\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.testResultsEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!)}?api-version=${Constants.API_VERSION}`,\n JSON.stringify(payload),\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return;\n }\n this.handleErrorResponse(response, Constants.postTestResults);\n } catch (error) {\n reporterLogger.error(`Error occurred while posting test results: ${error}`);\n }\n }\n\n async createStorageUri(): Promise<StorageUri> {\n const escapedRunId = encodeURIComponent(this.envVariables.runId!);\n const response: PipelineResponse = await this.httpService.callAPI(\n \"POST\",\n `${this.getServiceEndpoint()}/${Constants.storageUriEndpoint.replace(\"{workspaceId}\", this.envVariables.accountId!).replace(\"{testRunId}\", escapedRunId)}?api-version=${Constants.API_VERSION}`,\n null,\n this.envVariables.accessToken,\n \"application/json\",\n this.envVariables.correlationId!,\n );\n if (response.status === 200) {\n return JSON.parse(response.bodyAsText!) as StorageUri;\n }\n this.handleErrorResponse(response, Constants.getStorageUri);\n\n throw new Error(`Received status ${response.status} from service from GET StorageUri call.`);\n }\n\n private getServiceEndpoint(): string {\n return process.env[\"PLAYWRIGHT_SERVICE_REPORTING_URL\"]!;\n }\n\n private handleErrorResponse(response: PipelineResponse, action: string): void {\n const statusCode = response.status;\n const errorMessage = Constants.ERROR_MESSAGE[action]?.[statusCode] ?? \"Unknown error occured.\";\n if (!this.isInformationMessagePresent(statusCode.toString())) {\n this.addKeyToInformationMessage(statusCode.toString());\n this.addInformationalMessage(errorMessage);\n }\n process.stdout.write(`${errorMessage}\\n`);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/microsoft-playwright-testing",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.20241030.1",
|
|
4
4
|
"description": "Package to integrate your Playwright test suite with Microsoft Playwright Testing service",
|
|
5
5
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/microsoft-playwright-testing/README.md",
|
|
6
6
|
"sdk-type": "client",
|