@azure/playwright 1.1.3 → 1.1.5

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 (149) hide show
  1. package/dist/browser/common/constants.d.ts +2 -4
  2. package/dist/browser/common/constants.d.ts.map +1 -1
  3. package/dist/browser/common/constants.js +2 -4
  4. package/dist/browser/common/constants.js.map +1 -1
  5. package/dist/browser/common/entraIdAccessToken.d.ts +6 -0
  6. package/dist/browser/common/entraIdAccessToken.d.ts.map +1 -1
  7. package/dist/browser/common/entraIdAccessToken.js +24 -0
  8. package/dist/browser/common/entraIdAccessToken.js.map +1 -1
  9. package/dist/browser/common/types.d.ts +0 -4
  10. package/dist/browser/common/types.d.ts.map +1 -1
  11. package/dist/browser/common/types.js.map +1 -1
  12. package/dist/browser/core/playwrightServiceEntra.d.ts.map +1 -1
  13. package/dist/browser/core/playwrightServiceEntra.js +1 -0
  14. package/dist/browser/core/playwrightServiceEntra.js.map +1 -1
  15. package/dist/browser/reporter/playwrightReporter.d.ts +0 -1
  16. package/dist/browser/reporter/playwrightReporter.d.ts.map +1 -1
  17. package/dist/browser/reporter/playwrightReporter.js +3 -17
  18. package/dist/browser/reporter/playwrightReporter.js.map +1 -1
  19. package/dist/browser/utils/PlaywrightServiceClient.d.ts +1 -2
  20. package/dist/browser/utils/PlaywrightServiceClient.d.ts.map +1 -1
  21. package/dist/browser/utils/PlaywrightServiceClient.js +1 -26
  22. package/dist/browser/utils/PlaywrightServiceClient.js.map +1 -1
  23. package/dist/browser/utils/utils.d.ts +2 -3
  24. package/dist/browser/utils/utils.d.ts.map +1 -1
  25. package/dist/browser/utils/utils.js +8 -21
  26. package/dist/browser/utils/utils.js.map +1 -1
  27. package/dist/commonjs/common/constants.d.ts +2 -4
  28. package/dist/commonjs/common/constants.d.ts.map +1 -1
  29. package/dist/commonjs/common/constants.js +3 -5
  30. package/dist/commonjs/common/constants.js.map +1 -1
  31. package/dist/commonjs/common/entraIdAccessToken.d.ts +6 -0
  32. package/dist/commonjs/common/entraIdAccessToken.d.ts.map +1 -1
  33. package/dist/commonjs/common/entraIdAccessToken.js +24 -0
  34. package/dist/commonjs/common/entraIdAccessToken.js.map +1 -1
  35. package/dist/commonjs/common/types.d.ts +0 -4
  36. package/dist/commonjs/common/types.d.ts.map +1 -1
  37. package/dist/commonjs/common/types.js.map +1 -1
  38. package/dist/commonjs/core/playwrightServiceEntra.d.ts.map +1 -1
  39. package/dist/commonjs/core/playwrightServiceEntra.js +1 -0
  40. package/dist/commonjs/core/playwrightServiceEntra.js.map +1 -1
  41. package/dist/commonjs/reporter/playwrightReporter.d.ts +0 -1
  42. package/dist/commonjs/reporter/playwrightReporter.d.ts.map +1 -1
  43. package/dist/commonjs/reporter/playwrightReporter.js +2 -16
  44. package/dist/commonjs/reporter/playwrightReporter.js.map +1 -1
  45. package/dist/commonjs/tsdoc-metadata.json +1 -1
  46. package/dist/commonjs/utils/PlaywrightServiceClient.d.ts +1 -2
  47. package/dist/commonjs/utils/PlaywrightServiceClient.d.ts.map +1 -1
  48. package/dist/commonjs/utils/PlaywrightServiceClient.js +0 -25
  49. package/dist/commonjs/utils/PlaywrightServiceClient.js.map +1 -1
  50. package/dist/commonjs/utils/utils.d.ts +2 -3
  51. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  52. package/dist/commonjs/utils/utils.js +8 -22
  53. package/dist/commonjs/utils/utils.js.map +1 -1
  54. package/dist/esm/common/constants.d.ts +2 -4
  55. package/dist/esm/common/constants.d.ts.map +1 -1
  56. package/dist/esm/common/constants.js +93 -96
  57. package/dist/esm/common/constants.js.map +1 -7
  58. package/dist/esm/common/customerConfig.js +11 -11
  59. package/dist/esm/common/customerConfig.js.map +1 -7
  60. package/dist/esm/common/entraIdAccessToken.d.ts +6 -0
  61. package/dist/esm/common/entraIdAccessToken.d.ts.map +1 -1
  62. package/dist/esm/common/entraIdAccessToken.js +101 -85
  63. package/dist/esm/common/entraIdAccessToken.js.map +1 -7
  64. package/dist/esm/common/environmentVariables.js +19 -19
  65. package/dist/esm/common/environmentVariables.js.map +1 -7
  66. package/dist/esm/common/executor.js +58 -51
  67. package/dist/esm/common/executor.js.map +1 -7
  68. package/dist/esm/common/httpService.js +29 -34
  69. package/dist/esm/common/httpService.js.map +1 -7
  70. package/dist/esm/common/logger.js +4 -4
  71. package/dist/esm/common/logger.js.map +1 -7
  72. package/dist/esm/common/messages.js +166 -166
  73. package/dist/esm/common/messages.js.map +1 -7
  74. package/dist/esm/common/playwrightServiceConfig.js +91 -91
  75. package/dist/esm/common/playwrightServiceConfig.js.map +1 -7
  76. package/dist/esm/common/state.js +7 -7
  77. package/dist/esm/common/state.js.map +1 -7
  78. package/dist/esm/common/types.d.ts +0 -4
  79. package/dist/esm/common/types.d.ts.map +1 -1
  80. package/dist/esm/common/types.js +4 -0
  81. package/dist/esm/common/types.js.map +1 -7
  82. package/dist/esm/core/global/playwright-service-global-setup.js +17 -17
  83. package/dist/esm/core/global/playwright-service-global-setup.js.map +1 -7
  84. package/dist/esm/core/global/playwright-service-global-teardown.js +13 -16
  85. package/dist/esm/core/global/playwright-service-global-teardown.js.map +1 -7
  86. package/dist/esm/core/initializePlaywrightServiceTestRun.js +21 -13
  87. package/dist/esm/core/initializePlaywrightServiceTestRun.js.map +1 -7
  88. package/dist/esm/core/playwrightService.js +200 -149
  89. package/dist/esm/core/playwrightService.js.map +1 -7
  90. package/dist/esm/core/playwrightServiceEntra.d.ts.map +1 -1
  91. package/dist/esm/core/playwrightServiceEntra.js +43 -44
  92. package/dist/esm/core/playwrightServiceEntra.js.map +1 -7
  93. package/dist/esm/core/playwrightServiceUtils.js +8 -6
  94. package/dist/esm/core/playwrightServiceUtils.js.map +1 -7
  95. package/dist/esm/index.js +9 -7
  96. package/dist/esm/index.js.map +1 -7
  97. package/dist/esm/reporter/index.js +11 -4
  98. package/dist/esm/reporter/index.js.map +1 -7
  99. package/dist/esm/reporter/playwrightReporter.d.ts +0 -1
  100. package/dist/esm/reporter/playwrightReporter.d.ts.map +1 -1
  101. package/dist/esm/reporter/playwrightReporter.js +193 -202
  102. package/dist/esm/reporter/playwrightReporter.js.map +1 -7
  103. package/dist/esm/utils/PlaywrightServiceClient.d.ts +1 -2
  104. package/dist/esm/utils/PlaywrightServiceClient.d.ts.map +1 -1
  105. package/dist/esm/utils/PlaywrightServiceClient.js +61 -121
  106. package/dist/esm/utils/PlaywrightServiceClient.js.map +1 -7
  107. package/dist/esm/utils/cIInfoProvider.js +71 -58
  108. package/dist/esm/utils/cIInfoProvider.js.map +1 -7
  109. package/dist/esm/utils/getPackageVersion.js +17 -12
  110. package/dist/esm/utils/getPackageVersion.js.map +1 -7
  111. package/dist/esm/utils/getPlaywrightVersion.js +13 -15
  112. package/dist/esm/utils/getPlaywrightVersion.js.map +1 -7
  113. package/dist/esm/utils/packageManager.js +37 -37
  114. package/dist/esm/utils/packageManager.js.map +1 -7
  115. package/dist/esm/utils/parseJwt.js +14 -15
  116. package/dist/esm/utils/parseJwt.js.map +1 -7
  117. package/dist/esm/utils/playwrightReporterStorageManager.js +333 -358
  118. package/dist/esm/utils/playwrightReporterStorageManager.js.map +1 -7
  119. package/dist/esm/utils/utils.d.ts +2 -3
  120. package/dist/esm/utils/utils.d.ts.map +1 -1
  121. package/dist/esm/utils/utils.js +338 -380
  122. package/dist/esm/utils/utils.js.map +1 -7
  123. package/dist/react-native/common/constants.d.ts +2 -4
  124. package/dist/react-native/common/constants.d.ts.map +1 -1
  125. package/dist/react-native/common/constants.js +2 -4
  126. package/dist/react-native/common/constants.js.map +1 -1
  127. package/dist/react-native/common/entraIdAccessToken.d.ts +6 -0
  128. package/dist/react-native/common/entraIdAccessToken.d.ts.map +1 -1
  129. package/dist/react-native/common/entraIdAccessToken.js +24 -0
  130. package/dist/react-native/common/entraIdAccessToken.js.map +1 -1
  131. package/dist/react-native/common/types.d.ts +0 -4
  132. package/dist/react-native/common/types.d.ts.map +1 -1
  133. package/dist/react-native/common/types.js.map +1 -1
  134. package/dist/react-native/core/playwrightServiceEntra.d.ts.map +1 -1
  135. package/dist/react-native/core/playwrightServiceEntra.js +1 -0
  136. package/dist/react-native/core/playwrightServiceEntra.js.map +1 -1
  137. package/dist/react-native/reporter/playwrightReporter.d.ts +0 -1
  138. package/dist/react-native/reporter/playwrightReporter.d.ts.map +1 -1
  139. package/dist/react-native/reporter/playwrightReporter.js +3 -17
  140. package/dist/react-native/reporter/playwrightReporter.js.map +1 -1
  141. package/dist/react-native/utils/PlaywrightServiceClient.d.ts +1 -2
  142. package/dist/react-native/utils/PlaywrightServiceClient.d.ts.map +1 -1
  143. package/dist/react-native/utils/PlaywrightServiceClient.js +1 -26
  144. package/dist/react-native/utils/PlaywrightServiceClient.js.map +1 -1
  145. package/dist/react-native/utils/utils.d.ts +2 -3
  146. package/dist/react-native/utils/utils.d.ts.map +1 -1
  147. package/dist/react-native/utils/utils.js +8 -21
  148. package/dist/react-native/utils/utils.js.map +1 -1
  149. package/package.json +6 -6
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/common/messages.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const ServiceErrorMessageConstants = {\n NO_SERVICE_URL_ERROR: {\n key: \"NoServiceUrlError\",\n message:\n \"The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.\",\n },\n INVALID_GLOBAL_FUNCTION: {\n key: \"InvalidGlobalFunction\",\n message: \"File must export a single function.\",\n },\n INVALID_PLAYWRIGHT_VERSION_ERROR: {\n key: \"InvalidPlaywrightVersionError\",\n message:\n \"The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.\",\n },\n PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {\n key: \"PlaywrightVersionTooOldForReporting\",\n message:\n \"To use the Playwright Workspaces reporting feature, you need Playwright version 1.57 or later installed. Update the Playwright package to a supported version and try again.\",\n },\n MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {\n key: \"MultipleSetupFilePlaywrightVersionError\",\n message:\n \"The Playwright version you are using does not support multiple setup/teardown files. Please update to Playwright version 1.49.0 or higher.\",\n },\n WORKSPACE_MISMATCH_ERROR: {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n },\n NO_AUTH_ERROR_PAT_TOKEN: {\n key: \"NoAuthErrorPatToken\",\n message:\n \"Please set PLAYWRIGHT_SERVICE_ACCESS_TOKEN env variable when using ACCESS_TOKEN authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n NO_AUTH_ERROR_ENTRA_TOKEN: {\n key: \"NoAuthErrorEntraToken\",\n message:\n \"Could not authenticate with the service. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message:\n \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided is invalid. Please make sure to set a valid token.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided has expired. Create a new token.\",\n },\n NO_CRED_ENTRA_AUTH_ERROR: {\n key: \"NoCredEntraAuthError\",\n message:\n \"Missing 'credential' parameter which is required when using ENTRA_ID authentication, Azure credential not provided. See https://aka.ms/pww/docs/authentication for more information.\",\n },\n FAILED_TO_CREATE_TEST_RUN: {\n key: \"FailedToCreateTestRun\",\n message:\n \"Failed to create the test run in the Playwright workspaces. For more information, see https://aka.ms/pww/docs/troubleshooting\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. For more information, see https://aka.ms/pww/docs/troubleshooting`,\n },\n INVALID_PARAM_WITH_SERVICE_CONFIG: {\n key: \"InvalidParamWithServiceConfig\",\n message: `Remove serviceAuth, runId, and runName from getConnectOptions when using createAzurePlaywrightConfig. Configure these options through createAzurePlaywrightConfig instead.`,\n },\n INVALID_RUN_ID_FORMAT: {\n key: \"InvalidRunIdFormat\",\n message: \"The Run ID must be a valid GUID format. Please provide a valid GUID for the Run ID.\",\n },\n INVALID_AUTH_TYPE_ERROR: {\n key: \"InvalidAuthTypeError\",\n message: \"Invalid authentication type specified. Please use either ENTRA_ID or ACCESS_TOKEN.\",\n },\n FAILED_TO_GET_WORKSPACE_DETAILS: {\n key: \"FailedToGetWorkspaceDetails\",\n message: \"Failed to retrieve workspace details from the Playwright service.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to retrieve workspace details from the Playwright service. Error: ${errorDetails}. Please verify your service URL and authentication credentials.`,\n },\n STORAGE_URI_NOT_FOUND: {\n key: \"StorageUriNotFound\",\n message: \"Storage Account is not linked with this Playwright Workspace.\",\n },\n STORAGE_AUTHORIZATION_FAILED: {\n key: \"StorageAuthorizationFailed\",\n message:\n \"The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account - ${storageAccountName}. For more information, see https://aka.ms/pww-reporting`,\n },\n UNABLE_TO_EXTRACT_WORKSPACE_ID: {\n key: \"UnableToExtractWorkspaceId\",\n message: \"Unable to extract workspace ID from service URL\",\n },\n STORAGE_ACCOUNT_DELETED: {\n key: \"StorageAccountDeleted\",\n message:\n \"The storage account linked to your Playwright Workspace may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The storage account linked to your Playwright Workspace (${storageAccountName}) may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration`,\n },\n REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message:\n \"Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n HTML_REPORTER_REQUIRED: {\n key: \"HtmlReporterRequired\",\n message:\n \"Playwright Workspaces Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the 'html' reporter before playwright workspace reporter to generate test reports that can be uploaded to Azure Storage. Example: reporter: [['html'], ['@azure/playwright/reporter']]. For more information, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_METADATA_FETCH_FAILED: {\n key: \"WorkspaceMetadataFetchFailed\",\n message:\n \"Failed to retrieve workspace configuration. Reporting will be disabled for this run. Please check your authentication credentials and service URL.\",\n },\n WORKSPACE_REPORTING_DISABLED: {\n key: \"WorkspaceReportingDisabled\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is not enabled for the Playwright Workspace. To learn more about how to enable reporting and link a storage account, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_REPORTING_STORAGE_NOT_LINKED: {\n key: \"WorkspaceReportingStorageNotLinked\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is enabled for the Playwright Workspace, but no storage account is linked. Please link a storage account to enable reporting. For more information, see https://aka.ms/pww-reporting\",\n },\n UPLOAD_FAILED_FILES: {\n key: \"UploadFailedFiles\",\n message: \"Upload failed: files could not be uploaded\",\n formatWithCount: (failed: number): string =>\n `Upload failed: ${failed} files could not be uploaded`,\n },\n PLAYWRIGHT_TEST_REPORT_NOT_FOUND: {\n key: \"PlaywrightTestReportNotFound\",\n message: \"Playwright test report not found\",\n formatWithFolder: (folderName: string): string =>\n `Playwright test report not found: ${folderName}. For more information, see https://aka.ms/pww-reporting`,\n },\n REPORTING_ENABLED: {\n key: \"ReportingEnabled\",\n message: \"Playwright Workspaces reporting: ENABLED\",\n },\n COLLECTING_ARTIFACTS: {\n key: \"CollectingArtifacts\",\n message: \"Collecting artifacts: screenshots, videos, traces.\",\n },\n REPORTING_STATUS_SUCCESS: {\n key: \"ReportingStatusSuccess\",\n message: \"Reporting upload status: SUCCESS\",\n },\n REPORTING_STATUS_PARTIAL: {\n key: \"ReportingStatusPartial\",\n message: \"Reporting upload status: Partially Uploaded\",\n },\n REPORTING_STATUS_FAILED: {\n key: \"ReportingStatusFailed\",\n message: \"Reporting upload status: FAILED\",\n },\n TEST_REPORT_VIEW_URL: {\n key: \"TestReportViewUrl\",\n message: \"Published report URL: \",\n formatWithUrl: (url: string): string => `Published report URL: ${url}`,\n },\n UPLOADING_ARTIFACTS: {\n key: \"UploadingArtifacts\",\n message: \"Uploading artifacts to storage\",\n formatWithDetails: (storageAccount: string, container: string, folder: string): string =>\n `Uploading artifacts to: storage account= ${storageAccount}, storage container= ${container}, folder= ${folder}`,\n },\n FAILED_TO_GET_WORKSPACE_METADATA: {\n key: \"FailedToGetWorkspaceMetadata\",\n message: \"Failed to get workspace metadata\",\n formatWithError: (error: string): string => error,\n },\n TEST_RUN_CREATION_FAILED: {\n key: \"TestRunCreationFailed\",\n message: \"Failed to create test run. Test execution will continue.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create test run. Error: ${errorDetails}. Test execution will continue.`,\n },\n REPORTING_TEST_RUN_FAILED: {\n key: \"ReportingTestRunFailed\",\n message: \"Test run creation failed during setup.\",\n },\n REPORTER_REQUIRES_SERVICE_CONFIG: {\n key: \"ReporterRequiresServiceConfig\",\n message:\n \"Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig. For more information, see https://aka.ms/pww-reporting.\",\n },\n};\n"],
5
- "mappings": "AAGO,MAAM,+BAA+B;AAAA,EAC1C,sBAAsB;AAAA,IACpB,KAAK;AAAA,IACL,SACE;AAAA,EACJ;AAAA,EACA,yBAAyB;AAAA,IACvB,KAAK;AAAA,IACL,SAAS;AAAA,EACX;AAAA,EACA,kCAAkC;AAAA,IAChC,KAAK;AAAA,IACL,SACE;AAAA,EACJ;AAAA,EACA,0CAA0C;AAAA,IACxC,KAAK;AAAA,IACL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T,iBAAiB,CAAC,UAA0B;AAAA,EAC9C;AAAA,EACA,0BAA0B;AAAA,IACxB,KAAK;AAAA,IACL,SAAS;AAAA,IACT,wBAAwB,CAAC,iBACvB,qCAAqC,YAAY;AAAA,EACrD;AAAA,EACA,2BAA2B;AAAA,IACzB,KAAK;AAAA,IACL,SAAS;AAAA,EACX;AAAA,EACA,kCAAkC;AAAA,IAChC,KAAK;AAAA,IACL,SACE;AAAA,EACJ;AACF;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EACL,8GAA8G;KACjH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,qCAAqC;KAC/C;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,0IAA0I;KAC7I;IACD,wCAAwC,EAAE;QACxC,GAAG,EAAE,qCAAqC;QAC1C,OAAO,EACL,8KAA8K;KACjL;IACD,4CAA4C,EAAE;QAC5C,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EACL,4IAA4I;KAC/I;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,mHAAmH;KACtH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,qBAAqB;QAC1B,OAAO,EACL,kKAAkK;KACrK;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EACL,2GAA2G;KAC9G;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,iGAAiG;KACpG;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,+EAA+E;KACzF;IACD,w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iB,EAAE,MAAc,EAAU,EAAE,CACvF,4CAA4C,cAAc,wBAAwB,SAAS,aAAa,MAAM,EAAE;KACnH;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,8BAA8B;QACnC,OAAO,EAAE,kCAAkC;QAC3C,eAAe,EAAE,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK;KAClD;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,0DAA0D;QACnE,sBAAsB,EAAE,CAAC,YAAoB,EAAU,EAAE,CACvD,qCAAqC,YAAY,iCAAiC;KACrF;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,wCAAwC;KAClD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,mKAAmK;KACtK;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const ServiceErrorMessageConstants = {\n NO_SERVICE_URL_ERROR: {\n key: \"NoServiceUrlError\",\n message:\n \"The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.\",\n },\n INVALID_GLOBAL_FUNCTION: {\n key: \"InvalidGlobalFunction\",\n message: \"File must export a single function.\",\n },\n INVALID_PLAYWRIGHT_VERSION_ERROR: {\n key: \"InvalidPlaywrightVersionError\",\n message:\n \"The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.\",\n },\n PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {\n key: \"PlaywrightVersionTooOldForReporting\",\n message:\n \"To use the Playwright Workspaces reporting feature, you need Playwright version 1.57 or later installed. Update the Playwright package to a supported version and try again.\",\n },\n MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {\n key: \"MultipleSetupFilePlaywrightVersionError\",\n message:\n \"The Playwright version you are using does not support multiple setup/teardown files. Please update to Playwright version 1.49.0 or higher.\",\n },\n WORKSPACE_MISMATCH_ERROR: {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n },\n NO_AUTH_ERROR_PAT_TOKEN: {\n key: \"NoAuthErrorPatToken\",\n message:\n \"Please set PLAYWRIGHT_SERVICE_ACCESS_TOKEN env variable when using ACCESS_TOKEN authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n NO_AUTH_ERROR_ENTRA_TOKEN: {\n key: \"NoAuthErrorEntraToken\",\n message:\n \"Could not authenticate with the service. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message:\n \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided is invalid. Please make sure to set a valid token.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided has expired. Create a new token.\",\n },\n NO_CRED_ENTRA_AUTH_ERROR: {\n key: \"NoCredEntraAuthError\",\n message:\n \"Missing 'credential' parameter which is required when using ENTRA_ID authentication, Azure credential not provided. See https://aka.ms/pww/docs/authentication for more information.\",\n },\n FAILED_TO_CREATE_TEST_RUN: {\n key: \"FailedToCreateTestRun\",\n message:\n \"Failed to create the test run in the Playwright workspaces. For more information, see https://aka.ms/pww/docs/troubleshooting\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. For more information, see https://aka.ms/pww/docs/troubleshooting`,\n },\n INVALID_PARAM_WITH_SERVICE_CONFIG: {\n key: \"InvalidParamWithServiceConfig\",\n message: `Remove serviceAuth, runId, and runName from getConnectOptions when using createAzurePlaywrightConfig. Configure these options through createAzurePlaywrightConfig instead.`,\n },\n INVALID_RUN_ID_FORMAT: {\n key: \"InvalidRunIdFormat\",\n message: \"The Run ID must be a valid GUID format. Please provide a valid GUID for the Run ID.\",\n },\n INVALID_AUTH_TYPE_ERROR: {\n key: \"InvalidAuthTypeError\",\n message: \"Invalid authentication type specified. Please use either ENTRA_ID or ACCESS_TOKEN.\",\n },\n FAILED_TO_GET_WORKSPACE_DETAILS: {\n key: \"FailedToGetWorkspaceDetails\",\n message: \"Failed to retrieve workspace details from the Playwright service.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to retrieve workspace details from the Playwright service. Error: ${errorDetails}. Please verify your service URL and authentication credentials.`,\n },\n STORAGE_URI_NOT_FOUND: {\n key: \"StorageUriNotFound\",\n message: \"Storage Account is not linked with this Playwright Workspace.\",\n },\n STORAGE_AUTHORIZATION_FAILED: {\n key: \"StorageAuthorizationFailed\",\n message:\n \"The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account - ${storageAccountName}. For more information, see https://aka.ms/pww-reporting`,\n },\n UNABLE_TO_EXTRACT_WORKSPACE_ID: {\n key: \"UnableToExtractWorkspaceId\",\n message: \"Unable to extract workspace ID from service URL\",\n },\n STORAGE_ACCOUNT_DELETED: {\n key: \"StorageAccountDeleted\",\n message:\n \"The storage account linked to your Playwright Workspace may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The storage account linked to your Playwright Workspace (${storageAccountName}) may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration`,\n },\n REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message:\n \"Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n HTML_REPORTER_REQUIRED: {\n key: \"HtmlReporterRequired\",\n message:\n \"Playwright Workspaces Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the 'html' reporter before playwright workspace reporter to generate test reports that can be uploaded to Azure Storage. Example: reporter: [['html'], ['@azure/playwright/reporter']]. For more information, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_METADATA_FETCH_FAILED: {\n key: \"WorkspaceMetadataFetchFailed\",\n message:\n \"Failed to retrieve workspace configuration. Reporting will be disabled for this run. Please check your authentication credentials and service URL.\",\n },\n WORKSPACE_REPORTING_DISABLED: {\n key: \"WorkspaceReportingDisabled\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is not enabled for the Playwright Workspace. To learn more about how to enable reporting and link a storage account, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_REPORTING_STORAGE_NOT_LINKED: {\n key: \"WorkspaceReportingStorageNotLinked\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is enabled for the Playwright Workspace, but no storage account is linked. Please link a storage account to enable reporting. For more information, see https://aka.ms/pww-reporting\",\n },\n UPLOAD_FAILED_FILES: {\n key: \"UploadFailedFiles\",\n message: \"Upload failed: files could not be uploaded\",\n formatWithCount: (failed: number): string =>\n `Upload failed: ${failed} files could not be uploaded`,\n },\n PLAYWRIGHT_TEST_REPORT_NOT_FOUND: {\n key: \"PlaywrightTestReportNotFound\",\n message: \"Playwright test report not found\",\n formatWithFolder: (folderName: string): string =>\n `Playwright test report not found: ${folderName}. For more information, see https://aka.ms/pww-reporting`,\n },\n REPORTING_ENABLED: {\n key: \"ReportingEnabled\",\n message: \"Playwright Workspaces reporting: ENABLED\",\n },\n COLLECTING_ARTIFACTS: {\n key: \"CollectingArtifacts\",\n message: \"Collecting artifacts: screenshots, videos, traces.\",\n },\n REPORTING_STATUS_SUCCESS: {\n key: \"ReportingStatusSuccess\",\n message: \"Reporting upload status: SUCCESS\",\n },\n REPORTING_STATUS_PARTIAL: {\n key: \"ReportingStatusPartial\",\n message: \"Reporting upload status: Partially Uploaded\",\n },\n REPORTING_STATUS_FAILED: {\n key: \"ReportingStatusFailed\",\n message: \"Reporting upload status: FAILED\",\n },\n TEST_REPORT_VIEW_URL: {\n key: \"TestReportViewUrl\",\n message: \"Published report URL: \",\n formatWithUrl: (url: string): string => `Published report URL: ${url}`,\n },\n UPLOADING_ARTIFACTS: {\n key: \"UploadingArtifacts\",\n message: \"Uploading artifacts to storage\",\n formatWithDetails: (storageAccount: string, container: string, folder: string): string =>\n `Uploading artifacts to: storage account= ${storageAccount}, storage container= ${container}, folder= ${folder}`,\n },\n FAILED_TO_GET_WORKSPACE_METADATA: {\n key: \"FailedToGetWorkspaceMetadata\",\n message: \"Failed to get workspace metadata\",\n formatWithError: (error: string): string => error,\n },\n TEST_RUN_CREATION_FAILED: {\n key: \"TestRunCreationFailed\",\n message: \"Failed to create test run. Test execution will continue.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create test run. Error: ${errorDetails}. Test execution will continue.`,\n },\n REPORTING_TEST_RUN_FAILED: {\n key: \"ReportingTestRunFailed\",\n message: \"Test run creation failed during setup.\",\n },\n REPORTER_REQUIRES_SERVICE_CONFIG: {\n key: \"ReporterRequiresServiceConfig\",\n message:\n \"Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig. For more information, see https://aka.ms/pww-reporting.\",\n },\n};\n"]}
@@ -1,102 +1,102 @@
1
- import {
2
- Constants,
3
- DefaultConnectOptionsConstants,
4
- InternalEnvironmentVariables,
5
- ServiceAuth
6
- } from "./constants.js";
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { Constants, DefaultConnectOptionsConstants, InternalEnvironmentVariables, ServiceAuth, } from "./constants.js";
7
4
  import { getAndSetRunId, getRunName, ValidateRunID } from "../utils/utils.js";
