@azure/playwright 1.0.1-alpha.20251231.2 → 1.0.1-alpha.20260105.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/browser/common/entraIdAccessToken.js +1 -1
  2. package/dist/browser/common/entraIdAccessToken.js.map +1 -1
  3. package/dist/browser/common/messages.d.ts +9 -1
  4. package/dist/browser/common/messages.d.ts.map +1 -1
  5. package/dist/browser/common/messages.js +26 -18
  6. package/dist/browser/common/messages.js.map +1 -1
  7. package/dist/browser/core/playwrightService.js +1 -1
  8. package/dist/browser/core/playwrightService.js.map +1 -1
  9. package/dist/browser/reporter/playwrightReporter.d.ts.map +1 -1
  10. package/dist/browser/reporter/playwrightReporter.js +21 -1
  11. package/dist/browser/reporter/playwrightReporter.js.map +1 -1
  12. package/dist/browser/utils/utils.d.ts.map +1 -1
  13. package/dist/browser/utils/utils.js +3 -4
  14. package/dist/browser/utils/utils.js.map +1 -1
  15. package/dist/commonjs/common/entraIdAccessToken.js +1 -1
  16. package/dist/commonjs/common/entraIdAccessToken.js.map +1 -1
  17. package/dist/commonjs/common/messages.d.ts +9 -1
  18. package/dist/commonjs/common/messages.d.ts.map +1 -1
  19. package/dist/commonjs/common/messages.js +26 -18
  20. package/dist/commonjs/common/messages.js.map +1 -1
  21. package/dist/commonjs/core/playwrightService.js +1 -1
  22. package/dist/commonjs/core/playwrightService.js.map +1 -1
  23. package/dist/commonjs/reporter/playwrightReporter.d.ts.map +1 -1
  24. package/dist/commonjs/reporter/playwrightReporter.js +20 -0
  25. package/dist/commonjs/reporter/playwrightReporter.js.map +1 -1
  26. package/dist/commonjs/utils/utils.d.ts.map +1 -1
  27. package/dist/commonjs/utils/utils.js +3 -4
  28. package/dist/commonjs/utils/utils.js.map +1 -1
  29. package/dist/esm/common/entraIdAccessToken.js +1 -1
  30. package/dist/esm/common/entraIdAccessToken.js.map +1 -1
  31. package/dist/esm/common/messages.d.ts +9 -1
  32. package/dist/esm/common/messages.d.ts.map +1 -1
  33. package/dist/esm/common/messages.js +26 -18
  34. package/dist/esm/common/messages.js.map +1 -1
  35. package/dist/esm/core/playwrightService.js +1 -1
  36. package/dist/esm/core/playwrightService.js.map +1 -1
  37. package/dist/esm/reporter/playwrightReporter.d.ts.map +1 -1
  38. package/dist/esm/reporter/playwrightReporter.js +21 -1
  39. package/dist/esm/reporter/playwrightReporter.js.map +1 -1
  40. package/dist/esm/utils/utils.d.ts.map +1 -1
  41. package/dist/esm/utils/utils.js +3 -4
  42. package/dist/esm/utils/utils.js.map +1 -1
  43. package/dist/react-native/common/entraIdAccessToken.js +1 -1
  44. package/dist/react-native/common/entraIdAccessToken.js.map +1 -1
  45. package/dist/react-native/common/messages.d.ts +9 -1
  46. package/dist/react-native/common/messages.d.ts.map +1 -1
  47. package/dist/react-native/common/messages.js +26 -18
  48. package/dist/react-native/common/messages.js.map +1 -1
  49. package/dist/react-native/core/playwrightService.js +1 -1
  50. package/dist/react-native/core/playwrightService.js.map +1 -1
  51. package/dist/react-native/reporter/playwrightReporter.d.ts.map +1 -1
  52. package/dist/react-native/reporter/playwrightReporter.js +21 -1
  53. package/dist/react-native/reporter/playwrightReporter.js.map +1 -1
  54. package/dist/react-native/utils/utils.d.ts.map +1 -1
  55. package/dist/react-native/utils/utils.js +3 -4
  56. package/dist/react-native/utils/utils.js.map +1 -1
  57. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"playwrightReporter.js","sourceRoot":"","sources":["../../../src/reporter/playwrightReporter.ts"],"names":[],"mappings":";;AAGA,sGAAgG;AAChG,gDAAqF;AACrF,mDAAiD;AACjD,qFAA+E;AAC/E,yDAAmF;AACnF,uDAAqE;AACrE,oFAA8E;AAG9E;;GAEG;AAEH,MAAqB,kBAAkB;IAC7B,MAAM,CAAyB;IAC/B,iBAAiB,GAA6B,IAAI,CAAC;IACnD,kBAAkB,GAAG,KAAK,CAAC;IAEnC;;;;OAIG;IAEH,KAAK,C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CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7E,OAAO,YAAY,KAAK,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,MAAM,kBAAkB,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChE,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7E,OAAO,CACL,OAAO,YAAY,KAAK,QAAQ;gBAChC,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC;gBACnC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAClC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,gCAAgC;QAChC,IAAI,iBAAiB,KAAK,CAAC,CAAC,EAAE,CAAC;YAC7B,OAAO,CAAC,KAAK,CAAC,0CAA4B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAC3E,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,OAAO;QACT,CAAC;QAED,gFAAgF;QAChF,IAAI,kBAAkB,KAAK,CAAC,CAAC,IAAI,iBAAiB,GAAG,kBAAkB,EAAE,CAAC;YACxE,OAAO,CAAC,KAAK,CAAC,0CAA4B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAC3E,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,OAAO;QACT,CAAC;QAED,sBAAU,CAAC,IAAI,CACb,oFAAoF,CACrF,CAAC;IACJ,CAAC;CACF;AA3KD,qCA2KC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { FullConfig, Reporter } from \"@playwright/test/reporter\";\nimport { PlaywrightReporterStorageManager } from \"../utils/playwrightReporterStorageManager.js\";\nimport { getHtmlReporterOutputFolder, getPortalTestRunUrl } from \"../utils/utils.js\";\nimport { coreLogger } from \"../common/logger.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport { ServiceAuth, InternalEnvironmentVariables } from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport { PlaywrightServiceClient } from \"../utils/PlaywrightServiceClient.js\";\nimport type { WorkspaceMetaData, UploadResult } from \"../common/types.js\";\n\n/**\n * Azure Playwright Reporter - Uploads generated Playwright test report folder to Azure Storage.\n */\n\nexport default class PlaywrightReporter implements Reporter {\n private config: FullConfig | undefined;\n private workspaceMetadata: WorkspaceMetaData | null = null;\n private isReportingEnabled = false;\n\n /**\n * Called when test run begins. Stores configuration for later use and validates serviceAuthType and\n * retrieves workspace metadata.\n * @param config - Playwright test configuration\n */\n\n async onBegin(config: FullConfig): Promise<void> {\n coreLogger.info(`Reporter configuration: ${JSON.stringify(config.reporter, null, 2)}`);\n\n this.config = config;\n\n // Check if using service config\n const usingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n coreLogger.info(`Using service config: ${usingServiceConfig}`);\n if (!usingServiceConfig) {\n console.error(ServiceErrorMessageConstants.REPORTER_REQUIRES_SERVICE_CONFIG.message);\n this.isReportingEnabled = false;\n return;\n }\n\n // Check if test run creation was successful\n const testRunCreationSuccess =\n process.env[InternalEnvironmentVariables.TEST_RUN_CREATION_SUCCESS] === \"true\";\n if (!testRunCreationSuccess) {\n console.error(ServiceErrorMessageConstants.REPORTING_STATUS_FAILED.message);\n console.error(ServiceErrorMessageConstants.REPORTING_TEST_RUN_FAILED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n // Check authentication\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n coreLogger.info(`Current authentication type: ${playwrightServiceConfig.serviceAuthType}`);\n const isUsingAccessToken = playwrightServiceConfig.serviceAuthType === ServiceAuth.ACCESS_TOKEN;\n if (isUsingAccessToken) {\n console.error(ServiceErrorMessageConstants.REPORTER_REQUIRES_ENTRA_AUTH.message);\n this.isReportingEnabled = false;\n return;\n }\n coreLogger.info(\"Authentication validation passed - using ENTRA_ID\");\n\n // Get workspace metadata for later use\n try {\n const playwrightServiceApiClient = new PlaywrightServiceClient();\n this.workspaceMetadata = await playwrightServiceApiClient.getWorkspaceMetadata();\n\n if (!this.workspaceMetadata?.storageUri) {\n console.error(ServiceErrorMessageConstants.WORKSPACE_REPORTING_DISABLED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n this.isReportingEnabled = true;\n\n this.validateHtmlReporterConfiguration(config);\n if (this.isReportingEnabled) {\n console.log(ServiceErrorMessageConstants.REPORTING_ENABLED.message);\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(\n `${ServiceErrorMessageConstants.WORKSPACE_METADATA_FETCH_FAILED.message}Error: ${errorMessage} `,\n );\n this.isReportingEnabled = false;\n }\n }\n\n /**\n * Called when test run ends. Uploads Playwright test report to Azure Storage if reporting is enabled.\n */\n\n async onEnd(): Promise<void> {\n if (this.isReportingEnabled) {\n console.log(ServiceErrorMessageConstants.COLLECTING_ARTIFACTS.message);\n const uploadResult = await this.uploadHtmlReport();\n\n if (uploadResult.success) {\n if (\n uploadResult.partialSuccess &&\n uploadResult.failedFileDetails &&\n uploadResult.failedFileDetails.length > 0\n ) {\n console.log(\"Warning: Failed to upload the following files:\");\n uploadResult.failedFileDetails.forEach((fileDetail) => {\n console.log(` - ${fileDetail.fileName}, ERROR: ${fileDetail.error}`);\n });\n console.log(ServiceErrorMessageConstants.REPORTING_STATUS_PARTIAL.message);\n } else {\n console.log(ServiceErrorMessageConstants.REPORTING_STATUS_SUCCESS.message);\n }\n // Display portal URL for both full and partial success\n if (this.workspaceMetadata) {\n const portalUrl = getPortalTestRunUrl(this.workspaceMetadata);\n console.log(ServiceErrorMessageConstants.TEST_REPORT_VIEW_URL.formatWithUrl(portalUrl));\n }\n } else {\n console.error(ServiceErrorMessageConstants.REPORTING_STATUS_FAILED.message);\n if (uploadResult.errorMessage) {\n console.error(`Error: ${uploadResult.errorMessage}`);\n }\n }\n }\n }\n\n private async uploadHtmlReport(): Promise<UploadResult> {\n try {\n const outputFolder = getHtmlReporterOutputFolder(this.config);\n coreLogger.info(`Resolved Playwright test report output folder: ${outputFolder}`);\n const storageManager = new PlaywrightReporterStorageManager();\n coreLogger.info(\"Starting Playwright test report upload process\");\n const uploadResult = await storageManager.uploadPlaywrightHtmlReportAfterTests(\n outputFolder,\n this.workspaceMetadata,\n );\n\n if (uploadResult.success) {\n coreLogger.info(`Playwright Test report uploaded successfully to Azure Storage.`);\n }\n return uploadResult;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n coreLogger.error(`Upload failed: ${errorMessage}`);\n return { success: false, errorMessage };\n }\n }\n\n private validateHtmlReporterConfiguration(config: FullConfig): void {\n if (!config.reporter || !Array.isArray(config.reporter)) {\n console.error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n const htmlReporterIndex = config.reporter.findIndex((reporter) => {\n const reporterName = typeof reporter === \"string\" ? reporter : reporter?.[0];\n return reporterName === \"html\";\n });\n\n const azureReporterIndex = config.reporter.findIndex((reporter) => {\n const reporterName = typeof reporter === \"string\" ? reporter : reporter?.[0];\n return (\n typeof reporterName === \"string\" &&\n reporterName.includes(\"playwright\") &&\n reporterName.includes(\"reporter\")\n );\n });\n\n // Validate HTML reporter exists\n if (htmlReporterIndex === -1) {\n console.error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n // Validate HTML reporter comes before Azure reporter (if Azure reporter exists)\n if (azureReporterIndex !== -1 && htmlReporterIndex > azureReporterIndex) {\n console.error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n coreLogger.info(\n \"HTML reporter validation passed - HTML reporter is configured and properly ordered\",\n );\n }\n}\n"]}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CAAC,CAAC,CAAC;QAEH,MAAM,kBAAkB,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE;YAChE,MAAM,YAAY,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7E,OAAO,CACL,OAAO,YAAY,KAAK,QAAQ;gBAChC,YAAY,CAAC,QAAQ,CAAC,YAAY,CAAC;gBACnC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,CAClC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,gCAAgC;QAChC,IAAI,iBAAiB,KAAK,CAAC,CAAC,EAAE,CAAC;YAC7B,OAAO,CAAC,KAAK,CAAC,0CAA4B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAC3E,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,OAAO;QACT,CAAC;QAED,gFAAgF;QAChF,IAAI,kBAAkB,KAAK,CAAC,CAAC,IAAI,iBAAiB,GAAG,kBAAkB,EAAE,CAAC;YACxE,OAAO,CAAC,KAAK,CAAC,0CAA4B,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;YAC3E,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;YAChC,OAAO;QACT,CAAC;QAED,sBAAU,CAAC,IAAI,CACb,oFAAoF,CACrF,CAAC;IACJ,CAAC;CACF;AAnMD,qCAmMC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { FullConfig, Reporter } from \"@playwright/test/reporter\";\nimport { PlaywrightReporterStorageManager } from \"../utils/playwrightReporterStorageManager.js\";\nimport {\n getHtmlReporterOutputFolder,\n getPortalTestRunUrl,\n getVersionInfo,\n} from \"../utils/utils.js\";\nimport { coreLogger } from \"../common/logger.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport { ServiceAuth, InternalEnvironmentVariables } from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport { PlaywrightServiceClient } from \"../utils/PlaywrightServiceClient.js\";\nimport { getPlaywrightVersion } from \"../utils/getPlaywrightVersion.js\";\nimport type { WorkspaceMetaData, UploadResult } from \"../common/types.js\";\n\n/**\n * Azure Playwright Reporter - Uploads generated Playwright test report folder to Azure Storage.\n */\n\nexport default class PlaywrightReporter implements Reporter {\n private config: FullConfig | undefined;\n private workspaceMetadata: WorkspaceMetaData | null = null;\n private isReportingEnabled = false;\n\n /**\n * Called when test run begins. Stores configuration for later use and validates serviceAuthType and\n * retrieves workspace metadata.\n * @param config - Playwright test configuration\n */\n\n async onBegin(config: FullConfig): Promise<void> {\n coreLogger.info(`Reporter configuration: ${JSON.stringify(config.reporter, null, 2)}`);\n\n this.config = config;\n\n // Check Playwright version for reporting feature compatibility\n try {\n const playwrightVersion = getPlaywrightVersion();\n const playwrightVersionInfo = getVersionInfo(playwrightVersion);\n\n // Check if version is < 1.57\n const isReportingSupportedVersion =\n playwrightVersionInfo.major > 1 ||\n (playwrightVersionInfo.major === 1 && playwrightVersionInfo.minor >= 57);\n\n if (!isReportingSupportedVersion) {\n console.error(\n ServiceErrorMessageConstants.PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING.message,\n );\n this.isReportingEnabled = false;\n return;\n }\n } catch (error) {\n coreLogger.error(`Failed to get Playwright version: ${error}`);\n console.error(ServiceErrorMessageConstants.PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING.message);\n this.isReportingEnabled = false;\n return;\n }\n\n // Check if using service config\n const usingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n coreLogger.info(`Using service config: ${usingServiceConfig}`);\n if (!usingServiceConfig) {\n console.error(ServiceErrorMessageConstants.REPORTER_REQUIRES_SERVICE_CONFIG.message);\n this.isReportingEnabled = false;\n return;\n }\n\n // Check if test run creation was successful\n const testRunCreationSuccess =\n process.env[InternalEnvironmentVariables.TEST_RUN_CREATION_SUCCESS] === \"true\";\n if (!testRunCreationSuccess) {\n console.error(ServiceErrorMessageConstants.REPORTING_STATUS_FAILED.message);\n console.error(ServiceErrorMessageConstants.REPORTING_TEST_RUN_FAILED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n // Check authentication\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n coreLogger.info(`Current authentication type: ${playwrightServiceConfig.serviceAuthType}`);\n const isUsingAccessToken = playwrightServiceConfig.serviceAuthType === ServiceAuth.ACCESS_TOKEN;\n if (isUsingAccessToken) {\n console.error(ServiceErrorMessageConstants.REPORTER_REQUIRES_ENTRA_AUTH.message);\n this.isReportingEnabled = false;\n return;\n }\n coreLogger.info(\"Authentication validation passed - using ENTRA_ID\");\n\n // Get workspace metadata for later use\n try {\n const playwrightServiceApiClient = new PlaywrightServiceClient();\n this.workspaceMetadata = await playwrightServiceApiClient.getWorkspaceMetadata();\n\n if (!this.workspaceMetadata?.storageUri) {\n console.error(ServiceErrorMessageConstants.WORKSPACE_REPORTING_DISABLED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n this.isReportingEnabled = true;\n\n this.validateHtmlReporterConfiguration(config);\n if (this.isReportingEnabled) {\n console.log(ServiceErrorMessageConstants.REPORTING_ENABLED.message);\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n console.error(\n `${ServiceErrorMessageConstants.WORKSPACE_METADATA_FETCH_FAILED.message}Error: ${errorMessage} `,\n );\n this.isReportingEnabled = false;\n }\n }\n\n /**\n * Called when test run ends. Uploads Playwright test report to Azure Storage if reporting is enabled.\n */\n\n async onEnd(): Promise<void> {\n if (this.isReportingEnabled) {\n console.log(ServiceErrorMessageConstants.COLLECTING_ARTIFACTS.message);\n const uploadResult = await this.uploadHtmlReport();\n\n if (uploadResult.success) {\n if (\n uploadResult.partialSuccess &&\n uploadResult.failedFileDetails &&\n uploadResult.failedFileDetails.length > 0\n ) {\n console.log(\"Warning: Failed to upload the following files:\");\n uploadResult.failedFileDetails.forEach((fileDetail) => {\n console.log(` - ${fileDetail.fileName}, ERROR: ${fileDetail.error}`);\n });\n console.log(ServiceErrorMessageConstants.REPORTING_STATUS_PARTIAL.message);\n } else {\n console.log(ServiceErrorMessageConstants.REPORTING_STATUS_SUCCESS.message);\n }\n // Display portal URL for both full and partial success\n if (this.workspaceMetadata) {\n const portalUrl = getPortalTestRunUrl(this.workspaceMetadata);\n console.log(ServiceErrorMessageConstants.TEST_REPORT_VIEW_URL.formatWithUrl(portalUrl));\n }\n } else {\n console.error(ServiceErrorMessageConstants.REPORTING_STATUS_FAILED.message);\n if (uploadResult.errorMessage) {\n console.error(`Error: ${uploadResult.errorMessage}`);\n }\n }\n }\n }\n\n private async uploadHtmlReport(): Promise<UploadResult> {\n try {\n const outputFolder = getHtmlReporterOutputFolder(this.config);\n coreLogger.info(`Resolved Playwright test report output folder: ${outputFolder}`);\n const storageManager = new PlaywrightReporterStorageManager();\n coreLogger.info(\"Starting Playwright test report upload process\");\n const uploadResult = await storageManager.uploadPlaywrightHtmlReportAfterTests(\n outputFolder,\n this.workspaceMetadata,\n );\n\n if (uploadResult.success) {\n coreLogger.info(`Playwright Test report uploaded successfully to Azure Storage.`);\n }\n return uploadResult;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n coreLogger.error(`Upload failed: ${errorMessage}`);\n return { success: false, errorMessage };\n }\n }\n\n private validateHtmlReporterConfiguration(config: FullConfig): void {\n if (!config.reporter || !Array.isArray(config.reporter)) {\n console.error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n const htmlReporterIndex = config.reporter.findIndex((reporter) => {\n const reporterName = typeof reporter === \"string\" ? reporter : reporter?.[0];\n return reporterName === \"html\";\n });\n\n const azureReporterIndex = config.reporter.findIndex((reporter) => {\n const reporterName = typeof reporter === \"string\" ? reporter : reporter?.[0];\n return (\n typeof reporterName === \"string\" &&\n reporterName.includes(\"playwright\") &&\n reporterName.includes(\"reporter\")\n );\n });\n\n // Validate HTML reporter exists\n if (htmlReporterIndex === -1) {\n console.error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n // Validate HTML reporter comes before Azure reporter (if Azure reporter exists)\n if (azureReporterIndex !== -1 && htmlReporterIndex > azureReporterIndex) {\n console.error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n coreLogger.info(\n \"HTML reporter validation passed - HTML reporter is configured and properly ordered\",\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,WAAW,EAEX,SAAS,EACT,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAU5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAgB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAQ3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,eAAO,MAAM,iBAAiB,QAAO,MAapC,CAAC;AAIF,eAAO,MAAM,sBAAsB,GACjC,OAAO;IACL,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3D,EACD,eAAe,MAAM,KACpB,KAUF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,OAAO;IACL,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,CAAC,EAAE,CA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iBAAiB,GAAG,IAAI,GAAG,MAAM,CAoBvF;AAED,eAAO,MAAM,4BAA4B,GAAI,YAAY,MAAM,KAAG,MAAM,GAAG,IAqB1E,CAAC"}
