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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/dist/browser/common/constants.d.ts +1 -0
  2. package/dist/browser/common/constants.d.ts.map +1 -1
  3. package/dist/browser/common/constants.js +1 -0
  4. package/dist/browser/common/constants.js.map +1 -1
  5. package/dist/browser/common/messages.d.ts +14 -0
  6. package/dist/browser/common/messages.d.ts.map +1 -1
  7. package/dist/browser/common/messages.js +18 -4
  8. package/dist/browser/common/messages.js.map +1 -1
  9. package/dist/browser/core/initializePlaywrightServiceTestRun.d.ts.map +1 -1
  10. package/dist/browser/core/initializePlaywrightServiceTestRun.js +4 -5
  11. package/dist/browser/core/initializePlaywrightServiceTestRun.js.map +1 -1
  12. package/dist/browser/reporter/playwrightReporter.d.ts.map +1 -1
  13. package/dist/browser/reporter/playwrightReporter.js +37 -14
  14. package/dist/browser/reporter/playwrightReporter.js.map +1 -1
  15. package/dist/browser/utils/PlaywrightServiceClient.d.ts +9 -0
  16. package/dist/browser/utils/PlaywrightServiceClient.d.ts.map +1 -0
  17. package/dist/{esm/utils/playwrightServiceApicall.js → browser/utils/PlaywrightServiceClient.js} +13 -17
  18. package/dist/browser/utils/PlaywrightServiceClient.js.map +1 -0
  19. package/dist/browser/utils/playwrightReporterStorageManager.d.ts.map +1 -1
  20. package/dist/browser/utils/playwrightReporterStorageManager.js +15 -8
  21. package/dist/browser/utils/playwrightReporterStorageManager.js.map +1 -1
  22. package/dist/commonjs/common/constants.d.ts +1 -0
  23. package/dist/commonjs/common/constants.d.ts.map +1 -1
  24. package/dist/commonjs/common/constants.js +1 -0
  25. package/dist/commonjs/common/constants.js.map +1 -1
  26. package/dist/commonjs/common/messages.d.ts +14 -0
  27. package/dist/commonjs/common/messages.d.ts.map +1 -1
  28. package/dist/commonjs/common/messages.js +18 -4
  29. package/dist/commonjs/common/messages.js.map +1 -1
  30. package/dist/commonjs/core/initializePlaywrightServiceTestRun.d.ts.map +1 -1
  31. package/dist/commonjs/core/initializePlaywrightServiceTestRun.js +4 -5
  32. package/dist/commonjs/core/initializePlaywrightServiceTestRun.js.map +1 -1
  33. package/dist/commonjs/reporter/playwrightReporter.d.ts.map +1 -1
  34. package/dist/commonjs/reporter/playwrightReporter.js +36 -13
  35. package/dist/commonjs/reporter/playwrightReporter.js.map +1 -1
  36. package/dist/commonjs/utils/PlaywrightServiceClient.d.ts +9 -0
  37. package/dist/commonjs/utils/PlaywrightServiceClient.d.ts.map +1 -0
  38. package/dist/commonjs/utils/{playwrightServiceApicall.js → PlaywrightServiceClient.js} +13 -17
  39. package/dist/commonjs/utils/PlaywrightServiceClient.js.map +1 -0
  40. package/dist/commonjs/utils/playwrightReporterStorageManager.d.ts.map +1 -1
  41. package/dist/commonjs/utils/playwrightReporterStorageManager.js +15 -8
  42. package/dist/commonjs/utils/playwrightReporterStorageManager.js.map +1 -1
  43. package/dist/esm/common/constants.d.ts +1 -0
  44. package/dist/esm/common/constants.d.ts.map +1 -1
  45. package/dist/esm/common/constants.js +1 -0
  46. package/dist/esm/common/constants.js.map +1 -1
  47. package/dist/esm/common/messages.d.ts +14 -0
  48. package/dist/esm/common/messages.d.ts.map +1 -1
  49. package/dist/esm/common/messages.js +18 -4
  50. package/dist/esm/common/messages.js.map +1 -1
  51. package/dist/esm/core/initializePlaywrightServiceTestRun.d.ts.map +1 -1
  52. package/dist/esm/core/initializePlaywrightServiceTestRun.js +4 -5
  53. package/dist/esm/core/initializePlaywrightServiceTestRun.js.map +1 -1
  54. package/dist/esm/reporter/playwrightReporter.d.ts.map +1 -1
  55. package/dist/esm/reporter/playwrightReporter.js +37 -14
  56. package/dist/esm/reporter/playwrightReporter.js.map +1 -1
  57. package/dist/esm/utils/PlaywrightServiceClient.d.ts +9 -0
  58. package/dist/esm/utils/PlaywrightServiceClient.d.ts.map +1 -0
  59. package/dist/{browser/utils/playwrightServiceApicall.js → esm/utils/PlaywrightServiceClient.js} +13 -17
  60. package/dist/esm/utils/PlaywrightServiceClient.js.map +1 -0
  61. package/dist/esm/utils/playwrightReporterStorageManager.d.ts.map +1 -1
  62. package/dist/esm/utils/playwrightReporterStorageManager.js +15 -8
  63. package/dist/esm/utils/playwrightReporterStorageManager.js.map +1 -1
  64. package/dist/react-native/common/constants.d.ts +1 -0
  65. package/dist/react-native/common/constants.d.ts.map +1 -1
  66. package/dist/react-native/common/constants.js +1 -0
  67. package/dist/react-native/common/constants.js.map +1 -1
  68. package/dist/react-native/common/messages.d.ts +14 -0
  69. package/dist/react-native/common/messages.d.ts.map +1 -1
  70. package/dist/react-native/common/messages.js +18 -4
  71. package/dist/react-native/common/messages.js.map +1 -1
  72. package/dist/react-native/core/initializePlaywrightServiceTestRun.d.ts.map +1 -1
  73. package/dist/react-native/core/initializePlaywrightServiceTestRun.js +4 -5
  74. package/dist/react-native/core/initializePlaywrightServiceTestRun.js.map +1 -1
  75. package/dist/react-native/reporter/playwrightReporter.d.ts.map +1 -1
  76. package/dist/react-native/reporter/playwrightReporter.js +37 -14
  77. package/dist/react-native/reporter/playwrightReporter.js.map +1 -1
  78. package/dist/react-native/utils/PlaywrightServiceClient.d.ts +9 -0
  79. package/dist/react-native/utils/PlaywrightServiceClient.d.ts.map +1 -0
  80. package/dist/react-native/utils/{playwrightServiceApicall.js → PlaywrightServiceClient.js} +13 -17
  81. package/dist/react-native/utils/PlaywrightServiceClient.js.map +1 -0
  82. package/dist/react-native/utils/playwrightReporterStorageManager.d.ts.map +1 -1
  83. package/dist/react-native/utils/playwrightReporterStorageManager.js +15 -8
  84. package/dist/react-native/utils/playwrightReporterStorageManager.js.map +1 -1
  85. package/package.json +1 -1
  86. package/dist/browser/utils/playwrightServiceApicall.d.ts +0 -16
  87. package/dist/browser/utils/playwrightServiceApicall.d.ts.map +0 -1
  88. package/dist/browser/utils/playwrightServiceApicall.js.map +0 -1
  89. package/dist/commonjs/utils/playwrightServiceApicall.d.ts +0 -16
  90. package/dist/commonjs/utils/playwrightServiceApicall.d.ts.map +0 -1
  91. package/dist/commonjs/utils/playwrightServiceApicall.js.map +0 -1
  92. package/dist/esm/utils/playwrightServiceApicall.d.ts +0 -16
  93. package/dist/esm/utils/playwrightServiceApicall.d.ts.map +0 -1
  94. package/dist/esm/utils/playwrightServiceApicall.js.map +0 -1
  95. package/dist/react-native/utils/playwrightServiceApicall.d.ts +0 -16
  96. package/dist/react-native/utils/playwrightServiceApicall.d.ts.map +0 -1
  97. package/dist/react-native/utils/playwrightServiceApicall.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"playwrightReporterStorageManager.js","sourceRoot":"","sources":["../../../src/utils/playwrightReporterStorageManager.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,eAAe,EACf,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,MAAM,OAAO,gCAAgC;IAC3C,kDAAkD;IAClD,KAAK,CAAC,sBAAsB,CAC1B,UAA2B,EAC3B,KAAa,EACb,YAAoB,EACpB,gBAAmC;QAEnC,UAAU,CAAC,IAAI,CACb,0CAA0C,KAAK,mBAAmB,YAAY,EAAE,CACjF,CAAC;QACF,IAAI,CAAC;YACH,UAAU,CAAC,IAAI,CA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AY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACpD,MAAM,eAAe,CAAC,UAAU,CAAC,WAAW,EAAE;gBAC5C,eAAe,EAAE;oBACf,eAAe,EAAE,QAAQ,CAAC,WAAW;iBACtC;gBACD,SAAS,EAAE,eAAe,CAAC,oBAAoB;gBAC/C,WAAW,EAAE,eAAe,CAAC,oBAAoB;aAClD,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,qDAAqD;YACrD,MAAM,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnD,MAAM,eAAe,CAAC,YAAY,CAChC,MAAM,EACN,eAAe,CAAC,kBAAkB,EAClC,eAAe,CAAC,sBAAsB,EACtC;gBACE,eAAe,EAAE;oBACf,eAAe,EAAE,QAAQ,CAAC,WAAW;iBACtC;aACF,CACF,CAAC;QACJ,CAAC;QACD,UAAU,CAAC,IAAI,CAAC,0BAA0B,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IACrE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { BlobServiceClient, ContainerClient, BlockBlobClient } from \"@azure/storage-blob\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { coreLogger } from \"../common/logger.js\";\nimport { readFileSync, writeFileSync, existsSync, createReadStream } from \"fs\";\nimport { join } from \"path\";\nimport { UploadConstants } from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport {\n populateValuesFromServiceUrl,\n calculateOptimalConcurrency,\n collectAllFiles,\n getStorageAccountNameFromUri,\n} from \"./utils.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport type { WorkspaceMetaData, UploadResult } from \"../common/types.js\";\n\nexport class PlaywrightReporterStorageManager {\n // Uploads the HTML report folder to Azure Storage\n async uploadHtmlReportFolder(\n credential: TokenCredential,\n runId: string,\n outputFolder: string,\n workspaceDetails: WorkspaceMetaData,\n ): Promise<UploadResult> {\n coreLogger.info(\n `Starting HTML report upload for runId: ${runId}, outputFolder: ${outputFolder}`,\n );\n try {\n coreLogger.info(`Received workspace details: ${JSON.stringify(workspaceDetails, null, 2)}`);\n\n if (!workspaceDetails.storageUri) {\n coreLogger.error(\"Storage URI not found in workspace details\");\n return {\n success: false,\n errorMessage: ServiceErrorMessageConstants.STORAGE_URI_NOT_FOUND.message,\n };\n }\n\n const blobServiceClient = new BlobServiceClient(workspaceDetails?.storageUri, credential);\n const serviceUrlInfo = populateValuesFromServiceUrl();\n if (!serviceUrlInfo?.accountId) {\n coreLogger.error(\"Unable to extract workspace ID from service URL\");\n return {\n success: false,\n errorMessage: ServiceErrorMessageConstants.UNABLE_TO_EXTRACT_WORKSPACE_ID.message,\n };\n }\n\n const containerName = serviceUrlInfo.accountId.toLowerCase().replace(/[^a-z0-9-]/g, \"-\");\n const containerClient = blobServiceClient.getContainerClient(containerName);\n\n const containerExists = await containerClient.exists();\n if (!containerExists) {\n await containerClient.create();\n }\n\n const folderName = runId;\n const storageAccountName =\n getStorageAccountNameFromUri(workspaceDetails?.storageUri || \"\") || \"unknown\";\n console.log(\n ServiceErrorMessageConstants.UPLOADING_ARTIFACTS.formatWithDetails(\n storageAccountName,\n containerName,\n folderName,\n ),\n );\n\n await this.modifyTraceIndexHtml(outputFolder);\n const uploadResults = await this.uploadFolderInParallel(\n containerClient,\n outputFolder,\n outputFolder,\n folderName,\n );\n\n if (uploadResults.totalFiles === 0) {\n return { success: false, errorMessage: \"No files found to upload\" };\n }\n\n const failedFiles = uploadResults.totalFiles - uploadResults.uploadedFiles.length;\n if (failedFiles > 0) {\n // Get list of failed file names by comparing total files with uploaded files\n const uploadedSet = new Set(uploadResults.uploadedFiles);\n const allFiles = collectAllFiles(outputFolder, outputFolder, folderName);\n const failedFileNames = allFiles\n .filter((file) => !uploadedSet.has(file.relativePath))\n .map((file) => file.relativePath);\n\n return {\n success: false,\n partialSuccess: true,\n failedFileCount: failedFiles,\n totalFiles: uploadResults.totalFiles,\n failedFiles: failedFileNames,\n failedFileDetails: uploadResults.failedFileDetails,\n };\n }\n\n return { success: true };\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n coreLogger.error(`Failed to upload HTML report: ${error}`);\n\n if (\n error instanceof Error &&\n (error.message.includes(\"AuthorizationFailure\") ||\n error.message.includes(\"not authorized to perform this operation\"))\n ) {\n return {\n success: false,\n errorMessage: ServiceErrorMessageConstants.STORAGE_AUTHORIZATION_FAILED.message,\n };\n }\n\n return { success: false, errorMessage };\n }\n }\n private async modifyTraceIndexHtml(outputFolder: string): Promise<void> {\n coreLogger.info(`Starting trace modification for folder: ${outputFolder}`);\n const indexPath = join(outputFolder, \"trace/index.html\");\n\n if (!existsSync(indexPath)) {\n coreLogger.error(`trace/index.html not found at path: ${indexPath}`);\n return;\n }\n coreLogger.info(`Found trace/index.html at: ${indexPath}`);\n\n try {\n const redirectTraceviewerScript = `<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Redirecting to Trace Viewer...</title>\n</head>\n<body>\n <script>\n const url = new URL(location.href);\n const traceParam = url.searchParams.get('trace');\n const trace = new URL(traceParam);\n\n // Copy all query parameters from the current URL to the trace URL\n // This includes SAS tokens (sv, sr, sig, etc.) that are on the main URL\n for (const [key, value] of url.searchParams.entries()) {\n if (key !== 'trace') {\n trace.searchParams.set(key, value);\n }\n }\n\n const publicTraceViewer = new URL('https://trace.playwright.dev/');\n publicTraceViewer.searchParams.set('trace', trace.toString());\n location.href = publicTraceViewer.toString();\n </script>\n</body>\n</html>\n`;\n\n writeFileSync(indexPath, redirectTraceviewerScript, \"utf-8\");\n coreLogger.info(\"Successfully updated TraceViewer index file\");\n } catch (error) {\n coreLogger.error(\n `Error modifying trace/index.html: ${error instanceof Error ? error.message : String(error)}`,\n );\n return;\n }\n }\n\n // Uploads the entire Playwright HTML report folder after tests complete.\n\n async uploadPlaywrightHtmlReportAfterTests(\n outputFolderName?: string,\n workspaceMetadata?: WorkspaceMetaData | null,\n ): Promise<UploadResult> {\n try {\n coreLogger.info(\n `Starting post-test HTML report upload, folder name: ${outputFolderName || \"default (playwright-report)\"}`,\n );\n const cred = PlaywrightServiceConfig.instance.credential;\n if (!cred) {\n coreLogger.error(\"No credential found for authentication\");\n return {\n success: false,\n errorMessage: ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message,\n };\n }\n coreLogger.info(\"Credential found for authentication\");\n\n const folderName = outputFolderName || \"playwright-report\";\n const outputFolderPath = join(process.cwd(), folderName);\n\n if (!existsSync(outputFolderPath)) {\n coreLogger.error(`HTML report folder not found: ${outputFolderPath}`);\n return {\n success: false,\n errorMessage:\n ServiceErrorMessageConstants.PLAYWRIGHT_TEST_REPORT_NOT_FOUND.formatWithFolder(\n folderName,\n ),\n };\n }\n coreLogger.info(`HTML report folder found: ${outputFolderPath}`);\n\n const testRunId = PlaywrightServiceConfig.instance.runId;\n coreLogger.info(`Starting upload for test run ID: ${testRunId}`);\n const result = await this.uploadHtmlReportFolder(\n cred,\n testRunId,\n outputFolderPath,\n workspaceMetadata!,\n );\n coreLogger.info(`Completed upload for test run ID: ${testRunId}`);\n return result;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n coreLogger.error(`Upload failed: ${errorMessage}`);\n return { success: false, errorMessage };\n }\n }\n\n // Parallel Upload Engine - Core upload orchestration with performance optimization\n\n private async uploadFolderInParallel(\n containerClient: ContainerClient,\n folderPath: string,\n basePath: string,\n runIdFolderPrefix?: string,\n ): Promise<{\n uploadedFiles: string[];\n failedFiles: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n totalFiles: number;\n totalSize: number;\n uploadTime: number;\n }> {\n // Sort by size descending - upload large files first for better parallelization\n const filesToUpload = collectAllFiles(folderPath, basePath, runIdFolderPrefix).sort(\n (a, b) => b.size - a.size,\n );\n\n if (filesToUpload.length === 0) {\n return { uploadedFiles: [], failedFiles: [], totalFiles: 0, totalSize: 0, uploadTime: 0 };\n }\n\n const totalSize = filesToUpload.reduce((sum, file) => sum + file.size, 0);\n\n const concurrency = calculateOptimalConcurrency(filesToUpload);\n coreLogger.info(\n `Calculated optimal concurrency: ${concurrency} for ${filesToUpload.length} files (total size: ${(totalSize / 1024 / 1024).toFixed(2)} MB)`,\n );\n const uploadStartTime = Date.now();\n coreLogger.info(`Starting parallel upload with ${concurrency} concurrent operations`);\n const results = await this.uploadWithConcurrencyControl(\n containerClient,\n filesToUpload,\n concurrency,\n );\n\n const uploadEndTime = Date.now();\n const uploadTime = uploadEndTime - uploadStartTime;\n coreLogger.info(`Upload completed in ${uploadTime}ms (${(uploadTime / 1000).toFixed(2)}s)`);\n\n const failed = results.filter((r) => r.status === \"rejected\").length;\n const successful = results.filter((r) => r.status === \"fulfilled\").length;\n coreLogger.info(\n `Upload results: ${successful} successful, ${failed} failed out of ${results.length} total files`,\n );\n\n if (failed > 0) {\n const errors = results\n .filter((r): r is PromiseRejectedResult => r.status === \"rejected\")\n .map((r) => r.reason.message)\n .slice(0, 5); // Show first 5 errors\n\n errors.forEach((error, index) => {\n coreLogger.error(` ${index + 1}. ${error}`);\n });\n\n // Get failed file names and their error messages\n const uploadedSet = new Set(\n results\n .filter((r): r is PromiseFulfilledResult<string> => r.status === \"fulfilled\")\n .map((r) => r.value),\n );\n const failedFileNames = filesToUpload\n .filter((file) => !uploadedSet.has(file.relativePath))\n .map((file) => file.relativePath);\n\n // Create detailed error mapping\n const failedFileDetails: Array<{ fileName: string; error: string }> = [];\n results.forEach((result, index) => {\n if (result.status === \"rejected\") {\n const fileName = filesToUpload[index]?.relativePath || `File at index ${index}`;\n const errorMessage =\n result.reason instanceof Error ? result.reason.message : String(result.reason);\n failedFileDetails.push({ fileName, error: errorMessage });\n }\n });\n\n // Log error but don't throw to prevent breaking HTML reporter\n coreLogger.error(\n `Upload failed: ${failed} files could not be uploaded. Sample errors: ${errors.join(\", \")}`,\n );\n return {\n uploadedFiles: results\n .filter((r): r is PromiseFulfilledResult<string> => r.status === \"fulfilled\")\n .map((r) => r.value),\n failedFiles: failedFileNames,\n failedFileDetails,\n totalFiles: filesToUpload.length,\n totalSize,\n uploadTime,\n };\n }\n\n const uploadedFiles = results\n .filter((r): r is PromiseFulfilledResult<string> => r.status === \"fulfilled\")\n .map((r) => r.value);\n\n return {\n uploadedFiles,\n failedFiles: [],\n totalFiles: filesToUpload.length,\n totalSize,\n uploadTime,\n };\n }\n\n // Concurrency Control System - Manages parallel execution with controlled resource usage\n\n private async uploadWithConcurrencyControl(\n containerClient: ContainerClient,\n files: Array<{ fullPath: string; relativePath: string; size: number; contentType: string }>,\n concurrency: number,\n ): Promise<PromiseSettledResult<string>[]> {\n const uploadTasks = files.map((fileInfo) => async (): Promise<string> => {\n try {\n await this.uploadSingleFileOptimized(containerClient, fileInfo);\n return fileInfo.relativePath;\n } catch (error) {\n coreLogger.error(\n `Failed to upload file: ${fileInfo.relativePath} - ${\n error instanceof Error ? error.message : \"Unknown error\"\n }`,\n );\n throw error;\n }\n });\n\n return this.executeWithOptimizedBatching(uploadTasks, concurrency);\n }\n\n // Optimized Batch Execution Engine - High-performance task processing system\n\n private async executeWithOptimizedBatching<T>(\n tasks: Array<() => Promise<T>>,\n concurrency: number,\n ): Promise<PromiseSettledResult<T>[]> {\n const results: PromiseSettledResult<T>[] = new Array(tasks.length);\n let completedTasks = 0;\n\n // Splits tasks into optimal batches to balance memory usage vs. throughput\n const batchSize = Math.min(UploadConstants.BATCH_SIZE, concurrency * 2);\n const batches: Array<Array<() => Promise<T>>> = [];\n\n // Each batch will be processed with full concurrency before moving to next batch\n for (let i = 0; i < tasks.length; i += batchSize) {\n batches.push(tasks.slice(i, i + batchSize));\n }\n\n // Process each batch sequentially to maintain memory efficiency\n coreLogger.info(`Processing ${batches.length} batches with ${batchSize} tasks per batch`);\n for (let batchIndex = 0; batchIndex < batches.length; batchIndex++) {\n const batch = batches[batchIndex];\n const batchStartIndex = batchIndex * batchSize;\n coreLogger.info(\n `Starting batch ${batchIndex + 1}/${batches.length} with ${batch.length} tasks`,\n );\n\n // Transform each task into a promise that captures results at correct index\n const batchPromises = batch.map(async (task, taskIndex) => {\n const globalIndex = batchStartIndex + taskIndex;\n try {\n const result = await task();\n results[globalIndex] = { status: \"fulfilled\", value: result };\n return result;\n } catch (error) {\n results[globalIndex] = { status: \"rejected\", reason: error };\n coreLogger.error(\n `Task failed at index ${globalIndex}: ${\n error instanceof Error ? error.message : \"Unknown error\"\n }`,\n );\n return;\n }\n });\n\n const executing: Promise<any>[] = [];\n\n for (const promise of batchPromises) {\n if (executing.length >= concurrency) {\n await Promise.race(executing);\n }\n const wrappedPromise = promise\n .then((result) => {\n completedTasks++;\n return result;\n })\n .catch(() => {\n completedTasks++;\n })\n .finally(() => {\n // Cleanup: remove completed promise from executing array\n const index = executing.indexOf(wrappedPromise);\n if (index > -1) executing.splice(index, 1);\n });\n\n executing.push(wrappedPromise);\n }\n\n // Wait for all promises in current batch to complete before moving to next batch\n await Promise.allSettled(executing);\n coreLogger.info(`Completed batch ${batchIndex + 1}/${batches.length}`);\n }\n\n return results;\n }\n\n // Individual File Upload with Retry Logic\n\n private async uploadSingleFileOptimized(\n containerClient: ContainerClient,\n fileInfo: { fullPath: string; relativePath: string; contentType: string; size: number },\n ): Promise<void> {\n coreLogger.info(\n `Uploading file: ${fileInfo.relativePath} (${(fileInfo.size / 1024).toFixed(2)} KB, ${fileInfo.contentType})`,\n );\n const blockBlobClient = containerClient.getBlockBlobClient(fileInfo.relativePath);\n const maxRetries = UploadConstants.MAX_RETRY_ATTEMPTS;\n const baseDelay = UploadConstants.RETRY_BASE_DELAY;\n\n for (let attempt = 1; attempt <= maxRetries; attempt++) {\n try {\n await this.performOptimizedUpload(blockBlobClient, fileInfo);\n return;\n } catch (error) {\n const isLastAttempt = attempt === maxRetries;\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n coreLogger.info(\n `Upload attempt ${attempt} failed for ${fileInfo.relativePath}: ${errorMessage}`,\n );\n\n if (isLastAttempt) {\n coreLogger.error(\n `All retry attempts exhausted for ${fileInfo.relativePath}: ${errorMessage}`,\n );\n if (error instanceof Error) {\n throw error;\n }\n throw new Error(\n `Upload failed for ${fileInfo.relativePath} after ${maxRetries} attempts: ${errorMessage}`,\n );\n }\n\n // Exponential backoff with jitter (Azure SDK pattern)\n const delay = baseDelay * Math.pow(2, attempt - 1) + Math.random() * 500;\n coreLogger.info(\n `Retrying upload for ${fileInfo.relativePath} in ${delay.toFixed(0)}ms (attempt ${attempt + 1}/${maxRetries})`,\n );\n await new Promise((_resolve) => setTimeout(_resolve, delay));\n }\n }\n }\n\n // Multi-Strategy Upload Engine - Optimized upload based on file characteristics\n\n private async performOptimizedUpload(\n blockBlobClient: BlockBlobClient,\n fileInfo: { fullPath: string; relativePath: string; contentType: string; size: number },\n ): Promise<void> {\n if (fileInfo.size <= UploadConstants.SMALL_FILE_THRESHOLD) {\n // DIRECT UPLOAD: Optimal for small files (≤1MB)\n const fileContent = readFileSync(fileInfo.fullPath);\n await blockBlobClient.upload(fileContent, fileContent.length, {\n blobHTTPHeaders: {\n blobContentType: fileInfo.contentType,\n },\n });\n } else if (fileInfo.size <= UploadConstants.LARGE_FILE_THRESHOLD) {\n // BLOCK UPLOAD: Optimal for medium files (1MB - 100MB)\n const fileContent = readFileSync(fileInfo.fullPath);\n await blockBlobClient.uploadData(fileContent, {\n blobHTTPHeaders: {\n blobContentType: fileInfo.contentType,\n },\n blockSize: UploadConstants.OPTIMIZED_BLOCK_SIZE,\n concurrency: UploadConstants.PER_FILE_CONCURRENCY,\n });\n } else {\n // STREAMING UPLOAD: Optimal for large files (>100MB)\n const stream = createReadStream(fileInfo.fullPath);\n await blockBlobClient.uploadStream(\n stream,\n UploadConstants.STREAM_BUFFER_SIZE,\n UploadConstants.LARGE_FILE_CONCURRENCY,\n {\n blobHTTPHeaders: {\n blobContentType: fileInfo.contentType,\n },\n },\n );\n }\n coreLogger.info(`Successfully uploaded: ${fileInfo.relativePath}`);\n }\n}\n"]}
1
+ {"version":3,"file":"playwrightReporterStorageManager.js","sourceRoot":"","sources":["../../../src/utils/playwrightReporterStorageManager.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,iBAAiB,EAAoC,MAAM,qBAAqB,CAAC;AAE1F,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,eAAe,EACf,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAG/E,MAAM,OAAO,gCAAgC;IAC3C,kDAAkD;IAClD,KAAK,CAAC,sBAAsB,CAC1B,UAA2B,EAC3B,KAAa,EACb,YAAoB,EACpB,gBAAmC;QAEnC,UAAU,CAAC,IAAI,CACb,0CAA0C,KAAK,mBAAmB,YAAY,EAAE,CACjF,CAAC;QACF,IAAI,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YAE5F,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC;gBACjC,UAAU,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;gBAC/D,OAAO;oBACL,OAAO,EAAE,KAAK;oBACd,YAAY,EAAE,4BAA4B,CAAC,qBAAqB,CAAC,OAAO;iBACzE,CAAC;YACJ,CAAC;YAED,MAAM,iBAAiB,GAAG,IAAI,iBAAiB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WAAW,GAAG,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACpD,MAAM,eAAe,CAAC,UAAU,CAAC,WAAW,EAAE;gBAC5C,eAAe,EAAE;oBACf,eAAe,EAAE,QAAQ,CAAC,WAAW;iBACtC;gBACD,SAAS,EAAE,eAAe,CAAC,oBAAoB;gBAC/C,WAAW,EAAE,eAAe,CAAC,oBAAoB;aAClD,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,qDAAqD;YACrD,MAAM,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;YACnD,MAAM,eAAe,CAAC,YAAY,CAChC,MAAM,EACN,eAAe,CAAC,kBAAkB,EAClC,eAAe,CAAC,sBAAsB,EACtC;gBACE,eAAe,EAAE;oBACf,eAAe,EAAE,QAAQ,CAAC,WAAW;iBACtC;aACF,CACF,CAAC;QACJ,CAAC;QACD,UAAU,CAAC,IAAI,CAAC,0BAA0B,QAAQ,CAAC,YAAY,EAAE,CAAC,CAAC;IACrE,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { BlobServiceClient, ContainerClient, BlockBlobClient } from \"@azure/storage-blob\";\nimport type { TokenCredential } from \"@azure/core-auth\";\nimport { coreLogger } from \"../common/logger.js\";\nimport { readFileSync, writeFileSync, existsSync, createReadStream } from \"fs\";\nimport { join } from \"path\";\nimport { UploadConstants } from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport {\n populateValuesFromServiceUrl,\n calculateOptimalConcurrency,\n collectAllFiles,\n getStorageAccountNameFromUri,\n} from \"./utils.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport type { WorkspaceMetaData, UploadResult } from \"../common/types.js\";\n\nexport class PlaywrightReporterStorageManager {\n // Uploads the HTML report folder to Azure Storage\n async uploadHtmlReportFolder(\n credential: TokenCredential,\n runId: string,\n outputFolder: string,\n workspaceDetails: WorkspaceMetaData,\n ): Promise<UploadResult> {\n coreLogger.info(\n `Starting HTML report upload for runId: ${runId}, outputFolder: ${outputFolder}`,\n );\n try {\n coreLogger.info(`Received workspace details: ${JSON.stringify(workspaceDetails, null, 2)}`);\n\n if (!workspaceDetails.storageUri) {\n coreLogger.error(\"Storage URI not found in workspace details\");\n return {\n success: false,\n errorMessage: ServiceErrorMessageConstants.STORAGE_URI_NOT_FOUND.message,\n };\n }\n\n const blobServiceClient = new BlobServiceClient(workspaceDetails?.storageUri, credential);\n coreLogger.info(\"blobServiceClient created successfully.\");\n const serviceUrlInfo = populateValuesFromServiceUrl();\n if (!serviceUrlInfo?.accountId) {\n coreLogger.error(\"Unable to extract workspace ID from service URL\");\n return {\n success: false,\n errorMessage: ServiceErrorMessageConstants.UNABLE_TO_EXTRACT_WORKSPACE_ID.message,\n };\n }\n\n const containerName = serviceUrlInfo.accountId.toLowerCase().replace(/[^a-z0-9-]/g, \"-\");\n const containerClient = blobServiceClient.getContainerClient(containerName);\n\n const containerExists = await containerClient.exists();\n if (!containerExists) {\n coreLogger.info(`Container ${containerName} does not exist. Creating new container.`);\n await containerClient.create();\n } else {\n coreLogger.info(`Container ${containerName} already exists.`);\n }\n\n const folderName = runId;\n const storageAccountName =\n getStorageAccountNameFromUri(workspaceDetails?.storageUri || \"\") || \"unknown\";\n console.log(\n ServiceErrorMessageConstants.UPLOADING_ARTIFACTS.formatWithDetails(\n storageAccountName,\n containerName,\n folderName,\n ),\n );\n\n await this.modifyTraceIndexHtml(outputFolder);\n const uploadResults = await this.uploadFolderInParallel(\n containerClient,\n outputFolder,\n outputFolder,\n folderName,\n );\n\n if (uploadResults.totalFiles === 0) {\n return { success: false, errorMessage: \"No files found to upload\" };\n }\n\n const failedFiles = uploadResults.totalFiles - uploadResults.uploadedFiles.length;\n if (failedFiles > 0) {\n if (uploadResults.failedFileDetails) {\n const hasAuthorizationError = uploadResults.failedFileDetails.some(\n (fileDetail) =>\n fileDetail.error.includes(\"not authorized to perform this operation\") ||\n fileDetail.error.includes(\"AuthorizationFailure\"),\n );\n\n if (hasAuthorizationError) {\n return {\n success: false,\n errorMessage:\n ServiceErrorMessageConstants.STORAGE_AUTHORIZATION_FAILED.formatWithStorageAccount(\n storageAccountName,\n ),\n };\n }\n }\n\n // Get list of failed file names by comparing total files with uploaded files\n const uploadedSet = new Set(uploadResults.uploadedFiles);\n const allFiles = collectAllFiles(outputFolder, outputFolder, folderName);\n const failedFileNames = allFiles\n .filter((file) => !uploadedSet.has(file.relativePath))\n .map((file) => file.relativePath);\n\n return {\n success: false,\n partialSuccess: true,\n failedFileCount: failedFiles,\n totalFiles: uploadResults.totalFiles,\n failedFiles: failedFileNames,\n failedFileDetails: uploadResults.failedFileDetails,\n };\n }\n\n return { success: true };\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n coreLogger.error(`Failed to upload HTML report: ${error}`);\n return { success: false, errorMessage };\n }\n }\n private async modifyTraceIndexHtml(outputFolder: string): Promise<void> {\n coreLogger.info(`Starting trace modification for folder: ${outputFolder}`);\n const indexPath = join(outputFolder, \"trace/index.html\");\n\n if (!existsSync(indexPath)) {\n coreLogger.error(`trace/index.html not found at path: ${indexPath}`);\n return;\n }\n coreLogger.info(`Found trace/index.html at: ${indexPath}`);\n\n try {\n const redirectTraceviewerScript = `<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Redirecting to Trace Viewer...</title>\n</head>\n<body>\n <script>\n const url = new URL(location.href);\n const traceParam = url.searchParams.get('trace');\n const trace = new URL(traceParam);\n\n // Copy all query parameters from the current URL to the trace URL\n // This includes SAS tokens (sv, sr, sig, etc.) that are on the main URL\n for (const [key, value] of url.searchParams.entries()) {\n if (key !== 'trace') {\n trace.searchParams.set(key, value);\n }\n }\n\n const publicTraceViewer = new URL('https://trace.playwright.dev/');\n publicTraceViewer.searchParams.set('trace', trace.toString());\n location.href = publicTraceViewer.toString();\n </script>\n</body>\n</html>\n`;\n\n writeFileSync(indexPath, redirectTraceviewerScript, \"utf-8\");\n coreLogger.info(\"Successfully updated TraceViewer index file\");\n } catch (error) {\n coreLogger.error(\n `Error modifying trace/index.html: ${error instanceof Error ? error.message : String(error)}`,\n );\n return;\n }\n }\n\n // Uploads the entire Playwright HTML report folder after tests complete.\n\n async uploadPlaywrightHtmlReportAfterTests(\n outputFolderName?: string,\n workspaceMetadata?: WorkspaceMetaData | null,\n ): Promise<UploadResult> {\n try {\n coreLogger.info(\n `Starting post-test HTML report upload, folder name: ${outputFolderName || \"default (playwright-report)\"}`,\n );\n const cred = PlaywrightServiceConfig.instance.credential;\n if (!cred) {\n coreLogger.error(\"No credential found for authentication\");\n return {\n success: false,\n errorMessage: ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message,\n };\n }\n coreLogger.info(\"Credential found for authentication\");\n\n const folderName = outputFolderName || \"playwright-report\";\n const outputFolderPath = join(process.cwd(), folderName);\n\n if (!existsSync(outputFolderPath)) {\n coreLogger.error(`HTML report folder not found: ${outputFolderPath}`);\n return {\n success: false,\n errorMessage:\n ServiceErrorMessageConstants.PLAYWRIGHT_TEST_REPORT_NOT_FOUND.formatWithFolder(\n folderName,\n ),\n };\n }\n coreLogger.info(`HTML report folder found: ${outputFolderPath}`);\n\n const testRunId = PlaywrightServiceConfig.instance.runId;\n coreLogger.info(`Starting upload for test run ID: ${testRunId}`);\n const result = await this.uploadHtmlReportFolder(\n cred,\n testRunId,\n outputFolderPath,\n workspaceMetadata!,\n );\n coreLogger.info(`Completed upload for test run ID: ${testRunId}`);\n return result;\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n coreLogger.error(`Upload failed: ${errorMessage}`);\n return { success: false, errorMessage };\n }\n }\n\n // Parallel Upload Engine - Core upload orchestration with performance optimization\n\n private async uploadFolderInParallel(\n containerClient: ContainerClient,\n folderPath: string,\n basePath: string,\n runIdFolderPrefix?: string,\n ): Promise<{\n uploadedFiles: string[];\n failedFiles: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n totalFiles: number;\n totalSize: number;\n uploadTime: number;\n }> {\n // Sort by size descending - upload large files first for better parallelization\n const filesToUpload = collectAllFiles(folderPath, basePath, runIdFolderPrefix).sort(\n (a, b) => b.size - a.size,\n );\n\n if (filesToUpload.length === 0) {\n return { uploadedFiles: [], failedFiles: [], totalFiles: 0, totalSize: 0, uploadTime: 0 };\n }\n\n const totalSize = filesToUpload.reduce((sum, file) => sum + file.size, 0);\n\n const concurrency = calculateOptimalConcurrency(filesToUpload);\n coreLogger.info(\n `Calculated optimal concurrency: ${concurrency} for ${filesToUpload.length} files (total size: ${(totalSize / 1024 / 1024).toFixed(2)} MB)`,\n );\n const uploadStartTime = Date.now();\n coreLogger.info(`Starting parallel upload with ${concurrency} concurrent operations`);\n const results = await this.uploadWithConcurrencyControl(\n containerClient,\n filesToUpload,\n concurrency,\n );\n\n const uploadEndTime = Date.now();\n const uploadTime = uploadEndTime - uploadStartTime;\n coreLogger.info(`Upload completed in ${uploadTime}ms (${(uploadTime / 1000).toFixed(2)}s)`);\n\n const failed = results.filter((r) => r.status === \"rejected\").length;\n const successful = results.filter((r) => r.status === \"fulfilled\").length;\n coreLogger.info(\n `Upload results: ${successful} successful, ${failed} failed out of ${results.length} total files`,\n );\n\n if (failed > 0) {\n const errors = results\n .filter((r): r is PromiseRejectedResult => r.status === \"rejected\")\n .map((r) => r.reason.message)\n .slice(0, 5); // Show first 5 errors\n\n errors.forEach((error, index) => {\n coreLogger.error(` ${index + 1}. ${error}`);\n });\n\n // Get failed file names and their error messages\n const uploadedSet = new Set(\n results\n .filter((r): r is PromiseFulfilledResult<string> => r.status === \"fulfilled\")\n .map((r) => r.value),\n );\n const failedFileNames = filesToUpload\n .filter((file) => !uploadedSet.has(file.relativePath))\n .map((file) => file.relativePath);\n\n // Create detailed error mapping\n const failedFileDetails: Array<{ fileName: string; error: string }> = [];\n results.forEach((result, index) => {\n if (result.status === \"rejected\") {\n const fileName = filesToUpload[index]?.relativePath || `File at index ${index}`;\n const errorMessage =\n result.reason instanceof Error ? result.reason.message : String(result.reason);\n failedFileDetails.push({ fileName, error: errorMessage });\n }\n });\n\n // Log error but don't throw to prevent breaking HTML reporter\n coreLogger.error(\n `Upload failed: ${failed} files could not be uploaded. Sample errors: ${errors.join(\", \")}`,\n );\n return {\n uploadedFiles: results\n .filter((r): r is PromiseFulfilledResult<string> => r.status === \"fulfilled\")\n .map((r) => r.value),\n failedFiles: failedFileNames,\n failedFileDetails,\n totalFiles: filesToUpload.length,\n totalSize,\n uploadTime,\n };\n }\n\n const uploadedFiles = results\n .filter((r): r is PromiseFulfilledResult<string> => r.status === \"fulfilled\")\n .map((r) => r.value);\n\n return {\n uploadedFiles,\n failedFiles: [],\n totalFiles: filesToUpload.length,\n totalSize,\n uploadTime,\n };\n }\n\n // Concurrency Control System - Manages parallel execution with controlled resource usage\n\n private async uploadWithConcurrencyControl(\n containerClient: ContainerClient,\n files: Array<{ fullPath: string; relativePath: string; size: number; contentType: string }>,\n concurrency: number,\n ): Promise<PromiseSettledResult<string>[]> {\n const uploadTasks = files.map((fileInfo) => async (): Promise<string> => {\n try {\n await this.uploadSingleFileOptimized(containerClient, fileInfo);\n return fileInfo.relativePath;\n } catch (error) {\n coreLogger.error(\n `Failed to upload file: ${fileInfo.relativePath} - ${\n error instanceof Error ? error.message : \"Unknown error\"\n }`,\n );\n throw error;\n }\n });\n\n return this.executeWithOptimizedBatching(uploadTasks, concurrency);\n }\n\n // Optimized Batch Execution Engine - High-performance task processing system\n\n private async executeWithOptimizedBatching<T>(\n tasks: Array<() => Promise<T>>,\n concurrency: number,\n ): Promise<PromiseSettledResult<T>[]> {\n const results: PromiseSettledResult<T>[] = new Array(tasks.length);\n let completedTasks = 0;\n\n // Splits tasks into optimal batches to balance memory usage vs. throughput\n const batchSize = Math.min(UploadConstants.BATCH_SIZE, concurrency * 2);\n const batches: Array<Array<() => Promise<T>>> = [];\n\n // Each batch will be processed with full concurrency before moving to next batch\n for (let i = 0; i < tasks.length; i += batchSize) {\n batches.push(tasks.slice(i, i + batchSize));\n }\n\n // Process each batch sequentially to maintain memory efficiency\n coreLogger.info(`Processing ${batches.length} batches with ${batchSize} tasks per batch`);\n for (let batchIndex = 0; batchIndex < batches.length; batchIndex++) {\n const batch = batches[batchIndex];\n const batchStartIndex = batchIndex * batchSize;\n coreLogger.info(\n `Starting batch ${batchIndex + 1}/${batches.length} with ${batch.length} tasks`,\n );\n\n // Transform each task into a promise that captures results at correct index\n const batchPromises = batch.map(async (task, taskIndex) => {\n const globalIndex = batchStartIndex + taskIndex;\n try {\n const result = await task();\n results[globalIndex] = { status: \"fulfilled\", value: result };\n return result;\n } catch (error) {\n results[globalIndex] = { status: \"rejected\", reason: error };\n coreLogger.error(\n `Task failed at index ${globalIndex}: ${\n error instanceof Error ? error.message : \"Unknown error\"\n }`,\n );\n return;\n }\n });\n\n const executing: Promise<any>[] = [];\n\n for (const promise of batchPromises) {\n if (executing.length >= concurrency) {\n await Promise.race(executing);\n }\n const wrappedPromise = promise\n .then((result) => {\n completedTasks++;\n return result;\n })\n .catch(() => {\n completedTasks++;\n })\n .finally(() => {\n // Cleanup: remove completed promise from executing array\n const index = executing.indexOf(wrappedPromise);\n if (index > -1) executing.splice(index, 1);\n });\n\n executing.push(wrappedPromise);\n }\n\n // Wait for all promises in current batch to complete before moving to next batch\n await Promise.allSettled(executing);\n coreLogger.info(`Completed batch ${batchIndex + 1}/${batches.length}`);\n }\n\n return results;\n }\n\n // Individual File Upload with Retry Logic\n\n private async uploadSingleFileOptimized(\n containerClient: ContainerClient,\n fileInfo: { fullPath: string; relativePath: string; contentType: string; size: number },\n ): Promise<void> {\n coreLogger.info(\n `Uploading file: ${fileInfo.relativePath} (${(fileInfo.size / 1024).toFixed(2)} KB, ${fileInfo.contentType})`,\n );\n const blockBlobClient = containerClient.getBlockBlobClient(fileInfo.relativePath);\n const maxRetries = UploadConstants.MAX_RETRY_ATTEMPTS;\n const baseDelay = UploadConstants.RETRY_BASE_DELAY;\n\n for (let attempt = 1; attempt <= maxRetries; attempt++) {\n try {\n await this.performOptimizedUpload(blockBlobClient, fileInfo);\n return;\n } catch (error) {\n const isLastAttempt = attempt === maxRetries;\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n coreLogger.info(\n `Upload attempt ${attempt} failed for ${fileInfo.relativePath}: ${errorMessage}`,\n );\n\n if (isLastAttempt) {\n coreLogger.error(\n `All retry attempts exhausted for ${fileInfo.relativePath}: ${errorMessage}`,\n );\n if (error instanceof Error) {\n throw error;\n }\n throw new Error(\n `Upload failed for ${fileInfo.relativePath} after ${maxRetries} attempts: ${errorMessage}`,\n );\n }\n\n // Exponential backoff with jitter (Azure SDK pattern)\n const delay = baseDelay * Math.pow(2, attempt - 1) + Math.random() * 500;\n coreLogger.info(\n `Retrying upload for ${fileInfo.relativePath} in ${delay.toFixed(0)}ms (attempt ${attempt + 1}/${maxRetries})`,\n );\n await new Promise((_resolve) => setTimeout(_resolve, delay));\n }\n }\n }\n\n // Multi-Strategy Upload Engine - Optimized upload based on file characteristics\n\n private async performOptimizedUpload(\n blockBlobClient: BlockBlobClient,\n fileInfo: { fullPath: string; relativePath: string; contentType: string; size: number },\n ): Promise<void> {\n if (fileInfo.size <= UploadConstants.SMALL_FILE_THRESHOLD) {\n // DIRECT UPLOAD: Optimal for small files (≤1MB)\n const fileContent = readFileSync(fileInfo.fullPath);\n await blockBlobClient.upload(fileContent, fileContent.length, {\n blobHTTPHeaders: {\n blobContentType: fileInfo.contentType,\n },\n });\n } else if (fileInfo.size <= UploadConstants.LARGE_FILE_THRESHOLD) {\n // BLOCK UPLOAD: Optimal for medium files (1MB - 100MB)\n const fileContent = readFileSync(fileInfo.fullPath);\n await blockBlobClient.uploadData(fileContent, {\n blobHTTPHeaders: {\n blobContentType: fileInfo.contentType,\n },\n blockSize: UploadConstants.OPTIMIZED_BLOCK_SIZE,\n concurrency: UploadConstants.PER_FILE_CONCURRENCY,\n });\n } else {\n // STREAMING UPLOAD: Optimal for large files (>100MB)\n const stream = createReadStream(fileInfo.fullPath);\n await blockBlobClient.uploadStream(\n stream,\n UploadConstants.STREAM_BUFFER_SIZE,\n UploadConstants.LARGE_FILE_CONCURRENCY,\n {\n blobHTTPHeaders: {\n blobContentType: fileInfo.contentType,\n },\n },\n );\n }\n coreLogger.info(`Successfully uploaded: ${fileInfo.relativePath}`);\n }\n}\n"]}
@@ -66,6 +66,7 @@ export declare const InternalEnvironmentVariables: {
66
66
  MPT_SERVICE_OS: string;
67
67
  ONE_TIME_OPERATION_FLAG: string;
68
68
  USING_SERVICE_CONFIG: string;
69
+ TEST_RUN_CREATION_SUCCESS: string;
69
70
  };