8
5
  import { CIInfoProvider } from "../utils/cIInfoProvider.js";
9
6
  import { state } from "./state.js";
10
7
  import { ServiceErrorMessageConstants } from "./messages.js";
11
8
  class PlaywrightServiceConfig {
12
- serviceOs;
13
- runId;
14
- connectTimeout;
15
- slowMo;
16
- exposeNetwork;
17
- runName;
18
- apiVersion;
19
- _serviceAuthType = ServiceAuth.ENTRA_ID;
20
- credential;
21
- constructor() {
22
- this.serviceOs = process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] || DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS;
23
- this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || "";
24
- this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || "";
25
- this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;
26
- this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;
27
- this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;
28
- this.apiVersion = process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;
29
- }
30
- static get instance() {
31
- if (!state.playwrightServiceConfig) {
32
- state.playwrightServiceConfig = new PlaywrightServiceConfig();
9
+ serviceOs;
10
+ runId;
11
+ connectTimeout;
12
+ slowMo;
13
+ exposeNetwork;
14
+ runName;
15
+ apiVersion;
16
+ _serviceAuthType = ServiceAuth.ENTRA_ID;
17
+ credential;
18
+ constructor() {
19
+ this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||
20
+ DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS);
21
+ this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || "";
22
+ this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || "";
23
+ this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;
24
+ this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;
25
+ this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;
26
+ this.apiVersion =
27
+ process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;
33
28
  }
34
- return state.playwrightServiceConfig;
35
- }
36
- get serviceAuthType() {
37
- return this._serviceAuthType;
38
- }
39
- set serviceAuthType(value) {
40
- this._serviceAuthType = value;
41
- }
42
- async initialize() {
43
- if (!this.runName) {
44
- const ciConfigInfo = CIInfoProvider.getCIInfo();
45
- this.runName = await getRunName(ciConfigInfo);
29
+ static get instance() {
30
+ if (!state.playwrightServiceConfig) {
31
+ state.playwrightServiceConfig = new PlaywrightServiceConfig();
32
+ }
33
+ return state.playwrightServiceConfig;
46
34
  }
47
- }
48
- validateOptions = (options) => {
49
- if (!options) return;
50
- const isUsingServiceConfig = process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === "true";
51
- if (isUsingServiceConfig) {
52
- if (options.serviceAuthType || options.runId || options.runName) {
53
- const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;
54
- throw new Error(errorMessage);
55
- }
56
- return;
35
+ get serviceAuthType() {
36
+ return this._serviceAuthType;
57
37
  }
58
- };
59
- setOptions = (options, isGetConnectOptions = false) => {
60
- if (isGetConnectOptions) {
61
- this.validateOptions(options);
38
+ set serviceAuthType(value) {
39
+ this._serviceAuthType = value;
62
40
  }
63
- if (options?.exposeNetwork) {
64
- this.exposeNetwork = options.exposeNetwork;
41
+ async initialize() {
42
+ if (!this.runName) {
43
+ const ciConfigInfo = CIInfoProvider.getCIInfo();
44
+ this.runName = await getRunName(ciConfigInfo);
45
+ }
65
46
  }
66
- if (options?.apiVersion) {
67
- if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {
68
- process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;
69
- }
70
- this.apiVersion = options.apiVersion;
71
- }
72
- if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {
73
- if (options?.runId) {
74
- ValidateRunID(options.runId);
75
- this.runId = options.runId;
76
- process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;
77
- } else {
78
- this.runId = getAndSetRunId();
79
- }
80
- }
81
- if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {
82
- this.runName = options.runName;
83
- process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;
84
- }
85
- if (options?.os) {
86
- this.serviceOs = options.os;
87
- process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;
88
- }
89
- if (options?.slowMo) {
90
- this.slowMo = options.slowMo;
91
- }
92
- if (options?.connectTimeout) {
93
- this.connectTimeout = options.connectTimeout;
94
- }
95
- if (options?.credential) {
96
- this.credential = options.credential;
97
- }
98
- };
47
+ validateOptions = (options) => {
48
+ if (!options)
49
+ return;
50
+ const isUsingServiceConfig = process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === "true";
51
+ if (isUsingServiceConfig) {
52
+ if (options.serviceAuthType || options.runId || options.runName) {
53
+ const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;
54
+ throw new Error(errorMessage);
55
+ }
56
+ return;
57
+ }
58
+ };
59
+ setOptions = (options, isGetConnectOptions = false) => {
60
+ if (isGetConnectOptions) {
61
+ this.validateOptions(options);
62
+ }
63
+ if (options?.exposeNetwork) {
64
+ this.exposeNetwork = options.exposeNetwork;
65
+ }
66
+ if (options?.apiVersion) {
67
+ if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {
68
+ process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;
69
+ }
70
+ this.apiVersion = options.apiVersion;
71
+ }
72
+ if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {
73
+ if (options?.runId) {
74
+ ValidateRunID(options.runId);
75
+ this.runId = options.runId;
76
+ process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;
77
+ }
78
+ else {
79
+ this.runId = getAndSetRunId();
80
+ }
81
+ }
82
+ if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {
83
+ this.runName = options.runName;
84
+ process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;
85
+ }
86
+ if (options?.os) {
87
+ this.serviceOs = options.os;
88
+ process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;
89
+ }
90
+ if (options?.slowMo) {
91
+ this.slowMo = options.slowMo;
92
+ }
93
+ if (options?.connectTimeout) {
94
+ this.connectTimeout = options.connectTimeout;
95
+ }
96
+ if (options?.credential) {
97
+ this.credential = options.credential;
98
+ }
99
+ };
99
100
  }
100
- export {
101
- PlaywrightServiceConfig
102
- };
101
+ export { PlaywrightServiceConfig };
102
+ //# sourceMappingURL=playwrightServiceConfig.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/common/playwrightServiceConfig.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Constants,\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"./constants.js\";\nimport type { PlaywrightServiceAdditionalOptions, OsType } from \"./types.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { getAndSetRunId, getRunName, ValidateRunID } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\nimport { state } from \"./state.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public connectTimeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n public apiVersion: string;\n private _serviceAuthType: string = ServiceAuth.ENTRA_ID;\n public credential?: TokenCredential;\n\n constructor() {\n this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n this.apiVersion =\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;\n }\n\n public static get instance(): PlaywrightServiceConfig {\n if (!state.playwrightServiceConfig) {\n state.playwrightServiceConfig = new PlaywrightServiceConfig();\n }\n return state.playwrightServiceConfig;\n }\n\n public get serviceAuthType(): string {\n return this._serviceAuthType;\n }\n\n public set serviceAuthType(value: string) {\n this._serviceAuthType = value;\n }\n\n public async initialize(): Promise<void> {\n if (!this.runName) {\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n this.runName = await getRunName(ciConfigInfo);\n }\n }\n\n validateOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (!options) return;\n\n const isUsingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n if (isUsingServiceConfig) {\n if (options.serviceAuthType || options.runId || options.runName) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;\n throw new Error(errorMessage);\n }\n return;\n }\n };\n\n setOptions = (\n options?: PlaywrightServiceAdditionalOptions,\n isGetConnectOptions: boolean = false,\n ): void => {\n if (isGetConnectOptions) {\n this.validateOptions(options);\n }\n\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (options?.apiVersion) {\n if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;\n }\n this.apiVersion = options.apiVersion;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n ValidateRunID(options.runId);\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.connectTimeout) {\n this.connectTimeout = options.connectTimeout;\n }\n if (options?.credential) {\n this.credential = options.credential;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"],
5
- "mappings": "AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,gBAAgB,YAAY,qBAAqB;AAC1D,SAAS,sBAAsB;AAC/B,SAAS,aAAa;AACtB,SAAS,oCAAoC;AAE7C,MAAM,wBAAwB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACC,mBAA2B,YAAY;AAAA,EACxC;AAAA,EAEP,cAAc;AACZ,SAAK,YAAa,QAAQ,IAAI,6BAA6B,cAAc,KACvE,+BAA+B;AACjC,SAAK,UAAU,QAAQ,IAAI,6BAA6B,oBAAoB,KAAK;AACjF,SAAK,QAAQ,QAAQ,IAAI,6BAA6B,kBAAkB,KAAK;AAC7E,SAAK,iBAAiB,+BAA+B;AACrD,SAAK,SAAS,+BAA+B;AAC7C,SAAK,gBAAgB,+BAA+B;AACpD,SAAK,aACH,QAAQ,IAAI,6BAA6B,eAAe,KAAK,UAAU;AAAA,EAC3E;AAAA,EAEA,WAAkB,WAAoC;AACpD,QAAI,CAAC,MAAM,yBAAyB;AAClC,YAAM,0BAA0B,IAAI,wBAAwB;AAAA,IAC9D;AACA,WAAO,MAAM;AAAA,EACf;AAAA,EAEA,IAAW,kBAA0B;AACnC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6B,oBAAoB,IAAI,KAAK;AAAA,IACxE;AACA,QAAI,SAAS,IAAI;AACf,WAAK,YAAY,QAAQ;AACzB,cAAQ,IAAI,6BAA6B,cAAc,IAAI,KAAK;AAAA,IAClE;AACA,QAAI,SAAS,QAAQ;AACnB,WAAK,SAAS,QAAQ;AAAA,IACxB;AACA,QAAI,SAAS,gBAAgB;AAC3B,WAAK,iBAAiB,QAAQ;AAAA,IAChC;AACA,QAAI,SAAS,YAAY;AACvB,WAAK,aAAa,QAAQ;AAAA,IAC5B;AAAA,EACF;AACF;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,SAAS,EACT,8BAA8B,EAC9B,4BAA4B,EAC5B,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,uBAAuB;IACpB,SAAS,CAAS;IAClB,KAAK,CAAS;IACd,cAAc,CAAS;IACvB,MAAM,CAAS;IACf,aAAa,CAAS;IACtB,OAAO,CAAS;IAChB,UAAU,CAAS;IAClB,gBAAgB,GAAW,WAAW,CAAC,QAAQ,CAAC;IACjD,UAAU,CAAmB;IAEpC;QACE,IAAI,CAAC,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,cAAc,CAAC;YACxE,8BAA8B,CAAC,kBAAkB,CAAW,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,oBAAoB,CAAC,IAAI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A4B,CAAC,oBAAoB,CAAC,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;YACxF,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;YAC/B,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAChF,CAAC;QACD,IAAI,OAAO,EAAE,EAAE,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5E,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC/B,CAAC;QACD,IAAI,OAAO,EAAE,cAAc,EAAE,CAAC;YAC5B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC/C,CAAC;QACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;CACH;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Constants,\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"./constants.js\";\nimport type { PlaywrightServiceAdditionalOptions, OsType } from \"./types.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { getAndSetRunId, getRunName, ValidateRunID } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\nimport { state } from \"./state.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public connectTimeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n public apiVersion: string;\n private _serviceAuthType: string = ServiceAuth.ENTRA_ID;\n public credential?: TokenCredential;\n\n constructor() {\n this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n this.apiVersion =\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;\n }\n\n public static get instance(): PlaywrightServiceConfig {\n if (!state.playwrightServiceConfig) {\n state.playwrightServiceConfig = new PlaywrightServiceConfig();\n }\n return state.playwrightServiceConfig;\n }\n\n public get serviceAuthType(): string {\n return this._serviceAuthType;\n }\n\n public set serviceAuthType(value: string) {\n this._serviceAuthType = value;\n }\n\n public async initialize(): Promise<void> {\n if (!this.runName) {\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n this.runName = await getRunName(ciConfigInfo);\n }\n }\n\n validateOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (!options) return;\n\n const isUsingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n if (isUsingServiceConfig) {\n if (options.serviceAuthType || options.runId || options.runName) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;\n throw new Error(errorMessage);\n }\n return;\n }\n };\n\n setOptions = (\n options?: PlaywrightServiceAdditionalOptions,\n isGetConnectOptions: boolean = false,\n ): void => {\n if (isGetConnectOptions) {\n this.validateOptions(options);\n }\n\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (options?.apiVersion) {\n if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;\n }\n this.apiVersion = options.apiVersion;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n ValidateRunID(options.runId);\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.connectTimeout) {\n this.connectTimeout = options.connectTimeout;\n }\n if (options?.credential) {\n this.credential = options.credential;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"]}
@@ -1,9 +1,9 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
1
3
  globalThis.state = globalThis.state || {
2
- playwrightServiceEntra: null,
3
- customerConfig: null,
4
- playwrightServiceConfig: null
5
- };
6
- const state = globalThis.state;
7
- export {
8
- state
4
+ playwrightServiceEntra: null,
5
+ customerConfig: null,
6
+ playwrightServiceConfig: null,
9
7
  };
8
+ export const state = globalThis.state;
9
+ //# sourceMappingURL=state.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/common/state.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n(globalThis as any).state = (globalThis as any).state || {\n playwrightServiceEntra: null,\n customerConfig: null,\n playwrightServiceConfig: null,\n};\nexport const state: Record<string, any> = (globalThis as any).state;\n"],
5
- "mappings": "AAGC,WAAmB,QAAS,WAAmB,SAAS;AAAA,EACvD,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,yBAAyB;AAC3B;AACO,MAAM,QAA8B,WAAmB;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../src/common/state.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAEjC,UAAkB,CAAC,KAAK,GAAI,UAAkB,CAAC,KAAK,IAAI;IACvD,sBAAsB,EAAE,IAAI;IAC5B,cAAc,EAAE,IAAI;IACpB,uBAAuB,EAAE,IAAI;CAC9B,CAAC;AACF,MAAM,CAAC,MAAM,KAAK,GAAyB,UAAkB,CAAC,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n(globalThis as any).state = (globalThis as any).state || {\n playwrightServiceEntra: null,\n customerConfig: null,\n playwrightServiceConfig: null,\n};\nexport const state: Record<string, any> = (globalThis as any).state;\n"]}
@@ -192,10 +192,6 @@ export type WorkspaceMetaData = {
192
192
  storageUri?: string;
193
193
  reporting?: string;
194
194
  };