@@ -48,7 +48,6 @@ const getPackageVersion = () => {
48
48
  return "unknown-version";
49
49
  };
50
50
  exports.getPackageVersion = getPackageVersion;
51
- // const playwrightServiceConfig = new PlaywrightServiceConfig();
52
51
  const exitWithFailureMessage = (error, errorDetails) => {
53
52
  console.log();
54
53
  if (error.formatWithErrorDetails && errorDetails) {
@@ -131,7 +130,7 @@ const validateMptPAT = (validationFailureCallback) => {
131
130
  const accessToken = (0, exports.getAccessToken)();
132
131
  const result = (0, exports.populateValuesFromServiceUrl)();
133
132
  if (!accessToken) {
134
- validationFailureCallback(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR);
133
+ validationFailureCallback(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN);
135
134
  }
136
135
  const claims = (0, parseJwt_js_1.parseJwt)(accessToken);
137
136
  if (!claims.exp) {
@@ -162,7 +161,7 @@ const warnAboutTokenExpiry = (expirationTime, currentTime) => {
162
161
  const warnIfAccessTokenCloseToExpiry = () => {
163
162
  const accessToken = (0, exports.getAccessToken)();
164
163
  if (!accessToken) {
165
- throw new Error(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR.message);
164
+ throw new Error(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN.message);
166
165
  }
167
166
  const claims = (0, parseJwt_js_1.parseJwt)(accessToken);
168
167
  const currentTime = Date.now();
@@ -179,7 +178,7 @@ const fetchOrValidateAccessToken = async (credential) => {
179
178
  }
180
179
  const token = (0, exports.getAccessToken)();
181
180
  if (!token) {
182
- throw new Error(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR.message);
181
+ throw new Error(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR_ENTRA_TOKEN.message);
183
182
  }
184
183
  return token;
185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ccessTokenClaims,\n VersionInfo,\n JwtPayload,\n RunConfig,\n WorkspaceMetaData,\n} from \"../common/types.js\";\nimport {\n Constants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n RunConfigConstants,\n GitHubActionsConstants,\n} from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport { coreLogger } from \"../common/logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport process from \"node:process\";\nimport { randomUUID } from \"node:crypto\";\nimport { parseJwt } from \"./parseJwt.js\";\nimport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nimport { createEntraIdAccessToken } from \"../common/entraIdAccessToken.js\";\nimport { FullConfig } from \"@playwright/test\";\nimport { CI_PROVIDERS, CIInfo } from \"./cIInfoProvider.js\";\nimport { exec } from \"child_process\";\nimport { getPackageVersionFromFolder } from \"./getPackageVersion.js\";\nimport { readdirSync, statSync } from \"fs\";\nimport { join, relative } from \"path\";\nimport { UploadConstants } from \"../common/constants.js\";\n\n// Re-exporting for backward compatibility\nexport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nexport { parseJwt } from \"./parseJwt.js\";\n\nexport const getPackageVersion = (): string => {\n // hacky way to get package version\n // try from dist folder first (customer perspective)\n const distVersion = getPackageVersionFromFolder(\"../../../\");\n if (distVersion) {\n return distVersion;\n }\n // if not found, try from src folder (internal test suite)\n const srcVersion = getPackageVersionFromFolder(\"../../\");\n if (srcVersion) {\n return srcVersion;\n }\n return \"unknown-version\";\n};\n\n// const playwrightServiceConfig = new PlaywrightServiceConfig();\n\nexport const exitWithFailureMessage = (\n error: {\n key: string;\n message: string;\n formatWithErrorDetails?: (errorDetails: string) => string;\n },\n errorDetails?: string,\n): never => {\n console.log();\n\n if (error.formatWithErrorDetails && errorDetails) {\n console.error(error.formatWithErrorDetails(errorDetails));\n } else {\n console.error(error.message);\n }\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n};\n\nexport const throwErrorWithFailureMessage = (\n error: {\n key: string;\n message: string;\n formatWithErrorDetails?: (errorDetails: string) => string;\n },\n errorDetails?: string,\n): never => {\n console.log();\n\n const finalMessage =\n error.formatWithErrorDetails && errorDetails\n ? error.formatWithErrorDetails(errorDetails)\n : error.message;\n\n throw new Error(finalMessage);\n};\n\nexport const populateValuesFromServiceUrl = (): {\n region: string;\n domain: string;\n accountId: string;\n} | null => {\n // Service URL format: wss://<region>.api.playwright.microsoft.com/accounts/<workspace-id>/browsers\n const url = process.env[\"PLAYWRIGHT_SERVICE_URL\"]!;\n if (url) {\n const parts = url.split(\"/\");\n\n if (parts.length > 2) {\n const subdomainParts = parts[2]!.split(\".\");\n const region = subdomainParts.length > 0 ? subdomainParts[0] : null;\n const domain = subdomainParts.slice(2).join(\".\");\n const accountId = parts[4];\n\n return { region: region!, domain: domain!, accountId: accountId! };\n }\n }\n return null;\n};\n\nexport const getAccessToken = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n};\n\nexport const getServiceBaseURL = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_URL];\n};\n\nexport const isValidGuid = (guid: string | null | undefined): boolean => {\n if (!guid) {\n return false;\n }\n const guidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n return guidRegex.test(guid);\n};\n\nexport const getAndSetRunId = (): string => {\n const runId = randomUUID();\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = runId;\n return runId;\n};\n\nexport const getServiceWSEndpoint = (runId: string, os: string, apiVersion: string): string => {\n return `${getServiceBaseURL()}?runId=${encodeURIComponent(runId)}&os=${os}&api-version=${apiVersion}`;\n};\n\nexport const validateServiceUrl = (): void => {\n const serviceUrl = getServiceBaseURL();\n if (!serviceUrl) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n};\n\nexport const ValidateRunID = (runID: string): void => {\n const isValidRunID = isValidGuid(runID);\n if (!isValidRunID) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_RUN_ID_FORMAT.message;\n throw new Error(errorMessage);\n }\n};\nexport const validateMptPAT = (\n validationFailureCallback: (error: { key: string; message: string }) => void,\n): void => {\n try {\n const accessToken = getAccessToken();\n const result = populateValuesFromServiceUrl();\n if (!accessToken) {\n validationFailureCallback(ServiceErrorMessageConstants.NO_AUTH_ERROR);\n }\n const claims = parseJwt<Partial<AccessTokenClaims>>(accessToken!);\n if (!claims.exp) {\n validationFailureCallback(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n if (Date.now() >= claims.exp! * 1000) {\n validationFailureCallback(ServiceErrorMessageConstants.EXPIRED_MPT_PAT_ERROR);\n }\n if (result!.accountId !== claims!.pwid) {\n validationFailureCallback(ServiceErrorMessageConstants.WORKSPACE_MISMATCH_ERROR);\n }\n } catch (err) {\n coreLogger.error(err);\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n};\nconst isTokenExpiringSoon = (expirationTime: number, currentTime: number): boolean => {\n return expirationTime * 1000 - currentTime <= Constants.SevenDaysInMS;\n};\n\nconst warnAboutTokenExpiry = (expirationTime: number, currentTime: number): void => {\n const daysToExpiration = Math.ceil((expirationTime * 1000 - currentTime) / Constants.OneDayInMS);\n const expirationDate = new Date(expirationTime * 1000).toLocaleDateString();\n const expirationWarning = `Warning: The access token used for this test run will expire in ${daysToExpiration} days on ${expirationDate}. Generate a new token from the portal to avoid failures. For a simpler, more secure solution, switch to Microsoft Entra ID and eliminate token management. https://learn.microsoft.com/entra/identity/`;\n console.warn(expirationWarning);\n};\n\nexport const warnIfAccessTokenCloseToExpiry = (): void => {\n const accessToken = getAccessToken();\n if (!accessToken) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);\n }\n const claims = parseJwt<JwtPayload>(accessToken!);\n const currentTime = Date.now();\n if (isTokenExpiringSoon(claims.exp!, currentTime)) {\n warnAboutTokenExpiry(claims.exp!, currentTime);\n }\n};\n\nexport const fetchOrValidateAccessToken = async (credential?: TokenCredential): Promise<string> => {\n const entraIdAccessToken = createEntraIdAccessToken(credential);\n // Fetch a token or refresh if needed in a single call\n if (entraIdAccessToken.doesEntraIdAccessTokenNeedRotation()) {\n await entraIdAccessToken.fetchEntraIdAccessToken();\n }\n const token = getAccessToken();\n if (!token) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);\n }\n return token;\n};\n\nexport const getVersionInfo = (version: string): VersionInfo => {\n const regex = /^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?/;\n const match = version.match(regex);\n const versionInfo = {\n major: 0,\n minor: 0,\n patch: 0,\n };\n versionInfo.major = match && match[1] ? parseInt(match[1], 10) : 0;\n versionInfo.minor = match && match[2] ? parseInt(match[2], 10) : 0;\n versionInfo.patch = match && match[3] ? parseInt(match[3], 10) : 0;\n return versionInfo;\n};\n\nexport const validatePlaywrightVersion = (): void => {\n const minimumSupportedVersion = Constants.MinimumSupportedPlaywrightVersion;\n const installedVersion = getPlaywrightVersion();\n\n const minimumSupportedVersionInfo = getVersionInfo(minimumSupportedVersion);\n const installedVersionInfo = getVersionInfo(installedVersion);\n\n const isInstalledVersionGreater =\n installedVersionInfo.major > minimumSupportedVersionInfo.major ||\n (installedVersionInfo.major === minimumSupportedVersionInfo.major &&\n installedVersionInfo.minor >= minimumSupportedVersionInfo.minor);\n if (!isInstalledVersionGreater) {\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_PLAYWRIGHT_VERSION_ERROR);\n }\n};\n\nexport const getTestRunConfig = (config: FullConfig): RunConfig => {\n const maxWorkers = config.workers || config.metadata.actualWorkers;\n const frameWorkVersion = config.version;\n\n const testRunConfig: RunConfig = {\n framework: {\n name: RunConfigConstants.TEST_FRAMEWORK_NAME,\n version: frameWorkVersion,\n runnerName: RunConfigConstants.TEST_FRAMEWORK_RUNNERNAME,\n },\n sdkLanguage: RunConfigConstants.TEST_SDK_LANGUAGE,\n maxWorkers: maxWorkers,\n };\n return testRunConfig;\n};\n\nexport function getTestRunApiUrl(): string {\n const result = populateValuesFromServiceUrl();\n const runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID];\n\n if (!result?.region || !result?.domain || !result?.accountId) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n const baseUrl = `https://${result?.region}.reporting.api.${result?.domain}/playwrightworkspaces/${result?.accountId}/test-runs`;\n const url = runId ? `${baseUrl}/${runId}` : baseUrl;\n\n return `${url}?api-version=${Constants.LatestAPIVersion}`;\n}\n\nexport function isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n}\n\nasync function runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n}\n\nexport async function getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.providerName === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n try {\n const gitVersion = await runCommand(GitHubActionsConstants.GIT_VERSION_COMMAND);\n if (isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await runCommand(GitHubActionsConstants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n const gitCommitMessage = await runCommand(GitHubActionsConstants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n coreLogger.error(`Error in getting git commit message: ${err}.`);\n return \"\";\n }\n}\n\nexport function extractErrorMessage(responseBody: string): string {\n if (!responseBody) {\n return \"\";\n }\n\n try {\n const errorResponse = JSON.parse(responseBody);\n if (errorResponse.error && errorResponse.error.message) {\n return errorResponse.error.message;\n }\n return responseBody;\n } catch (e) {\n return responseBody;\n }\n}\n\nexport function getWorkspaceMetaDataApiUrl(): string {\n const result = populateValuesFromServiceUrl();\n\n if (!result?.region || !result?.domain || !result?.accountId) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n const baseUrl = `https://${result?.region}.api.${result?.domain}/playwrightworkspaces/${result?.accountId}`;\n\n return `${baseUrl}?api-version=${Constants.LatestAPIVersion}`;\n}\n\nexport function getHtmlReporterOutputFolder(config: FullConfig | undefined): string {\n const defaultFolder = \"playwright-report\";\n\n if (!config?.reporter) {\n return defaultFolder;\n }\n\n for (const reporter of config.reporter) {\n if (Array.isArray(reporter)) {\n const [reporterName, options] = reporter;\n if (reporterName === \"html\" && options && typeof options === \"object\") {\n return (options as any).outputFolder || defaultFolder;\n }\n } else if (typeof reporter === \"string\" && reporter === \"html\") {\n return defaultFolder;\n }\n }\n\n return defaultFolder;\n}\n\nexport function getContentType(filePath: string): string {\n const ext = filePath.toLowerCase().split(\".\").pop();\n\n const contentTypes: { [key: string]: string } = {\n html: \"text/html\",\n css: \"text/css\",\n js: \"application/javascript\",\n json: \"application/json\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n svg: \"image/svg+xml\",\n ico: \"image/x-icon\",\n txt: \"text/plain\",\n ttf: \"font/ttf\",\n woff: \"font/woff\",\n woff2: \"font/woff2\",\n webmanifest: \"application/manifest+json\",\n map: \"application/json\",\n xml: \"application/xml\",\n pdf: \"application/pdf\",\n zip: \"application/zip\",\n };\n\n return contentTypes[ext || \"\"] || \"application/octet-stream\";\n}\n\nexport function calculateOptimalConcurrency(files: Array<{ size: number }>): number {\n const totalFiles = files.length;\n const totalSize = files.reduce((sum, f) => sum + f.size, 0);\n const avgFileSize = totalSize / totalFiles;\n\n let optimalConcurrency: number;\n\n if (totalFiles <= 10) {\n optimalConcurrency = Math.min(totalFiles, 10);\n } else if (avgFileSize < UploadConstants.SMALL_FILE_THRESHOLD) {\n optimalConcurrency = Math.min(\n UploadConstants.MAX_CONCURRENCY,\n Math.max(UploadConstants.BASE_CONCURRENCY, totalFiles / 50),\n );\n } else if (totalFiles > 1000) {\n optimalConcurrency = Math.min(\n UploadConstants.MAX_CONCURRENCY,\n UploadConstants.BASE_CONCURRENCY + Math.floor(totalFiles / 200),\n );\n } else {\n optimalConcurrency = Math.min(\n UploadConstants.MAX_CONCURRENCY,\n UploadConstants.BASE_CONCURRENCY,\n );\n }\n\n return Math.floor(optimalConcurrency);\n}\n\nexport function collectAllFiles(\n folderPath: string,\n basePath: string,\n runIdFolderPrefix?: string,\n): Array<{\n fullPath: string;\n relativePath: string;\n size: number;\n contentType: string;\n}> {\n const files: Array<{\n fullPath: string;\n relativePath: string;\n size: number;\n contentType: string;\n }> = [];\n\n const stack = [folderPath];\n\n while (stack.length > 0) {\n const currentPath = stack.pop()!;\n\n try {\n const items = readdirSync(currentPath);\n\n for (const item of items) {\n const itemPath = join(currentPath, item);\n const stats = statSync(itemPath);\n\n if (stats.isDirectory()) {\n stack.push(itemPath);\n } else {\n let relativePath = relative(basePath, itemPath).split(\"\\\\\").join(\"/\");\n\n if (runIdFolderPrefix) {\n relativePath = `${runIdFolderPrefix}/${relativePath}`;\n }\n\n files.push({\n fullPath: itemPath,\n relativePath,\n size: stats.size,\n contentType: getContentType(itemPath),\n });\n }\n }\n } catch (error) {\n continue;\n }\n }\n\n return files;\n}\n\nexport function getPortalTestRunUrl(workspaceMetadata: WorkspaceMetaData | null): string {\n const { subscriptionId, resourceId, name } = workspaceMetadata ?? {};\n if (!subscriptionId || !resourceId || !name) {\n throw new Error(\n \"Missing required workspace metadata: subscriptionId, resourceId, and name are required\",\n );\n }\n\n // Extract resource group from resourceId\n const resourceIdParts = resourceId.split(\"/\");\n const resourceGroupIndex = resourceIdParts.findIndex(\n (part) => part.toLowerCase() === \"resourcegroups\",\n );\n\n if (resourceGroupIndex === -1 || resourceGroupIndex + 1 >= resourceIdParts.length) {\n throw new Error(\"Invalid resourceId format: could not extract resource group name\");\n }\n\n const resourceGroupName = resourceIdParts[resourceGroupIndex + 1];\n return `https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/${encodeURIComponent(subscriptionId)}/resourceGroups/${encodeURIComponent(resourceGroupName)}/providers/Microsoft.LoadTestService/playwrightWorkspaces/${encodeURIComponent(name)}/TestRuns`;\n}\n\nexport const getStorageAccountNameFromUri = (storageUri: string): string | null => {\n try {\n if (!storageUri || typeof storageUri !== \"string\") {\n return null;\n }\n\n const url = new URL(storageUri);\n const hostname = url.hostname;\n\n // Extract storage account name from hostname pattern: {accountname}.blob.core.windows.net\n const match = hostname.match(/^([^.]+)\\.blob\\.core\\.windows\\.net$/i);\n\n if (match && match[1]) {\n return match[1];\n }\n\n return null;\n } catch (error) {\n console.warn(\"Failed to extract storage account name from URI:\", storageUri, error);\n return null;\n }\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAgQlC,4CAWC;AAED,sCAEC;AAkBD,gCAyBC;AAED,kDAcC;AAED,gEASC;AAED,kEAmBC;AAED,wCAyBC;AAED,kEA2BC;AAED,0CAoDC;AAED,kDAoBC;;AAreD,yDAMgC;AAChC,uDAAqE;AACrE,mDAAiD;AAEjD,wEAAmC;AACnC,6CAAyC;AACzC,+CAAyC;AACzC,uEAAiE;AACjE,2EAA2E;AAE3E,2DAA2D;AAC3D,iDAAqC;AACrC,iEAAqE;AACrE,2BAA2C;AAC3C,+BAAsC;AACtC,yDAAyD;AAEzD,0CAA0C;AAC1C,qE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CAAC,UAAkB,EAAiB,EAAE;IAChF,IAAI,CAAC;QACH,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YAClD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;QAChC,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAE9B,0FAA0F;QAC1F,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAErE,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACtB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,kDAAkD,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QACpF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AArBW,QAAA,4BAA4B,gCAqBvC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n AccessTokenClaims,\n VersionInfo,\n JwtPayload,\n RunConfig,\n WorkspaceMetaData,\n} from \"../common/types.js\";\nimport {\n Constants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n RunConfigConstants,\n GitHubActionsConstants,\n} from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport { coreLogger } from \"../common/logger.js\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport process from \"node:process\";\nimport { randomUUID } from \"node:crypto\";\nimport { parseJwt } from \"./parseJwt.js\";\nimport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nimport { createEntraIdAccessToken } from \"../common/entraIdAccessToken.js\";\nimport { FullConfig } from \"@playwright/test\";\nimport { CI_PROVIDERS, CIInfo } from \"./cIInfoProvider.js\";\nimport { exec } from \"child_process\";\nimport { getPackageVersionFromFolder } from \"./getPackageVersion.js\";\nimport { readdirSync, statSync } from \"fs\";\nimport { join, relative } from \"path\";\nimport { UploadConstants } from \"../common/constants.js\";\n\n// Re-exporting for backward compatibility\nexport { getPlaywrightVersion } from \"./getPlaywrightVersion.js\";\nexport { parseJwt } from \"./parseJwt.js\";\n\nexport const getPackageVersion = (): string => {\n // hacky way to get package version\n // try from dist folder first (customer perspective)\n const distVersion = getPackageVersionFromFolder(\"../../../\");\n if (distVersion) {\n return distVersion;\n }\n // if not found, try from src folder (internal test suite)\n const srcVersion = getPackageVersionFromFolder(\"../../\");\n if (srcVersion) {\n return srcVersion;\n }\n return \"unknown-version\";\n};\n\nexport const exitWithFailureMessage = (\n error: {\n key: string;\n message: string;\n formatWithErrorDetails?: (errorDetails: string) => string;\n },\n errorDetails?: string,\n): never => {\n console.log();\n\n if (error.formatWithErrorDetails && errorDetails) {\n console.error(error.formatWithErrorDetails(errorDetails));\n } else {\n console.error(error.message);\n }\n // eslint-disable-next-line n/no-process-exit\n process.exit(1);\n};\n\nexport const throwErrorWithFailureMessage = (\n error: {\n key: string;\n message: string;\n formatWithErrorDetails?: (errorDetails: string) => string;\n },\n errorDetails?: string,\n): never => {\n console.log();\n\n const finalMessage =\n error.formatWithErrorDetails && errorDetails\n ? error.formatWithErrorDetails(errorDetails)\n : error.message;\n\n throw new Error(finalMessage);\n};\n\nexport const populateValuesFromServiceUrl = (): {\n region: string;\n domain: string;\n accountId: string;\n} | null => {\n // Service URL format: wss://<region>.api.playwright.microsoft.com/accounts/<workspace-id>/browsers\n const url = process.env[\"PLAYWRIGHT_SERVICE_URL\"]!;\n if (url) {\n const parts = url.split(\"/\");\n\n if (parts.length > 2) {\n const subdomainParts = parts[2]!.split(\".\");\n const region = subdomainParts.length > 0 ? subdomainParts[0] : null;\n const domain = subdomainParts.slice(2).join(\".\");\n const accountId = parts[4];\n\n return { region: region!, domain: domain!, accountId: accountId! };\n }\n }\n return null;\n};\n\nexport const getAccessToken = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n};\n\nexport const getServiceBaseURL = (): string | undefined => {\n return process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_URL];\n};\n\nexport const isValidGuid = (guid: string | null | undefined): boolean => {\n if (!guid) {\n return false;\n }\n const guidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;\n return guidRegex.test(guid);\n};\n\nexport const getAndSetRunId = (): string => {\n const runId = randomUUID();\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = runId;\n return runId;\n};\n\nexport const getServiceWSEndpoint = (runId: string, os: string, apiVersion: string): string => {\n return `${getServiceBaseURL()}?runId=${encodeURIComponent(runId)}&os=${os}&api-version=${apiVersion}`;\n};\n\nexport const validateServiceUrl = (): void => {\n const serviceUrl = getServiceBaseURL();\n if (!serviceUrl) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n};\n\nexport const ValidateRunID = (runID: string): void => {\n const isValidRunID = isValidGuid(runID);\n if (!isValidRunID) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_RUN_ID_FORMAT.message;\n throw new Error(errorMessage);\n }\n};\nexport const validateMptPAT = (\n validationFailureCallback: (error: { key: string; message: string }) => void,\n): void => {\n try {\n const accessToken = getAccessToken();\n const result = populateValuesFromServiceUrl();\n if (!accessToken) {\n validationFailureCallback(ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN);\n }\n const claims = parseJwt<Partial<AccessTokenClaims>>(accessToken!);\n if (!claims.exp) {\n validationFailureCallback(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n if (Date.now() >= claims.exp! * 1000) {\n validationFailureCallback(ServiceErrorMessageConstants.EXPIRED_MPT_PAT_ERROR);\n }\n if (result!.accountId !== claims!.pwid) {\n validationFailureCallback(ServiceErrorMessageConstants.WORKSPACE_MISMATCH_ERROR);\n }\n } catch (err) {\n coreLogger.error(err);\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_MPT_PAT_ERROR);\n }\n};\nconst isTokenExpiringSoon = (expirationTime: number, currentTime: number): boolean => {\n return expirationTime * 1000 - currentTime <= Constants.SevenDaysInMS;\n};\n\nconst warnAboutTokenExpiry = (expirationTime: number, currentTime: number): void => {\n const daysToExpiration = Math.ceil((expirationTime * 1000 - currentTime) / Constants.OneDayInMS);\n const expirationDate = new Date(expirationTime * 1000).toLocaleDateString();\n const expirationWarning = `Warning: The access token used for this test run will expire in ${daysToExpiration} days on ${expirationDate}. Generate a new token from the portal to avoid failures. For a simpler, more secure solution, switch to Microsoft Entra ID and eliminate token management. https://learn.microsoft.com/entra/identity/`;\n console.warn(expirationWarning);\n};\n\nexport const warnIfAccessTokenCloseToExpiry = (): void => {\n const accessToken = getAccessToken();\n if (!accessToken) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN.message);\n }\n const claims = parseJwt<JwtPayload>(accessToken!);\n const currentTime = Date.now();\n if (isTokenExpiringSoon(claims.exp!, currentTime)) {\n warnAboutTokenExpiry(claims.exp!, currentTime);\n }\n};\n\nexport const fetchOrValidateAccessToken = async (credential?: TokenCredential): Promise<string> => {\n const entraIdAccessToken = createEntraIdAccessToken(credential);\n // Fetch a token or refresh if needed in a single call\n if (entraIdAccessToken.doesEntraIdAccessTokenNeedRotation()) {\n await entraIdAccessToken.fetchEntraIdAccessToken();\n }\n const token = getAccessToken();\n if (!token) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_ENTRA_TOKEN.message);\n }\n return token;\n};\n\nexport const getVersionInfo = (version: string): VersionInfo => {\n const regex = /^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?/;\n const match = version.match(regex);\n const versionInfo = {\n major: 0,\n minor: 0,\n patch: 0,\n };\n versionInfo.major = match && match[1] ? parseInt(match[1], 10) : 0;\n versionInfo.minor = match && match[2] ? parseInt(match[2], 10) : 0;\n versionInfo.patch = match && match[3] ? parseInt(match[3], 10) : 0;\n return versionInfo;\n};\n\nexport const validatePlaywrightVersion = (): void => {\n const minimumSupportedVersion = Constants.MinimumSupportedPlaywrightVersion;\n const installedVersion = getPlaywrightVersion();\n\n const minimumSupportedVersionInfo = getVersionInfo(minimumSupportedVersion);\n const installedVersionInfo = getVersionInfo(installedVersion);\n\n const isInstalledVersionGreater =\n installedVersionInfo.major > minimumSupportedVersionInfo.major ||\n (installedVersionInfo.major === minimumSupportedVersionInfo.major &&\n installedVersionInfo.minor >= minimumSupportedVersionInfo.minor);\n if (!isInstalledVersionGreater) {\n exitWithFailureMessage(ServiceErrorMessageConstants.INVALID_PLAYWRIGHT_VERSION_ERROR);\n }\n};\n\nexport const getTestRunConfig = (config: FullConfig): RunConfig => {\n const maxWorkers = config.workers || config.metadata.actualWorkers;\n const frameWorkVersion = config.version;\n\n const testRunConfig: RunConfig = {\n framework: {\n name: RunConfigConstants.TEST_FRAMEWORK_NAME,\n version: frameWorkVersion,\n runnerName: RunConfigConstants.TEST_FRAMEWORK_RUNNERNAME,\n },\n sdkLanguage: RunConfigConstants.TEST_SDK_LANGUAGE,\n maxWorkers: maxWorkers,\n };\n return testRunConfig;\n};\n\nexport function getTestRunApiUrl(): string {\n const result = populateValuesFromServiceUrl();\n const runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID];\n\n if (!result?.region || !result?.domain || !result?.accountId) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n const baseUrl = `https://${result?.region}.reporting.api.${result?.domain}/playwrightworkspaces/${result?.accountId}/test-runs`;\n const url = runId ? `${baseUrl}/${runId}` : baseUrl;\n\n return `${url}?api-version=${Constants.LatestAPIVersion}`;\n}\n\nexport function isNullOrEmpty(str: string | null | undefined): boolean {\n return !str || str.trim() === \"\";\n}\n\nasync function runCommand(command: string): Promise<string> {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error);\n return;\n }\n if (stderr) {\n reject(new Error(stderr));\n return;\n }\n resolve(stdout.trim());\n });\n });\n}\n\nexport async function getRunName(ciInfo: CIInfo): Promise<string> {\n if (\n ciInfo.providerName === CI_PROVIDERS.GITHUB &&\n process.env[\"GITHUB_EVENT_NAME\"] === \"pull_request\"\n ) {\n const prNumber: string = `${process.env[\"GITHUB_REF_NAME\"]?.split(\"/\")[0]}`;\n const prLink: string = `${process.env[\"GITHUB_REPOSITORY\"]}/pull/${prNumber}`;\n return `PR# ${prNumber} on Repo: ${process.env[\"GITHUB_REPOSITORY\"]} (${prLink})`;\n }\n\n try {\n const gitVersion = await runCommand(GitHubActionsConstants.GIT_VERSION_COMMAND);\n if (isNullOrEmpty(gitVersion)) {\n throw new Error(\"Git is not installed on the machine\");\n }\n const isInsideWorkTree = await runCommand(GitHubActionsConstants.GIT_REV_PARSE);\n if (isInsideWorkTree !== \"true\") {\n throw new Error(\"Not inside a git repository\");\n }\n const gitCommitMessage = await runCommand(GitHubActionsConstants.GIT_COMMIT_MESSAGE_COMMAND);\n return gitCommitMessage;\n } catch (err) {\n coreLogger.error(`Error in getting git commit message: ${err}.`);\n return \"\";\n }\n}\n\nexport function extractErrorMessage(responseBody: string): string {\n if (!responseBody) {\n return \"\";\n }\n\n try {\n const errorResponse = JSON.parse(responseBody);\n if (errorResponse.error && errorResponse.error.message) {\n return errorResponse.error.message;\n }\n return responseBody;\n } catch (e) {\n return responseBody;\n }\n}\n\nexport function getWorkspaceMetaDataApiUrl(): string {\n const result = populateValuesFromServiceUrl();\n\n if (!result?.region || !result?.domain || !result?.accountId) {\n exitWithFailureMessage(ServiceErrorMessageConstants.NO_SERVICE_URL_ERROR);\n }\n const baseUrl = `https://${result?.region}.api.${result?.domain}/playwrightworkspaces/${result?.accountId}`;\n\n return `${baseUrl}?api-version=${Constants.LatestAPIVersion}`;\n}\n\nexport function getHtmlReporterOutputFolder(config: FullConfig | undefined): string {\n const defaultFolder = \"playwright-report\";\n\n if (!config?.reporter) {\n return defaultFolder;\n }\n\n for (const reporter of config.reporter) {\n if (Array.isArray(reporter)) {\n const [reporterName, options] = reporter;\n if (reporterName === \"html\" && options && typeof options === \"object\") {\n return (options as any).outputFolder || defaultFolder;\n }\n } else if (typeof reporter === \"string\" && reporter === \"html\") {\n return defaultFolder;\n }\n }\n\n return defaultFolder;\n}\n\nexport function getContentType(filePath: string): string {\n const ext = filePath.toLowerCase().split(\".\").pop();\n\n const contentTypes: { [key: string]: string } = {\n html: \"text/html\",\n css: \"text/css\",\n js: \"application/javascript\",\n json: \"application/json\",\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n svg: \"image/svg+xml\",\n ico: \"image/x-icon\",\n txt: \"text/plain\",\n ttf: \"font/ttf\",\n woff: \"font/woff\",\n woff2: \"font/woff2\",\n webmanifest: \"application/manifest+json\",\n map: \"application/json\",\n xml: \"application/xml\",\n pdf: \"application/pdf\",\n zip: \"application/zip\",\n };\n\n return contentTypes[ext || \"\"] || \"application/octet-stream\";\n}\n\nexport function calculateOptimalConcurrency(files: Array<{ size: number }>): number {\n const totalFiles = files.length;\n const totalSize = files.reduce((sum, f) => sum + f.size, 0);\n const avgFileSize = totalSize / totalFiles;\n\n let optimalConcurrency: number;\n\n if (totalFiles <= 10) {\n optimalConcurrency = Math.min(totalFiles, 10);\n } else if (avgFileSize < UploadConstants.SMALL_FILE_THRESHOLD) {\n optimalConcurrency = Math.min(\n UploadConstants.MAX_CONCURRENCY,\n Math.max(UploadConstants.BASE_CONCURRENCY, totalFiles / 50),\n );\n } else if (totalFiles > 1000) {\n optimalConcurrency = Math.min(\n UploadConstants.MAX_CONCURRENCY,\n UploadConstants.BASE_CONCURRENCY + Math.floor(totalFiles / 200),\n );\n } else {\n optimalConcurrency = Math.min(\n UploadConstants.MAX_CONCURRENCY,\n UploadConstants.BASE_CONCURRENCY,\n );\n }\n\n return Math.floor(optimalConcurrency);\n}\n\nexport function collectAllFiles(\n folderPath: string,\n basePath: string,\n runIdFolderPrefix?: string,\n): Array<{\n fullPath: string;\n relativePath: string;\n size: number;\n contentType: string;\n}> {\n const files: Array<{\n fullPath: string;\n relativePath: string;\n size: number;\n contentType: string;\n }> = [];\n\n const stack = [folderPath];\n\n while (stack.length > 0) {\n const currentPath = stack.pop()!;\n\n try {\n const items = readdirSync(currentPath);\n\n for (const item of items) {\n const itemPath = join(currentPath, item);\n const stats = statSync(itemPath);\n\n if (stats.isDirectory()) {\n stack.push(itemPath);\n } else {\n let relativePath = relative(basePath, itemPath).split(\"\\\\\").join(\"/\");\n\n if (runIdFolderPrefix) {\n relativePath = `${runIdFolderPrefix}/${relativePath}`;\n }\n\n files.push({\n fullPath: itemPath,\n relativePath,\n size: stats.size,\n contentType: getContentType(itemPath),\n });\n }\n }\n } catch (error) {\n continue;\n }\n }\n\n return files;\n}\n\nexport function getPortalTestRunUrl(workspaceMetadata: WorkspaceMetaData | null): string {\n const { subscriptionId, resourceId, name } = workspaceMetadata ?? {};\n if (!subscriptionId || !resourceId || !name) {\n throw new Error(\n \"Missing required workspace metadata: subscriptionId, resourceId, and name are required\",\n );\n }\n\n // Extract resource group from resourceId\n const resourceIdParts = resourceId.split(\"/\");\n const resourceGroupIndex = resourceIdParts.findIndex(\n (part) => part.toLowerCase() === \"resourcegroups\",\n );\n\n if (resourceGroupIndex === -1 || resourceGroupIndex + 1 >= resourceIdParts.length) {\n throw new Error(\"Invalid resourceId format: could not extract resource group name\");\n }\n\n const resourceGroupName = resourceIdParts[resourceGroupIndex + 1];\n return `https://ms.portal.azure.com/#@microsoft.onmicrosoft.com/resource/subscriptions/${encodeURIComponent(subscriptionId)}/resourceGroups/${encodeURIComponent(resourceGroupName)}/providers/Microsoft.LoadTestService/playwrightWorkspaces/${encodeURIComponent(name)}/TestRuns`;\n}\n\nexport const getStorageAccountNameFromUri = (storageUri: string): string | null => {\n try {\n if (!storageUri || typeof storageUri !== \"string\") {\n return null;\n }\n\n const url = new URL(storageUri);\n const hostname = url.hostname;\n\n // Extract storage account name from hostname pattern: {accountname}.blob.core.windows.net\n const match = hostname.match(/^([^.]+)\\.blob\\.core\\.windows\\.net$/i);\n\n if (match && match[1]) {\n return match[1];\n }\n\n return null;\n } catch (error) {\n console.warn(\"Failed to extract storage account name from URI:\", storageUri, error);\n return null;\n }\n};\n"]}
@@ -42,7 +42,7 @@ export class EntraIdAccessToken {
42
42
  catch (err) {
43
43
  coreLogger.error(err);
44
44
  process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = "true";
45
- throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);
45
+ throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_ENTRA_TOKEN.message);
46
46
  }
47
47
  };
48
48
  doesEntraIdAccessTokenNeedRotation() {
@@ -1 +1 @@
1
- {"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,OAAO,kBAAkB;IACtB,KAAK,CAAU;IACd,gBAAgB,CAAU,CAAC,kBAAkB;IAC7C,WAAW,CAAmB;IAC9B,SAAS,GAAG,KAAK,CAAC;IAE1B,YAAY,UAA4B;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;YACtB,OAAO;QACT,CAAC;QACD,I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YACX,OAAO;QACT,CAAC;IACH,CAAC,CAAC;CACH;AAED,MAAM,UAAU,wBAAwB,CAAC,UAA4B;IACnE,OAAO,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { coreLogger } from \"./logger.js\";\nimport {\n EntraIdAccessTokenConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants.js\";\nimport type { AccessTokenClaims } from \"./types.js\";\nimport { parseJwt } from \"../utils/parseJwt.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nexport class EntraIdAccessToken {\n public token?: string;\n private _expiryTimestamp?: number; // in milliseconds\n private _credential?: TokenCredential;\n private _noOpFlag = false;\n\n constructor(credential?: TokenCredential) {\n this._credential = credential;\n if (!this._credential) {\n this._noOpFlag = true;\n return;\n }\n this.setEntraIdAccessTokenFromEnvironment();\n }\n\n public fetchEntraIdAccessToken = async (): Promise<void> => {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n try {\n coreLogger.info(\"Fetching entra id access token\");\n const accessToken = await this._credential!.getToken(EntraIdAccessTokenConstants.SCOPE);\n if (!accessToken) {\n throw new Error(\"Entra id access token is null\");\n }\n if (accessToken.token === this.token) {\n // azure identity library can fetch the same token again from cache. 10 mins before expiry, it allows token refresh\n coreLogger.info(\"Cached access token is returned, will be retried again.\");\n return;\n }\n this.token = accessToken.token;\n this._expiryTimestamp = accessToken.expiresOnTimestamp;\n process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN] = this.token!;\n coreLogger.info(\"Entra id access token fetched and set in environment variable\");\n coreLogger.info(\n \"Entra id access token expiry:\",\n new Date(this._expiryTimestamp!).toISOString(),\n );\n return;\n } catch (err) {\n coreLogger.error(err);\n process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = \"true\";\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);\n }\n };\n\n public doesEntraIdAccessTokenNeedRotation(): boolean {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n if (!this.token) {\n coreLogger.info(\"Entra id access token not found, needs rotation\");\n return true;\n }\n const lifetimeLeft = this._expiryTimestamp! - new Date().getTime();\n const doesEntraTokenRequireRotation =\n lifetimeLeft <\n EntraIdAccessTokenConstants.LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION * 60 * 1000;\n coreLogger.info(\n \"Entra id access token requires rotation:\",\n doesEntraTokenRequireRotation ? \"Yes\" : \"No\",\n );\n return doesEntraTokenRequireRotation;\n }\n\n private setEntraIdAccessTokenFromEnvironment = (): void => {\n try {\n const token = process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n if (!token) {\n return;\n }\n const claims = parseJwt<Partial<AccessTokenClaims>>(token);\n if (claims.pwid) {\n return;\n } // mpt PAT\n const expiry = new Date(claims.exp! * 1000);\n this.token = token;\n this._expiryTimestamp = expiry.getTime();\n } catch (_) {\n return;\n }\n };\n}\n\nexport function createEntraIdAccessToken(credential?: TokenCredential): EntraIdAccessToken {\n return new EntraIdAccessToken(credential);\n}\n"]}
1
+ {"version":3,"file":"entraIdAccessToken.js","sourceRoot":"","sources":["../../../src/common/entraIdAccessToken.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAE7D,MAAM,OA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,MAAM,CAAC,IAAI,EAAE,CAAC;gBAChB,OAAO;YACT,CAAC,CAAC,UAAU;YACZ,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,GAAI,GAAG,IAAI,CAAC,CAAC;YAC5C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;QAC3C,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;QACT,CAAC;IACH,CAAC,CAAC;CACH;AAED,MAAM,UAAU,wBAAwB,CAAC,UAA4B;IACnE,OAAO,IAAI,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { coreLogger } from \"./logger.js\";\nimport {\n EntraIdAccessTokenConstants,\n InternalEnvironmentVariables,\n ServiceEnvironmentVariable,\n} from \"./constants.js\";\nimport type { AccessTokenClaims } from \"./types.js\";\nimport { parseJwt } from \"../utils/parseJwt.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nexport class EntraIdAccessToken {\n public token?: string;\n private _expiryTimestamp?: number; // in milliseconds\n private _credential?: TokenCredential;\n private _noOpFlag = false;\n\n constructor(credential?: TokenCredential) {\n this._credential = credential;\n if (!this._credential) {\n this._noOpFlag = true;\n return;\n }\n this.setEntraIdAccessTokenFromEnvironment();\n }\n\n public fetchEntraIdAccessToken = async (): Promise<void> => {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n try {\n coreLogger.info(\"Fetching entra id access token\");\n const accessToken = await this._credential!.getToken(EntraIdAccessTokenConstants.SCOPE);\n if (!accessToken) {\n throw new Error(\"Entra id access token is null\");\n }\n if (accessToken.token === this.token) {\n // azure identity library can fetch the same token again from cache. 10 mins before expiry, it allows token refresh\n coreLogger.info(\"Cached access token is returned, will be retried again.\");\n return;\n }\n this.token = accessToken.token;\n this._expiryTimestamp = accessToken.expiresOnTimestamp;\n process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN] = this.token!;\n coreLogger.info(\"Entra id access token fetched and set in environment variable\");\n coreLogger.info(\n \"Entra id access token expiry:\",\n new Date(this._expiryTimestamp!).toISOString(),\n );\n return;\n } catch (err) {\n coreLogger.error(err);\n process.env[InternalEnvironmentVariables.MPT_SETUP_FATAL_ERROR] = \"true\";\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_ENTRA_TOKEN.message);\n }\n };\n\n public doesEntraIdAccessTokenNeedRotation(): boolean {\n if (this._noOpFlag) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n if (!this.token) {\n coreLogger.info(\"Entra id access token not found, needs rotation\");\n return true;\n }\n const lifetimeLeft = this._expiryTimestamp! - new Date().getTime();\n const doesEntraTokenRequireRotation =\n lifetimeLeft <\n EntraIdAccessTokenConstants.LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION * 60 * 1000;\n coreLogger.info(\n \"Entra id access token requires rotation:\",\n doesEntraTokenRequireRotation ? \"Yes\" : \"No\",\n );\n return doesEntraTokenRequireRotation;\n }\n\n private setEntraIdAccessTokenFromEnvironment = (): void => {\n try {\n const token = process.env[ServiceEnvironmentVariable.PLAYWRIGHT_SERVICE_ACCESS_TOKEN];\n if (!token) {\n return;\n }\n const claims = parseJwt<Partial<AccessTokenClaims>>(token);\n if (claims.pwid) {\n return;\n } // mpt PAT\n const expiry = new Date(claims.exp! * 1000);\n this.token = token;\n this._expiryTimestamp = expiry.getTime();\n } catch (_) {\n return;\n }\n };\n}\n\nexport function createEntraIdAccessToken(credential?: TokenCredential): EntraIdAccessToken {\n return new EntraIdAccessToken(credential);\n}\n"]}
@@ -11,6 +11,10 @@ export declare const ServiceErrorMessageConstants: {
11
11
  key: string;
12
12
  message: string;
13
13
  };
14
+ PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {
15
+ key: string;
16
+ message: string;
17
+ };
14
18
  MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {
15
19
  key: string;
16
20
  message: string;
@@ -19,7 +23,11 @@ export declare const ServiceErrorMessageConstants: {
19
23
  key: string;
20
24
  message: string;
21
25
  };
22
- NO_AUTH_ERROR: {
26
+ NO_AUTH_ERROR_PAT_TOKEN: {
27
+ key: string;
28
+ message: string;
29
+ };
30
+ NO_AUTH_ERROR_ENTRA_TOKEN: {
23
31
  key: string;
24
32
  message: string;
25
33
  };
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA+CE,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;+CAkBf,MAAM,KAAG,MAAM;;;;;;;;;uDAWP,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;kCA8BpC,MAAM,KAAG,MAAM;;;;;uCAMV,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BzB,MAAM,KAAG,MAAM;;;;;4CAKA,MAAM,aAAa,MAAM,UAAU,MAAM,KAAG,MAAM;;;;;iCAM7D,MAAM,KAAG,MAAM;;;;;+CAKD,MAAM,KAAG,MAAM;;;;;;;;;;CAYzD,CAAC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA0DE,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;+CAkBf,MAAM,KAAG,MAAM;;;;;;;;;uDAWP,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;kCA8BpC,MAAM,KAAG,MAAM;;;;;uCAMV,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BzB,MAAM,KAAG,MAAM;;;;;4CAKA,MAAM,aAAa,MAAM,UAAU,MAAM,KAAG,MAAM;;;;;iCAM7D,MAAM,KAAG,MAAM;;;;;+CAKD,MAAM,KAAG,MAAM;;;;;;;;;;CAYzD,CAAC"}
@@ -13,6 +13,10 @@ export const ServiceErrorMessageConstants = {
13
13
  key: "InvalidPlaywrightVersionError",
14
14
  message: "The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.",
15
15
  },
16
+ PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {
17
+ key: "PlaywrightVersionTooOldForReporting",
18
+ message: "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.",
19
+ },
16
20
  MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {
17
21
  key: "MultipleSetupFilePlaywrightVersionError",
18
22
  message: "The Playwright version you are using does not support multiple setup/teardown files. Please update to Playwright version 1.49.0 or higher.",
@@ -21,26 +25,30 @@ export const ServiceErrorMessageConstants = {
21
25
  key: "InvalidAccessToken",
22
26
  message: "The provided access token does not match the specified workspace URL. Please verify that both values are correct.",
23
27
  },
24
- NO_AUTH_ERROR: {
25
- key: "NoAuthError",
26
- message: "Could not authenticate with the service. Please refer to https://aka.ms/pww/docs/authentication for more information.",
28
+ NO_AUTH_ERROR_PAT_TOKEN: {
29
+ key: "NoAuthErrorPatToken",
30
+ message: "Please set PLAYWRIGHT_SERVICE_ACCESS_TOKEN env variable when using ACCESS_TOKEN authentication. For more information, see https://aka.ms/pww/docs/authentication",
31
+ },
32
+ NO_AUTH_ERROR_ENTRA_TOKEN: {
33
+ key: "NoAuthErrorEntraToken",
34
+ message: "Could not authenticate with the service. For more information, see https://aka.ms/pww/docs/authentication",
27
35
  },
28
36
  INVALID_MPT_PAT_ERROR: {
29
37
  key: "InvalidMptPatError",
30
- message: "The authentication token provided is invalid. Check the token and try again.",
38
+ message: "The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided is invalid. Please make sure to set a valid token.",
31
39
  },
32
40
  EXPIRED_MPT_PAT_ERROR: {
33
41
  key: "ExpiredMptPatError",
34
- message: "Your authentication token has expired. Create a new token.",
42
+ message: "The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided has expired. Create a new token.",
35
43
  },
36
44
  NO_CRED_ENTRA_AUTH_ERROR: {
37
45
  key: "NoCredEntraAuthError",
38
- message: "Azure credentials not found when using Entra ID authentication. Please refer to https://aka.ms/pww/docs/authentication for more information.",
46
+ message: "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.",
39
47
  },
40
48
  FAILED_TO_CREATE_TEST_RUN: {
41
49
  key: "FailedToCreateTestRun",
42
- message: "Failed to create the test run in the Playwright workspaces. Please refer to https://aka.ms/pww/docs/troubleshooting for more information.",
43
- formatWithErrorDetails: (errorDetails) => `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. Please refer to https://aka.ms/pww/docs/troubleshooting for more information.`,
50
+ message: "Failed to create the test run in the Playwright workspaces. For more information, see https://aka.ms/pww/docs/troubleshooting",
51
+ formatWithErrorDetails: (errorDetails) => `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. For more information, see https://aka.ms/pww/docs/troubleshooting`,
44
52
  },
45
53
  INVALID_PARAM_WITH_SERVICE_CONFIG: {
46
54
  key: "InvalidParamWithServiceConfig",
@@ -65,8 +73,8 @@ export const ServiceErrorMessageConstants = {
65
73
  },
66
74
  STORAGE_AUTHORIZATION_FAILED: {
67
75
  key: "StorageAuthorizationFailed",
68
- message: "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. Refer to https://aka.ms/pww-reporting",
69
- formatWithStorageAccount: (storageAccountName) => `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}. Refer to https://aka.ms/pww-reporting`,
76
+ message: "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",
77
+ formatWithStorageAccount: (storageAccountName) => `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`,
70
78
  },
71
79
  UNABLE_TO_EXTRACT_WORKSPACE_ID: {
72
80
  key: "UnableToExtractWorkspaceId",
@@ -74,11 +82,11 @@ export const ServiceErrorMessageConstants = {
74
82
  },
75
83
  REPORTER_REQUIRES_ENTRA_AUTH: {
76
84
  key: "ReporterRequiresEntraAuth",
77
- message: "Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. Please refer to https://aka.ms/pww/docs/authentication for more information.",
85
+ message: "Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. For more information, see https://aka.ms/pww/docs/authentication",
78
86
  },
79
87
  HTML_REPORTER_REQUIRED: {
80
88
  key: "HtmlReporterRequired",
81
- message: "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']]",
89
+ message: "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",
82
90
  },
83
91
  WORKSPACE_METADATA_FETCH_FAILED: {
84
92
  key: "WorkspaceMetadataFetchFailed",
@@ -86,7 +94,7 @@ export const ServiceErrorMessageConstants = {
86
94
  },
87
95
  WORKSPACE_REPORTING_DISABLED: {
88
96
  key: "WorkspaceReportingDisabled",
89
- message: "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, refer to https://aka.ms/pww-reporting ",
97
+ message: "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, For more information, see https://aka.ms/pww-reporting",
90
98
  },
91
99
  UPLOAD_FAILED_FILES: {
92
100
  key: "UploadFailedFiles",
@@ -96,7 +104,7 @@ export const ServiceErrorMessageConstants = {
96
104
  PLAYWRIGHT_TEST_REPORT_NOT_FOUND: {
97
105
  key: "PlaywrightTestReportNotFound",
98
106
  message: "Playwright test report not found",
99
- formatWithFolder: (folderName) => `Playwright test report not found: ${folderName}`,
107
+ formatWithFolder: (folderName) => `Playwright test report not found: ${folderName}. For more information, see https://aka.ms/pww-reporting`,
100
108
  },
101
109
  REPORTING_ENABLED: {
102
110
  key: "ReportingEnabled",
@@ -108,15 +116,15 @@ export const ServiceErrorMessageConstants = {
108
116
  },
109
117
  REPORTING_STATUS_SUCCESS: {
110
118
  key: "ReportingStatusSuccess",
111
- message: "Reporting status: SUCCESS",
119
+ message: "Reporting upload status: SUCCESS",
112
120
  },
113
121
  REPORTING_STATUS_PARTIAL: {
114
122
  key: "ReportingStatusPartial",
115
- message: "Reporting status: Partially Uploaded",
123
+ message: "Reporting upload status: Partially Uploaded",
116
124
  },
117
125
  REPORTING_STATUS_FAILED: {
118
126
  key: "ReportingStatusFailed",
119
- message: "Reporting status: FAILED",
127
+ message: "Reporting upload status: FAILED",
120
128
  },
121
129
  TEST_REPORT_VIEW_URL: {
122
130
  key: "TestReportViewUrl",
@@ -144,7 +152,7 @@ export const ServiceErrorMessageConstants = {
144
152
  },
145
153
  REPORTER_REQUIRES_SERVICE_CONFIG: {
146
154
  key: "ReporterRequiresServiceConfig",
147
- message: "Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig.",
155
+ message: "Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig. For more information, see https://aka.ms/pww-reporting.",
148
156
  },
149
157
  };
150
158
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
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,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,aAAa,EAAE;QACb,GAAG,EAAE,aAAa;QAClB,OAAO,EACL,uHAAuH;KAC1H;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,8EAA8E;KACxF;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,4DAA4D;KACtE;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EACL,8IAA8I;KACjJ;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EACL,2IAA2I;QAC7I,sBAAsB,EAAE,CAAC,YAAoB,EAAU,EAAE,CACvD,sEAAsE,YAAY,iFAAiF;KACtK;IACD,iCAAiC,EAAE;QACjC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EAAE,4KAA4K;KACtL;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,qFAAqF;KAC/F;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,sBAAsB;QA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AG,EAAE,qBAAqB;QAC1B,OAAO,EAAE,oDAAoD;KAC9D;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,2BAA2B;KACrC;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,sCAAsC;KAChD;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,0BAA0B;KACpC;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EAAE,wBAAwB;QACjC,aAAa,EAAE,CAAC,GAAW,EAAU,EAAE,CAAC,yBAAyB,GAAG,EAAE;KACvE;IACD,mBAAmB,EAAE;QACnB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,gCAAgC;QACzC,iBAAiB,EAAE,CAAC,cAAsB,EAAE,SAAiB,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,2GAA2G;KAC9G;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 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: {\n key: \"NoAuthError\",\n message:\n \"Could not authenticate with the service. Please refer to https://aka.ms/pww/docs/authentication for more information.\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message: \"The authentication token provided is invalid. Check the token and try again.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"Your authentication token has expired. Create a new token.\",\n },\n NO_CRED_ENTRA_AUTH_ERROR: {\n key: \"NoCredEntraAuthError\",\n message:\n \"Azure credentials not found when using Entra ID authentication. Please refer to 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. Please refer to https://aka.ms/pww/docs/troubleshooting for more information.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. Please refer to https://aka.ms/pww/docs/troubleshooting for more information.`,\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. Refer to 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}. Refer to 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 REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message:\n \"Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. Please refer to https://aka.ms/pww/docs/authentication for more information.\",\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']]\",\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, refer to 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}`,\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 status: SUCCESS\",\n },\n REPORTING_STATUS_PARTIAL: {\n key: \"ReportingStatusPartial\",\n message: \"Reporting status: Partially Uploaded\",\n },\n REPORTING_STATUS_FAILED: {\n key: \"ReportingStatusFailed\",\n message: \"Reporting 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.\",\n },\n};\n"]}
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;KACp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CAAkC;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 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, 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"]}
@@ -194,7 +194,7 @@ const getConnectOptions = async (options) => {
194
194
  throw new Error(ServiceErrorMessageConstants.INVALID_AUTH_TYPE_ERROR.message);
195
195
  }
196
196
  if (!token) {
197
- throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR.message);
197
+ throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN.message);
198
198
  }
199
199
  return {
200
200
  wsEndpoint: getServiceWSEndpoint(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion),