@azure/playwright 1.0.1-alpha.20251223.1 → 1.0.1-alpha.20251225.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/common/constants.d.ts +13 -0
- package/dist/browser/common/constants.d.ts.map +1 -1
- package/dist/browser/common/constants.js +13 -0
- package/dist/browser/common/constants.js.map +1 -1
- package/dist/browser/common/messages.d.ts +41 -0
- package/dist/browser/common/messages.d.ts.map +1 -1
- package/dist/browser/common/messages.js +41 -0
- package/dist/browser/common/messages.js.map +1 -1
- package/dist/browser/common/playwrightServiceConfig.d.ts +2 -0
- package/dist/browser/common/playwrightServiceConfig.d.ts.map +1 -1
- package/dist/browser/common/playwrightServiceConfig.js +4 -0
- package/dist/browser/common/playwrightServiceConfig.js.map +1 -1
- package/dist/browser/common/types.d.ts +13 -0
- package/dist/browser/common/types.d.ts.map +1 -1
- package/dist/browser/common/types.js.map +1 -1
- package/dist/browser/reporter/index.d.ts +10 -0
- package/dist/browser/reporter/index.d.ts.map +1 -0
- package/dist/browser/reporter/index.js +12 -0
- package/dist/browser/reporter/index.js.map +1 -0
- package/dist/browser/reporter/playwrightReporter.d.ts +21 -0
- package/dist/browser/reporter/playwrightReporter.d.ts.map +1 -0
- package/dist/browser/reporter/playwrightReporter.js +88 -0
- package/dist/browser/reporter/playwrightReporter.js.map +1 -0
- package/dist/browser/utils/playwrightReporterStorageManager.d.ts +14 -0
- package/dist/browser/utils/playwrightReporterStorageManager.d.ts.map +1 -0
- package/dist/browser/utils/playwrightReporterStorageManager.js +310 -0
- package/dist/browser/utils/playwrightReporterStorageManager.js.map +1 -0
- package/dist/browser/utils/playwrightServiceApicall.d.ts +1 -0
- package/dist/browser/utils/playwrightServiceApicall.d.ts.map +1 -1
- package/dist/browser/utils/playwrightServiceApicall.js +18 -1
- package/dist/browser/utils/playwrightServiceApicall.js.map +1 -1
- package/dist/browser/utils/utils.d.ts +14 -1
- package/dist/browser/utils/utils.d.ts.map +1 -1
- package/dist/browser/utils/utils.js +119 -0
- package/dist/browser/utils/utils.js.map +1 -1
- package/dist/commonjs/common/constants.d.ts +13 -0
- package/dist/commonjs/common/constants.d.ts.map +1 -1
- package/dist/commonjs/common/constants.js +14 -1
- package/dist/commonjs/common/constants.js.map +1 -1
- package/dist/commonjs/common/messages.d.ts +41 -0
- package/dist/commonjs/common/messages.d.ts.map +1 -1
- package/dist/commonjs/common/messages.js +41 -0
- package/dist/commonjs/common/messages.js.map +1 -1
- package/dist/commonjs/common/playwrightServiceConfig.d.ts +2 -0
- package/dist/commonjs/common/playwrightServiceConfig.d.ts.map +1 -1
- package/dist/commonjs/common/playwrightServiceConfig.js +4 -0
- package/dist/commonjs/common/playwrightServiceConfig.js.map +1 -1
- package/dist/commonjs/common/types.d.ts +13 -0
- package/dist/commonjs/common/types.d.ts.map +1 -1
- package/dist/commonjs/common/types.js.map +1 -1
- package/dist/commonjs/reporter/index.d.ts +10 -0
- package/dist/commonjs/reporter/index.d.ts.map +1 -0
- package/dist/commonjs/reporter/index.js +15 -0
- package/dist/commonjs/reporter/index.js.map +1 -0
- package/dist/commonjs/reporter/playwrightReporter.d.ts +21 -0
- package/dist/commonjs/reporter/playwrightReporter.d.ts.map +1 -0
- package/dist/commonjs/reporter/playwrightReporter.js +91 -0
- package/dist/commonjs/reporter/playwrightReporter.js.map +1 -0
- package/dist/commonjs/utils/playwrightReporterStorageManager.d.ts +14 -0
- package/dist/commonjs/utils/playwrightReporterStorageManager.d.ts.map +1 -0
- package/dist/commonjs/utils/playwrightReporterStorageManager.js +314 -0
- package/dist/commonjs/utils/playwrightReporterStorageManager.js.map +1 -0
- package/dist/commonjs/utils/playwrightServiceApicall.d.ts +1 -0
- package/dist/commonjs/utils/playwrightServiceApicall.d.ts.map +1 -1
- package/dist/commonjs/utils/playwrightServiceApicall.js +17 -0
- package/dist/commonjs/utils/playwrightServiceApicall.js.map +1 -1
- package/dist/commonjs/utils/utils.d.ts +14 -1
- package/dist/commonjs/utils/utils.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.js +125 -0
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/esm/common/constants.d.ts +13 -0
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +13 -0
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/messages.d.ts +41 -0
- package/dist/esm/common/messages.d.ts.map +1 -1
- package/dist/esm/common/messages.js +41 -0
- package/dist/esm/common/messages.js.map +1 -1
- package/dist/esm/common/playwrightServiceConfig.d.ts +2 -0
- package/dist/esm/common/playwrightServiceConfig.d.ts.map +1 -1
- package/dist/esm/common/playwrightServiceConfig.js +4 -0
- package/dist/esm/common/playwrightServiceConfig.js.map +1 -1
- package/dist/esm/common/types.d.ts +13 -0
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/reporter/index.d.ts +10 -0
- package/dist/esm/reporter/index.d.ts.map +1 -0
- package/dist/esm/reporter/index.js +12 -0
- package/dist/esm/reporter/index.js.map +1 -0
- package/dist/esm/reporter/playwrightReporter.d.ts +21 -0
- package/dist/esm/reporter/playwrightReporter.d.ts.map +1 -0
- package/dist/esm/reporter/playwrightReporter.js +88 -0
- package/dist/esm/reporter/playwrightReporter.js.map +1 -0
- package/dist/esm/utils/playwrightReporterStorageManager.d.ts +14 -0
- package/dist/esm/utils/playwrightReporterStorageManager.d.ts.map +1 -0
- package/dist/esm/utils/playwrightReporterStorageManager.js +310 -0
- package/dist/esm/utils/playwrightReporterStorageManager.js.map +1 -0
- package/dist/esm/utils/playwrightServiceApicall.d.ts +1 -0
- package/dist/esm/utils/playwrightServiceApicall.d.ts.map +1 -1
- package/dist/esm/utils/playwrightServiceApicall.js +18 -1
- package/dist/esm/utils/playwrightServiceApicall.js.map +1 -1
- package/dist/esm/utils/utils.d.ts +14 -1
- package/dist/esm/utils/utils.d.ts.map +1 -1
- package/dist/esm/utils/utils.js +119 -0
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/react-native/common/constants.d.ts +13 -0
- package/dist/react-native/common/constants.d.ts.map +1 -1
- package/dist/react-native/common/constants.js +13 -0
- package/dist/react-native/common/constants.js.map +1 -1
- package/dist/react-native/common/messages.d.ts +41 -0
- package/dist/react-native/common/messages.d.ts.map +1 -1
- package/dist/react-native/common/messages.js +41 -0
- package/dist/react-native/common/messages.js.map +1 -1
- package/dist/react-native/common/playwrightServiceConfig.d.ts +2 -0
- package/dist/react-native/common/playwrightServiceConfig.d.ts.map +1 -1
- package/dist/react-native/common/playwrightServiceConfig.js +4 -0
- package/dist/react-native/common/playwrightServiceConfig.js.map +1 -1
- package/dist/react-native/common/types.d.ts +13 -0
- package/dist/react-native/common/types.d.ts.map +1 -1
- package/dist/react-native/common/types.js.map +1 -1
- package/dist/react-native/reporter/index.d.ts +10 -0
- package/dist/react-native/reporter/index.d.ts.map +1 -0
- package/dist/react-native/reporter/index.js +12 -0
- package/dist/react-native/reporter/index.js.map +1 -0
- package/dist/react-native/reporter/playwrightReporter.d.ts +21 -0
- package/dist/react-native/reporter/playwrightReporter.d.ts.map +1 -0
- package/dist/react-native/reporter/playwrightReporter.js +88 -0
- package/dist/react-native/reporter/playwrightReporter.js.map +1 -0
- package/dist/react-native/utils/playwrightReporterStorageManager.d.ts +14 -0
- package/dist/react-native/utils/playwrightReporterStorageManager.d.ts.map +1 -0
- package/dist/react-native/utils/playwrightReporterStorageManager.js +310 -0
- package/dist/react-native/utils/playwrightReporterStorageManager.js.map +1 -0
- package/dist/react-native/utils/playwrightServiceApicall.d.ts +1 -0
- package/dist/react-native/utils/playwrightServiceApicall.d.ts.map +1 -1
- package/dist/react-native/utils/playwrightServiceApicall.js +18 -1
- package/dist/react-native/utils/playwrightServiceApicall.js.map +1 -1
- package/dist/react-native/utils/utils.d.ts +14 -1
- package/dist/react-native/utils/utils.d.ts.map +1 -1
- package/dist/react-native/utils/utils.js +119 -0
- package/dist/react-native/utils/utils.js.map +1 -1
- package/package.json +24 -4
|
@@ -67,4 +67,17 @@ export declare const InternalEnvironmentVariables: {
|
|
|
67
67
|
ONE_TIME_OPERATION_FLAG: string;
|
|
68
68
|
USING_SERVICE_CONFIG: string;
|
|
69
69
|
};
|
|
70
|
+
export declare const UploadConstants: {
|
|
71
|
+
SMALL_FILE_THRESHOLD: number;
|
|
72
|
+
LARGE_FILE_THRESHOLD: number;
|
|
73
|
+
BASE_CONCURRENCY: number;
|
|
74
|
+
MAX_CONCURRENCY: number;
|
|
75
|
+
PER_FILE_CONCURRENCY: number;
|
|
76
|
+
LARGE_FILE_CONCURRENCY: number;
|
|
77
|
+
BATCH_SIZE: number;
|
|
78
|
+
OPTIMIZED_BLOCK_SIZE: number;
|
|
79
|
+
STREAM_BUFFER_SIZE: number;
|
|
80
|
+
MAX_RETRY_ATTEMPTS: number;
|
|
81
|
+
RETRY_BASE_DELAY: number;
|
|
82
|
+
};
|
|
70
83
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -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"}
|
|
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"}
|
|
@@ -69,4 +69,17 @@ export const InternalEnvironmentVariables = {
|
|
|
69
69
|
ONE_TIME_OPERATION_FLAG: "_ONE_TIME_OPERATION_FLAG",
|
|
70
70
|
USING_SERVICE_CONFIG: "_USING_SERVICE_CONFIG",
|
|
71
71
|
};
|
|
72
|
+
export const UploadConstants = {
|
|
73
|
+
SMALL_FILE_THRESHOLD: 1024 * 1024,
|
|
74
|
+
LARGE_FILE_THRESHOLD: 100 * 1024 * 1024,
|
|
75
|
+
BASE_CONCURRENCY: 20,
|
|
76
|
+
MAX_CONCURRENCY: 50,
|
|
77
|
+
PER_FILE_CONCURRENCY: 10,
|
|
78
|
+
LARGE_FILE_CONCURRENCY: 5,
|
|
79
|
+
BATCH_SIZE: 100,
|
|
80
|
+
OPTIMIZED_BLOCK_SIZE: 8 * 1024 * 1024,
|
|
81
|
+
STREAM_BUFFER_SIZE: 4 * 1024 * 1024,
|
|
82
|
+
MAX_RETRY_ATTEMPTS: 3,
|
|
83
|
+
RETRY_BASE_DELAY: 1000,
|
|
84
|
+
};
|
|
72
85
|
//# sourceMappingURL=constants.js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AAG;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;AAEF,MAAM,CAAC,MAAM,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;CAC9C,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"]}
|
|
1
|
+
{"version":3,"file":"const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E,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;AAEF,MAAM,CAAC,MAAM,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;CAC9C,CAAC;AAEF,MAAM,CAAC,MAAM,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};\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"]}
|
|
@@ -52,5 +52,46 @@ export declare const ServiceErrorMessageConstants: {
|
|
|
52
52
|
key: string;
|
|
53
53
|
message: string;
|
|
54
54
|
};
|
|
55
|
+
FAILED_TO_GET_WORKSPACE_DETAILS: {
|
|
56
|
+
key: string;
|
|
57
|
+
message: string;
|
|
58
|
+
formatWithErrorDetails: (errorDetails: string) => string;
|
|
59
|
+
};
|
|
60
|
+
STORAGE_URI_NOT_FOUND: {
|
|
61
|
+
key: string;
|
|
62
|
+
message: string;
|
|
63
|
+
};
|
|
64
|
+
UNABLE_TO_EXTRACT_WORKSPACE_ID: {
|
|
65
|
+
key: string;
|
|
66
|
+
message: string;
|
|
67
|
+
};
|
|
68
|
+
HTML_REPORT_UPLOAD_FAILED: {
|
|
69
|
+
key: string;
|
|
70
|
+
message: string;
|
|
71
|
+
formatWithError: (errorMessage: string) => string;
|
|
72
|
+
};
|
|
73
|
+
HTML_REPORT_FOLDER_NOT_FOUND: {
|
|
74
|
+
key: string;
|
|
75
|
+
message: string;
|
|
76
|
+
formatWithFolder: (folderName: string) => string;
|
|
77
|
+
};
|
|
78
|
+
UPLOAD_FAILED_MULTIPLE_FILES: {
|
|
79
|
+
key: string;
|
|
80
|
+
message: string;
|
|
81
|
+
formatWithDetails: (failed: number, errors: string[]) => string;
|
|
82
|
+
};
|
|
83
|
+
UPLOAD_RETRY_EXHAUSTED: {
|
|
84
|
+
key: string;
|
|
85
|
+
message: string;
|
|
86
|
+
formatWithDetails: (maxRetries: number, errorMessage: string) => string;
|
|
87
|
+
};
|
|
88
|
+
REPORTER_REQUIRES_ENTRA_AUTH: {
|
|
89
|
+
key: string;
|
|
90
|
+
message: string;
|
|
91
|
+
};
|
|
92
|
+
HTML_REPORTER_REQUIRED: {
|
|
93
|
+
key: string;
|
|
94
|
+
message: string;
|
|
95
|
+
};
|
|
55
96
|
};
|
|
56
97
|
//# 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
|
|
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;;;;;;;;;;;;;wCActB,MAAM,KAAG,MAAM;;;;;uCAKhB,MAAM,KAAG,MAAM;;;;;oCAKlB,MAAM,UAAU,MAAM,EAAE,KAAG,MAAM;;;;;wCAM7B,MAAM,gBAAgB,MAAM,KAAG,MAAM;;;;;;;;;;CAYxE,CAAC"}
|
|
@@ -54,5 +54,46 @@ export const ServiceErrorMessageConstants = {
|
|
|
54
54
|
key: "InvalidAuthTypeError",
|
|
55
55
|
message: "Invalid authentication type specified. Please use either ENTRA_ID or ACCESS_TOKEN.",
|
|
56
56
|
},
|
|
57
|
+
FAILED_TO_GET_WORKSPACE_DETAILS: {
|
|
58
|
+
key: "FailedToGetWorkspaceDetails",
|
|
59
|
+
message: "Failed to retrieve workspace details from the Playwright service.",
|
|
60
|
+
formatWithErrorDetails: (errorDetails) => `Failed to retrieve workspace details from the Playwright service. Error: ${errorDetails}. Please verify your service URL and authentication credentials.`,
|
|
61
|
+
},
|
|
62
|
+
STORAGE_URI_NOT_FOUND: {
|
|
63
|
+
key: "StorageUriNotFound",
|
|
64
|
+
message: "Storage URI not found in workspace details",
|
|
65
|
+
},
|
|
66
|
+
UNABLE_TO_EXTRACT_WORKSPACE_ID: {
|
|
67
|
+
key: "UnableToExtractWorkspaceId",
|
|
68
|
+
message: "Unable to extract workspace ID from service URL",
|
|
69
|
+
},
|
|
70
|
+
HTML_REPORT_UPLOAD_FAILED: {
|
|
71
|
+
key: "HtmlReportUploadFailed",
|
|
72
|
+
message: "HTML report upload failed",
|
|
73
|
+
formatWithError: (errorMessage) => `HTML report upload failed: ${errorMessage}`,
|
|
74
|
+
},
|
|
75
|
+
HTML_REPORT_FOLDER_NOT_FOUND: {
|
|
76
|
+
key: "HtmlReportFolderNotFound",
|
|
77
|
+
message: "HTML report folder not found",
|
|
78
|
+
formatWithFolder: (folderName) => `HTML report folder not found: ${folderName}`,
|
|
79
|
+
},
|
|
80
|
+
UPLOAD_FAILED_MULTIPLE_FILES: {
|
|
81
|
+
key: "UploadFailedMultipleFiles",
|
|
82
|
+
message: "Upload failed: multiple files could not be uploaded",
|
|
83
|
+
formatWithDetails: (failed, errors) => `Upload failed: ${failed} files could not be uploaded. Sample errors: ${errors.join(", ")}`,
|
|
84
|
+
},
|
|
85
|
+
UPLOAD_RETRY_EXHAUSTED: {
|
|
86
|
+
key: "UploadRetryExhausted",
|
|
87
|
+
message: "Failed after maximum retry attempts",
|
|
88
|
+
formatWithDetails: (maxRetries, errorMessage) => `Failed after ${maxRetries} attempts: ${errorMessage}`,
|
|
89
|
+
},
|
|
90
|
+
REPORTER_REQUIRES_ENTRA_AUTH: {
|
|
91
|
+
key: "ReporterRequiresEntraAuth",
|
|
92
|
+
message: "The Azure Playwright Reporter can only be used with ENTRA_ID authentication.",
|
|
93
|
+
},
|
|
94
|
+
HTML_REPORTER_REQUIRED: {
|
|
95
|
+
key: "HtmlReporterRequired",
|
|
96
|
+
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']]",
|
|
97
|
+
},
|
|
57
98
|
};
|
|
58
99
|
//# sourceMappingURL=messages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EACL,8GAA8G;KACjH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,qCAAqC;KAC/C;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,0IAA0I;KAC7I;IACD,4CAA4C,EAAE;QAC5C,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EACL,4IAA4I;KAC/I;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,mHAAmH;KACtH;IACD,aAAa,EAAE;QACb,GAAG,EAAE,aAAa;QAClB,OAAO,EACL,uHAAuH;KAC1H;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,8EAA8E;KACxF;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,4DAA4D;KACtE;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EACL,8IAA8I;KACjJ;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EACL,2IAA2I;QAC7I,sBAAsB,EAAE,CAAC,YAAoB,EAAU,EAAE,CACvD,sEAAsE,YAAY,iFAAiF;KACtK;IACD,iCAAiC,EAAE;QACjC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EAAE,4KAA4K;KACtL;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,qFAAqF;KAC/F;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EAAE,oFAAoF;KAC9F;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};\n"]}
|
|
1
|
+
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,oBAAoB,EAAE;QACpB,GAAG,EAAE,mBAAmB;QACxB,OAAO,EACL,8GAA8G;KACjH;IACD,uBAAuB,EAAE;QACvB,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BAA8B,EAAE;QAC9B,GAAG,EAAE,4BAA4B;QACjC,OAAO,EAAE,iDAAiD;KAC3D;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,2BAA2B;QACpC,eAAe,EAAE,CAAC,YAAoB,EAAU,EAAE,CAAC,8BAA8B,YAAY,EAAE;KAChG;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,0BAA0B;QAC/B,OAAO,EAAE,8BAA8B;QACvC,gBAAgB,EAAE,CAAC,UAAkB,EAAU,EAAE,CAAC,iCAAiC,UAAU,EAAE;KAChG;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,2BAA2B;QAChC,OAAO,EAAE,qDAAqD;QAC9D,iBAAiB,EAAE,CAAC,MAAc,EAAE,MAAgB,EAAU,EAAE,CAC9D,kBAAkB,MAAM,gDAAgD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;KAC9F;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EAAE,qCAAqC;QAC9C,iBAAiB,EAAE,CAAC,UAAkB,EAAE,YAAoB,EAAU,EAAE,CACtE,gBAAgB,UAAU,cAAc,YAAY,EAAE;KACzD;IACD,4BAA4B,EAAE;QAC5B,GAAG,EAAE,2BAA2B;QAChC,OAAO,EAAE,8EAA8E;KACxF;IACD,sBAAsB,EAAE;QACtB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EACL,0QAA0Q;KAC7Q;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 URI not found in workspace details\",\n },\n UNABLE_TO_EXTRACT_WORKSPACE_ID: {\n key: \"UnableToExtractWorkspaceId\",\n message: \"Unable to extract workspace ID from service URL\",\n },\n HTML_REPORT_UPLOAD_FAILED: {\n key: \"HtmlReportUploadFailed\",\n message: \"HTML report upload failed\",\n formatWithError: (errorMessage: string): string => `HTML report upload failed: ${errorMessage}`,\n },\n HTML_REPORT_FOLDER_NOT_FOUND: {\n key: \"HtmlReportFolderNotFound\",\n message: \"HTML report folder not found\",\n formatWithFolder: (folderName: string): string => `HTML report folder not found: ${folderName}`,\n },\n UPLOAD_FAILED_MULTIPLE_FILES: {\n key: \"UploadFailedMultipleFiles\",\n message: \"Upload failed: multiple files could not be uploaded\",\n formatWithDetails: (failed: number, errors: string[]): string =>\n `Upload failed: ${failed} files could not be uploaded. Sample errors: ${errors.join(\", \")}`,\n },\n UPLOAD_RETRY_EXHAUSTED: {\n key: \"UploadRetryExhausted\",\n message: \"Failed after maximum retry attempts\",\n formatWithDetails: (maxRetries: number, errorMessage: string): string =>\n `Failed after ${maxRetries} attempts: ${errorMessage}`,\n },\n REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message: \"The Azure Playwright Reporter can only be used with ENTRA_ID authentication.\",\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};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PlaywrightServiceAdditionalOptions, OsType } from "./types.js";
|
|
2
|
+
import type { TokenCredential } from "@azure/identity";
|
|
2
3
|
declare class PlaywrightServiceConfig {
|
|
3
4
|
serviceOs: OsType;
|
|
4
5
|
runId: string;
|
|
@@ -8,6 +9,7 @@ declare class PlaywrightServiceConfig {
|
|
|
8
9
|
runName: string;
|
|
9
10
|
apiVersion: string;
|
|
10
11
|
private _serviceAuthType;
|
|
12
|
+
credential?: TokenCredential;
|
|
11
13
|
constructor();
|
|
12
14
|
static get instance(): PlaywrightServiceConfig;
|
|
13
15
|
get serviceAuthType(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAMvD,cAAM,uBAAuB;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,gBAAgB,CAAgC;IACjD,UAAU,CAAC,EAAE,eAAe,CAAC;;IAcpC,WAAkB,QAAQ,IAAI,uBAAuB,CAKpD;IAED,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,eAAe,CAAC,KAAK,EAAE,MAAM,EAEvC;IAEY,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOxC,eAAe,GAAI,UAAU,kCAAkC,KAAG,IAAI,CAYpE;IAEF,UAAU,GACR,UAAU,kCAAkC,EAC5C,sBAAqB,OAAe,KACnC,IAAI,CAwCL;CACH;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -14,6 +14,7 @@ class PlaywrightServiceConfig {
|
|
|
14
14
|
runName;
|
|
15
15
|
apiVersion;
|
|
16
16
|
_serviceAuthType = ServiceAuth.ENTRA_ID;
|
|
17
|
+
credential;
|
|
17
18
|
constructor() {
|
|
18
19
|
this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||
|
|
19
20
|
DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS);
|
|
@@ -92,6 +93,9 @@ class PlaywrightServiceConfig {
|
|
|
92
93
|
if (options?.connectTimeout) {
|
|
93
94
|
this.connectTimeout = options.connectTimeout;
|
|
94
95
|
}
|
|
96
|
+
if (options?.credential) {
|
|
97
|
+
this.credential = options.credential;
|
|
98
|
+
}
|
|
95
99
|
};
|
|
96
100
|
}
|
|
97
101
|
export { PlaywrightServiceConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,SAAS,EACT,8BAA8B,EAC9B,4BAA4B,EAC5B,WAAW,GACZ,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,SAAS,EACT,8BAA8B,EAC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C;QACD,IAAI,OAAO,EAAE,cAAc,EAAE,CAAC;YAC5B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC/C,CAAC;QACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;CACH;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Constants,\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"./constants.js\";\nimport type { PlaywrightServiceAdditionalOptions, OsType } from \"./types.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { getAndSetRunId, getRunName, ValidateRunID } from \"../utils/utils.js\";\nimport { CIInfoProvider } from \"../utils/cIInfoProvider.js\";\nimport { state } from \"./state.js\";\nimport { ServiceErrorMessageConstants } from \"./messages.js\";\n\nclass PlaywrightServiceConfig {\n public serviceOs: OsType;\n public runId: string;\n public connectTimeout: number;\n public slowMo: number;\n public exposeNetwork: string;\n public runName: string;\n public apiVersion: string;\n private _serviceAuthType: string = ServiceAuth.ENTRA_ID;\n public credential?: TokenCredential;\n\n constructor() {\n this.serviceOs = (process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] ||\n DefaultConnectOptionsConstants.DEFAULT_SERVICE_OS) as OsType;\n this.runName = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] || \"\";\n this.runId = process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] || \"\";\n this.connectTimeout = DefaultConnectOptionsConstants.DEFAULT_TIMEOUT;\n this.slowMo = DefaultConnectOptionsConstants.DEFAULT_SLOW_MO;\n this.exposeNetwork = DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;\n this.apiVersion =\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] || Constants.LatestAPIVersion;\n }\n\n public static get instance(): PlaywrightServiceConfig {\n if (!state.playwrightServiceConfig) {\n state.playwrightServiceConfig = new PlaywrightServiceConfig();\n }\n return state.playwrightServiceConfig;\n }\n\n public get serviceAuthType(): string {\n return this._serviceAuthType;\n }\n\n public set serviceAuthType(value: string) {\n this._serviceAuthType = value;\n }\n\n public async initialize(): Promise<void> {\n if (!this.runName) {\n const ciConfigInfo = CIInfoProvider.getCIInfo();\n this.runName = await getRunName(ciConfigInfo);\n }\n }\n\n validateOptions = (options?: PlaywrightServiceAdditionalOptions): void => {\n if (!options) return;\n\n const isUsingServiceConfig =\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] === \"true\";\n if (isUsingServiceConfig) {\n if (options.serviceAuthType || options.runId || options.runName) {\n const errorMessage = ServiceErrorMessageConstants.INVALID_PARAM_WITH_SERVICE_CONFIG.message;\n throw new Error(errorMessage);\n }\n return;\n }\n };\n\n setOptions = (\n options?: PlaywrightServiceAdditionalOptions,\n isGetConnectOptions: boolean = false,\n ): void => {\n if (isGetConnectOptions) {\n this.validateOptions(options);\n }\n\n if (options?.exposeNetwork) {\n this.exposeNetwork = options.exposeNetwork;\n }\n if (options?.apiVersion) {\n if (!process.env[InternalEnvironmentVariables.MPT_API_VERSION]) {\n process.env[InternalEnvironmentVariables.MPT_API_VERSION] = options.apiVersion;\n }\n this.apiVersion = options.apiVersion;\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID]) {\n if (options?.runId) {\n ValidateRunID(options.runId);\n this.runId = options.runId;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_ID] = this.runId;\n } else {\n this.runId = getAndSetRunId();\n }\n }\n if (!process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] && options?.runName) {\n this.runName = options.runName;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_RUN_NAME] = this.runName;\n }\n if (options?.os) {\n this.serviceOs = options.os;\n process.env[InternalEnvironmentVariables.MPT_SERVICE_OS] = this.serviceOs;\n }\n if (options?.slowMo) {\n this.slowMo = options.slowMo;\n }\n if (options?.connectTimeout) {\n this.connectTimeout = options.connectTimeout;\n }\n if (options?.credential) {\n this.credential = options.credential;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"]}
|
|
@@ -170,4 +170,17 @@ export type TestRunCreatePayload = {
|
|
|
170
170
|
config?: RunConfig;
|
|
171
171
|
ciConfig?: CIInfo;
|
|
172
172
|
};
|
|
173
|
+
export type WorkspaceMetaData = {
|
|
174
|
+
id?: string;
|
|
175
|
+
resourceId?: string;
|
|
176
|
+
name?: string;
|
|
177
|
+
state?: string;
|
|
178
|
+
subscriptionId?: string;
|
|
179
|
+
subscriptionState?: string;
|
|
180
|
+
tenantId?: string;
|
|
181
|
+
location?: string;
|
|
182
|
+
regionalAffinity?: string;
|
|
183
|
+
localAuth?: string;
|
|
184
|
+
storageUri?: string;
|
|
185
|
+
};
|
|
173
186
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIpD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG;IACpD,OAAO,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;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
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS, SDKLanguage } from \"./constants.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Custom token credential for Entra ID authentication. Learn more at {@link https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md | Using Azure Identity}.\n *\n * @defaultValue `DefaultAzureCredential`\n */\n credential?: TokenCredential;\n /**\n * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\n\n /**\n * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n};\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS, SDKLanguage } from \"./constants.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Custom token credential for Entra ID authentication. Learn more at {@link https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md | Using Azure Identity}.\n *\n * @defaultValue `DefaultAzureCredential`\n */\n credential?: TokenCredential;\n /**\n * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\n\n /**\n * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n};\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n\nexport type WorkspaceMetaData = {\n id?: string;\n resourceId?: string;\n name?: string;\n state?: string;\n subscriptionId?: string;\n subscriptionState?: string;\n tenantId?: string;\n location?: string;\n regionalAffinity?: string;\n localAuth?: string;\n storageUri?: string;\n};\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure Playwright Reporter
|
|
3
|
+
* Feature that uploads the report generated by the HTML reporter to the customer's storage account and
|
|
4
|
+
* view them in the service portal for faster and easier troubleshooting.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
import playwrightReporter from "./playwrightReporter.js";
|
|
9
|
+
export default playwrightReporter;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reporter/index.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AAEH,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Azure Playwright Reporter
|
|
5
|
+
* Feature that uploads the report generated by the HTML reporter to the customer's storage account and
|
|
6
|
+
* view them in the service portal for faster and easier troubleshooting.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import playwrightReporter from "./playwrightReporter.js";
|
|
11
|
+
export default playwrightReporter;
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/reporter/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AAEH,OAAO,kBAAkB,MAAM,yBAAyB,CAAC;AAEzD,eAAe,kBAAkB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Azure Playwright Reporter\n * Feature that uploads the report generated by the HTML reporter to the customer's storage account and\n * view them in the service portal for faster and easier troubleshooting.\n *\n * @packageDocumentation\n */\n\nimport playwrightReporter from \"./playwrightReporter.js\";\n\nexport default playwrightReporter;\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FullConfig, Reporter } from "@playwright/test/reporter";
|
|
2
|
+
/**
|
|
3
|
+
* Azure Playwright Reporter - Uploads generated Playwright test report folder to Azure Storage.
|
|
4
|
+
*/
|
|
5
|
+
export default class PlaywrightReporter implements Reporter {
|
|
6
|
+
private config;
|
|
7
|
+
private workspaceMetadata;
|
|
8
|
+
/**
|
|
9
|
+
* Called when test run begins. Stores configuration for later use and validates serviceAuthType and
|
|
10
|
+
* retrieves workspace metadata.
|
|
11
|
+
* @param config - Playwright test configuration
|
|
12
|
+
*/
|
|
13
|
+
onBegin(config: FullConfig): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Called when test run ends. Uploads Playwright test report to Azure Storage.
|
|
16
|
+
*/
|
|
17
|
+
onEnd(): Promise<void>;
|
|
18
|
+
private uploadHtmlReport;
|
|
19
|
+
private validateHtmlReporterConfiguration;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=playwrightReporter.d.ts.map
|
|
@@ -0,0 +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;AActE;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,kBAAmB,YAAW,QAAQ;IACzD,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,iBAAiB,CAAkC;IAE3D;;;;OAIG;IAEG,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BhD;;OAEG;IAEG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAKd,gBAAgB;IAuB9B,OAAO,CAAC,iCAAiC;CAqB1C"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { PlaywrightReporterStorageManager } from "../utils/playwrightReporterStorageManager.js";
|
|
2
|
+
import { getHtmlReporterOutputFolder, getPortalTestRunUrl, exitWithFailureMessage, } from "../utils/utils.js";
|
|
3
|
+
import { coreLogger } from "../common/logger.js";
|
|
4
|
+
import { PlaywrightServiceConfig } from "../common/playwrightServiceConfig.js";
|
|
5
|
+
import { ServiceAuth } from "../common/constants.js";
|
|
6
|
+
import { ServiceErrorMessageConstants } from "../common/messages.js";
|
|
7
|
+
import { PlaywrightServiceApiCall } from "../utils/playwrightServiceApicall.js";
|
|
8
|
+
/**
|
|
9
|
+
* Azure Playwright Reporter - Uploads generated Playwright test report folder to Azure Storage.
|
|
10
|
+
*/
|
|
11
|
+
export default class PlaywrightReporter {
|
|
12
|
+
config;
|
|
13
|
+
workspaceMetadata = null;
|
|
14
|
+
/**
|
|
15
|
+
* Called when test run begins. Stores configuration for later use and validates serviceAuthType and
|
|
16
|
+
* retrieves workspace metadata.
|
|
17
|
+
* @param config - Playwright test configuration
|
|
18
|
+
*/
|
|
19
|
+
async onBegin(config) {
|
|
20
|
+
coreLogger.info(`Reporter configuration: ${JSON.stringify(config.reporter, null, 2)}`);
|
|
21
|
+
// Validate that HTML reporter is configured
|
|
22
|
+
this.validateHtmlReporterConfiguration(config);
|
|
23
|
+
// Validate that reporter is used only with ENTRA_ID authentication
|
|
24
|
+
const playwrightServiceConfig = PlaywrightServiceConfig.instance;
|
|
25
|
+
coreLogger.info(`Current authentication type: ${playwrightServiceConfig.serviceAuthType}`);
|
|
26
|
+
const isUsingAccessToken = playwrightServiceConfig.serviceAuthType === ServiceAuth.ACCESS_TOKEN;
|
|
27
|
+
if (isUsingAccessToken) {
|
|
28
|
+
exitWithFailureMessage(ServiceErrorMessageConstants.REPORTER_REQUIRES_ENTRA_AUTH);
|
|
29
|
+
}
|
|
30
|
+
coreLogger.info("Authentication validation passed - using ENTRA_ID");
|
|
31
|
+
this.config = config;
|
|
32
|
+
// Get workspace metadata for later use
|
|
33
|
+
try {
|
|
34
|
+
const playwrightServiceApiClient = new PlaywrightServiceApiCall();
|
|
35
|
+
this.workspaceMetadata = await playwrightServiceApiClient.getWorkspaceMetadata();
|
|
36
|
+
process.stdout.write("Initializing reporting for this test run.\n");
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
coreLogger.error(`Failed to get workspace metadata: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
40
|
+
process.stderr.write("Failed to initialize reporting for this test run.\n");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Called when test run ends. Uploads Playwright test report to Azure Storage.
|
|
45
|
+
*/
|
|
46
|
+
async onEnd() {
|
|
47
|
+
process.stdout.write(`Uploading Playwright Test report in Azure storage account.\n`);
|
|
48
|
+
await this.uploadHtmlReport();
|
|
49
|
+
}
|
|
50
|
+
async uploadHtmlReport() {
|
|
51
|
+
try {
|
|
52
|
+
const outputFolder = getHtmlReporterOutputFolder(this.config);
|
|
53
|
+
coreLogger.info(`Resolved Playwright test report output folder: ${outputFolder}`);
|
|
54
|
+
const storageManager = new PlaywrightReporterStorageManager();
|
|
55
|
+
coreLogger.info("Starting Playwright test report upload process");
|
|
56
|
+
await storageManager.uploadPlaywrightHtmlReportAfterTests(outputFolder, this.workspaceMetadata);
|
|
57
|
+
coreLogger.info(`✅ Playwright Test report uploaded successfully to Azure Storage.`);
|
|
58
|
+
// Display portal URL for test report
|
|
59
|
+
if (this.workspaceMetadata) {
|
|
60
|
+
const portalUrl = getPortalTestRunUrl(this.workspaceMetadata);
|
|
61
|
+
process.stdout.write(`You can view test report at: ${portalUrl}\n`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
66
|
+
process.stderr.write(`❌ Failed to upload Playwright test report: ${errorMessage}\n`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
validateHtmlReporterConfiguration(config) {
|
|
70
|
+
if (!config.reporter || !Array.isArray(config.reporter)) {
|
|
71
|
+
throw new Error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);
|
|
72
|
+
}
|
|
73
|
+
const hasHtmlReporter = config.reporter.some((reporter) => {
|
|
74
|
+
if (typeof reporter === "string") {
|
|
75
|
+
return reporter === "html";
|
|
76
|
+
}
|
|
77
|
+
if (Array.isArray(reporter) && reporter.length > 0) {
|
|
78
|
+
return reporter[0] === "html";
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
});
|
|
82
|
+
if (!hasHtmlReporter) {
|
|
83
|
+
exitWithFailureMessage(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED);
|
|
84
|
+
}
|
|
85
|
+
coreLogger.info("HTML reporter validation passed - HTML reporter is configured");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=playwrightReporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwrightReporter.js","sourceRoot":"","sources":["../../../src/reporter/playwrightReporter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAGhF;;GAEG;AAEH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAC7B,MAAM,CAAyB;IAC/B,iBAAiB,GAA6B,IAAI,CAAC;IAE3D;;;;OAIG;IAEH,KAAK,CAAC,OAAO,CAAC,MAAk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;YACxD,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;gBACjC,OAAO,QAAQ,KAAK,MAAM,CAAC;YAC7B,CAAC;YACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACnD,OAAO,QAAQ,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;YAChC,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,sBAAsB,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,CAAC;QAC9E,CAAC;QAED,UAAU,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport type { FullConfig, Reporter } from \"@playwright/test/reporter\";\nimport { PlaywrightReporterStorageManager } from \"../utils/playwrightReporterStorageManager.js\";\nimport {\n getHtmlReporterOutputFolder,\n getPortalTestRunUrl,\n exitWithFailureMessage,\n} 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 } 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\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 // Validate that HTML reporter is configured\n this.validateHtmlReporterConfiguration(config);\n\n // Validate that reporter is used only with ENTRA_ID 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 exitWithFailureMessage(ServiceErrorMessageConstants.REPORTER_REQUIRES_ENTRA_AUTH);\n }\n coreLogger.info(\"Authentication validation passed - using ENTRA_ID\");\n this.config = config;\n // Get workspace metadata for later use\n try {\n const playwrightServiceApiClient = new PlaywrightServiceApiCall();\n this.workspaceMetadata = await playwrightServiceApiClient.getWorkspaceMetadata();\n process.stdout.write(\"Initializing reporting for this test run.\\n\");\n } catch (error) {\n coreLogger.error(\n `Failed to get workspace metadata: ${error instanceof Error ? error.message : String(error)}\\n`,\n );\n process.stderr.write(\"Failed to initialize reporting for this test run.\\n\");\n }\n }\n\n /**\n * Called when test run ends. Uploads Playwright test report to Azure Storage.\n */\n\n async onEnd(): Promise<void> {\n process.stdout.write(`Uploading Playwright Test report in Azure storage account.\\n`);\n await this.uploadHtmlReport();\n }\n\n private async uploadHtmlReport(): Promise<void> {\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 await storageManager.uploadPlaywrightHtmlReportAfterTests(\n outputFolder,\n this.workspaceMetadata,\n );\n coreLogger.info(`✅ Playwright Test report uploaded successfully to Azure Storage.`);\n\n // Display portal URL for test report\n if (this.workspaceMetadata) {\n const portalUrl = getPortalTestRunUrl(this.workspaceMetadata);\n process.stdout.write(`You can view test report at: ${portalUrl}\\n`);\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : \"Unknown error\";\n process.stderr.write(`❌ Failed to upload Playwright test report: ${errorMessage}\\n`);\n }\n }\n\n private validateHtmlReporterConfiguration(config: FullConfig): void {\n if (!config.reporter || !Array.isArray(config.reporter)) {\n throw new Error(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED.message);\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 exitWithFailureMessage(ServiceErrorMessageConstants.HTML_REPORTER_REQUIRED);\n }\n\n coreLogger.info(\"HTML reporter validation passed - HTML reporter is configured\");\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TokenCredential } from "@azure/core-auth";
|
|
2
|
+
import type { WorkspaceMetaData } from "../common/types.js";
|
|
3
|
+
export declare class PlaywrightReporterStorageManager {
|
|
4
|
+
uploadHtmlReportFolder(credential: TokenCredential, runId: string, outputFolder: string, workspaceDetails: WorkspaceMetaData): Promise<void>;
|
|
5
|
+
private uploadSasWorkerFile;
|
|
6
|
+
private modifyIndexHtml;
|
|
7
|
+
uploadPlaywrightHtmlReportAfterTests(outputFolderName?: string, workspaceMetadata?: WorkspaceMetaData | null): Promise<void>;
|
|
8
|
+
private uploadFolderInParallel;
|
|
9
|
+
private uploadWithConcurrencyControl;
|
|
10
|
+
private executeWithOptimizedBatching;
|
|
11
|
+
private uploadSingleFileOptimized;
|
|
12
|
+
private performOptimizedUpload;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=playwrightReporterStorageManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwrightReporterStorageManager.d.ts","sourceRoot":"","sources":["../../../src/utils/playwrightReporterStorageManager.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAYxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE5D,qBAAa,gCAAgC;IACrC,sBAAsB,CAC1B,UAAU,EAAE,eAAe,EAC3B,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,iBAAiB,GAClC,OAAO,CAAC,IAAI,CAAC;YA6CF,mBAAmB;YA+BnB,eAAe;IA2DvB,oCAAoC,CACxC,gBAAgB,CAAC,EAAE,MAAM,EACzB,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,GAC3C,OAAO,CAAC,IAAI,CAAC;YA8BF,sBAAsB;YAyEtB,4BAA4B;YAqB5B,4BAA4B;YAuE5B,yBAAyB;YA4CzB,sBAAsB;CAsCrC"}
|