195
- export type TenantInfo = {
196
- tenantId?: string;
197
- defaultDomain?: string;
198
- };
199
195
  export interface UploadResult {
200
196
  success: boolean;
201
197
  errorMessage?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIzD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,UAAU,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,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,KAAK,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B"}
@@ -0,0 +1,4 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }
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 { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS, SDKLanguage } from \"./constants.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport type { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Use cloud hosted browsers.\n *\n * @defaultValue `true`\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 * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n};\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n\nexport type WorkspaceMetaData = {\n id?: string;\n resourceId?: string;\n name?: string;\n state?: string;\n subscriptionId?: string;\n subscriptionState?: string;\n tenantId?: string;\n location?: string;\n regionalAffinity?: string;\n localAuth?: string;\n storageUri?: string;\n reporting?: string;\n};\n\nexport interface UploadResult {\n success: boolean;\n errorMessage?: string;\n failedFileCount?: number;\n totalFiles?: number;\n failedFiles?: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n partialSuccess?: boolean;\n}\n"]}
@@ -1,3 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
1
3
  import { dirname } from "node:path";
2
4
  import playwrightServiceEntra from "../playwrightServiceEntra.js";
3
5
  import { loadCustomerGlobalFunction } from "../../common/executor.js";
@@ -5,21 +7,19 @@ import customerConfig from "../../common/customerConfig.js";
5
7
  import { PlaywrightServiceConfig } from "../../common/playwrightServiceConfig.js";
