@azure/microsoft-playwright-testing 1.0.0-alpha.20250116.1 → 1.0.0-alpha.20250122.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/common/constants.d.ts +2 -3
  3. package/dist/common/constants.d.ts.map +1 -1
  4. package/dist/common/constants.js +2 -3
  5. package/dist/common/constants.js.map +1 -1
  6. package/dist/common/playwrightServiceConfig.d.ts.map +1 -1
  7. package/dist/common/playwrightServiceConfig.js +2 -2
  8. package/dist/common/playwrightServiceConfig.js.map +1 -1
  9. package/dist/common/types.d.ts +26 -67
  10. package/dist/common/types.d.ts.map +1 -1
  11. package/dist/common/types.js.map +1 -1
  12. package/dist/core/global/playwright-service-global-setup.d.ts +1 -1
  13. package/dist/core/global/playwright-service-global-setup.d.ts.map +1 -1
  14. package/dist/core/global/playwright-service-global-setup.js.map +1 -1
  15. package/dist/core/global/playwright-service-global-teardown.d.ts +1 -1
  16. package/dist/core/global/playwright-service-global-teardown.d.ts.map +1 -1
  17. package/dist/core/global/playwright-service-global-teardown.js.map +1 -1
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/reporter/mptReporter.d.ts +2 -2
  22. package/dist/reporter/mptReporter.d.ts.map +1 -1
  23. package/dist/reporter/mptReporter.js +3 -3
  24. package/dist/reporter/mptReporter.js.map +1 -1
  25. package/dist/utils/cIInfoProvider.d.ts +1 -1
  26. package/dist/utils/cIInfoProvider.d.ts.map +1 -1
  27. package/dist/utils/cIInfoProvider.js +4 -6
  28. package/dist/utils/cIInfoProvider.js.map +1 -1
  29. package/dist/utils/reporterUtils.d.ts +1 -0
  30. package/dist/utils/reporterUtils.d.ts.map +1 -1
  31. package/dist/utils/reporterUtils.js +9 -1
  32. package/dist/utils/reporterUtils.js.map +1 -1
  33. package/dist/utils/serviceClient.js +1 -1
  34. package/dist/utils/serviceClient.js.map +1 -1
  35. package/dist/utils/utils.js +1 -1
  36. package/dist/utils/utils.js.map +1 -1
  37. package/package.json +2 -2
  38. package/types/microsoft-playwright-testing.d.ts +37 -79
  39. package/types/reporter/microsoft-playwright-testing.d.ts +3 -3
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Release History
2
2
 
3
- ## 1.0.0-beta.7 (Unreleased)
3
+ ## 1.0.0-beta.8 (Unreleased)
4
4
 
5
5
  ### Features Added
6
6
 
@@ -10,6 +10,21 @@
10
10
 
11
11
  ### Other Changes
12
12
 
13
+ ## 1.0.0-beta.7 (2025-01-17)
14
+
15
+ ### Features Added
16
+
17
+ - Warning message when MPT access token is close to expiry
18
+ - Handling custom attachments in tests
19
+
20
+ ### Bugs Fixed
21
+
22
+ - Attaching code snippet in error messages
23
+
24
+ ### Other Changes
25
+
26
+ - Improved error messaging for reporting and scalable failures
27
+
13
28
  ## 1.0.0-beta.6 (2024-11-29)
14
29
 
15
30
  ### Features Added
@@ -25,11 +25,8 @@ export declare const ServiceAuth: {
25
25
  * Environment variables used by Microsoft Playwright Testing
26
26
  */
27
27
  export declare const ServiceEnvironmentVariable: {
28
- PLAYWRIGHT_SERVICE_OS: string;
29
- PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: string;
30
28
  PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string;
31
29
  PLAYWRIGHT_SERVICE_URL: string;
32
- PLAYWRIGHT_SERVICE_REPORTING_URL: string;
33
30
  };
34
31
  export declare const DefaultConnectOptionsConstants: {
35
32
  DEFAULT_TIMEOUT: number;
@@ -90,6 +87,8 @@ export declare const InternalEnvironmentVariables: {
90
87
  MPT_SERVICE_RUN_NAME: string;
91
88
  MPT_SERVICE_RUN_ID: string;
92
89
  MPT_CLOUD_HOSTED_BROWSER_USED: string;
90
+ MPT_SERVICE_OS: string;
91
+ MPT_SERVICE_REPORTING_URL: string;
93
92
  ONE_TIME_OPERATION_FLAG: string;
94
93
  };
95
94
  export declare const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = "1.47.0";
@@ -1 +1 @@
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,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;IAC7E,gBAAuB,0BAA0B,uCAAqC;IACtF,gBAAuB,yBAAyB,OAAO;IACvD,gBAAuB,aAAa,SAA2B;IAC/D,gBAAuB,UAAU,SAAuB;IACxD,gBAAuB,WAAW,wBAAwB;IAC1D,gBAAuB,EAAE,QAAQ;IACjC,gBAAuB,0BAA0B,WAA6B;IAC9E,gBAAuB,gBAAgB,EAAE,MAAM,EAAE,CAO/C;IAEF,gBAAuB,0BAA0B,uEACqB;IACtE,gBAAuB,2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
  * Environment variables used by Microsoft Playwright Testing
28
28
  */
29
29
  exports.ServiceEnvironmentVariable = {
30
- PLAYWRIGHT_SERVICE_OS: "PLAYWRIGHT_SERVICE_OS",
31
- PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: "PLAYWRIGHT_SERVICE_EXPOSE_NETWORK",
32
30
  PLAYWRIGHT_SERVICE_ACCESS_TOKEN: "PLAYWRIGHT_SERVICE_ACCESS_TOKEN",
33
31
  PLAYWRIGHT_SERVICE_URL: "PLAYWRIGHT_SERVICE_URL",
34
- PLAYWRIGHT_SERVICE_REPORTING_URL: "PLAYWRIGHT_SERVICE_REPORTING_URL",
35
32
  };
36
33
  exports.DefaultConnectOptionsConstants = {
37
34
  DEFAULT_TIMEOUT: 30000,
@@ -225,6 +222,8 @@ exports.InternalEnvironmentVariables = {
225
222
  MPT_SERVICE_RUN_NAME: "_MPT_SERVICE_RUN_NAME",
226
223
  MPT_SERVICE_RUN_ID: "_MPT_SERVICE_RUN_ID",
227
224
  MPT_CLOUD_HOSTED_BROWSER_USED: "_MPT_CLOUD_HOSTED_BROWSER_USED",
225
+ MPT_SERVICE_OS: "_MPT_SERVICE_OS",
226
+ MPT_SERVICE_REPORTING_URL: "_MPT_SERVICE_REPORTING_URL",
228
227
  ONE_TIME_OPERATION_FLAG: "_ONE_TIME_OPERATION_FLAG",
229
228
  };
230
229
  exports.MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = "1.47.0";
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIa,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACU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E,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,mHAAmH;QACrH,OAAO,EAAE,6EAA6E;QACtF,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,+CAA+C;QACpD,OAAO,EACL,6HAA6H;QAC/H,OAAO,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,wDAAwD;QACjE,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,yEAAyE;QAClF,OAAO,EAAE,mFAAmF;QAC5F,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;IAC/D,uBAAuB,EAAE,0BAA0B;CACpD,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 DEFAULT_DASHBOARD_ENDPOINT = \"https://playwright.microsoft.com\";\n public static readonly DEFAULT_SERVICE_ENDPOINT =\n \"https://{region}.reporting.api.playwright-test.io\";\n public static readonly DEFAULT_REDACTED_MESSAGE = \"***REDACTED***\";\n public static readonly SAS_URI_SEPARATOR = \"?\";\n public static readonly DEFAULT_TEST_RUN_NAME = \"MPTReporterTests\";\n public static readonly TEST_BATCH_SIZE = 50;\n public static readonly UPLOAD_MODE = \"sdk\";\n public static readonly GIT_VERSION_COMMAND = \"git --version\";\n public static readonly GIT_REV_PARSE = \"git rev-parse --is-inside-work-tree\";\n public static readonly GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:\"%s\"';\n public static readonly ERROR_MESSAGES_MAX_LENGTH = 100;\n public static readonly sevenDaysInMs = 7 * 24 * 60 * 60 * 1000;\n public static readonly oneDayInMs = 24 * 60 * 60 * 1000;\n public static readonly API_VERSION = \"2024-09-01-preview\";\n public static readonly OS = \"Os\";\n public static readonly NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];\n public static readonly SupportedRegions: string[] = [\n \"eastus\",\n \"eastasia\",\n \"westeurope\",\n \"westus3\",\n \"centraluseuap\",\n \"eastus2euap\",\n ];\n // Error messages\n public static readonly CONFLICT_409_ERROR_MESSAGE =\n \"Test run with id {runId} already exists. Provide a unique run id.\";\n public static readonly FORBIDDEN_403_ERROR_MESSAGE = `You do not have the required permissions to upload test results. This could be because\n\n a. Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general\n b. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n c. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>\n `;\n // API Endpoints\n public static readonly testRunsEndpoint: string = \"workspaces/{workspaceId}/test-runs\";\n public static readonly testRunsShardEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:updateShardExecutionStatus\";\n public static readonly storageUriEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:createArtifactsUploadBaseUri\";\n public static readonly testResultsEndpoint: string =\n \"workspaces/{workspaceId}/test-results/upload-batch\";\n public static readonly patchTestRun: string = \"patchTestRun\";\n public static readonly getTestRun: string = \"getTestRun\";\n public static readonly patchTestRunShardStart: string = \"patchTestRunShardStart\";\n public static readonly patchTestRunShardEnd: string = \"patchTestRunShardEnd\";\n public static readonly postTestResults: string = \"postTestResults\";\n public static readonly getStorageUri: string = \"getStorageUri\";\n public static readonly ERROR_MESSAGE: ApiErrorMessage = {\n patchTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardStart: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardEnd: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n postTestResults: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getStorageUri: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n };\n}\n\nexport const TestErrorType = {\n Scalable: \"Scalable\",\n Reporting: \"Reporting\",\n};\n\nexport const TestResultErrorConstants = [\n {\n key: \"401\",\n message: \"The authentication token provided is invalid. Please check the token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*401 Unauthorized)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"NoPermissionOnWorkspace_Scalable\",\n message: `You do not have the required permissions to run tests. This could be because:\n\n a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n b. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>'.\n `,\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*CheckAccess API call with non successful response)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidWorkspace_Scalable\",\n message: \"The specified workspace does not exist. Please verify your workspace settings.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccountOrSubscriptionState)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n pattern: /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccessToken)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessTokenOrUserOrWorkspaceNotFound_Scalable\",\n message:\n \"The data for the user, workspace or access token was not found. Please check the request or create new token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*404 Not Found)(?=[\\s\\S]*NotFound)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessKeyBasedAuthNotSupported_Scalable\",\n message:\n \"Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*AccessKeyBasedAuthNotSupported)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"503\",\n message: \"The service is currently unavailable. Please check the service status and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*503 Service Unavailable)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"504\",\n message: \"The request to the service timed out. Please try again later.\",\n pattern: /(?=.*browserType\\.connect)(?=.*504 Gateway Timeout)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"QuotaLimitError_Scalable\",\n message:\n \"It is possible that the maximum number of concurrent sessions allowed for your workspace has been exceeded. Check the quota at https://aka.ms/mpt/resource-quota.\",\n pattern: /(?=.*browserType\\.connect): (?=.*Timeout .* exceeded)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"BrowserConnectionError_Scalable\",\n message: \"The service is currently unavailable. Please try again after some time.\",\n pattern: /(?=.*browserType\\.connect): (?=.Target page, context or browser has been closed)/i,\n type: TestErrorType.Scalable,\n },\n];\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n};\n\nexport const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = \"1.47.0\";\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/common/constants.ts"],"names":[],"mappings":";;;AAIa,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,+BAA+B,EAAE,iCAAiC;IA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;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,wDAAwD;QACjE,IAAI,EAAE,qBAAa,CAAC,QAAQ;KAC7B;IACD;QACE,GAAG,EAAE,iCAAiC;QACtC,OAAO,EAAE,yEAAyE;QAClF,OAAO,EAAE,mFAAmF;QAC5F,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;IAC/D,cAAc,EAAE,iBAAiB;IACjC,yBAAyB,EAAE,4BAA4B;IACvD,uBAAuB,EAAE,0BAA0B;CACpD,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_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n};\n\nexport const API_VERSION = \"2023-10-01-preview\";\n\n// Do not put an ending slash for the urls,\n// for example use https://www.microsoft.com/en-in and not https://www.microsoft.com/en-in/\n\nexport class Constants {\n // Config related constants\n public static readonly TEST_FRAMEWORK_NAME = \"PLAYWRIGHT\";\n public static readonly TEST_FRAMEWORK_RUNNERNAME = \"PLAYWRIGHT\";\n public static readonly TEST_TYPE = \"WebTest\";\n public static readonly TEST_SDK_LANGUAGE = \"JAVASCRIPT\";\n // Placeholder version\n public static readonly DEFAULT_DASHBOARD_ENDPOINT = \"https://playwright.microsoft.com\";\n public static readonly DEFAULT_SERVICE_ENDPOINT =\n \"https://{region}.reporting.api.playwright-test.io\";\n public static readonly DEFAULT_REDACTED_MESSAGE = \"***REDACTED***\";\n public static readonly SAS_URI_SEPARATOR = \"?\";\n public static readonly DEFAULT_TEST_RUN_NAME = \"MPTReporterTests\";\n public static readonly TEST_BATCH_SIZE = 50;\n public static readonly UPLOAD_MODE = \"sdk\";\n public static readonly GIT_VERSION_COMMAND = \"git --version\";\n public static readonly GIT_REV_PARSE = \"git rev-parse --is-inside-work-tree\";\n public static readonly GIT_COMMIT_MESSAGE_COMMAND = 'git log -1 --pretty=format:\"%s\"';\n public static readonly ERROR_MESSAGES_MAX_LENGTH = 100;\n public static readonly sevenDaysInMs = 7 * 24 * 60 * 60 * 1000;\n public static readonly oneDayInMs = 24 * 60 * 60 * 1000;\n public static readonly API_VERSION = \"2024-09-01-preview\";\n public static readonly OS = \"Os\";\n public static readonly NON_RETRYABLE_STATUS_CODES = [400, 403, 404, 405, 409];\n public static readonly SupportedRegions: string[] = [\n \"eastus\",\n \"eastasia\",\n \"westeurope\",\n \"westus3\",\n \"centraluseuap\",\n \"eastus2euap\",\n ];\n // Error messages\n public static readonly CONFLICT_409_ERROR_MESSAGE =\n \"Test run with id {runId} already exists. Provide a unique run id.\";\n public static readonly FORBIDDEN_403_ERROR_MESSAGE = `You do not have the required permissions to upload test results. This could be because\n\n a. Reporting is not enabled for your workspace {workspaceId}. Enable the Reporting feature under Feature management settings using the Playwright portal: https://playwright.microsoft.com/workspaces/{workspaceId}/settings/general\n b. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n c. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>\n `;\n // API Endpoints\n public static readonly testRunsEndpoint: string = \"workspaces/{workspaceId}/test-runs\";\n public static readonly testRunsShardEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:updateShardExecutionStatus\";\n public static readonly storageUriEndpoint: string =\n \"workspaces/{workspaceId}/test-runs/{testRunId}:createArtifactsUploadBaseUri\";\n public static readonly testResultsEndpoint: string =\n \"workspaces/{workspaceId}/test-results/upload-batch\";\n public static readonly patchTestRun: string = \"patchTestRun\";\n public static readonly getTestRun: string = \"getTestRun\";\n public static readonly patchTestRunShardStart: string = \"patchTestRunShardStart\";\n public static readonly patchTestRunShardEnd: string = \"patchTestRunShardEnd\";\n public static readonly postTestResults: string = \"postTestResults\";\n public static readonly getStorageUri: string = \"getStorageUri\";\n public static readonly ERROR_MESSAGE: ApiErrorMessage = {\n patchTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getTestRun: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardStart: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n patchTestRunShardEnd: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n postTestResults: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n getStorageUri: {\n 400: \"The request made to the server is invalid. Please check the request parameters and try again.\",\n 401: \"The authentication token provided is invalid. Please check the token and try again.\",\n 403: \"You do not have the required permissions to run tests. Please contact your workspace administrator.\",\n 500: \"An unexpected error occurred on our server. Our team is working to resolve the issue. Please try again later, or contact support if the problem continues.\",\n 429: \"You have exceeded the rate limit for the API. Please wait and try again later.\",\n 504: \"The request to the service timed out. Please try again later.\",\n 503: \"The service is currently unavailable. Please check the service status and try again.\",\n },\n };\n}\n\nexport const TestErrorType = {\n Scalable: \"Scalable\",\n Reporting: \"Reporting\",\n};\n\nexport const TestResultErrorConstants = [\n {\n key: \"401\",\n message: \"The authentication token provided is invalid. Please check the token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*401 Unauthorized)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"NoPermissionOnWorkspace_Scalable\",\n message: `You do not have the required permissions to run tests. This could be because:\n\n a. You do not have the required roles on the workspace. Only Owner and Contributor roles can run tests. Contact the service administrator.\n b. The workspace you are trying to run the tests on is in a different Azure tenant than what you are signed into. Check the tenant id from Azure portal (https://aka.ms/mpt/find-tenant-id) and login using the command 'az login --tenant <TENANT_ID>'.\n `,\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*CheckAccess API call with non successful response)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidWorkspace_Scalable\",\n message: \"The specified workspace does not exist. Please verify your workspace settings.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccountOrSubscriptionState)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n pattern: /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*InvalidAccessToken)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessTokenOrUserOrWorkspaceNotFound_Scalable\",\n message:\n \"The data for the user, workspace or access token was not found. Please check the request or create new token and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*404 Not Found)(?=[\\s\\S]*NotFound)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"AccessKeyBasedAuthNotSupported_Scalable\",\n message:\n \"Authentication through service access token is disabled for this workspace. Please use Entra ID to authenticate.\",\n pattern:\n /(?=.*browserType\\.connect)(?=.*403 Forbidden)(?=[\\s\\S]*AccessKeyBasedAuthNotSupported)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"503\",\n message: \"The service is currently unavailable. Please check the service status and try again.\",\n pattern: /(?=.*browserType\\.connect)(?=.*503 Service Unavailable)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"504\",\n message: \"The request to the service timed out. Please try again later.\",\n pattern: /(?=.*browserType\\.connect)(?=.*504 Gateway Timeout)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"QuotaLimitError_Scalable\",\n message:\n \"It is possible that the maximum number of concurrent sessions allowed for your workspace has been exceeded. Check the quota at https://aka.ms/mpt/resource-quota.\",\n pattern: /(?=.*browserType\\.connect): (?=.*Timeout .* exceeded)/i,\n type: TestErrorType.Scalable,\n },\n {\n key: \"BrowserConnectionError_Scalable\",\n message: \"The service is currently unavailable. Please try again after some time.\",\n pattern: /(?=.*browserType\\.connect): (?=.Target page, context or browser has been closed)/i,\n type: TestErrorType.Scalable,\n },\n];\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n MPT_SERVICE_OS: \"_MPT_SERVICE_OS\",\n MPT_SERVICE_REPORTING_URL: \"_MPT_SERVICE_REPORTING_URL\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n};\n\nexport const MINIMUM_SUPPORTED_PLAYWRIGHT_VERSION = \"1.47.0\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"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
+ {"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAIA,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"}
@@ -26,7 +26,7 @@ class PlaywrightServiceConfig {
26
26
  }
27
27
  if (options === null || options === void 0 ? void 0 : options.os) {
28
28
  this.serviceOs = options.os;
29
- process.env[constants_1.ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_OS] = this.serviceOs;
29
+ process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;
30
30
  }
31
31
  if (options === null || options === void 0 ? void 0 : options.slowMo) {
32
32
  this.slowMo = options.slowMo;
@@ -35,7 +35,7 @@ class PlaywrightServiceConfig {
35
35
  this.timeout = options.timeout;
36
36
  }
37
37
  };
38
- this.serviceOs = (process.env[constants_1.ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_OS] ||
38
+ this.serviceOs = (process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_OS] ||
39
39
  constants_1.DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS);
40
40
  this.runName = process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || "";
41
41
  this.runId = process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || "";
@@ -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,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AAC,GAAG,CAAC,sCAA0B,CAAC,qBAAqB,CAAC;YAC7E,0CAA8B,CAAC,kBAAkB,CAAW,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,wCAA4B,CAAC,oBAAoB,CAAC,IAAI,EAAE,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 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"]}
1
+ {"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,2CAA2F;AAE3F,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,KAA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,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 { DefaultConnectOptionsConstants, InternalEnvironmentVariables } 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[InternalEnvironmentVariables.MPT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.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[InternalEnvironmentVariables.MPT_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,20 +1,7 @@
1
1
  import type { Location, TestStep } from "@playwright/test/reporter";
2
+ import type { ConnectOptions } from "@playwright/test";
2
3
  import type { ServiceAuth, ServiceOS } from "./constants";
3
4
  import type { TokenCredential } from "@azure/identity";
4
- export type JwtPayload = {
5
- aid?: string;
6
- iss?: string;
7
- sub?: string;
8
- aud?: string[] | string;
9
- exp?: number;
10
- nbf?: number;
11
- iat?: number;
12
- jti?: string;
13
- };
14
- export type AccessTokenClaims = JwtPayload & {
15
- aid?: string;
16
- accountId?: string;
17
- };
18
5
  /**
19
6
  * @public
20
7
  *
@@ -28,45 +15,6 @@ export type EndpointOptions = {
28
15
  */
29
16
  wsEndpoint: string;
30
17
  };
31
- /**
32
- * @public
33
- *
34
- * Connect options for the service.
35
- */
36
- export type ConnectOptions = {
37
- /**
38
- * @public
39
- *
40
- * Additional HTTP headers to be sent with web socket connect request.
41
- */
42
- headers?: {
43
- [key: string]: string;
44
- };
45
- /**
46
- * @public
47
- *
48
- * Exposes network available on the connecting client to the browser being connected to.
49
- *
50
- * @defaultValue `<loopback>`
51
- */
52
- exposeNetwork?: string;
53
- /**
54
- * @public
55
- *
56
- * Maximum time in milliseconds to wait for the connection to be established.
57
- *
58
- * @defaultValue `30000`
59
- */
60
- timeout?: number;
61
- /**
62
- * @public
63
- *
64
- * Slows down Playwright operations by the specified amount of milliseconds.
65
- *
66
- * @defaultValue `0`
67
- */
68
- slowMo?: number;
69
- };
70
18
  /**
71
19
  * @public
72
20
  *
@@ -186,15 +134,6 @@ export type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];
186
134
  * Authentication types supported by Microsoft Playwright Testing.
187
135
  */
188
136
  export type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];
189
- export type ErrorDetails = {
190
- message: string;
191
- location?: Location;
192
- };
193
- export type ApiErrorMessage = {
194
- [key: string]: {
195
- [key: number]: string;
196
- };
197
- };
198
137
  /**
199
138
  * @public
200
139
  *
@@ -212,7 +151,7 @@ export type ApiErrorMessage = {
212
151
  * });
213
152
  * ```
214
153
  */
215
- export interface MPTReporterConfig {
154
+ export type ReporterConfiguration = {
216
155
  /**
217
156
  * @public
218
157
  *
@@ -229,7 +168,30 @@ export interface MPTReporterConfig {
229
168
  * @defaultValue `true`
230
169
  */
231
170
  enableResultPublish?: boolean;
232
- }
171
+ };
172
+ export type JwtPayload = {
173
+ aid?: string;
174
+ iss?: string;
175
+ sub?: string;
176
+ aud?: string[] | string;
177
+ exp?: number;
178
+ nbf?: number;
179
+ iat?: number;
180
+ jti?: string;
181
+ };
182
+ export type AccessTokenClaims = JwtPayload & {
183
+ aid?: string;
184
+ accountId?: string;
185
+ };
186
+ export type ErrorDetails = {
187
+ message: string;
188
+ location?: Location;
189
+ };
190
+ export type ApiErrorMessage = {
191
+ [key: string]: {
192
+ [key: number]: string;
193
+ };
194
+ };
233
195
  export type DedupedStep = {
234
196
  step: TestStep;
235
197
  count: number;
@@ -261,7 +223,4 @@ export type PackageManager = {
261
223
  runCommand: (command: string, args: string) => string;
262
224
  getVersionFromStdout: (stdout: string) => string;
263
225
  };
264
- export interface FullConfig {
265
- configFile?: string;
266
- }
267
226
  //# sourceMappingURL=types.d.ts.map
@@ -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,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,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AAU,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"}
@@ -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 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 * 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 { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS } from \"./constants\";\nimport type { TokenCredential } from \"@azure/identity\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/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 * 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\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 type ReporterConfiguration = {\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};\n\n// Internal APIs\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\nexport type ErrorDetails = {\n message: string;\n location?: Location;\n};\n\nexport type ApiErrorMessage = {\n [key: string]: {\n [key: number]: string;\n };\n};\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"]}
@@ -1,4 +1,4 @@
1
- import type { FullConfig } from "../../common/types";
1
+ import type { FullConfig } from "@playwright/test";
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,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,QAAA,MAAM,mCAAmC,WAAkB,UAAU,KAAG,OAAO,CAAC,GAAG,CAWlF,CAAC;AAEF,eAAe,mCAAmC,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,kBAAkB,CAAC;AAKnD,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,IAAI,uBAAuB,GAAQ,IAAI,CAAC;IACxC,IAAI,wBAAc,CAAC,WAAW,IAAI,OAAO,wBAAc,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACjF,uBAAuB,GAAG,MAAM,IAAA,qCAA0B,EAAC,OAAO,EAAE,wBAAc,CAAC,WAAW,CAAC,CAAC;IAClG,CAAC;IAED,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 let customerGlobalSetupFunc: any = null;\n if (customerConfig.globalSetup && typeof customerConfig.globalSetup === \"string\") {\n customerGlobalSetupFunc = await loadCustomerGlobalFunction(rootDir, 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,IAAI,uBAAuB,GAAQ,IAAI,CAAC;IACxC,IAAI,wBAAc,CAAC,WAAW,IAAI,OAAO,wBAAc,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACjF,uBAAuB,GAAG,MAAM,IAAA,qCAA0B,EAAC,OAAO,EAAE,wBAAc,CAAC,WAAW,CAAC,CAAC;IAClG,CAAC;IAED,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 \"@playwright/test\";\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 let customerGlobalSetupFunc: any = null;\n if (customerConfig.globalSetup && typeof customerConfig.globalSetup === \"string\") {\n customerGlobalSetupFunc = await loadCustomerGlobalFunction(rootDir, 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 type { FullConfig } from "../../common/types";
1
+ import type { FullConfig } from "@playwright/test";
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,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,QAAA,MAAM,sCAAsC,WAAkB,UAAU,KAAG,OAAO,CAAC,IAAI,CActF,CAAC;AAEF,eAAe,sCAAsC,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,kBAAkB,CAAC;AAKnD,QAAA,MAAM,sCAAsC,WAAkB,UAAU,KAAG,OAAO,CAAC,IAAI,CActF,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,IAAI,0BAA0B,GAAQ,IAAI,CAAC;IAC3C,IAAI,wBAAc,CAAC,cAAc,IAAI,OAAO,wBAAc,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;QACvF,0BAA0B,GAAG,MAAM,IAAA,qCAA0B,EAC3D,OAAO,EACP,wBAAc,CAAC,cAAc,CAC9B,CAAC;IACJ,CAAC;IAED,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 let customerGlobalTeardownFunc: any = null;\n if (customerConfig.globalTeardown && typeof customerConfig.globalTeardown === \"string\") {\n customerGlobalTeardownFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalTeardown,\n );\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,IAAI,0BAA0B,GAAQ,IAAI,CAAC;IAC3C,IAAI,wBAAc,CAAC,cAAc,IAAI,OAAO,wBAAc,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;QACvF,0BAA0B,GAAG,MAAM,IAAA,qCAA0B,EAC3D,OAAO,EACP,wBAAc,CAAC,cAAc,CAC9B,CAAC;IACJ,CAAC;IAED,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 \"@playwright/test\";\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 let customerGlobalTeardownFunc: any = null;\n if (customerConfig.globalTeardown && typeof customerConfig.globalTeardown === \"string\") {\n customerGlobalTeardownFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalTeardown,\n );\n }\n\n playwrightServiceEntra.globalTeardown();\n if (customerGlobalTeardownFunc) {\n await customerGlobalTeardownFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalTeardownWrapper;\n"]}
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  import { ServiceAuth, ServiceOS, ServiceEnvironmentVariable } from "./common/constants";
7
- import type { OsType, AuthenticationType, BrowserConnectOptions, MPTReporterConfig, EndpointOptions, ConnectOptions, PlaywrightServiceAdditionalOptions } from "./common/types";
7
+ import type { OsType, AuthenticationType, BrowserConnectOptions, ReporterConfiguration, EndpointOptions, PlaywrightServiceAdditionalOptions } from "./common/types";
8
8
  import { getServiceConfig, getConnectOptions } from "./core/playwrightService";