70
71
  export declare const UploadConstants: {
71
72
  SMALL_FILE_THRESHOLD: number;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B;;;;CAIvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;CAM1C,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;CAUxC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B;;;;CAIvC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS;;;CAGZ,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,WAAW;;;CAGd,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;CAGtC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;CAM1C,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAIvB,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;CAMrB,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAWxC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAC"}
@@ -71,6 +71,7 @@ exports.InternalEnvironmentVariables = {
71
71
  MPT_SERVICE_OS: "_MPT_SERVICE_OS",
72
72
  ONE_TIME_OPERATION_FLAG: "_ONE_TIME_OPERATION_FLAG",
73
73
  USING_SERVICE_CONFIG: "_USING_SERVICE_CONFIG",
74
+ TEST_RUN_CREATION_SUCCESS: "_MPT_TEST_RUN_CREATION_SUCCESS",
74
75
  };
75
76
  exports.UploadConstants = {
76
77
  SMALL_FILE_THRESHOLD: 1024 * 1024,
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,+BA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;IACjC,oBAAoB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACvC,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,EAAE;IACnB,oBAAoB,EAAE,EAAE;IACxB,sBAAsB,EAAE,CAAC;IACzB,UAAU,EAAE,GAAG;IACf,oBAAoB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACrC,kBAAkB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACnC,kBAAkB,EAAE,CAAC;IACrB,gBAAgB,EAAE,IAAI;CACvB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Azure Playwright cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Azure Playwright\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Azure Playwright\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n};\n\nexport const GitHubActionsConstants = {\n GIT_VERSION_COMMAND: \"git --version\",\n GIT_REV_PARSE: \"git rev-parse --is-inside-work-tree\",\n GIT_COMMIT_MESSAGE_COMMAND: 'git log -1 --pretty=format:\"%s\"',\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n DEFAULT_SERVICE_AUTH_TYPE: ServiceAuth.ENTRA_ID,\n};\n\nexport const SDKLanguage = {\n JAVASCRIPT: \"JAVASCRIPT\",\n TYPESCRIPT: \"TYPESCRIPT\",\n CSHARP: \"CSHARP\",\n};\n\nexport const RunConfigConstants = {\n TEST_FRAMEWORK_NAME: \"PLAYWRIGHT\",\n TEST_SDK_LANGUAGE: SDKLanguage.JAVASCRIPT,\n TEST_FRAMEWORK_RUNNERNAME: \"PLAYWRIGHT\",\n};\n\nexport const Constants = {\n SevenDaysInMS: 7 * 24 * 60 * 60 * 1000,\n OneDayInMS: 24 * 60 * 60 * 1000,\n MinimumSupportedPlaywrightVersion: \"1.47.0\",\n LatestAPIVersion: \"2025-09-01\",\n HTTP_CALL_TIMEOUT: 10000,\n};\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_API_VERSION: \"_MPT_API_VERSION\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n MPT_SERVICE_OS: \"_MPT_SERVICE_OS\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n USING_SERVICE_CONFIG: \"_USING_SERVICE_CONFIG\",\n};\n\nexport const UploadConstants = {\n SMALL_FILE_THRESHOLD: 1024 * 1024,\n LARGE_FILE_THRESHOLD: 100 * 1024 * 1024,\n BASE_CONCURRENCY: 20,\n MAX_CONCURRENCY: 50,\n PER_FILE_CONCURRENCY: 10,\n LARGE_FILE_CONCURRENCY: 5,\n BATCH_SIZE: 100,\n OPTIMIZED_BLOCK_SIZE: 8 * 1024 * 1024,\n STREAM_BUFFER_SIZE: 4 * 1024 * 1024,\n MAX_RETRY_ATTEMPTS: 3,\n RETRY_BASE_DELAY: 1000,\n};\n"]}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,2BAA2B,GAAG;IACzC,+CAA+C,EAAE,EAAE;IACnD,KAAK,EAAE,8CAA8C;IACrD,mCAAmC,EAAE,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;;;GAGG;AACU,QAAA,WAAW,GAAG;IACzB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX;;;GAGG;AACU,QAAA,0BAA0B,GAAG;IACxC,+BAA+B,EAAE,iCAAiC;IAClE,sBAAsB,EAAE,wBAAwB;CACjD,CAAC;AAEW,QAAA,sBAAsB,GAAG;IACpC,mBAAmB,EAAE,eAAe;IACpC,aAAa,EAAE,qCAAqC;IACpD,0BAA0B,EAAE,iCAAiC;CAC9D,CAAC;AAEW,QAAA,8BAA8B,GAAG;IAC5C,eAAe,EAAE,KAAK;IACtB,eAAe,EAAE,CAAC;IAClB,sBAAsB,EAAE,YAAY;IACpC,kBAAkB,EAAE,iBAAS,CAAC,KAAK;IACnC,yBAAyB,EAAE,mBAAW,CAAC,QAAQ;CAChD,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,mBAAmB,EAAE,YAAY;IACjC,iBAAiB,EAAE,mBAAW,CAAC,UAAU;IACzC,yBAAyB,EAAE,YAAY;CACxC,CAAC;AAEW,QAAA,SAAS,GAAG;IACvB,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACtC,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAC/B,iCAAiC,EAAE,QAAQ;IAC3C,gBAAgB,EAAE,YAAY;IAC9B,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC1C,sBAAsB,EAAE,yBAAyB;IACjD,qBAAqB,EAAE,wBAAwB;IAC/C,oBAAoB,EAAE,uBAAuB;IAC7C,eAAe,EAAE,kBAAkB;IACnC,kBAAkB,EAAE,qBAAqB;IACzC,6BAA6B,EAAE,gCAAgC;IAC/D,cAAc,EAAE,iBAAiB;IACjC,uBAAuB,EAAE,0BAA0B;IACnD,oBAAoB,EAAE,uBAAuB;IAC7C,yBAAyB,EAAE,gCAAgC;CAC5D,CAAC;AAEW,QAAA,eAAe,GAAG;IAC7B,oBAAoB,EAAE,IAAI,GAAG,IAAI;IACjC,oBAAoB,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;IACvC,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,EAAE;IACnB,oBAAoB,EAAE,EAAE;IACxB,sBAAsB,EAAE,CAAC;IACzB,UAAU,EAAE,GAAG;IACf,oBAAoB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACrC,kBAAkB,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI;IACnC,kBAAkB,EAAE,CAAC;IACrB,gBAAgB,EAAE,IAAI;CACvB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const EntraIdAccessTokenConstants = {\n LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,\n SCOPE: \"https://management.core.windows.net/.default\",\n ROTATION_INTERVAL_PERIOD_IN_MINUTES: 4,\n};\n\n/** @public\n *\n * OS types supported on Azure Playwright cloud hosted browsers\n */\nexport const ServiceOS = {\n LINUX: \"linux\",\n WINDOWS: \"windows\",\n} as const;\n\n/** @public\n *\n * Authentication types supported on Azure Playwright\n */\nexport const ServiceAuth = {\n ENTRA_ID: \"ENTRA_ID\",\n ACCESS_TOKEN: \"ACCESS_TOKEN\",\n} as const;\n\n/** @public\n *\n * Environment variables used by Azure Playwright\n */\nexport const ServiceEnvironmentVariable = {\n PLAYWRIGHT_SERVICE_ACCESS_TOKEN: \"PLAYWRIGHT_SERVICE_ACCESS_TOKEN\",\n PLAYWRIGHT_SERVICE_URL: \"PLAYWRIGHT_SERVICE_URL\",\n};\n\nexport const GitHubActionsConstants = {\n GIT_VERSION_COMMAND: \"git --version\",\n GIT_REV_PARSE: \"git rev-parse --is-inside-work-tree\",\n GIT_COMMIT_MESSAGE_COMMAND: 'git log -1 --pretty=format:\"%s\"',\n};\n\nexport const DefaultConnectOptionsConstants = {\n DEFAULT_TIMEOUT: 30000,\n DEFAULT_SLOW_MO: 0,\n DEFAULT_EXPOSE_NETWORK: \"<loopback>\",\n DEFAULT_SERVICE_OS: ServiceOS.LINUX,\n DEFAULT_SERVICE_AUTH_TYPE: ServiceAuth.ENTRA_ID,\n};\n\nexport const SDKLanguage = {\n JAVASCRIPT: \"JAVASCRIPT\",\n TYPESCRIPT: \"TYPESCRIPT\",\n CSHARP: \"CSHARP\",\n};\n\nexport const RunConfigConstants = {\n TEST_FRAMEWORK_NAME: \"PLAYWRIGHT\",\n TEST_SDK_LANGUAGE: SDKLanguage.JAVASCRIPT,\n TEST_FRAMEWORK_RUNNERNAME: \"PLAYWRIGHT\",\n};\n\nexport const Constants = {\n SevenDaysInMS: 7 * 24 * 60 * 60 * 1000,\n OneDayInMS: 24 * 60 * 60 * 1000,\n MinimumSupportedPlaywrightVersion: \"1.47.0\",\n LatestAPIVersion: \"2025-09-01\",\n HTTP_CALL_TIMEOUT: 10000,\n};\n\nexport const InternalEnvironmentVariables = {\n MPT_PLAYWRIGHT_VERSION: \"_MPT_PLAYWRIGHT_VERSION\",\n MPT_SETUP_FATAL_ERROR: \"_MPT_SETUP_FATAL_ERROR\",\n MPT_SERVICE_RUN_NAME: \"_MPT_SERVICE_RUN_NAME\",\n MPT_API_VERSION: \"_MPT_API_VERSION\",\n MPT_SERVICE_RUN_ID: \"_MPT_SERVICE_RUN_ID\",\n MPT_CLOUD_HOSTED_BROWSER_USED: \"_MPT_CLOUD_HOSTED_BROWSER_USED\",\n MPT_SERVICE_OS: \"_MPT_SERVICE_OS\",\n ONE_TIME_OPERATION_FLAG: \"_ONE_TIME_OPERATION_FLAG\",\n USING_SERVICE_CONFIG: \"_USING_SERVICE_CONFIG\",\n TEST_RUN_CREATION_SUCCESS: \"_MPT_TEST_RUN_CREATION_SUCCESS\",\n};\n\nexport const UploadConstants = {\n SMALL_FILE_THRESHOLD: 1024 * 1024,\n LARGE_FILE_THRESHOLD: 100 * 1024 * 1024,\n BASE_CONCURRENCY: 20,\n MAX_CONCURRENCY: 50,\n PER_FILE_CONCURRENCY: 10,\n LARGE_FILE_CONCURRENCY: 5,\n BATCH_SIZE: 100,\n OPTIMIZED_BLOCK_SIZE: 8 * 1024 * 1024,\n STREAM_BUFFER_SIZE: 4 * 1024 * 1024,\n MAX_RETRY_ATTEMPTS: 3,\n RETRY_BASE_DELAY: 1000,\n};\n"]}
@@ -64,6 +64,7 @@ export declare const ServiceErrorMessageConstants: {
64
64
  STORAGE_AUTHORIZATION_FAILED: {
65
65
  key: string;
66
66
  message: string;
67
+ formatWithStorageAccount: (storageAccountName: string) => string;
67
68
  };
68
69
  UNABLE_TO_EXTRACT_WORKSPACE_ID: {
69
70
  key: string;
@@ -130,5 +131,18 @@ export declare const ServiceErrorMessageConstants: {
130
131
  message: string;
131
132
  formatWithError: (error: string) => string;
132
133
  };
134
+ TEST_RUN_CREATION_FAILED: {
135
+ key: string;
136
+ message: string;
137
+ formatWithErrorDetails: (errorDetails: string) => string;
138
+ };
139
+ REPORTING_TEST_RUN_FAILED: {
140
+ key: string;
141
+ message: string;
142
+ };
143
+ REPORTER_REQUIRES_SERVICE_CONFIG: {
144
+ key: string;
145
+ message: string;
146
+ };
133
147
  };
134
148
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA+CE,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;+CAkBf,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAuC5B,MAAM,KAAG,MAAM;;;;;uCAMV,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;6BA0BzB,MAAM,KAAG,MAAM;;;;;4CAKA,MAAM,aAAa,MAAM,UAAU,MAAM,KAAG,MAAM;;;;;iCAM7D,MAAM,KAAG,MAAM;;CAE3C,CAAC"}
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"}
@@ -68,7 +68,8 @@ exports.ServiceErrorMessageConstants = {
68
68
  },
69
69
  STORAGE_AUTHORIZATION_FAILED: {
70
70
  key: "StorageAuthorizationFailed",
71
- message: "This request is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to this storage account.",
71
+ 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",
72
+ 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`,
72
73
  },
73
74
  UNABLE_TO_EXTRACT_WORKSPACE_ID: {
74
75
  key: "UnableToExtractWorkspaceId",
@@ -76,11 +77,11 @@ exports.ServiceErrorMessageConstants = {
76
77
  },
77
78
  REPORTER_REQUIRES_ENTRA_AUTH: {
78
79
  key: "ReporterRequiresEntraAuth",
79
- message: "The Azure Playwright Reporter can only be used with ENTRA_ID authentication. Please refer to https://aka.ms/pww/docs/authentication for more information.",
80
+ message: "Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. Please refer to https://aka.ms/pww/docs/authentication for more information.",
80
81
  },
81
82
  HTML_REPORTER_REQUIRED: {
82
83
  key: "HtmlReporterRequired",
83
- message: "The Azure Playwright Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the HTML reporter to generate test reports that can be uploaded to Azure Storage. Example: reporter: [['html'], ['@azure/playwright/reporter']]",
84
+ 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']]",
84
85
  },
85
86
  WORKSPACE_METADATA_FETCH_FAILED: {
86
87
  key: "WorkspaceMetadataFetchFailed",
@@ -88,7 +89,7 @@ exports.ServiceErrorMessageConstants = {
88
89
  },
89
90
  WORKSPACE_REPORTING_DISABLED: {
90
91
  key: "WorkspaceReportingDisabled",
91
- message: "Playwright Workspaces reporting: DISABLED. Please refer to https://aka.ms/pww-reporting for more information.",
92
+ 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 ",
92
93
  },
93
94
  UPLOAD_FAILED_FILES: {
94
95
  key: "UploadFailedFiles",
@@ -135,5 +136,18 @@ exports.ServiceErrorMessageConstants = {
135
136
  message: "Failed to get workspace metadata",
136
137
  formatWithError: (error) => error,
137
138
  },
139
+ TEST_RUN_CREATION_FAILED: {
140
+ key: "TestRunCreationFailed",
141
+ message: "Failed to create test run. Test execution will continue.",
142
+ formatWithErrorDetails: (errorDetails) => `Failed to create test run. Error: ${errorDetails}. Test execution will continue.`,
143
+ },
144
+ REPORTING_TEST_RUN_FAILED: {
145
+ key: "ReportingTestRunFailed",
146
+ message: "Test run creation failed during setup.",
147
+ },
148
+ REPORTER_REQUIRES_SERVICE_CONFIG: {
149
+ key: "ReporterRequiresServiceConfig",
150
+ message: "Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig.",
151
+ },
138
152
  };
139
153
  //# sourceMappingURL=messages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,4BAA4B,GAAG;IAC1C,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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CAAC,KAAa,EAAU,EAAE,CAAC,KAAK;KAClD;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 \"This request is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to this storage account.\",\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 \"The Azure Playwright 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 \"The Azure Playwright Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the HTML 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. Please refer to https://aka.ms/pww-reporting for more information.\",\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};\n"]}
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAErB,QAAA,4BAA4B,GAAG;IAC1C,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EACL,8GAA8G;KACjH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,qCAAqC;KAC/C;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,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;QAC3B,OAAO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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 +1 @@
1
- {"version":3,"file":"initializePlaywrightServiceTestRun.d.ts","sourceRoot":"","sources":["../../../src/core/initializePlaywrightServiceTestRun.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMnD;;;;;GAKG;AACH,wBAAsB,kCAAkC,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB1F"}
1
+ {"version":3,"file":"initializePlaywrightServiceTestRun.d.ts","sourceRoot":"","sources":["../../../src/core/initializePlaywrightServiceTestRun.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAMnD;;;;;GAKG;AACH,wBAAsB,kCAAkC,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAe1F"}
@@ -3,7 +3,7 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.initializePlaywrightServiceTestRun = initializePlaywrightServiceTestRun;
6
- const playwrightServiceApicall_js_1 = require("../utils/playwrightServiceApicall.js");
6
+ const PlaywrightServiceClient_js_1 = require("../utils/PlaywrightServiceClient.js");
7
7
  const playwrightServiceConfig_js_1 = require("../common/playwrightServiceConfig.js");
8
8
  const utils_js_1 = require("../utils/utils.js");
9
9
  const cIInfoProvider_js_1 = require("../utils/cIInfoProvider.js");
@@ -14,9 +14,9 @@ const cIInfoProvider_js_1 = require("../utils/cIInfoProvider.js");
14
14
  * @returns Promise that resolves when service initialization is complete
15
15
  */
16
16
  async function initializePlaywrightServiceTestRun(config) {
17
- const playwrightServiceApiClient = new playwrightServiceApicall_js_1.PlaywrightServiceApiCall();
18
- const ciConfigInfo = cIInfoProvider_js_1.CIInfoProvider.getCIInfo();
17
+ const playwrightServiceApiClient = new PlaywrightServiceClient_js_1.PlaywrightServiceClient();
19
18
  const playwrightServiceConfig = playwrightServiceConfig_js_1.PlaywrightServiceConfig.instance;
19
+ const ciConfigInfo = cIInfoProvider_js_1.CIInfoProvider.getCIInfo();
20
20
  const testRunCreatePayload = {
21
21
  displayName: playwrightServiceConfig.runName === ""
22
22
  ? playwrightServiceConfig.runId
@@ -24,7 +24,6 @@ async function initializePlaywrightServiceTestRun(config) {
24
24
  config: (0, utils_js_1.getTestRunConfig)(config),
25
25
  ciConfig: ciConfigInfo,
26
26
  };
27
- // Create/update test run in the service
28
- await playwrightServiceApiClient.patchTestRunAPI(testRunCreatePayload);
27
+ await playwrightServiceApiClient.createOrUpdateTestRun(testRunCreatePayload);
29
28
  }
30
29
  //# sourceMappingURL=initializePlaywrightServiceTestRun.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initializePlaywrightServiceTestRun.js","sourceRoot":"","sources":["../../../src/core/initializePlaywrightServiceTestRun.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAclC,gFAkBC;AA7BD,sFAAgF;AAChF,qFAA+E;AAC/E,gDAAqD;AACrD,kEAA4D;AAE5D;;;;;GAKG;AACI,KAAK,UAAU,kCAAkC,CAAC,MAAkB;IACzE,MAAM,0BAA0B,GAAG,IAAI,sDAAwB,EAAE,CAAC;IAElE,MAAM,YAAY,GAAG,kCAAc,CAAC,SAAS,EAAE,CAAC;IAEhD,MAAM,uBAAuB,GAAG,oDAAuB,CAAC,QAAQ,CAAC;IAEjE,MAAM,oBAAoB,GAAG;QAC3B,WAAW,EACT,uBAAuB,CAAC,OAAO,KAAK,EAAE;YACpC,CAAC,CAAC,uBAAuB,CAAC,KAAK;YAC/B,CAAC,CAAC,uBAAuB,CAAC,OAAO;QACrC,MAAM,EAAE,IAAA,2BAAgB,EAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,YAAY;KACvB,CAAC;IAEF,wCAAwC;IACxC,MAAM,0BAA0B,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAC;AACzE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullConfig } from \"@playwright/test\";\nimport { PlaywrightServiceApiCall } from \"../utils/playwrightServiceApicall.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport { getTestRunConfig } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\n\n/**\n * Initializes the Playwright workspaces by setting up authentication and creating a test run.\n *\n * @param config - The full Playwright configuration\n * @returns Promise that resolves when service initialization is complete\n */\nexport async function initializePlaywrightServiceTestRun(config: FullConfig): Promise<void> {\n const playwrightServiceApiClient = new PlaywrightServiceApiCall();\n\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n\n const testRunCreatePayload = {\n displayName:\n playwrightServiceConfig.runName === \"\"\n ? playwrightServiceConfig.runId\n : playwrightServiceConfig.runName,\n config: getTestRunConfig(config),\n ciConfig: ciConfigInfo,\n };\n\n // Create/update test run in the service\n await playwrightServiceApiClient.patchTestRunAPI(testRunCreatePayload);\n}\n"]}
1
+ {"version":3,"file":"initializePlaywrightServiceTestRun.js","sourceRoot":"","sources":["../../../src/core/initializePlaywrightServiceTestRun.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAclC,gFAeC;AA1BD,oFAA8E;AAC9E,qFAA+E;AAC/E,gDAAqD;AACrD,kEAA4D;AAE5D;;;;;GAKG;AACI,KAAK,UAAU,kCAAkC,CAAC,MAAkB;IACzE,MAAM,0BAA0B,GAAG,IAAI,oDAAuB,EAAE,CAAC;IACjE,MAAM,uBAAuB,GAAG,oDAAuB,CAAC,QAAQ,CAAC;IACjE,MAAM,YAAY,GAAG,kCAAc,CAAC,SAAS,EAAE,CAAC;IAEhD,MAAM,oBAAoB,GAAG;QAC3B,WAAW,EACT,uBAAuB,CAAC,OAAO,KAAK,EAAE;YACpC,CAAC,CAAC,uBAAuB,CAAC,KAAK;YAC/B,CAAC,CAAC,uBAAuB,CAAC,OAAO;QACrC,MAAM,EAAE,IAAA,2BAAgB,EAAC,MAAM,CAAC;QAChC,QAAQ,EAAE,YAAY;KACvB,CAAC;IAEF,MAAM,0BAA0B,CAAC,qBAAqB,CAAC,oBAAoB,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullConfig } from \"@playwright/test\";\nimport { PlaywrightServiceClient } from \"../utils/PlaywrightServiceClient.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport { getTestRunConfig } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\n\n/**\n * Initializes the Playwright workspaces by setting up authentication and creating a test run.\n *\n * @param config - The full Playwright configuration\n * @returns Promise that resolves when service initialization is complete\n */\nexport async function initializePlaywrightServiceTestRun(config: FullConfig): Promise<void> {\n const playwrightServiceApiClient = new PlaywrightServiceClient();\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n\n const testRunCreatePayload = {\n displayName:\n playwrightServiceConfig.runName === \"\"\n ? playwrightServiceConfig.runId\n : playwrightServiceConfig.runName,\n config: getTestRunConfig(config),\n ciConfig: ciConfigInfo,\n };\n\n await playwrightServiceApiClient.createOrUpdateTestRun(testRunCreatePayload);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"playwrightReporter.d.ts","sourceRoot":"","sources":["../../../src/reporter/playwrightReporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAUtE;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,QAAQ;IACzD,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,iBAAiB,CAAkC;IAC3D,OAAO,CAAC,kBAAkB,CAAS;IAEnC;;;;OAIG;IAEG,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA2ChD;;OAEG;IAEG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAiCd,gBAAgB;IAsB9B,OAAO,CAAC,iCAAiC;CAyB1C"}
1
+ {"version":3,"file":"playwrightReporter.d.ts","sourceRoot":"","sources":["../../../src/reporter/playwrightReporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAUtE;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,QAAQ;IACzD,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,iBAAiB,CAAkC;IAC3D,OAAO,CAAC,kBAAkB,CAAS;IAEnC;;;;OAIG;IAEG,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA8DhD;;OAEG;IAEG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAiCd,gBAAgB;IAsB9B,OAAO,CAAC,iCAAiC;CAuC1C"}
@@ -6,7 +6,7 @@ const logger_js_1 = require("../common/logger.js");
6
6
  const playwrightServiceConfig_js_1 = require("../common/playwrightServiceConfig.js");
7
7
  const constants_js_1 = require("../common/constants.js");
8
8
  const messages_js_1 = require("../common/messages.js");
9
- const playwrightServiceApicall_js_1 = require("../utils/playwrightServiceApicall.js");
9
+ const PlaywrightServiceClient_js_1 = require("../utils/PlaywrightServiceClient.js");
10
10
  /**
11
11
  * Azure Playwright Reporter - Uploads generated Playwright test report folder to Azure Storage.
12
12
  */
@@ -22,6 +22,22 @@ class PlaywrightReporter {
22
22
  async onBegin(config) {
23
23
  logger_js_1.coreLogger.info(`Reporter configuration: ${JSON.stringify(config.reporter, null, 2)}`);
24
24
  this.config = config;
25
+ // Check if using service config
26
+ const usingServiceConfig = process.env[constants_js_1.InternalEnvironmentVariables.USING_SERVICE_CONFIG] === "true";
27
+ logger_js_1.coreLogger.info(`Using service config: ${usingServiceConfig}`);
28
+ if (!usingServiceConfig) {
29
+ console.error(messages_js_1.ServiceErrorMessageConstants.REPORTER_REQUIRES_SERVICE_CONFIG.message);
30
+ this.isReportingEnabled = false;
31
+ return;
32
+ }
33
+ // Check if test run creation was successful
34
+ const testRunCreationSuccess = process.env[constants_js_1.InternalEnvironmentVariables.TEST_RUN_CREATION_SUCCESS] === "true";
35
+ if (!testRunCreationSuccess) {
36
+ console.error(messages_js_1.ServiceErrorMessageConstants.REPORTING_STATUS_FAILED.message);
37
+ console.error(messages_js_1.ServiceErrorMessageConstants.REPORTING_TEST_RUN_FAILED.message);
38
+ this.isReportingEnabled = false;
39
+ return;
40
+ }
25
41
  // Check authentication
26
42
  const playwrightServiceConfig = playwrightServiceConfig_js_1.PlaywrightServiceConfig.instance;
27
43
  logger_js_1.coreLogger.info(`Current authentication type: ${playwrightServiceConfig.serviceAuthType}`);
@@ -34,11 +50,10 @@ class PlaywrightReporter {
34
50
  logger_js_1.coreLogger.info("Authentication validation passed - using ENTRA_ID");
35
51
  // Get workspace metadata for later use
36
52
  try {
37
- const playwrightServiceApiClient = new playwrightServiceApicall_js_1.PlaywrightServiceApiCall();
53
+ const playwrightServiceApiClient = new PlaywrightServiceClient_js_1.PlaywrightServiceClient();
38
54
  this.workspaceMetadata = await playwrightServiceApiClient.getWorkspaceMetadata();
39
55
  if (!this.workspaceMetadata?.storageUri) {
40
56
  console.error(messages_js_1.ServiceErrorMessageConstants.WORKSPACE_REPORTING_DISABLED.message);
41
- console.error(messages_js_1.ServiceErrorMessageConstants.STORAGE_URI_NOT_FOUND.message);
42
57
  this.isReportingEnabled = false;
43
58
  return;
44
59
  }
@@ -112,21 +127,29 @@ class PlaywrightReporter {
112
127
  this.isReportingEnabled = false;
113
128
  return;
114
129
  }
115
- const hasHtmlReporter = config.reporter.some((reporter) => {
116
- if (typeof reporter === "string") {
117
- return reporter === "html";
118
- }
119
- if (Array.isArray(reporter) && reporter.length > 0) {
120
- return reporter[0] === "html";
121
- }
122
- return false;
130
+ const htmlReporterIndex = config.reporter.findIndex((reporter) => {
131
+ const reporterName = typeof reporter === "string" ? reporter : reporter?.[0];
132
+ return reporterName === "html";
133
+ });
134
+ const azureReporterIndex = config.reporter.findIndex((reporter) => {
135
+ const reporterName = typeof reporter === "string" ? reporter : reporter?.[0];
136
+ return (typeof reporterName === "string" &&
137
+ reporterName.includes("playwright") &&
138
+ reporterName.includes("reporter"));
123
139
  });
124
- if (!hasHtmlReporter) {
140
+ // Validate HTML reporter exists
141
+ if (htmlReporterIndex === -1) {
142
+ console.error(messages_js_1.ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);
143
+ this.isReportingEnabled = false;
144
+ return;
145
+ }
146
+ // Validate HTML reporter comes before Azure reporter (if Azure reporter exists)
147
+ if (azureReporterIndex !== -1 && htmlReporterIndex > azureReporterIndex) {
125
148
  console.error(messages_js_1.ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);
126
149
  this.isReportingEnabled = false;
127
150
  return;
128
151
  }
129
- logger_js_1.coreLogger.info("HTML reporter validation passed - HTML reporter is configured");
152
+ logger_js_1.coreLogger.info("HTML reporter validation passed - HTML reporter is configured and properly ordered");
130
153
  }
131
154
  }
132
155
  exports.default = PlaywrightReporter;
@@ -1 +1 @@
1
- {"version":3,"file":"playwrightReporter.js","sourceRoot":"","sources":["../../../src/reporter/playwrightReporter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AAkB,GAAG,KAAK,CAAC;YAChC,OAAO;QACT,CAAC;QAED,sBAAU,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;CACF;AA1ID,qCA0IC","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 } from \"../common/constants.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport { PlaywrightServiceApiCall } from \"../utils/playwrightServiceApicall.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 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 PlaywrightServiceApiCall();\n this.workspaceMetadata = await playwrightServiceApiClient.getWorkspaceMetadata();\n\n if (!this.workspaceMetadata?.storageUri) {\n console.error(ServiceErrorMessageConstants.WORKSPACE_REPORTING_DISABLED.message);\n console.error(ServiceErrorMessageConstants.STORAGE_URI_NOT_FOUND.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 hasHtmlReporter = config.reporter.some((reporter) => {\n if (typeof reporter === \"string\") {\n return reporter === \"html\";\n }\n if (Array.isArray(reporter) && reporter.length > 0) {\n return reporter[0] === \"html\";\n }\n return false;\n });\n\n if (!hasHtmlReporter) {\n console.error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\n this.isReportingEnabled = false;\n return;\n }\n\n coreLogger.info(\"HTML reporter validation passed - HTML reporter is configured\");\n }\n}\n"]}
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,CAAC,OAAO,CAAC,MAAkB;QAC9B,sBAAU,CAAC,IAAI,CAAC,2BAA2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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"]}
@@ -0,0 +1,9 @@
1
+ import { HttpService } from "../common/httpService.js";
2
+ import { TestRunCreatePayload, WorkspaceMetaData } from "../common/types.js";
3
+ export declare class PlaywrightServiceClient {
4
+ private httpService;
5
+ constructor(httpService?: HttpService);
6
+ createOrUpdateTestRun(payload: TestRunCreatePayload): Promise<void>;
7
+ getWorkspaceMetadata(): Promise<WorkspaceMetaData>;
8
+ }
9
+ //# sourceMappingURL=PlaywrightServiceClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaywrightServiceClient.d.ts","sourceRoot":"","sources":["../../../src/utils/PlaywrightServiceClient.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG7E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,WAAW,CAAc;gBAErB,WAAW,CAAC,EAAE,WAAW;IAI/B,qBAAqB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IA8CnE,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAsCzD"}