6
8
  import { initializePlaywrightServiceTestRun } from "../initializePlaywrightServiceTestRun.js";
7
9
  const playwrightServiceGlobalSetupWrapper = async (config) => {
8
- const rootDir = config.configFile ? dirname(config.configFile) : process.cwd();
9
- let customerGlobalSetupFunc = null;
10
- if (customerConfig.globalSetup && typeof customerConfig.globalSetup === "string") {
11
- customerGlobalSetupFunc = await loadCustomerGlobalFunction(rootDir, customerConfig.globalSetup);
12
- }
13
- const serviceAuthType = PlaywrightServiceConfig.instance.serviceAuthType;
14
- if (serviceAuthType === "ENTRA_ID") {
15
- await playwrightServiceEntra.globalSetup();
16
- }
17
- await initializePlaywrightServiceTestRun(config);
18
- if (customerGlobalSetupFunc) {
19
- return customerGlobalSetupFunc(config);
20
- }
21
- };
22
- var playwright_service_global_setup_default = playwrightServiceGlobalSetupWrapper;
23
- export {
24
- playwright_service_global_setup_default as default
10
+ const rootDir = config.configFile ? dirname(config.configFile) : process.cwd();
11
+ let customerGlobalSetupFunc = null;
12
+ if (customerConfig.globalSetup && typeof customerConfig.globalSetup === "string") {
13
+ customerGlobalSetupFunc = await loadCustomerGlobalFunction(rootDir, customerConfig.globalSetup);
14
+ }
15
+ const serviceAuthType = PlaywrightServiceConfig.instance.serviceAuthType;
16
+ if (serviceAuthType === "ENTRA_ID") {
17
+ await playwrightServiceEntra.globalSetup();
18
+ }
19
+ await initializePlaywrightServiceTestRun(config);
20
+ if (customerGlobalSetupFunc) {
21
+ return customerGlobalSetupFunc(config);
22
+ }
25
23
  };