9
- export { getServiceConfig, getConnectOptions, ServiceOS, ServiceAuth, ServiceEnvironmentVariable, OsType, AuthenticationType, BrowserConnectOptions, EndpointOptions, ConnectOptions, MPTReporterConfig, PlaywrightServiceAdditionalOptions, };
9
+ export { getServiceConfig, getConnectOptions, ServiceOS, ServiceAuth, ServiceEnvironmentVariable, OsType, AuthenticationType, BrowserConnectOptions, EndpointOptions, ReporterConfiguration, PlaywrightServiceAdditionalOptions, };
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kCAAkC,EACnC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,0BAA0B,EAC1B,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,kCAAkC,GACnC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACxF,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,eAAe,EACf,kCAAkC,EACnC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE/E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,0BAA0B,EAC1B,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,kCAAkC,GACnC,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Library for integrating Microsoft Playwright Testing with existing playwright projects.\n *\n * @packageDocumentation\n */\n\nimport { ServiceAuth, ServiceOS, ServiceEnvironmentVariable } from \"./common/constants\";\nimport type {\n OsType,\n AuthenticationType,\n BrowserConnectOptions,\n MPTReporterConfig,\n EndpointOptions,\n ConnectOptions,\n PlaywrightServiceAdditionalOptions,\n} from \"./common/types\";\nimport { getServiceConfig, getConnectOptions } from \"./core/playwrightService\";\n\nexport {\n getServiceConfig,\n getConnectOptions,\n ServiceOS,\n ServiceAuth,\n ServiceEnvironmentVariable,\n OsType,\n AuthenticationType,\n BrowserConnectOptions,\n EndpointOptions,\n ConnectOptions,\n MPTReporterConfig,\n PlaywrightServiceAdditionalOptions,\n};\n"],"names":[],"mappings":";;AAAA;AACA;;;AAEA;;;;AAIG;AAEH,MAAwF,WAAA,GAAA,OAAA,CAAA,oBAAA,CAAA;AAgBtF,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAhBO,uBAAW,CAgBP,EAAA,EAAA,CAAA;AADX,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,WAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAfoB,qBAAS,CAepB,EAAA,EAAA,CAAA;AAET,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAjB+B,sCAA0B,CAiB/B,EAAA,EAAA,CAAA;AAP5B,MAA+E,mBAAA,GAAA,OAAA,CAAA,0BAAA,CAAA;AAG7E,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAHO,oCAAgB,CAGP,EAAA,EAAA,CAAA;AAChB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAJyB,qCAAiB,CAIzB,EAAA,EAAA,CAAA;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Library for integrating Microsoft Playwright Testing with existing playwright projects.\n *\n * @packageDocumentation\n */\n\nimport { ServiceAuth, ServiceOS, ServiceEnvironmentVariable } from \"./common/constants\";\nimport type {\n OsType,\n AuthenticationType,\n BrowserConnectOptions,\n ReporterConfiguration,\n EndpointOptions,\n PlaywrightServiceAdditionalOptions,\n} from \"./common/types\";\nimport { getServiceConfig, getConnectOptions } from \"./core/playwrightService\";\n\nexport {\n getServiceConfig,\n getConnectOptions,\n ServiceOS,\n ServiceAuth,\n ServiceEnvironmentVariable,\n OsType,\n AuthenticationType,\n BrowserConnectOptions,\n EndpointOptions,\n ReporterConfiguration,\n PlaywrightServiceAdditionalOptions,\n};\n"],"names":[],"mappings":";;AAAA;AACA;;;AAEA;;;;AAIG;AAEH,MAAwF,WAAA,GAAA,OAAA,CAAA,oBAAA,CAAA;AAetF,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,aAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAfO,uBAAW,CAeP,EAAA,EAAA,CAAA;AADX,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,WAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAdoB,qBAAS,CAcpB,EAAA,EAAA,CAAA;AAET,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,4BAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAhB+B,sCAA0B,CAgB/B,EAAA,EAAA,CAAA;AAP5B,MAA+E,mBAAA,GAAA,OAAA,CAAA,0BAAA,CAAA;AAG7E,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,kBAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAHO,oCAAgB,CAGP,EAAA,EAAA,CAAA;AAChB,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA,EAAA,UAAA,EAAA,IAAA,EAAA,GAAA,EAAA,YAAA,EAAA,OAJyB,qCAAiB,CAIzB,EAAA,EAAA,CAAA;;"}
@@ -1,5 +1,5 @@
1
1
  import type { FullResult, TestCase, TestResult, FullConfig, Reporter, Suite } from "@playwright/test/reporter";
2
- import type { MPTReporterConfig } from "../common/types";
2
+ import type { ReporterConfiguration } from "../common/types";
3
3
  /**
4
4
  * @public
5
5
  *
@@ -40,7 +40,7 @@ declare class MPTReporter implements Reporter {
40
40
  private numWorkers;
41
41
  private testRunUrl;
42
42
  private enableResultPublish;
43
- constructor(config: Partial<MPTReporterConfig>);
43
+ constructor(config: Partial<ReporterConfiguration>);
44
44
  private _addError;
45
45
  private _addInformationalMessage;
46
46
  private _addKeyToInformationMessage;
@@ -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;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;IACrC,OAAO,CAAC,qBAAqB,CAAgB;IAC7C,OAAO,CAAC,yBAAyB,CAAgB;IACjD,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,cAAc,CAIpB;IACF,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,mBAAmB,CAAiB;gBAEhC,MAAM,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAQ9C,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,wBAAwB,CAE9B;IAEF,OAAO,CAAC,2BAA2B,CAEjC;IAEF,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O,CAAC,cAAc,CAAkC;IACxD,OAAO,CAAC,cAAc,CAAoB;IAC1C,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,eAAe,CAAgD;IACvE,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,qBAAqB,CAAgB;IAC7C,OAAO,CAAC,yBAAyB,CAAgB;IACjD,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,cAAc,CAIpB;IACF,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,mBAAmB,CAAiB;gBAEhC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC;IAQlD,OAAO,CAAC,SAAS;IAMjB,OAAO,CAAC,wBAAwB,CAE9B;IAEF,OAAO,CAAC,2BAA2B,CAEjC;IAEF,OAAO,CAAC,4BAA4B,CAElC;IACF,OAAO,CAAC,uBAAuB,CAM7B;IACF;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAgB/C;;;;;;;OAOG;IACH,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI;IAsBnD;;;;;;;;;;;;;;OAcG;IACG,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;YA4ChC,QAAQ;YAgCR,UAAU;YA6CV,MAAM;IAkBpB,OAAO,CAAC,mBAAmB,CAUzB;YACY,4BAA4B;IA0C1C,OAAO,CAAC,qBAAqB;IAwD7B,OAAO,CAAC,4BAA4B;IAOpC,OAAO,CAAC,iBAAiB;IAsBzB;;;;;OAKG;IACH,aAAa,IAAI,OAAO;CAGzB;AACD,eAAe,WAAW,CAAC"}
@@ -218,7 +218,7 @@ class MPTReporter {
218
218
  return;
219
219
  }
220
220
  this.uploadMetadata.numTestResults++;
221
- const testResultObject = this.reporterUtils.getTestResultObject(test, result, this.ciInfo.jobId);
221
+ const testResultObject = this.reporterUtils.getTestResultObject(test, result, this.ciInfo.jobName);
222
222
  this.testResultBatch.add(testResultObject);
223
223
  // Store test attachments in array
224
224
  const testAttachments = [];
@@ -298,12 +298,12 @@ class MPTReporter {
298
298
  this.isTokenValid = false;
299
299
  return;
300
300
  }
301
- if (!process.env["PLAYWRIGHT_SERVICE_REPORTING_URL"]) {
301
+ if (!process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL]) {
302
302
  process.stdout.write("\nReporting service url not found.");
303
303
  this.isTokenValid = false;
304
304
  return;
305
305
  }
306
- logger_1.reporterLogger.info(`Reporting url - ${process.env["PLAYWRIGHT_SERVICE_REPORTING_URL"]}`);
306
+ logger_1.reporterLogger.info(`Reporting url - ${process.env[constants_1.InternalEnvironmentVariables.MPT_SERVICE_REPORTING_URL]}`);
307
307
  if (this.envVariables.accessToken === undefined || this.envVariables.accessToken === "") {
308
308
  process.stdout.write(`\n${messages_1.ServiceErrorMessageConstants.NO_AUTH_ERROR.message}`);
309
309
  this.isTokenValid = false;