24
+ export default playwrightServiceGlobalSetupWrapper;
25
+ //# sourceMappingURL=playwright-service-global-setup.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/core/global/playwright-service-global-setup.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"node:path\";\nimport type { FullConfig } from \"@playwright/test\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra.js\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor.js\";\nimport customerConfig from \"../../common/customerConfig.js\";\nimport { PlaywrightServiceConfig } from \"../../common/playwrightServiceConfig.js\";\nimport { initializePlaywrightServiceTestRun } from \"../initializePlaywrightServiceTestRun.js\";\n\nconst playwrightServiceGlobalSetupWrapper = async (config: FullConfig): Promise<any> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n let customerGlobalSetupFunc: any = null;\n if (customerConfig.globalSetup && typeof customerConfig.globalSetup === \"string\") {\n customerGlobalSetupFunc = await loadCustomerGlobalFunction(rootDir, customerConfig.globalSetup);\n }\n const serviceAuthType = PlaywrightServiceConfig.instance.serviceAuthType;\n if (serviceAuthType === \"ENTRA_ID\") {\n await playwrightServiceEntra.globalSetup();\n }\n await initializePlaywrightServiceTestRun(config);\n if (customerGlobalSetupFunc) {\n return customerGlobalSetupFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalSetupWrapper;\n"],
5
- "mappings": "AAGA,SAAS,eAAe;AAExB,OAAO,4BAA4B;AACnC,SAAS,kCAAkC;AAC3C,OAAO,oBAAoB;AAC3B,SAAS,+BAA+B;AACxC,SAAS,0CAA0C;AAEnD,MAAM,sCAAsC,OAAO,WAAqC;AACtF,QAAM,UAAU,OAAO,aAAa,QAAQ,OAAO,UAAW,IAAI,QAAQ,IAAI;AAC9E,MAAI,0BAA+B;AACnC,MAAI,eAAe,eAAe,OAAO,eAAe,gBAAgB,UAAU;AAChF,8BAA0B,MAAM,2BAA2B,SAAS,eAAe,WAAW;AAAA,EAChG;AACA,QAAM,kBAAkB,wBAAwB,SAAS;AACzD,MAAI,oBAAoB,YAAY;AAClC,UAAM,uBAAuB,YAAY;AAAA,EAC3C;AACA,QAAM,mCAAmC,MAAM;AAC/C,MAAI,yBAAyB;AAC3B,WAAO,wBAAwB,MAAM;AAAA,EACvC;AACF;AAEA,IAAO,0CAAQ;",
6
- "names": []
7
- }
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,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,sBAAsB,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAClF,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAE9F,MAAM,mCAAmC,GAAG,KAAK,EAAE,MAAkB,EAAgB,EAAE;IACrF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAChF,IAAI,uBAAuB,GAAQ,IAAI,CAAC;IACxC,IAAI,cAAc,CAAC,WAAW,IAAI,OAAO,cAAc,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;QACjF,uBAAuB,GAAG,MAAM,0BAA0B,CAAC,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IAClG,CAAC;IACD,MAAM,eAAe,GAAG,uBAAuB,CAAC,QAAQ,CAAC,eAAe,CAAC;IACzE,IAAI,eAAe,KAAK,UAAU,EAAE,CAAC;QACnC,MAAM,sBAAsB,CAAC,WAAW,EAAE,CAAC;IAC7C,CAAC;IACD,MAAM,kCAAkC,CAAC,MAAM,CAAC,CAAC;IACjD,IAAI,uBAAuB,EAAE,CAAC;QAC5B,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;IACzC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,mCAAmC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"node:path\";\nimport type { FullConfig } from \"@playwright/test\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra.js\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor.js\";\nimport customerConfig from \"../../common/customerConfig.js\";\nimport { PlaywrightServiceConfig } from \"../../common/playwrightServiceConfig.js\";\nimport { initializePlaywrightServiceTestRun } from \"../initializePlaywrightServiceTestRun.js\";\n\nconst playwrightServiceGlobalSetupWrapper = async (config: FullConfig): Promise<any> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n let customerGlobalSetupFunc: any = null;\n if (customerConfig.globalSetup && typeof customerConfig.globalSetup === \"string\") {\n customerGlobalSetupFunc = await loadCustomerGlobalFunction(rootDir, customerConfig.globalSetup);\n }\n const serviceAuthType = PlaywrightServiceConfig.instance.serviceAuthType;\n if (serviceAuthType === \"ENTRA_ID\") {\n await playwrightServiceEntra.globalSetup();\n }\n await initializePlaywrightServiceTestRun(config);\n if (customerGlobalSetupFunc) {\n return customerGlobalSetupFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalSetupWrapper;\n"]}
@@ -1,22 +1,19 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
1
3
  import { dirname } from "node:path";
2
4
  import playwrightServiceEntra from "../playwrightServiceEntra.js";
3
5
  import { loadCustomerGlobalFunction } from "../../common/executor.js";
4
6
  import customerConfig from "../../common/customerConfig.js";
5
7
  const playwrightServiceGlobalTeardownWrapper = async (config) => {
6
- const rootDir = config.configFile ? dirname(config.configFile) : process.cwd();
7
- let customerGlobalTeardownFunc = null;
8
- if (customerConfig.globalTeardown && typeof customerConfig.globalTeardown === "string") {
9
- customerGlobalTeardownFunc = await loadCustomerGlobalFunction(
10
- rootDir,
11
- customerConfig.globalTeardown
12
- );
13
- }
14
- playwrightServiceEntra.globalTeardown();
15
- if (customerGlobalTeardownFunc) {
16
- await customerGlobalTeardownFunc(config);
17
- }
18
- };
19
- var playwright_service_global_teardown_default = playwrightServiceGlobalTeardownWrapper;
20
- export {
21
- playwright_service_global_teardown_default as default
8
+ const rootDir = config.configFile ? dirname(config.configFile) : process.cwd();
9
+ let customerGlobalTeardownFunc = null;
10
+ if (customerConfig.globalTeardown && typeof customerConfig.globalTeardown === "string") {
11
+ customerGlobalTeardownFunc = await loadCustomerGlobalFunction(rootDir, customerConfig.globalTeardown);
12
+ }
13
+ playwrightServiceEntra.globalTeardown();
14
+ if (customerGlobalTeardownFunc) {
15
+ await customerGlobalTeardownFunc(config);
16
+ }
22
17
  };
18
+ export default playwrightServiceGlobalTeardownWrapper;
19
+ //# sourceMappingURL=playwright-service-global-teardown.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/core/global/playwright-service-global-teardown.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"node:path\";\nimport type { FullConfig } from \"@playwright/test\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra.js\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor.js\";\nimport customerConfig from \"../../common/customerConfig.js\";\n\nconst playwrightServiceGlobalTeardownWrapper = async (config: FullConfig): Promise<void> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n let customerGlobalTeardownFunc: any = null;\n if (customerConfig.globalTeardown && typeof customerConfig.globalTeardown === \"string\") {\n customerGlobalTeardownFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalTeardown,\n );\n }\n playwrightServiceEntra.globalTeardown();\n if (customerGlobalTeardownFunc) {\n await customerGlobalTeardownFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalTeardownWrapper;\n"],
5
- "mappings": "AAGA,SAAS,eAAe;AAExB,OAAO,4BAA4B;AACnC,SAAS,kCAAkC;AAC3C,OAAO,oBAAoB;AAE3B,MAAM,yCAAyC,OAAO,WAAsC;AAC1F,QAAM,UAAU,OAAO,aAAa,QAAQ,OAAO,UAAW,IAAI,QAAQ,IAAI;AAC9E,MAAI,6BAAkC;AACtC,MAAI,eAAe,kBAAkB,OAAO,eAAe,mBAAmB,UAAU;AACtF,iCAA6B,MAAM;AAAA,MACjC;AAAA,MACA,eAAe;AAAA,IACjB;AAAA,EACF;AACA,yBAAuB,eAAe;AACtC,MAAI,4BAA4B;AAC9B,UAAM,2BAA2B,MAAM;AAAA,EACzC;AACF;AAEA,IAAO,6CAAQ;",
6
- "names": []
7
- }
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,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,sBAAsB,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,cAAc,MAAM,gCAAgC,CAAC;AAE5D,MAAM,sCAAsC,GAAG,KAAK,EAAE,MAAkB,EAAiB,EAAE;IACzF,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,UAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;IAChF,IAAI,0BAA0B,GAAQ,IAAI,CAAC;IAC3C,IAAI,cAAc,CAAC,cAAc,IAAI,OAAO,cAAc,CAAC,cAAc,KAAK,QAAQ,EAAE,CAAC;QACvF,0BAA0B,GAAG,MAAM,0BAA0B,CAC3D,OAAO,EACP,cAAc,CAAC,cAAc,CAC9B,CAAC;IACJ,CAAC;IACD,sBAAsB,CAAC,cAAc,EAAE,CAAC;IACxC,IAAI,0BAA0B,EAAE,CAAC;QAC/B,MAAM,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,sCAAsC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { dirname } from \"node:path\";\nimport type { FullConfig } from \"@playwright/test\";\nimport playwrightServiceEntra from \"../playwrightServiceEntra.js\";\nimport { loadCustomerGlobalFunction } from \"../../common/executor.js\";\nimport customerConfig from \"../../common/customerConfig.js\";\n\nconst playwrightServiceGlobalTeardownWrapper = async (config: FullConfig): Promise<void> => {\n const rootDir = config.configFile ? dirname(config.configFile!) : process.cwd();\n let customerGlobalTeardownFunc: any = null;\n if (customerConfig.globalTeardown && typeof customerConfig.globalTeardown === \"string\") {\n customerGlobalTeardownFunc = await loadCustomerGlobalFunction(\n rootDir,\n customerConfig.globalTeardown,\n );\n }\n playwrightServiceEntra.globalTeardown();\n if (customerGlobalTeardownFunc) {\n await customerGlobalTeardownFunc(config);\n }\n};\n\nexport default playwrightServiceGlobalTeardownWrapper;\n"]}
@@ -1,18 +1,26 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
1
3
  import { PlaywrightServiceClient } from "../utils/PlaywrightServiceClient.js";
2
4
  import { PlaywrightServiceConfig } from "../common/playwrightServiceConfig.js";
3
5
  import { getTestRunConfig } from "../utils/utils.js";
4
6
  import { CIInfoProvider } from "../utils/cIInfoProvider.js";
5
- async function initializePlaywrightServiceTestRun(config) {
6
- const playwrightServiceApiClient = new PlaywrightServiceClient();
7
- const playwrightServiceConfig = PlaywrightServiceConfig.instance;
8
- const ciConfigInfo = CIInfoProvider.getCIInfo();
9
- const testRunCreatePayload = {
10
- displayName: playwrightServiceConfig.runName === "" ? playwrightServiceConfig.runId : playwrightServiceConfig.runName,
11
- config: getTestRunConfig(config),
12
- ciConfig: ciConfigInfo
13
- };
14
- await playwrightServiceApiClient.createOrUpdateTestRun(testRunCreatePayload);
7
+ /**
8
+ * Initializes the Playwright workspaces by setting up authentication and creating a test run.
9
+ *
10
+ * @param config - The full Playwright configuration
11
+ * @returns Promise that resolves when service initialization is complete
12
+ */
13
+ export async function initializePlaywrightServiceTestRun(config) {
14
+ const playwrightServiceApiClient = new PlaywrightServiceClient();
15
+ const playwrightServiceConfig = PlaywrightServiceConfig.instance;
16
+ const ciConfigInfo = CIInfoProvider.getCIInfo();
17
+ const testRunCreatePayload = {
18
+ displayName: playwrightServiceConfig.runName === ""
19
+ ? playwrightServiceConfig.runId
20
+ : playwrightServiceConfig.runName,
21
+ config: getTestRunConfig(config),
22
+ ciConfig: ciConfigInfo,
23
+ };
24
+ await playwrightServiceApiClient.createOrUpdateTestRun(testRunCreatePayload);
15
25
  }
16
- export {
17
- initializePlaywrightServiceTestRun
18
- };
26
+ //# sourceMappingURL=initializePlaywrightServiceTestRun.js.map
@@ -1,7 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["/mnt/vss/_work/1/s/sdk/loadtesting/playwright/src/core/initializePlaywrightServiceTestRun.ts"],
4
- "sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullConfig } from \"@playwright/test\";\nimport { PlaywrightServiceClient } from \"../utils/PlaywrightServiceClient.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport { getTestRunConfig } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\n\n/**\n * Initializes the Playwright workspaces by setting up authentication and creating a test run.\n *\n * @param config - The full Playwright configuration\n * @returns Promise that resolves when service initialization is complete\n */\nexport async function initializePlaywrightServiceTestRun(config: FullConfig): Promise<void> {\n const playwrightServiceApiClient = new PlaywrightServiceClient();\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n\n const testRunCreatePayload = {\n displayName:\n playwrightServiceConfig.runName === \"\"\n ? playwrightServiceConfig.runId\n : playwrightServiceConfig.runName,\n config: getTestRunConfig(config),\n ciConfig: ciConfigInfo,\n };\n\n await playwrightServiceApiClient.createOrUpdateTestRun(testRunCreatePayload);\n}\n"],
5
- "mappings": "AAIA,SAAS,+BAA+B;AACxC,SAAS,+BAA+B;AACxC,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAQ/B,eAAsB,mCAAmC,QAAmC;AAC1F,QAAM,6BAA6B,IAAI,wBAAwB;AAC/D,QAAM,0BAA0B,wBAAwB;AACxD,QAAM,eAAe,eAAe,UAAU;AAE9C,QAAM,uBAAuB;AAAA,IAC3B,aACE,wBAAwB,YAAY,KAChC,wBAAwB,QACxB,wBAAwB;AAAA,IAC9B,QAAQ,iBAAiB,MAAM;AAAA,IAC/B,UAAU;AAAA,EACZ;AAEA,QAAM,2BAA2B,sBAAsB,oBAAoB;AAC7E;",
6
- "names": []
7
- }
1
+ {"version":3,"file":"initializePlaywrightServiceTestRun.js","sourceRoot":"","sources":["../../../src/core/initializePlaywrightServiceTestRun.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kCAAkC,CAAC,MAAkB;IACzE,MAAM,0BAA0B,GAAG,IAAI,uBAAuB,EAAE,CAAC;IACjE,MAAM,uBAAuB,GAAG,uBAAuB,CAAC,QAAQ,CAAC;IACjE,MAAM,YAAY,GAAG,cAAc,CAAC,SAAS,EAAE,CAAC;IAEhD,MAAM,oBAAoB,GAAG;QAC3B,WAAW,EACT,uBAAuB,CAAC,OAAO,KAAK,EAAE;YACpC,CAAC,CAAC,uBAAuB,CAAC,KAAK;YAC/B,CAAC,CAAC,uBAAuB,CAAC,OAAO;QACrC,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,YAAY;KACvB,CAAC;IAEF,MAAM,0BAA0B,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullConfig } from \"@playwright/test\";\nimport { PlaywrightServiceClient } from \"../utils/PlaywrightServiceClient.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport { getTestRunConfig } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\n\n/**\n * Initializes the Playwright workspaces by setting up authentication and creating a test run.\n *\n * @param config - The full Playwright configuration\n * @returns Promise that resolves when service initialization is complete\n */\nexport async function initializePlaywrightServiceTestRun(config: FullConfig): Promise<void> {\n const playwrightServiceApiClient = new PlaywrightServiceClient();\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n\n const testRunCreatePayload = {\n displayName:\n playwrightServiceConfig.runName === \"\"\n ? playwrightServiceConfig.runId\n : playwrightServiceConfig.runName,\n config: getTestRunConfig(config),\n ciConfig: ciConfigInfo,\n };\n\n await playwrightServiceApiClient.createOrUpdateTestRun(testRunCreatePayload);\n}\n"]}