@azure/playwright 1.1.5 → 1.1.6
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/README.md +10 -18
- package/dist/commonjs/common/constants.d.ts +6 -1
- package/dist/commonjs/common/constants.d.ts.map +1 -1
- package/dist/commonjs/common/constants.js +10 -1
- package/dist/commonjs/common/constants.js.map +1 -1
- package/dist/commonjs/common/messages.d.ts +4 -0
- package/dist/commonjs/common/messages.d.ts.map +1 -1
- package/dist/commonjs/common/messages.js +6 -0
- package/dist/commonjs/common/messages.js.map +1 -1
- package/dist/commonjs/common/playwrightServiceConfig.d.ts +2 -1
- package/dist/commonjs/common/playwrightServiceConfig.d.ts.map +1 -1
- package/dist/commonjs/common/playwrightServiceConfig.js +5 -0
- package/dist/commonjs/common/playwrightServiceConfig.js.map +1 -1
- package/dist/commonjs/common/types.d.ts +15 -0
- package/dist/commonjs/common/types.d.ts.map +1 -1
- package/dist/commonjs/common/types.js.map +1 -1
- package/dist/commonjs/core/playwrightService.d.ts.map +1 -1
- package/dist/commonjs/core/playwrightService.js +7 -7
- package/dist/commonjs/core/playwrightService.js.map +1 -1
- package/dist/{browser/core/playwrightServiceUtils.d.ts → commonjs/core/playwrightServiceUtils-cjs.d.ts} +1 -1
- package/dist/commonjs/core/playwrightServiceUtils-cjs.d.ts.map +1 -0
- package/dist/commonjs/core/playwrightServiceUtils-cjs.js +14 -0
- package/dist/commonjs/core/playwrightServiceUtils-cjs.js.map +1 -0
- package/dist/commonjs/index.d.ts +2 -2
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/reporter/playwrightReporter.d.ts.map +1 -1
- package/dist/commonjs/reporter/playwrightReporter.js +12 -11
- package/dist/commonjs/reporter/playwrightReporter.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/{browser/utils/getPackageVersion.d.ts → commonjs/utils/getPackageVersion-cjs.d.ts} +1 -1
- package/dist/commonjs/utils/getPackageVersion-cjs.d.ts.map +1 -0
- package/dist/commonjs/utils/{getPackageVersion.js → getPackageVersion-cjs.js} +1 -1
- package/dist/commonjs/utils/getPackageVersion-cjs.js.map +1 -0
- package/dist/commonjs/utils/parseJwt.d.ts.map +1 -1
- package/dist/commonjs/utils/parseJwt.js +2 -3
- package/dist/commonjs/utils/parseJwt.js.map +1 -1
- package/dist/commonjs/utils/utils.d.ts +3 -2
- package/dist/commonjs/utils/utils.d.ts.map +1 -1
- package/dist/commonjs/utils/utils.js +33 -6
- package/dist/commonjs/utils/utils.js.map +1 -1
- package/dist/esm/common/constants.d.ts +6 -1
- package/dist/esm/common/constants.d.ts.map +1 -1
- package/dist/esm/common/constants.js +9 -0
- package/dist/esm/common/constants.js.map +1 -1
- package/dist/esm/common/messages.d.ts +4 -0
- package/dist/esm/common/messages.d.ts.map +1 -1
- package/dist/esm/common/messages.js +6 -0
- package/dist/esm/common/messages.js.map +1 -1
- package/dist/esm/common/playwrightServiceConfig.d.ts +2 -1
- package/dist/esm/common/playwrightServiceConfig.d.ts.map +1 -1
- package/dist/esm/common/playwrightServiceConfig.js +6 -1
- package/dist/esm/common/playwrightServiceConfig.js.map +1 -1
- package/dist/esm/common/types.d.ts +15 -0
- package/dist/esm/common/types.d.ts.map +1 -1
- package/dist/esm/common/types.js.map +1 -1
- package/dist/esm/core/playwrightService.d.ts.map +1 -1
- package/dist/esm/core/playwrightService.js +2 -2
- package/dist/esm/core/playwrightService.js.map +1 -1
- package/dist/esm/core/playwrightServiceUtils.d.ts.map +1 -1
- package/dist/esm/core/playwrightServiceUtils.js +4 -2
- package/dist/esm/core/playwrightServiceUtils.js.map +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/reporter/playwrightReporter.d.ts.map +1 -1
- package/dist/esm/reporter/playwrightReporter.js +13 -12
- package/dist/esm/reporter/playwrightReporter.js.map +1 -1
- package/dist/esm/utils/getPackageVersion.d.ts.map +1 -1
- package/dist/esm/utils/getPackageVersion.js +2 -2
- package/dist/esm/utils/getPackageVersion.js.map +1 -1
- package/dist/esm/utils/parseJwt.d.ts.map +1 -1
- package/dist/esm/utils/parseJwt.js +2 -3
- package/dist/esm/utils/parseJwt.js.map +1 -1
- package/dist/esm/utils/utils.d.ts +3 -2
- package/dist/esm/utils/utils.d.ts.map +1 -1
- package/dist/esm/utils/utils.js +29 -3
- package/dist/esm/utils/utils.js.map +1 -1
- package/package.json +18 -26
- package/dist/browser/common/constants.d.ts +0 -104
- package/dist/browser/common/constants.d.ts.map +0 -1
- package/dist/browser/common/constants.js +0 -106
- package/dist/browser/common/constants.js.map +0 -1
- package/dist/browser/common/customerConfig.d.ts +0 -8
- package/dist/browser/common/customerConfig.d.ts.map +0 -1
- package/dist/browser/common/customerConfig.js +0 -16
- package/dist/browser/common/customerConfig.js.map +0 -1
- package/dist/browser/common/entraIdAccessToken.d.ts +0 -19
- package/dist/browser/common/entraIdAccessToken.d.ts.map +0 -1
- package/dist/browser/common/entraIdAccessToken.js +0 -108
- package/dist/browser/common/entraIdAccessToken.js.map +0 -1
- package/dist/browser/common/environmentVariables.d.ts +0 -12
- package/dist/browser/common/environmentVariables.d.ts.map +0 -1
- package/dist/browser/common/environmentVariables.js +0 -22
- package/dist/browser/common/environmentVariables.js.map +0 -1
- package/dist/browser/common/executor.d.ts +0 -2
- package/dist/browser/common/executor.d.ts.map +0 -1
- package/dist/browser/common/executor.js +0 -73
- package/dist/browser/common/executor.js.map +0 -1
- package/dist/browser/common/httpService.d.ts +0 -5
- package/dist/browser/common/httpService.d.ts.map +0 -1
- package/dist/browser/common/httpService.js +0 -34
- package/dist/browser/common/httpService.js.map +0 -1
- package/dist/browser/common/logger.d.ts +0 -2
- package/dist/browser/common/logger.d.ts.map +0 -1
- package/dist/browser/common/logger.js +0 -5
- package/dist/browser/common/logger.js.map +0 -1
- package/dist/browser/common/messages.d.ts +0 -165
- package/dist/browser/common/messages.d.ts.map +0 -1
- package/dist/browser/common/messages.js +0 -167
- package/dist/browser/common/messages.js.map +0 -1
- package/dist/browser/common/playwrightServiceConfig.d.ts +0 -22
- package/dist/browser/common/playwrightServiceConfig.d.ts.map +0 -1
- package/dist/browser/common/playwrightServiceConfig.js +0 -102
- package/dist/browser/common/playwrightServiceConfig.js.map +0 -1
- package/dist/browser/common/state.d.ts +0 -2
- package/dist/browser/common/state.d.ts.map +0 -1
- package/dist/browser/common/state.js +0 -9
- package/dist/browser/common/state.js.map +0 -1
- package/dist/browser/common/types.d.ts +0 -207
- package/dist/browser/common/types.d.ts.map +0 -1
- package/dist/browser/common/types.js +0 -4
- package/dist/browser/common/types.js.map +0 -1
- package/dist/browser/core/global/playwright-service-global-setup.d.ts +0 -4
- package/dist/browser/core/global/playwright-service-global-setup.d.ts.map +0 -1
- package/dist/browser/core/global/playwright-service-global-setup.js +0 -25
- package/dist/browser/core/global/playwright-service-global-setup.js.map +0 -1
- package/dist/browser/core/global/playwright-service-global-teardown.d.ts +0 -4
- package/dist/browser/core/global/playwright-service-global-teardown.d.ts.map +0 -1
- package/dist/browser/core/global/playwright-service-global-teardown.js +0 -19
- package/dist/browser/core/global/playwright-service-global-teardown.js.map +0 -1
- package/dist/browser/core/initializePlaywrightServiceTestRun.d.ts +0 -9
- package/dist/browser/core/initializePlaywrightServiceTestRun.d.ts.map +0 -1
- package/dist/browser/core/initializePlaywrightServiceTestRun.js +0 -26
- package/dist/browser/core/initializePlaywrightServiceTestRun.js.map +0 -1
- package/dist/browser/core/playwrightService.d.ts +0 -66
- package/dist/browser/core/playwrightService.d.ts.map +0 -1
- package/dist/browser/core/playwrightService.js +0 -219
- package/dist/browser/core/playwrightService.js.map +0 -1
- package/dist/browser/core/playwrightServiceEntra.d.ts +0 -15
- package/dist/browser/core/playwrightServiceEntra.d.ts.map +0 -1
- package/dist/browser/core/playwrightServiceEntra.js +0 -53
- package/dist/browser/core/playwrightServiceEntra.js.map +0 -1
- package/dist/browser/core/playwrightServiceUtils.d.ts.map +0 -1
- package/dist/browser/core/playwrightServiceUtils.js +0 -13
- package/dist/browser/core/playwrightServiceUtils.js.map +0 -1
- package/dist/browser/index.d.ts +0 -10
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.js +0 -11
- package/dist/browser/index.js.map +0 -1
- package/dist/browser/package.json +0 -3
- package/dist/browser/reporter/index.d.ts +0 -10
- package/dist/browser/reporter/index.d.ts.map +0 -1
- package/dist/browser/reporter/index.js +0 -12
- package/dist/browser/reporter/index.js.map +0 -1
- package/dist/browser/reporter/playwrightReporter.d.ts +0 -28
- package/dist/browser/reporter/playwrightReporter.d.ts.map +0 -1
- package/dist/browser/reporter/playwrightReporter.js +0 -210
- package/dist/browser/reporter/playwrightReporter.js.map +0 -1
- package/dist/browser/utils/PlaywrightServiceClient.d.ts +0 -9
- package/dist/browser/utils/PlaywrightServiceClient.d.ts.map +0 -1
- package/dist/browser/utils/PlaywrightServiceClient.js +0 -67
- package/dist/browser/utils/PlaywrightServiceClient.js.map +0 -1
- package/dist/browser/utils/cIInfoProvider.d.ts +0 -20
- package/dist/browser/utils/cIInfoProvider.d.ts.map +0 -1
- package/dist/browser/utils/cIInfoProvider.js +0 -75
- package/dist/browser/utils/cIInfoProvider.js.map +0 -1
- package/dist/browser/utils/getPackageVersion.d.ts.map +0 -1
- package/dist/browser/utils/getPackageVersion.js +0 -23
- package/dist/browser/utils/getPackageVersion.js.map +0 -1
- package/dist/browser/utils/getPlaywrightVersion.d.ts +0 -2
- package/dist/browser/utils/getPlaywrightVersion.d.ts.map +0 -1
- package/dist/browser/utils/getPlaywrightVersion.js +0 -19
- package/dist/browser/utils/getPlaywrightVersion.js.map +0 -1
- package/dist/browser/utils/packageManager.d.ts +0 -15
- package/dist/browser/utils/packageManager.d.ts.map +0 -1
- package/dist/browser/utils/packageManager.js +0 -41
- package/dist/browser/utils/packageManager.js.map +0 -1
- package/dist/browser/utils/parseJwt.d.ts +0 -4
- package/dist/browser/utils/parseJwt.d.ts.map +0 -1
- package/dist/browser/utils/parseJwt.js +0 -16
- package/dist/browser/utils/parseJwt.js.map +0 -1
- package/dist/browser/utils/playwrightReporterStorageManager.d.ts +0 -13
- package/dist/browser/utils/playwrightReporterStorageManager.d.ts.map +0 -1
- package/dist/browser/utils/playwrightReporterStorageManager.js +0 -452
- package/dist/browser/utils/playwrightReporterStorageManager.js.map +0 -1
- package/dist/browser/utils/utils.d.ts +0 -57
- package/dist/browser/utils/utils.d.ts.map +0 -1
- package/dist/browser/utils/utils.js +0 -392
- package/dist/browser/utils/utils.js.map +0 -1
- package/dist/commonjs/common/environmentVariables.d.ts +0 -12
- package/dist/commonjs/common/environmentVariables.d.ts.map +0 -1
- package/dist/commonjs/common/environmentVariables.js +0 -26
- package/dist/commonjs/common/environmentVariables.js.map +0 -1
- package/dist/commonjs/core/playwrightServiceUtils.d.ts +0 -5
- package/dist/commonjs/core/playwrightServiceUtils.d.ts.map +0 -1
- package/dist/commonjs/core/playwrightServiceUtils.js +0 -12
- package/dist/commonjs/core/playwrightServiceUtils.js.map +0 -1
- package/dist/commonjs/utils/getPackageVersion.d.ts +0 -2
- package/dist/commonjs/utils/getPackageVersion.d.ts.map +0 -1
- package/dist/commonjs/utils/getPackageVersion.js.map +0 -1
- package/dist/esm/common/environmentVariables.d.ts +0 -12
- package/dist/esm/common/environmentVariables.d.ts.map +0 -1
- package/dist/esm/common/environmentVariables.js +0 -22
- package/dist/esm/common/environmentVariables.js.map +0 -1
- package/dist/react-native/common/constants.d.ts +0 -104
- package/dist/react-native/common/constants.d.ts.map +0 -1
- package/dist/react-native/common/constants.js +0 -106
- package/dist/react-native/common/constants.js.map +0 -1
- package/dist/react-native/common/customerConfig.d.ts +0 -8
- package/dist/react-native/common/customerConfig.d.ts.map +0 -1
- package/dist/react-native/common/customerConfig.js +0 -16
- package/dist/react-native/common/customerConfig.js.map +0 -1
- package/dist/react-native/common/entraIdAccessToken.d.ts +0 -19
- package/dist/react-native/common/entraIdAccessToken.d.ts.map +0 -1
- package/dist/react-native/common/entraIdAccessToken.js +0 -108
- package/dist/react-native/common/entraIdAccessToken.js.map +0 -1
- package/dist/react-native/common/environmentVariables.d.ts +0 -12
- package/dist/react-native/common/environmentVariables.d.ts.map +0 -1
- package/dist/react-native/common/environmentVariables.js +0 -22
- package/dist/react-native/common/environmentVariables.js.map +0 -1
- package/dist/react-native/common/executor.d.ts +0 -2
- package/dist/react-native/common/executor.d.ts.map +0 -1
- package/dist/react-native/common/executor.js +0 -73
- package/dist/react-native/common/executor.js.map +0 -1
- package/dist/react-native/common/httpService.d.ts +0 -5
- package/dist/react-native/common/httpService.d.ts.map +0 -1
- package/dist/react-native/common/httpService.js +0 -34
- package/dist/react-native/common/httpService.js.map +0 -1
- package/dist/react-native/common/logger.d.ts +0 -2
- package/dist/react-native/common/logger.d.ts.map +0 -1
- package/dist/react-native/common/logger.js +0 -5
- package/dist/react-native/common/logger.js.map +0 -1
- package/dist/react-native/common/messages.d.ts +0 -165
- package/dist/react-native/common/messages.d.ts.map +0 -1
- package/dist/react-native/common/messages.js +0 -167
- package/dist/react-native/common/messages.js.map +0 -1
- package/dist/react-native/common/playwrightServiceConfig.d.ts +0 -22
- package/dist/react-native/common/playwrightServiceConfig.d.ts.map +0 -1
- package/dist/react-native/common/playwrightServiceConfig.js +0 -102
- package/dist/react-native/common/playwrightServiceConfig.js.map +0 -1
- package/dist/react-native/common/state.d.ts +0 -2
- package/dist/react-native/common/state.d.ts.map +0 -1
- package/dist/react-native/common/state.js +0 -9
- package/dist/react-native/common/state.js.map +0 -1
- package/dist/react-native/common/types.d.ts +0 -207
- package/dist/react-native/common/types.d.ts.map +0 -1
- package/dist/react-native/common/types.js +0 -4
- package/dist/react-native/common/types.js.map +0 -1
- package/dist/react-native/core/global/playwright-service-global-setup.d.ts +0 -4
- package/dist/react-native/core/global/playwright-service-global-setup.d.ts.map +0 -1
- package/dist/react-native/core/global/playwright-service-global-setup.js +0 -25
- package/dist/react-native/core/global/playwright-service-global-setup.js.map +0 -1
- package/dist/react-native/core/global/playwright-service-global-teardown.d.ts +0 -4
- package/dist/react-native/core/global/playwright-service-global-teardown.d.ts.map +0 -1
- package/dist/react-native/core/global/playwright-service-global-teardown.js +0 -19
- package/dist/react-native/core/global/playwright-service-global-teardown.js.map +0 -1
- package/dist/react-native/core/initializePlaywrightServiceTestRun.d.ts +0 -9
- package/dist/react-native/core/initializePlaywrightServiceTestRun.d.ts.map +0 -1
- package/dist/react-native/core/initializePlaywrightServiceTestRun.js +0 -26
- package/dist/react-native/core/initializePlaywrightServiceTestRun.js.map +0 -1
- package/dist/react-native/core/playwrightService.d.ts +0 -66
- package/dist/react-native/core/playwrightService.d.ts.map +0 -1
- package/dist/react-native/core/playwrightService.js +0 -219
- package/dist/react-native/core/playwrightService.js.map +0 -1
- package/dist/react-native/core/playwrightServiceEntra.d.ts +0 -15
- package/dist/react-native/core/playwrightServiceEntra.d.ts.map +0 -1
- package/dist/react-native/core/playwrightServiceEntra.js +0 -53
- package/dist/react-native/core/playwrightServiceEntra.js.map +0 -1
- package/dist/react-native/core/playwrightServiceUtils.d.ts +0 -5
- package/dist/react-native/core/playwrightServiceUtils.d.ts.map +0 -1
- package/dist/react-native/core/playwrightServiceUtils.js +0 -13
- package/dist/react-native/core/playwrightServiceUtils.js.map +0 -1
- package/dist/react-native/index.d.ts +0 -10
- package/dist/react-native/index.d.ts.map +0 -1
- package/dist/react-native/index.js +0 -11
- package/dist/react-native/index.js.map +0 -1
- package/dist/react-native/package.json +0 -3
- package/dist/react-native/reporter/index.d.ts +0 -10
- package/dist/react-native/reporter/index.d.ts.map +0 -1
- package/dist/react-native/reporter/index.js +0 -12
- package/dist/react-native/reporter/index.js.map +0 -1
- package/dist/react-native/reporter/playwrightReporter.d.ts +0 -28
- package/dist/react-native/reporter/playwrightReporter.d.ts.map +0 -1
- package/dist/react-native/reporter/playwrightReporter.js +0 -210
- package/dist/react-native/reporter/playwrightReporter.js.map +0 -1
- package/dist/react-native/utils/PlaywrightServiceClient.d.ts +0 -9
- package/dist/react-native/utils/PlaywrightServiceClient.d.ts.map +0 -1
- package/dist/react-native/utils/PlaywrightServiceClient.js +0 -67
- package/dist/react-native/utils/PlaywrightServiceClient.js.map +0 -1
- package/dist/react-native/utils/cIInfoProvider.d.ts +0 -20
- package/dist/react-native/utils/cIInfoProvider.d.ts.map +0 -1
- package/dist/react-native/utils/cIInfoProvider.js +0 -75
- package/dist/react-native/utils/cIInfoProvider.js.map +0 -1
- package/dist/react-native/utils/getPackageVersion.d.ts +0 -2
- package/dist/react-native/utils/getPackageVersion.d.ts.map +0 -1
- package/dist/react-native/utils/getPackageVersion.js +0 -23
- package/dist/react-native/utils/getPackageVersion.js.map +0 -1
- package/dist/react-native/utils/getPlaywrightVersion.d.ts +0 -2
- package/dist/react-native/utils/getPlaywrightVersion.d.ts.map +0 -1
- package/dist/react-native/utils/getPlaywrightVersion.js +0 -19
- package/dist/react-native/utils/getPlaywrightVersion.js.map +0 -1
- package/dist/react-native/utils/packageManager.d.ts +0 -15
- package/dist/react-native/utils/packageManager.d.ts.map +0 -1
- package/dist/react-native/utils/packageManager.js +0 -41
- package/dist/react-native/utils/packageManager.js.map +0 -1
- package/dist/react-native/utils/parseJwt.d.ts +0 -4
- package/dist/react-native/utils/parseJwt.d.ts.map +0 -1
- package/dist/react-native/utils/parseJwt.js +0 -16
- package/dist/react-native/utils/parseJwt.js.map +0 -1
- package/dist/react-native/utils/playwrightReporterStorageManager.d.ts +0 -13
- package/dist/react-native/utils/playwrightReporterStorageManager.d.ts.map +0 -1
- package/dist/react-native/utils/playwrightReporterStorageManager.js +0 -452
- package/dist/react-native/utils/playwrightReporterStorageManager.js.map +0 -1
- package/dist/react-native/utils/utils.d.ts +0 -57
- package/dist/react-native/utils/utils.d.ts.map +0 -1
- package/dist/react-native/utils/utils.js +0 -392
- package/dist/react-native/utils/utils.js.map +0 -1
package/README.md
CHANGED
|
@@ -163,26 +163,18 @@ The Azure Playwright reporter is included with the `@azure/playwright` package a
|
|
|
163
163
|
Add both the HTML reporter and Azure Playwright reporter to your `playwright.service.config.ts`:
|
|
164
164
|
|
|
165
165
|
```typescript snippet:configure_reporters
|
|
166
|
-
import { getServiceConfig, PlaywrightReporter } from "@azure/playwright";
|
|
167
|
-
import { defineConfig } from "@playwright/test";
|
|
168
166
|
import { DefaultAzureCredential } from "@azure/identity";
|
|
169
|
-
|
|
170
|
-
// <snippet_configure_reporters>
|
|
171
|
-
import { getServiceConfig, PlaywrightReporter } from "@azure/playwright";
|
|
172
167
|
import { defineConfig } from "@playwright/test";
|
|
173
|
-
import {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
reporter
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
],
|
|
184
|
-
},
|
|
185
|
-
);
|
|
168
|
+
import { createAzurePlaywrightConfig } from "@azure/playwright";
|
|
169
|
+
|
|
170
|
+
const credential = new DefaultAzureCredential();
|
|
171
|
+
const playwrightConfig = defineConfig({});
|
|
172
|
+
defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig, { credential }), {
|
|
173
|
+
reporter: [
|
|
174
|
+
["html", { open: "never" }], // HTML reporter must come first
|
|
175
|
+
["@azure/playwright/reporter"], // Azure reporter uploads HTML report
|
|
176
|
+
],
|
|
177
|
+
});
|
|
186
178
|
```
|
|
187
179
|
|
|
188
180
|
#### 2. Prerequisites for Reporting
|
|
@@ -99,6 +99,11 @@ export declare const UploadConstants: {
|
|
|
99
99
|
RETRY_BASE_DELAY: number;
|
|
100
100
|
};
|
|
101
101
|
export declare const BrowserSessionSourceType: {
|
|
102
|
-
PLAYWRIGHT_WORKSPACES_TEST_RUN:
|
|
102
|
+
readonly PLAYWRIGHT_WORKSPACES_TEST_RUN: "PlaywrightWorkspacesTestRun";
|
|
103
|
+
readonly OTHERS: "Others";
|
|
104
|
+
};
|
|
105
|
+
export declare const StorageUriValidationConstants: {
|
|
106
|
+
AllowedProtocol: string;
|
|
107
|
+
AllowedHostnameSuffixes: readonly [".blob.core.windows.net", ".blob.core.usgovcloudapi.net", ".blob.core.chinacloudapi.cn"];
|
|
103
108
|
};
|
|
104
109
|
//# 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;;;;;CAKvC,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,YAAY;;;;;;;;;;;;;;;CAexB,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAWxC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAC;AAEF,eAAO,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/common/constants.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B;;;;;CAKvC,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,YAAY;;;;;;;;;;;;;;;CAexB,CAAC;AAEF,eAAO,MAAM,4BAA4B;;;;;;;;;;;CAWxC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;CAY3B,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;CAG3B,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;CAOzC,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT License.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.BrowserSessionSourceType = exports.UploadConstants = exports.InternalEnvironmentVariables = exports.UrlConstants = exports.Constants = exports.RunConfigConstants = exports.SDKLanguage = exports.DefaultConnectOptionsConstants = exports.GitHubActionsConstants = exports.ServiceEnvironmentVariable = exports.ServiceAuth = exports.ServiceOS = exports.EntraIdAccessTokenConstants = void 0;
|
|
5
|
+
exports.StorageUriValidationConstants = exports.BrowserSessionSourceType = exports.UploadConstants = exports.InternalEnvironmentVariables = exports.UrlConstants = exports.Constants = exports.RunConfigConstants = exports.SDKLanguage = exports.DefaultConnectOptionsConstants = exports.GitHubActionsConstants = exports.ServiceEnvironmentVariable = exports.ServiceAuth = exports.ServiceOS = exports.EntraIdAccessTokenConstants = void 0;
|
|
6
6
|
exports.EntraIdAccessTokenConstants = {
|
|
7
7
|
LIFETIME_LEFT_THRESHOLD_IN_MINUTES_FOR_ROTATION: 15,
|
|
8
8
|
SCOPE: "https://management.core.windows.net/.default",
|
|
@@ -105,5 +105,14 @@ exports.UploadConstants = {
|
|
|
105
105
|
};
|
|
106
106
|
exports.BrowserSessionSourceType = {
|
|
107
107
|
PLAYWRIGHT_WORKSPACES_TEST_RUN: "PlaywrightWorkspacesTestRun",
|
|
108
|
+
OTHERS: "Others",
|
|
109
|
+
};
|
|
110
|
+
exports.StorageUriValidationConstants = {
|
|
111
|
+
AllowedProtocol: "https:",
|
|
112
|
+
AllowedHostnameSuffixes: [
|
|
113
|
+
".blob.core.windows.net",
|
|
114
|
+
".blob.core.usgovcloudapi.net",
|
|
115
|
+
".blob.core.chinacloudapi.cn",
|
|
116
|
+
],
|
|
108
117
|
};
|
|
109
118
|
//# sourceMappingURL=constants.js.map
|
|
@@ -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,aAAa,EAAE,oCAAoC;IACnD,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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C;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;AAEW,QAAA,wBAAwB,GAAG;IACtC,8BAA8B,EAAE,6BAA6B;
|
|
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,aAAa,EAAE,oCAAoC;IACnD,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,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E,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;AAEW,QAAA,wBAAwB,GAAG;IACtC,8BAA8B,EAAE,6BAA6B;IAC7D,MAAM,EAAE,QAAQ;CACR,CAAC;AAEE,QAAA,6BAA6B,GAAG;IAC3C,eAAe,EAAE,QAAQ;IACzB,uBAAuB,EAAE;QACvB,wBAAwB;QACxB,8BAA8B;QAC9B,6BAA6B;KACrB;CACX,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 STORAGE_SCOPE: \"https://storage.azure.com/.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 UrlConstants = {\n AzurePortalBaseUrl: \"https://ms.portal.azure.com\",\n ReportingApiSubdomain: \"reporting.api\",\n ApiSubdomain: \"api\",\n PlaywrightWorkspacesPath: \"playwrightworkspaces\",\n TestRunsPath: \"test-runs\",\n LoadTestServiceProvider: \"Microsoft.LoadTestService\",\n PlaywrightWorkspacesResourceType: \"playwrightWorkspaces\",\n TestRunsRoute: \"TestRuns\",\n ResourceGroupsPath: \"resourcegroups\",\n ResourcePath: \"/resource\",\n SubscriptionsPath: \"/subscriptions\",\n ResourceGroupsUrlPath: \"/resourceGroups\",\n ProvidersPath: \"/providers\",\n TestReportViewPath: \"#view/Microsoft_Azure_CloudNativeTesting/TestReport.ReactView\",\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\nexport const BrowserSessionSourceType = {\n PLAYWRIGHT_WORKSPACES_TEST_RUN: \"PlaywrightWorkspacesTestRun\",\n OTHERS: \"Others\",\n} as const;\n\nexport const StorageUriValidationConstants = {\n AllowedProtocol: \"https:\",\n AllowedHostnameSuffixes: [\n \".blob.core.windows.net\",\n \".blob.core.usgovcloudapi.net\",\n \".blob.core.chinacloudapi.cn\",\n ] as const,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA0DE,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;+CAkBf,MAAM,KAAG,MAAM
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../src/common/messages.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CA0DE,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;+CAkBf,MAAM,KAAG,MAAM;;;;;;;;;;;;;uDAkBP,MAAM,KAAG,MAAM;;;;;;;;;uDAWf,MAAM,KAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;kCA+BpC,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"}
|
|
@@ -74,6 +74,12 @@ exports.ServiceErrorMessageConstants = {
|
|
|
74
74
|
key: "StorageUriNotFound",
|
|
75
75
|
message: "Storage Account is not linked with this Playwright Workspace.",
|
|
76
76
|
},
|
|
77
|
+
INVALID_STORAGE_URI: {
|
|
78
|
+
key: "InvalidStorageUri",
|
|
79
|
+
message: "The storage URI configured on this Playwright Workspace is not a valid Azure Storage Blob endpoint. " +
|
|
80
|
+
"Please ask a workspace administrator to relink a valid Azure Storage Blob account. " +
|
|
81
|
+
"For more information, see https://aka.ms/pww-reporting",
|
|
82
|
+
},
|
|
77
83
|
STORAGE_AUTHORIZATION_FAILED: {
|
|
78
84
|
key: "StorageAuthorizationFailed",
|
|
79
85
|
message: "The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting",
|
|
@@ -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,wCAAwC,EAAE;QACxC,GAAG,EAAE,qCAAqC;QAC1C,OAAO,EACL,8KAA8K;KACjL;IACD,4CAA4C,EAAE;QAC5C,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EACL,4IAA4I;KAC/I;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,mHAAmH;KACtH;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,qBAAqB;QAC1B,OAAO,EACL,kKAAkK;KACrK;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EACL,2GAA2G;KAC9G;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EACL,iGAAiG;KACpG;IACD,qBAAqB,EAAE;QACrB,GAAG,EAAE,oBAAoB;QACzB,OAAO,EAAE,+EAA+E;KACzF;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,sBAAsB;QAC3B,OAAO,EACL,s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AS,aAAa,MAAM,EAAE;KACnH;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,8BAA8B;QACnC,OAAO,EAAE,kCAAkC;QAC3C,eAAe,EAAE,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK;KAClD;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,0DAA0D;QACnE,sBAAsB,EAAE,CAAC,YAAoB,EAAU,EAAE,CACvD,qCAAqC,YAAY,iCAAiC;KACrF;IACD,yBAAyB,EAAE;QACzB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,wCAAwC;KAClD;IACD,gCAAgC,EAAE;QAChC,GAAG,EAAE,+BAA+B;QACpC,OAAO,EACL,mKAAmK;KACtK;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const ServiceErrorMessageConstants = {\n NO_SERVICE_URL_ERROR: {\n key: \"NoServiceUrlError\",\n message:\n \"The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.\",\n },\n INVALID_GLOBAL_FUNCTION: {\n key: \"InvalidGlobalFunction\",\n message: \"File must export a single function.\",\n },\n INVALID_PLAYWRIGHT_VERSION_ERROR: {\n key: \"InvalidPlaywrightVersionError\",\n message:\n \"The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.\",\n },\n PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {\n key: \"PlaywrightVersionTooOldForReporting\",\n message:\n \"To use the Playwright Workspaces reporting feature, you need Playwright version 1.57 or later installed. Update the Playwright package to a supported version and try again.\",\n },\n MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {\n key: \"MultipleSetupFilePlaywrightVersionError\",\n message:\n \"The Playwright version you are using does not support multiple setup/teardown files. Please update to Playwright version 1.49.0 or higher.\",\n },\n WORKSPACE_MISMATCH_ERROR: {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n },\n NO_AUTH_ERROR_PAT_TOKEN: {\n key: \"NoAuthErrorPatToken\",\n message:\n \"Please set PLAYWRIGHT_SERVICE_ACCESS_TOKEN env variable when using ACCESS_TOKEN authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n NO_AUTH_ERROR_ENTRA_TOKEN: {\n key: \"NoAuthErrorEntraToken\",\n message:\n \"Could not authenticate with the service. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message:\n \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided is invalid. Please make sure to set a valid token.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided has expired. Create a new token.\",\n },\n NO_CRED_ENTRA_AUTH_ERROR: {\n key: \"NoCredEntraAuthError\",\n message:\n \"Missing 'credential' parameter which is required when using ENTRA_ID authentication, Azure credential not provided. See https://aka.ms/pww/docs/authentication for more information.\",\n },\n FAILED_TO_CREATE_TEST_RUN: {\n key: \"FailedToCreateTestRun\",\n message:\n \"Failed to create the test run in the Playwright workspaces. For more information, see https://aka.ms/pww/docs/troubleshooting\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. For more information, see https://aka.ms/pww/docs/troubleshooting`,\n },\n INVALID_PARAM_WITH_SERVICE_CONFIG: {\n key: \"InvalidParamWithServiceConfig\",\n message: `Remove serviceAuth, runId, and runName from getConnectOptions when using createAzurePlaywrightConfig. Configure these options through createAzurePlaywrightConfig instead.`,\n },\n INVALID_RUN_ID_FORMAT: {\n key: \"InvalidRunIdFormat\",\n message: \"The Run ID must be a valid GUID format. Please provide a valid GUID for the Run ID.\",\n },\n INVALID_AUTH_TYPE_ERROR: {\n key: \"InvalidAuthTypeError\",\n message: \"Invalid authentication type specified. Please use either ENTRA_ID or ACCESS_TOKEN.\",\n },\n FAILED_TO_GET_WORKSPACE_DETAILS: {\n key: \"FailedToGetWorkspaceDetails\",\n message: \"Failed to retrieve workspace details from the Playwright service.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to retrieve workspace details from the Playwright service. Error: ${errorDetails}. Please verify your service URL and authentication credentials.`,\n },\n STORAGE_URI_NOT_FOUND: {\n key: \"StorageUriNotFound\",\n message: \"Storage Account is not linked with this Playwright Workspace.\",\n },\n STORAGE_AUTHORIZATION_FAILED: {\n key: \"StorageAuthorizationFailed\",\n message:\n \"The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account - ${storageAccountName}. For more information, see https://aka.ms/pww-reporting`,\n },\n UNABLE_TO_EXTRACT_WORKSPACE_ID: {\n key: \"UnableToExtractWorkspaceId\",\n message: \"Unable to extract workspace ID from service URL\",\n },\n STORAGE_ACCOUNT_DELETED: {\n key: \"StorageAccountDeleted\",\n message:\n \"The storage account linked to your Playwright Workspace may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The storage account linked to your Playwright Workspace (${storageAccountName}) may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration`,\n },\n REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message:\n \"Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n HTML_REPORTER_REQUIRED: {\n key: \"HtmlReporterRequired\",\n message:\n \"Playwright Workspaces Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the 'html' reporter before playwright workspace reporter to generate test reports that can be uploaded to Azure Storage. Example: reporter: [['html'], ['@azure/playwright/reporter']]. For more information, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_METADATA_FETCH_FAILED: {\n key: \"WorkspaceMetadataFetchFailed\",\n message:\n \"Failed to retrieve workspace configuration. Reporting will be disabled for this run. Please check your authentication credentials and service URL.\",\n },\n WORKSPACE_REPORTING_DISABLED: {\n key: \"WorkspaceReportingDisabled\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is not enabled for the Playwright Workspace. To learn more about how to enable reporting and link a storage account, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_REPORTING_STORAGE_NOT_LINKED: {\n key: \"WorkspaceReportingStorageNotLinked\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is enabled for the Playwright Workspace, but no storage account is linked. Please link a storage account to enable reporting. For more information, see https://aka.ms/pww-reporting\",\n },\n UPLOAD_FAILED_FILES: {\n key: \"UploadFailedFiles\",\n message: \"Upload failed: files could not be uploaded\",\n formatWithCount: (failed: number): string =>\n `Upload failed: ${failed} files could not be uploaded`,\n },\n PLAYWRIGHT_TEST_REPORT_NOT_FOUND: {\n key: \"PlaywrightTestReportNotFound\",\n message: \"Playwright test report not found\",\n formatWithFolder: (folderName: string): string =>\n `Playwright test report not found: ${folderName}. For more information, see https://aka.ms/pww-reporting`,\n },\n REPORTING_ENABLED: {\n key: \"ReportingEnabled\",\n message: \"Playwright Workspaces reporting: ENABLED\",\n },\n COLLECTING_ARTIFACTS: {\n key: \"CollectingArtifacts\",\n message: \"Collecting artifacts: screenshots, videos, traces.\",\n },\n REPORTING_STATUS_SUCCESS: {\n key: \"ReportingStatusSuccess\",\n message: \"Reporting upload status: SUCCESS\",\n },\n REPORTING_STATUS_PARTIAL: {\n key: \"ReportingStatusPartial\",\n message: \"Reporting upload status: Partially Uploaded\",\n },\n REPORTING_STATUS_FAILED: {\n key: \"ReportingStatusFailed\",\n message: \"Reporting upload status: FAILED\",\n },\n TEST_REPORT_VIEW_URL: {\n key: \"TestReportViewUrl\",\n message: \"Published report URL: \",\n formatWithUrl: (url: string): string => `Published report URL: ${url}`,\n },\n UPLOADING_ARTIFACTS: {\n key: \"UploadingArtifacts\",\n message: \"Uploading artifacts to storage\",\n formatWithDetails: (storageAccount: string, container: string, folder: string): string =>\n `Uploading artifacts to: storage account= ${storageAccount}, storage container= ${container}, folder= ${folder}`,\n },\n FAILED_TO_GET_WORKSPACE_METADATA: {\n key: \"FailedToGetWorkspaceMetadata\",\n message: \"Failed to get workspace metadata\",\n formatWithError: (error: string): string => error,\n },\n TEST_RUN_CREATION_FAILED: {\n key: \"TestRunCreationFailed\",\n message: \"Failed to create test run. Test execution will continue.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create test run. Error: ${errorDetails}. Test execution will continue.`,\n },\n REPORTING_TEST_RUN_FAILED: {\n key: \"ReportingTestRunFailed\",\n message: \"Test run creation failed during setup.\",\n },\n REPORTER_REQUIRES_SERVICE_CONFIG: {\n key: \"ReporterRequiresServiceConfig\",\n message:\n \"Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig. For more information, see https://aka.ms/pww-reporting.\",\n },\n};\n"]}
|
|
1
|
+
{"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,wCAAwC,EAAE;QACxC,GAAG,EAAE,qCAAqC;QAC1C,OAAO,EACL,8KAA8K;KACjL;IACD,4CAA4C,EAAE;QAC5C,GAAG,EAAE,yCA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qB;QAC1B,OAAO,EAAE,oDAAoD;KAC9D;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,kCAAkC;KAC5C;IACD,wBAAwB,EAAE;QACxB,GAAG,EAAE,wBAAwB;QAC7B,OAAO,EAAE,6CAA6C;KACvD;IACD,uBAAuB,EAAE;QACvB,GAAG,EAAE,uBAAuB;QAC5B,OAAO,EAAE,iCAAiC;KAC3C;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,mKAAmK;KACtK;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const ServiceErrorMessageConstants = {\n NO_SERVICE_URL_ERROR: {\n key: \"NoServiceUrlError\",\n message:\n \"The value for the PLAYWRIGHT_SERVICE_URL variable is not set correctly. Please verify the URL and try again.\",\n },\n INVALID_GLOBAL_FUNCTION: {\n key: \"InvalidGlobalFunction\",\n message: \"File must export a single function.\",\n },\n INVALID_PLAYWRIGHT_VERSION_ERROR: {\n key: \"InvalidPlaywrightVersionError\",\n message:\n \"The Playwright version you are using is not supported. See the list of supported versions at https://aka.ms/pww/docs/supported-versions.\",\n },\n PLAYWRIGHT_VERSION_TOO_OLD_FOR_REPORTING: {\n key: \"PlaywrightVersionTooOldForReporting\",\n message:\n \"To use the Playwright Workspaces reporting feature, you need Playwright version 1.57 or later installed. Update the Playwright package to a supported version and try again.\",\n },\n MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR: {\n key: \"MultipleSetupFilePlaywrightVersionError\",\n message:\n \"The Playwright version you are using does not support multiple setup/teardown files. Please update to Playwright version 1.49.0 or higher.\",\n },\n WORKSPACE_MISMATCH_ERROR: {\n key: \"InvalidAccessToken\",\n message:\n \"The provided access token does not match the specified workspace URL. Please verify that both values are correct.\",\n },\n NO_AUTH_ERROR_PAT_TOKEN: {\n key: \"NoAuthErrorPatToken\",\n message:\n \"Please set PLAYWRIGHT_SERVICE_ACCESS_TOKEN env variable when using ACCESS_TOKEN authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n NO_AUTH_ERROR_ENTRA_TOKEN: {\n key: \"NoAuthErrorEntraToken\",\n message:\n \"Could not authenticate with the service. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n INVALID_MPT_PAT_ERROR: {\n key: \"InvalidMptPatError\",\n message:\n \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided is invalid. Please make sure to set a valid token.\",\n },\n EXPIRED_MPT_PAT_ERROR: {\n key: \"ExpiredMptPatError\",\n message: \"The PLAYWRIGHT_SERVICE_ACCESS_TOKEN provided has expired. Create a new token.\",\n },\n NO_CRED_ENTRA_AUTH_ERROR: {\n key: \"NoCredEntraAuthError\",\n message:\n \"Missing 'credential' parameter which is required when using ENTRA_ID authentication, Azure credential not provided. See https://aka.ms/pww/docs/authentication for more information.\",\n },\n FAILED_TO_CREATE_TEST_RUN: {\n key: \"FailedToCreateTestRun\",\n message:\n \"Failed to create the test run in the Playwright workspaces. For more information, see https://aka.ms/pww/docs/troubleshooting\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create the test run in the Playwright workspaces. Error: ${errorDetails}. For more information, see https://aka.ms/pww/docs/troubleshooting`,\n },\n INVALID_PARAM_WITH_SERVICE_CONFIG: {\n key: \"InvalidParamWithServiceConfig\",\n message: `Remove serviceAuth, runId, and runName from getConnectOptions when using createAzurePlaywrightConfig. Configure these options through createAzurePlaywrightConfig instead.`,\n },\n INVALID_RUN_ID_FORMAT: {\n key: \"InvalidRunIdFormat\",\n message: \"The Run ID must be a valid GUID format. Please provide a valid GUID for the Run ID.\",\n },\n INVALID_AUTH_TYPE_ERROR: {\n key: \"InvalidAuthTypeError\",\n message: \"Invalid authentication type specified. Please use either ENTRA_ID or ACCESS_TOKEN.\",\n },\n FAILED_TO_GET_WORKSPACE_DETAILS: {\n key: \"FailedToGetWorkspaceDetails\",\n message: \"Failed to retrieve workspace details from the Playwright service.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to retrieve workspace details from the Playwright service. Error: ${errorDetails}. Please verify your service URL and authentication credentials.`,\n },\n STORAGE_URI_NOT_FOUND: {\n key: \"StorageUriNotFound\",\n message: \"Storage Account is not linked with this Playwright Workspace.\",\n },\n INVALID_STORAGE_URI: {\n key: \"InvalidStorageUri\",\n message:\n \"The storage URI configured on this Playwright Workspace is not a valid Azure Storage Blob endpoint. \" +\n \"Please ask a workspace administrator to relink a valid Azure Storage Blob account. \" +\n \"For more information, see https://aka.ms/pww-reporting\",\n },\n STORAGE_AUTHORIZATION_FAILED: {\n key: \"StorageAuthorizationFailed\",\n message:\n \"The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account. For more information, see https://aka.ms/pww-reporting\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The user is not authorized to perform this operation. Please make sure you have the Storage Blob Data Contributor role assigned to the storage account - ${storageAccountName}. For more information, see https://aka.ms/pww-reporting`,\n },\n UNABLE_TO_EXTRACT_WORKSPACE_ID: {\n key: \"UnableToExtractWorkspaceId\",\n message: \"Unable to extract workspace ID from service URL\",\n },\n STORAGE_ACCOUNT_DELETED: {\n key: \"StorageAccountDeleted\",\n message:\n \"The storage account linked to your Playwright Workspace may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration\",\n formatWithStorageAccount: (storageAccountName: string): string =>\n `The storage account linked to your Playwright Workspace (${storageAccountName}) may have been deleted. Please link a different storage account to your Playwright Workspace before trying again. To learn more on how to link a new storage account, refer to https://aka.ms/pww-reporting-migration`,\n },\n REPORTER_REQUIRES_ENTRA_AUTH: {\n key: \"ReporterRequiresEntraAuth\",\n message:\n \"Playwright Workspaces Reporter can only be used with ENTRA_ID authentication. For more information, see https://aka.ms/pww/docs/authentication\",\n },\n HTML_REPORTER_REQUIRED: {\n key: \"HtmlReporterRequired\",\n message:\n \"Playwright Workspaces Reporter requires the 'html' reporter to be configured in your Playwright configuration. Please add the 'html' reporter before playwright workspace reporter to generate test reports that can be uploaded to Azure Storage. Example: reporter: [['html'], ['@azure/playwright/reporter']]. For more information, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_METADATA_FETCH_FAILED: {\n key: \"WorkspaceMetadataFetchFailed\",\n message:\n \"Failed to retrieve workspace configuration. Reporting will be disabled for this run. Please check your authentication credentials and service URL.\",\n },\n WORKSPACE_REPORTING_DISABLED: {\n key: \"WorkspaceReportingDisabled\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is not enabled for the Playwright Workspace. To learn more about how to enable reporting and link a storage account, see https://aka.ms/pww-reporting\",\n },\n WORKSPACE_REPORTING_STORAGE_NOT_LINKED: {\n key: \"WorkspaceReportingStorageNotLinked\",\n message:\n \"Playwright Workspaces reporting: DISABLED. Reporting is enabled for the Playwright Workspace, but no storage account is linked. Please link a storage account to enable reporting. For more information, see https://aka.ms/pww-reporting\",\n },\n UPLOAD_FAILED_FILES: {\n key: \"UploadFailedFiles\",\n message: \"Upload failed: files could not be uploaded\",\n formatWithCount: (failed: number): string =>\n `Upload failed: ${failed} files could not be uploaded`,\n },\n PLAYWRIGHT_TEST_REPORT_NOT_FOUND: {\n key: \"PlaywrightTestReportNotFound\",\n message: \"Playwright test report not found\",\n formatWithFolder: (folderName: string): string =>\n `Playwright test report not found: ${folderName}. For more information, see https://aka.ms/pww-reporting`,\n },\n REPORTING_ENABLED: {\n key: \"ReportingEnabled\",\n message: \"Playwright Workspaces reporting: ENABLED\",\n },\n COLLECTING_ARTIFACTS: {\n key: \"CollectingArtifacts\",\n message: \"Collecting artifacts: screenshots, videos, traces.\",\n },\n REPORTING_STATUS_SUCCESS: {\n key: \"ReportingStatusSuccess\",\n message: \"Reporting upload status: SUCCESS\",\n },\n REPORTING_STATUS_PARTIAL: {\n key: \"ReportingStatusPartial\",\n message: \"Reporting upload status: Partially Uploaded\",\n },\n REPORTING_STATUS_FAILED: {\n key: \"ReportingStatusFailed\",\n message: \"Reporting upload status: FAILED\",\n },\n TEST_REPORT_VIEW_URL: {\n key: \"TestReportViewUrl\",\n message: \"Published report URL: \",\n formatWithUrl: (url: string): string => `Published report URL: ${url}`,\n },\n UPLOADING_ARTIFACTS: {\n key: \"UploadingArtifacts\",\n message: \"Uploading artifacts to storage\",\n formatWithDetails: (storageAccount: string, container: string, folder: string): string =>\n `Uploading artifacts to: storage account= ${storageAccount}, storage container= ${container}, folder= ${folder}`,\n },\n FAILED_TO_GET_WORKSPACE_METADATA: {\n key: \"FailedToGetWorkspaceMetadata\",\n message: \"Failed to get workspace metadata\",\n formatWithError: (error: string): string => error,\n },\n TEST_RUN_CREATION_FAILED: {\n key: \"TestRunCreationFailed\",\n message: \"Failed to create test run. Test execution will continue.\",\n formatWithErrorDetails: (errorDetails: string): string =>\n `Failed to create test run. Error: ${errorDetails}. Test execution will continue.`,\n },\n REPORTING_TEST_RUN_FAILED: {\n key: \"ReportingTestRunFailed\",\n message: \"Test run creation failed during setup.\",\n },\n REPORTER_REQUIRES_SERVICE_CONFIG: {\n key: \"ReporterRequiresServiceConfig\",\n message:\n \"Playwright Workspaces Reporter requires the use of service configuration via createAzurePlaywrightConfig. For more information, see https://aka.ms/pww-reporting.\",\n },\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PlaywrightServiceAdditionalOptions, OsType } from "./types.js";
|
|
1
|
+
import type { BrowserSessionSourceTypeValue, PlaywrightServiceAdditionalOptions, OsType } from "./types.js";
|
|
2
2
|
import type { TokenCredential } from "@azure/identity";
|
|
3
3
|
declare class PlaywrightServiceConfig {
|
|
4
4
|
serviceOs: OsType;
|
|
@@ -8,6 +8,7 @@ declare class PlaywrightServiceConfig {
|
|
|
8
8
|
exposeNetwork: string;
|
|
9
9
|
runName: string;
|
|
10
10
|
apiVersion: string;
|
|
11
|
+
sourceType: BrowserSessionSourceTypeValue;
|
|
11
12
|
private _serviceAuthType;
|
|
12
13
|
credential?: TokenCredential;
|
|
13
14
|
constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playwrightServiceConfig.d.ts","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,6BAA6B,EAC7B,kCAAkC,EAClC,MAAM,EACP,MAAM,YAAY,CAAC;AACpB,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;IACnB,UAAU,EAAE,6BAA6B,CAAC;IACjD,OAAO,CAAC,gBAAgB,CAAgC;IACjD,UAAU,CAAC,EAAE,eAAe,CAAC;;IAepC,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,CA2CL;CACH;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -16,6 +16,7 @@ class PlaywrightServiceConfig {
|
|
|
16
16
|
exposeNetwork;
|
|
17
17
|
runName;
|
|
18
18
|
apiVersion;
|
|
19
|
+
sourceType;
|
|
19
20
|
_serviceAuthType = constants_js_1.ServiceAuth.ENTRA_ID;
|
|
20
21
|
credential;
|
|
21
22
|
constructor() {
|
|
@@ -28,6 +29,7 @@ class PlaywrightServiceConfig {
|
|
|
28
29
|
this.exposeNetwork = constants_js_1.DefaultConnectOptionsConstants.DEFAULT_EXPOSE_NETWORK;
|
|
29
30
|
this.apiVersion =
|
|
30
31
|
process.env[constants_js_1.InternalEnvironmentVariables.MPT_API_VERSION] || constants_js_1.Constants.LatestAPIVersion;
|
|
32
|
+
this.sourceType = constants_js_1.BrowserSessionSourceType.PLAYWRIGHT_WORKSPACES_TEST_RUN;
|
|
31
33
|
}
|
|
32
34
|
static get instance() {
|
|
33
35
|
if (!state_js_1.state.playwrightServiceConfig) {
|
|
@@ -99,6 +101,9 @@ class PlaywrightServiceConfig {
|
|
|
99
101
|
if (options?.credential) {
|
|
100
102
|
this.credential = options.credential;
|
|
101
103
|
}
|
|
104
|
+
if (options?.sourceType) {
|
|
105
|
+
this.sourceType = options.sourceType;
|
|
106
|
+
}
|
|
102
107
|
};
|
|
103
108
|
}
|
|
104
109
|
exports.PlaywrightServiceConfig = PlaywrightServiceConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,
|
|
1
|
+
{"version":3,"file":"playwrightServiceConfig.js","sourceRoot":"","sources":["../../../src/common/playwrightServiceConfig.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,iDAMwB;AAOxB,gDAA8E;AAC9E,kEAA4D;AAC5D,yCAAmC;AACnC,+CAA6D;AAE7D,MAAM,uBAAuB;IACpB,SAAS,CAAS;IAClB,KAAK,CAAS;IACd,cAAc,CAAS;IACvB,MAAM,CAAS;IACf,aAAa,CAAS;IACtB,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,UAAU,CAAgC;IACzC,gBAAgB,GAAW,0BAAW,CAAC,QAAQ,CAAC;IACjD,UAAU,CAAmB;IAEpC;QACE,IAAI,CAAC,SAAS,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,cAAc,CAAC;YACxE,6CAA8B,CAAC,kBAAkB,CAAW,CAAC;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;QAChF,IAAI,CAAC,cAAc,GAAG,6CAA8B,CAAC,eAAe,CAAC;QACrE,IAAI,CAAC,MAAM,GAAG,6CAA8B,CAAC,eAAe,CAAC;QAC7D,IAAI,CAAC,aAAa,GAAG,6C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C,GAAG,IAAI,CAAC,OAAO,CAAC;QAChF,CAAC;QACD,IAAI,OAAO,EAAE,EAAE,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,EAAE,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QAC5E,CAAC;QACD,IAAI,OAAO,EAAE,MAAM,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC/B,CAAC;QACD,IAAI,OAAO,EAAE,cAAc,EAAE,CAAC;YAC5B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC/C,CAAC;QACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;QACD,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;YACxB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;CACH;AAEQ,0DAAuB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n BrowserSessionSourceType,\n Constants,\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"./constants.js\";\nimport type {\n BrowserSessionSourceTypeValue,\n PlaywrightServiceAdditionalOptions,\n OsType,\n} 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 public sourceType: BrowserSessionSourceTypeValue;\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 this.sourceType = BrowserSessionSourceType.PLAYWRIGHT_WORKSPACES_TEST_RUN;\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 if (options?.sourceType) {\n this.sourceType = options.sourceType;\n }\n };\n}\n\nexport { PlaywrightServiceConfig };\n"]}
|
|
@@ -129,7 +129,22 @@ export type PlaywrightServiceAdditionalOptions = {
|
|
|
129
129
|
* @defaultValue `2025-09-01`
|
|
130
130
|
*/
|
|
131
131
|
apiVersion?: "2025-09-01";
|
|
132
|
+
/**
|
|
133
|
+
* @public
|
|
134
|
+
*
|
|
135
|
+
* Identifies the tool that initiated remote browser sessions, sent to the
|
|
136
|
+
* service as the `sourceType` query parameter on the WebSocket endpoint.
|
|
137
|
+
*
|
|
138
|
+
* @defaultValue `PlaywrightWorkspacesTestRun`
|
|
139
|
+
*/
|
|
140
|
+
sourceType?: BrowserSessionSourceTypeValue;
|
|
132
141
|
};
|
|
142
|
+
/**
|
|
143
|
+
* @public
|
|
144
|
+
*
|
|
145
|
+
* Source identifier values accepted by Azure Playwright for the `sourceType` option.
|
|
146
|
+
*/
|
|
147
|
+
export type BrowserSessionSourceTypeValue = "PlaywrightWorkspacesTestRun" | "Others";
|
|
133
148
|
/**
|
|
134
149
|
* @public
|
|
135
150
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAIzD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;OAIG;IACH,UAAU,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;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,kBAAkB,CAAC;IAErC;;;;;;OAMG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;OAMG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B;;;;;;OAMG;IACH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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 type { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Use cloud hosted browsers.\n *\n * @defaultValue `true`\n */\n useCloudHostedBrowsers?: boolean;\n\n /**\n * @public\n *\n * Custom token credential for Entra ID authentication. Learn more at {@link https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md | Using Azure Identity}.\n *\n * @defaultValue `DefaultAzureCredential`\n */\n credential?: TokenCredential;\n /**\n * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\n\n /**\n * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n};\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n\nexport type WorkspaceMetaData = {\n id?: string;\n resourceId?: string;\n name?: string;\n state?: string;\n subscriptionId?: string;\n subscriptionState?: string;\n tenantId?: string;\n location?: string;\n regionalAffinity?: string;\n localAuth?: string;\n storageUri?: string;\n reporting?: string;\n};\n\nexport interface UploadResult {\n success: boolean;\n errorMessage?: string;\n failedFileCount?: number;\n totalFiles?: number;\n failedFiles?: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n partialSuccess?: boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/common/types.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ConnectOptions } from \"@playwright/test\";\nimport type { ServiceAuth, ServiceOS, SDKLanguage } from \"./constants.js\";\nimport type { TokenCredential } from \"@azure/identity\";\nimport type { CIInfo } from \"../utils/cIInfoProvider.js\";\n\n// Public APIs\n\n/**\n * @public\n *\n * Endpoint options for the service.\n */\nexport type EndpointOptions = {\n /**\n * @public\n *\n * A browser websocket endpoint to connect to.\n */\n wsEndpoint: string;\n};\n\n/**\n * @public\n *\n * Browser connect options for the service. This includes endpoint options and connect options.\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions, BrowserConnectOptions } from \"@azure/playwright\";\n *\n * test(\"has title\", async ({ browserName }) => {\n * const { wsEndpoint, options } : BrowserConnectOptions = await getConnectOptions();\n * const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);\n * const context = await browser.newContext();\n * const page = await context.newPage();\n *\n * await page.goto(\"https://playwright.dev/\");\n * await expect(page).toHaveTitle(/Playwright/);\n *\n * await page.close();\n * await context.close();\n * await browser.close();\n * });\n * ```\n */\nexport type BrowserConnectOptions = EndpointOptions & {\n options: ConnectOptions;\n};\n\n/**\n * @public\n *\n * Additional options for the service.\n */\nexport type PlaywrightServiceAdditionalOptions = {\n /**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n *\n * @defaultValue `ENTRA_ID`\n */\n serviceAuthType?: AuthenticationType;\n\n /**\n * @public\n *\n * Operating system types supported by Azure Playwright.\n *\n * @defaultValue `linux`\n */\n os?: OsType;\n\n /**\n * @public\n *\n * Run id for the test run.\n *\n * @defaultValue `current datetime as ISO string`\n */\n runId?: string;\n\n /**\n * @public\n *\n * Maximum time in milliseconds to wait for the connection to be established.\n *\n * @defaultValue `30000`\n */\n connectTimeout?: number;\n\n /**\n * @public\n *\n * Slows down Playwright operations by the specified amount of milliseconds.\n *\n * @defaultValue `0`\n */\n slowMo?: number;\n\n /**\n * @public\n *\n * Exposes network available on the connecting client to the browser being connected to.\n *\n * @defaultValue `<loopback>`\n */\n exposeNetwork?: string;\n\n /**\n * @public\n *\n * Use cloud hosted browsers.\n *\n * @defaultValue `true`\n */\n useCloudHostedBrowsers?: boolean;\n\n /**\n * @public\n *\n * Custom token credential for Entra ID authentication. Learn more at {@link https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md | Using Azure Identity}.\n *\n * @defaultValue `DefaultAzureCredential`\n */\n credential?: TokenCredential;\n /**\n * @public\n *\n * Run name for the test run.\n *\n * @defaultValue `guid`\n */\n runName?: string;\n\n /**\n * @public\n *\n * API Version\n *\n * @defaultValue `2025-09-01`\n */\n apiVersion?: \"2025-09-01\";\n\n /**\n * @public\n *\n * Identifies the tool that initiated remote browser sessions, sent to the\n * service as the `sourceType` query parameter on the WebSocket endpoint.\n *\n * @defaultValue `PlaywrightWorkspacesTestRun`\n */\n sourceType?: BrowserSessionSourceTypeValue;\n};\n\n/**\n * @public\n *\n * Source identifier values accepted by Azure Playwright for the `sourceType` option.\n */\nexport type BrowserSessionSourceTypeValue = \"PlaywrightWorkspacesTestRun\" | \"Others\";\n\n/**\n * @public\n *\n * OS Types supported by Azure Playwright.\n */\nexport type OsType = (typeof ServiceOS)[keyof typeof ServiceOS];\n\n/**\n * @public\n *\n * Authentication types supported by Azure Playwright.\n */\nexport type AuthenticationType = (typeof ServiceAuth)[keyof typeof ServiceAuth];\n\n// Internal APIs\n\nexport type JwtPayload = {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n};\n\nexport type AccessTokenClaims = JwtPayload & {\n pwid?: string;\n};\n\nexport type VersionInfo = {\n major: number;\n minor: number;\n patch: number;\n};\n\nexport type PackageManager = {\n runCommand: (command: string, args: string) => string;\n getVersionFromStdout: (stdout: string) => string;\n};\n\nexport type RunConfig = {\n framework?: RunFramework;\n sdkLanguage?: (typeof SDKLanguage)[keyof typeof SDKLanguage];\n maxWorkers?: number;\n};\n\nexport type RunFramework = {\n name?: string;\n version?: string;\n runnerName?: string;\n};\n\nexport type TestRunCreatePayload = {\n displayName: string;\n config?: RunConfig;\n ciConfig?: CIInfo;\n};\n\nexport type WorkspaceMetaData = {\n id?: string;\n resourceId?: string;\n name?: string;\n state?: string;\n subscriptionId?: string;\n subscriptionState?: string;\n tenantId?: string;\n location?: string;\n regionalAffinity?: string;\n localAuth?: string;\n storageUri?: string;\n reporting?: string;\n};\n\nexport interface UploadResult {\n success: boolean;\n errorMessage?: string;\n failedFileCount?: number;\n totalFiles?: number;\n failedFiles?: string[];\n failedFileDetails?: Array<{ fileName: string; error: string }>;\n partialSuccess?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../../src/core/playwrightService.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kCAAkC,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAgBpG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAa7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,QAAA,MAAM,2BAA2B,GAC/B,YAAY,oBAAoB,EAChC,UAAU,kCAAkC,KAC3C,
|
|
1
|
+
{"version":3,"file":"playwrightService.d.ts","sourceRoot":"","sources":["../../../src/core/playwrightService.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,kCAAkC,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAgBpG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAa7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,QAAA,MAAM,2BAA2B,GAC/B,YAAY,oBAAoB,EAChC,UAAU,kCAAkC,KAC3C,oBAkHF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,iBAAiB,GACrB,UAAU,kCAAkC,KAC3C,OAAO,CAAC,qBAAqB,CA2C/B,CAAC;AAEF,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,CAAC"}
|
|
@@ -10,7 +10,7 @@ const playwrightServiceConfig_js_1 = require("../common/playwrightServiceConfig.
|
|
|
10
10
|
const playwrightServiceEntra_js_1 = tslib_1.__importDefault(require("./playwrightServiceEntra.js"));
|
|
11
11
|
const utils_js_1 = require("../utils/utils.js");
|
|
12
12
|
const messages_js_1 = require("../common/messages.js");
|
|
13
|
-
const
|
|
13
|
+
const playwrightServiceUtils_1 = require("./playwrightServiceUtils-cjs.js");
|
|
14
14
|
const performOneTimeOperation = (options) => {
|
|
15
15
|
const oneTimeOperationFlag = process.env[constants_js_1.InternalEnvironmentVariables.ONE_TIME_OPERATION_FLAG] === "true";
|
|
16
16
|
if (oneTimeOperationFlag)
|
|
@@ -119,13 +119,13 @@ const createAzurePlaywrightConfig = (baseConfig, options) => {
|
|
|
119
119
|
if (customerConfig_js_1.default.globalTeardown) {
|
|
120
120
|
globalFunctions.globalTeardown.push(...customerConfig_js_1.default.globalTeardown);
|
|
121
121
|
}
|
|
122
|
-
globalFunctions.globalSetup.push(
|
|
123
|
-
globalFunctions.globalTeardown.push(
|
|
122
|
+
globalFunctions.globalSetup.push(playwrightServiceUtils_1.globalPaths.setup);
|
|
123
|
+
globalFunctions.globalTeardown.push(playwrightServiceUtils_1.globalPaths.teardown);
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
126
|
// If multiple global file is not supported, wrap playwright-service global setup/teardown with customer provided global setup/teardown
|
|
127
|
-
globalFunctions.globalSetup =
|
|
128
|
-
globalFunctions.globalTeardown =
|
|
127
|
+
globalFunctions.globalSetup = playwrightServiceUtils_1.globalPaths.setup;
|
|
128
|
+
globalFunctions.globalTeardown = playwrightServiceUtils_1.globalPaths.teardown;
|
|
129
129
|
}
|
|
130
130
|
performOneTimeOperation(options);
|
|
131
131
|
if (options?.useCloudHostedBrowsers === false) {
|
|
@@ -141,7 +141,7 @@ const createAzurePlaywrightConfig = (baseConfig, options) => {
|
|
|
141
141
|
return {
|
|
142
142
|
use: {
|
|
143
143
|
connectOptions: {
|
|
144
|
-
wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion),
|
|
144
|
+
wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion, playwrightServiceConfig.sourceType),
|
|
145
145
|
headers: {
|
|
146
146
|
Authorization: `Bearer ${(0, utils_js_1.getAccessToken)()}`,
|
|
147
147
|
"x-ms-package-version": `@azure/playwright/${(0, utils_js_1.getPackageVersion)()}`,
|
|
@@ -208,7 +208,7 @@ const getConnectOptions = async (options) => {
|
|
|
208
208
|
throw new Error(messages_js_1.ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN.message);
|
|
209
209
|
}
|
|
210
210
|
return {
|
|
211
|
-
wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion),
|
|
211
|
+
wsEndpoint: (0, utils_js_1.getServiceWSEndpoint)(playwrightServiceConfig.runId, playwrightServiceConfig.serviceOs, playwrightServiceConfig.apiVersion, playwrightServiceConfig.sourceType),
|
|
212
212
|
options: {
|
|
213
213
|
headers: {
|
|
214
214
|
Authorization: `Bearer ${token}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwrightService.js","sourceRoot":"","sources":["../../../src/core/playwrightService.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,yDAIgC;AAChC,4FAAyD;AACzD,qFAA+E;AAC/E,oGAAiE;AAEjE,gDAa2B;AAC3B,uDAAqE;AAErE,2EAA0D;AAE1D,MAAM,uBAAuB,GAAG,CAAC,OAA4C,EAAQ,EAAE;IACrF,MAAM,oBAAoB,GACxB,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,uBAAuB,CAAC,KAAK,MAAM,CAAC;IAC/E,IAAI,oBAAoB;QAAE,OAAO;IACjC,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,uBAAuB,CAAC,GAAG,MAAM,CAAC;IAC3E,IAAI,OAAO,EAAE,eAAe,KAAK,0BAAW,CAAC,YAAY,EAAE,CAAC;QAC1D,IAAA,yCAA8B,GAAE,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,2BAA2B,GAAG,CAClC,UAAgC,EAChC,OAA4C,EACtB,EAAE;IACxB,IAAA,oCAAyB,GAAE,CAAC;IAC5B,IAAA,6BAAkB,GAAE,CAAC;IAErB,oEAAoE;IACpE,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC;IACxE,MAAM,qBAAqB,GAAG,IAAA,yBAAc,EAAC,IAAA,+BAAoB,GAAE,CAAC,CAAC;IACrE,MAAM,6BAA6B,GACjC,qBAAqB,CAAC,KAAK,IAAI,CAAC,IAAI,qBAAqB,CAAC,KAAK,IAAI,EAAE,CAAC;IACxE,IAAI,OAAO,EA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;QACrE,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,0CAA4B,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACjF,CAAC;QACD,mCAAsB,CAAC,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC;QAC/D,KAAK,GAAG,MAAM,IAAA,qCAA0B,EAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;SAAM,IAAI,uBAAuB,CAAC,eAAe,KAAK,0BAAW,CAAC,YAAY,EAAE,CAAC;QAChF,IAAA,yBAAc,EAAC,uCAA4B,CAAC,CAAC;QAC7C,KAAK,GAAG,IAAA,yBAAc,GAAE,CAAC;IAC3B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,0CAA4B,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,0CAA4B,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChF,CAAC;IAED,OAAO;QACL,UAAU,EAAE,IAAA,+BAAoB,EAC9B,uBAAuB,CAAC,KAAK,EAC7B,uBAAuB,CAAC,SAAS,EACjC,uBAAuB,CAAC,UAAU,CACnC;QACD,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,KAAK,EAAE;gBAChC,sBAAsB,EAAE,qBAAqB,IAAA,4BAAiB,GAAE,EAAE;aACnE;YACD,OAAO,EAAE,uBAAuB,CAAC,cAAc;YAC/C,aAAa,EAAE,uBAAuB,CAAC,aAAa;YACpD,MAAM,EAAE,uBAAuB,CAAC,MAAM;SACvC;KACF,CAAC;AACJ,CAAC,CAAC;AAEoC,8CAAiB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"../common/constants.js\";\nimport customerConfig from \"../common/customerConfig.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport playwrightServiceEntra from \"./playwrightServiceEntra.js\";\nimport type { PlaywrightServiceAdditionalOptions, BrowserConnectOptions } from \"../common/types.js\";\nimport {\n fetchOrValidateAccessToken,\n getAccessToken,\n getServiceWSEndpoint,\n validateMptPAT,\n validatePlaywrightVersion,\n validateServiceUrl,\n exitWithFailureMessage,\n getPlaywrightVersion,\n getVersionInfo,\n throwErrorWithFailureMessage,\n getPackageVersion,\n warnIfAccessTokenCloseToExpiry,\n} from \"../utils/utils.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport type { PlaywrightTestConfig } from \"@playwright/test\";\nimport { globalPaths } from \"./playwrightServiceUtils.js\";\n\nconst performOneTimeOperation = (options?: PlaywrightServiceAdditionalOptions): void => {\n const oneTimeOperationFlag =\n process.env[InternalEnvironmentVariables.ONE_TIME_OPERATION_FLAG] === \"true\";\n if (oneTimeOperationFlag) return;\n process.env[InternalEnvironmentVariables.ONE_TIME_OPERATION_FLAG] = \"true\";\n if (options?.serviceAuthType === ServiceAuth.ACCESS_TOKEN) {\n warnIfAccessTokenCloseToExpiry();\n }\n};\n\n/**\n * @public\n *\n * Generate playwright configuration integrated with Azure Playwright.\n *\n * @param baseConfig - base playwright configuration\n * @param options - additional options for the service\n * @returns PlaywrightConfig\n *\n * @example\n * ```\n * import { defineConfig } from \"playwright/test\";\n * import { createAzurePlaywrightConfig } from \"@azure/playwright\";\n * import playwrightConfig from \"./playwright.config\";\n *\n * export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig));\n * ```\n *\n * @example\n * ```\n * import { defineConfig } from \"playwright/test\";\n * import { createAzurePlaywrightConfig, ServiceOS, ServiceAuth } from \"@azure/playwright\";\n * import playwrightConfig from \"./playwright.config\";\n * import { DefaultAzureCredential } from '@azure/identity';\n *\n * export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig, {\n * credential: new DefaultAzureCredential(),\n * serviceAuthType: ServiceAuth.ENTRA_ID,\n * os: ServiceOS.WINDOWS\n * }));\n * ```\n */\nconst createAzurePlaywrightConfig = (\n baseConfig: PlaywrightTestConfig,\n options?: PlaywrightServiceAdditionalOptions,\n): PlaywrightTestConfig => {\n validatePlaywrightVersion();\n validateServiceUrl();\n\n // Set environment variable to indicate user is using service config\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] = \"true\";\n const playwrightVersionInfo = getVersionInfo(getPlaywrightVersion());\n const isMultipleGlobalFileSupported =\n playwrightVersionInfo.major >= 1 && playwrightVersionInfo.minor >= 49;\n if (options?.credential) {\n playwrightServiceEntra.entraIdAccessToken = options.credential;\n }\n\n // if global setup/teardown is string -\n // 1. if multiple global file is supported, convert it to array\n // 2. wrap playwright-service global setup/teardown with customer provided global setup/teardown\n\n // if global setup/teardown is array -\n // 1. if multiple global file is not supported, throw error\n // 2. append playwright-service global setup/teardown with customer provided global setup/teardown\n if (baseConfig && baseConfig.globalSetup) {\n if (typeof baseConfig.globalSetup === \"string\") {\n if (isMultipleGlobalFileSupported) {\n customerConfig.globalSetup = [baseConfig.globalSetup];\n } else {\n customerConfig.globalSetup = baseConfig.globalSetup;\n }\n } else {\n if (!isMultipleGlobalFileSupported) {\n throw new Error(\n ServiceErrorMessageConstants.MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR.message,\n );\n }\n customerConfig.globalSetup = baseConfig.globalSetup;\n }\n }\n\n if (baseConfig && baseConfig.globalTeardown) {\n if (typeof baseConfig.globalTeardown === \"string\") {\n if (isMultipleGlobalFileSupported) {\n customerConfig.globalTeardown = [baseConfig.globalTeardown];\n } else {\n customerConfig.globalTeardown = baseConfig.globalTeardown;\n }\n } else {\n if (!isMultipleGlobalFileSupported) {\n throw new Error(\n ServiceErrorMessageConstants.MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR.message,\n );\n }\n customerConfig.globalTeardown = baseConfig.globalTeardown;\n }\n }\n\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n playwrightServiceConfig.setOptions(options);\n playwrightServiceConfig.serviceAuthType =\n options?.serviceAuthType || DefaultConnectOptionsConstants.DEFAULT_SERVICE_AUTH_TYPE;\n\n const globalFunctions: any = {};\n\n if (options?.serviceAuthType === ServiceAuth.ACCESS_TOKEN) {\n // mpt PAT requested and set by the customer, no need to setup entra lifecycle handlers\n validateMptPAT(exitWithFailureMessage);\n }\n // If multiple global file is supported, append playwright-service global setup/teardown with customer provided global setup/teardown\n if (isMultipleGlobalFileSupported) {\n globalFunctions.globalSetup = [] as string[];\n globalFunctions.globalTeardown = [] as string[];\n if (customerConfig.globalSetup) {\n globalFunctions.globalSetup.push(...(customerConfig.globalSetup as string[]));\n }\n if (customerConfig.globalTeardown) {\n globalFunctions.globalTeardown.push(...(customerConfig.globalTeardown as string[]));\n }\n globalFunctions.globalSetup.push(globalPaths.setup);\n globalFunctions.globalTeardown.push(globalPaths.teardown);\n } else {\n // If multiple global file is not supported, wrap playwright-service global setup/teardown with customer provided global setup/teardown\n globalFunctions.globalSetup = globalPaths.setup;\n globalFunctions.globalTeardown = globalPaths.teardown;\n }\n performOneTimeOperation(options);\n if (options?.useCloudHostedBrowsers === false) {\n console.log(\"\\nRunning tests using local browsers.\");\n return {\n ...globalFunctions,\n };\n }\n if (!process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED]) {\n process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] = \"true\";\n console.log(\"\\nRunning tests using Playwright workspaces.\");\n }\n\n return {\n use: {\n connectOptions: {\n wsEndpoint: getServiceWSEndpoint(\n playwrightServiceConfig.runId,\n playwrightServiceConfig.serviceOs,\n playwrightServiceConfig.apiVersion,\n ),\n headers: {\n Authorization: `Bearer ${getAccessToken()}`,\n \"x-ms-package-version\": `@azure/playwright/${getPackageVersion()}`,\n },\n timeout: playwrightServiceConfig.connectTimeout,\n exposeNetwork: playwrightServiceConfig.exposeNetwork,\n slowMo: playwrightServiceConfig.slowMo,\n },\n },\n ...globalFunctions,\n };\n};\n\n/**\n * @public\n *\n * Get connect options required to connect to Azure Playwright's cloud hosted browsers.\n *\n * @param options - additional options for the service\n * @returns BrowserConnectOptions\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions } from \"@azure/playwright\";\n *\n * test('has title', async ({ browserName }) => {\n * const { wsEndpoint, options } = 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 */\nconst getConnectOptions = async (\n options?: PlaywrightServiceAdditionalOptions,\n): Promise<BrowserConnectOptions> => {\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n\n playwrightServiceConfig.setOptions(options, true);\n performOneTimeOperation(options);\n playwrightServiceConfig.serviceAuthType =\n options?.serviceAuthType || DefaultConnectOptionsConstants.DEFAULT_SERVICE_AUTH_TYPE;\n\n let token: string | undefined;\n if (playwrightServiceConfig.serviceAuthType === ServiceAuth.ENTRA_ID) {\n if (!options?.credential) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n playwrightServiceEntra.entraIdAccessToken = options.credential;\n token = await fetchOrValidateAccessToken(options.credential);\n } else if (playwrightServiceConfig.serviceAuthType === ServiceAuth.ACCESS_TOKEN) {\n validateMptPAT(throwErrorWithFailureMessage);\n token = getAccessToken();\n } else {\n throw new Error(ServiceErrorMessageConstants.INVALID_AUTH_TYPE_ERROR.message);\n }\n\n if (!token) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN.message);\n }\n\n return {\n wsEndpoint: getServiceWSEndpoint(\n playwrightServiceConfig.runId,\n playwrightServiceConfig.serviceOs,\n playwrightServiceConfig.apiVersion,\n ),\n options: {\n headers: {\n Authorization: `Bearer ${token}`,\n \"x-ms-package-version\": `@azure/playwright/${getPackageVersion()}`,\n },\n timeout: playwrightServiceConfig.connectTimeout,\n exposeNetwork: playwrightServiceConfig.exposeNetwork,\n slowMo: playwrightServiceConfig.slowMo,\n },\n };\n};\n\nexport { createAzurePlaywrightConfig, getConnectOptions };\n"]}
|
|
1
|
+
{"version":3,"file":"playwrightService.js","sourceRoot":"","sources":["../../../src/core/playwrightService.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,yDAIgC;AAChC,4FAAyD;AACzD,qFAA+E;AAC/E,oGAAiE;AAEjE,gDAa2B;AAC3B,uDAAqE;AAErE,kFAAoE;AAEpE,MAAM,uBAAuB,GAAG,CAAC,OAA4C,EAAQ,EAAE;IACrF,MAAM,oBAAoB,GACxB,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,uBAAuB,CAAC,KAAK,MAAM,CAAC;IAC/E,IAAI,oBAAoB;QAAE,OAAO;IACjC,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,uBAAuB,CAAC,GAAG,MAAM,CAAC;IAC3E,IAAI,OAAO,EAAE,eAAe,KAAK,0BAAW,CAAC,YAAY,EAAE,CAAC;QAC1D,IAAA,yCAA8B,GAAE,CAAC;IACnC,CAAC;AACH,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,2BAA2B,GAAG,CAClC,UAAgC,EAChC,OAA4C,EACtB,EAAE;IACxB,IAAA,oCAAyB,GAAE,CAAC;IAC5B,IAAA,6BAAkB,GAAE,CAAC;IAErB,oEAAoE;IACpE,OAAO,CAAC,GAAG,CAAC,2CAA4B,CAAC,oBAAoB,CAAC,GAAG,MAAM,CAAC;IACxE,MAAM,qBAAqB,GAAG,IAAA,yBAAc,EAAC,IAAA,+BAAoB,GAAE,CAAC,CAAC;IACr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SACvC;KACF,CAAC;AACJ,CAAC,CAAC;AAEoC,8CAAiB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n DefaultConnectOptionsConstants,\n InternalEnvironmentVariables,\n ServiceAuth,\n} from \"../common/constants.js\";\nimport customerConfig from \"../common/customerConfig.js\";\nimport { PlaywrightServiceConfig } from \"../common/playwrightServiceConfig.js\";\nimport playwrightServiceEntra from \"./playwrightServiceEntra.js\";\nimport type { PlaywrightServiceAdditionalOptions, BrowserConnectOptions } from \"../common/types.js\";\nimport {\n fetchOrValidateAccessToken,\n getAccessToken,\n getServiceWSEndpoint,\n validateMptPAT,\n validatePlaywrightVersion,\n validateServiceUrl,\n exitWithFailureMessage,\n getPlaywrightVersion,\n getVersionInfo,\n throwErrorWithFailureMessage,\n getPackageVersion,\n warnIfAccessTokenCloseToExpiry,\n} from \"../utils/utils.js\";\nimport { ServiceErrorMessageConstants } from \"../common/messages.js\";\nimport type { PlaywrightTestConfig } from \"@playwright/test\";\nimport { globalPaths } from \"#platform/core/playwrightServiceUtils\";\n\nconst performOneTimeOperation = (options?: PlaywrightServiceAdditionalOptions): void => {\n const oneTimeOperationFlag =\n process.env[InternalEnvironmentVariables.ONE_TIME_OPERATION_FLAG] === \"true\";\n if (oneTimeOperationFlag) return;\n process.env[InternalEnvironmentVariables.ONE_TIME_OPERATION_FLAG] = \"true\";\n if (options?.serviceAuthType === ServiceAuth.ACCESS_TOKEN) {\n warnIfAccessTokenCloseToExpiry();\n }\n};\n\n/**\n * @public\n *\n * Generate playwright configuration integrated with Azure Playwright.\n *\n * @param baseConfig - base playwright configuration\n * @param options - additional options for the service\n * @returns PlaywrightConfig\n *\n * @example\n * ```\n * import { defineConfig } from \"playwright/test\";\n * import { createAzurePlaywrightConfig } from \"@azure/playwright\";\n * import playwrightConfig from \"./playwright.config\";\n *\n * export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig));\n * ```\n *\n * @example\n * ```\n * import { defineConfig } from \"playwright/test\";\n * import { createAzurePlaywrightConfig, ServiceOS, ServiceAuth } from \"@azure/playwright\";\n * import playwrightConfig from \"./playwright.config\";\n * import { DefaultAzureCredential } from '@azure/identity';\n *\n * export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig, {\n * credential: new DefaultAzureCredential(),\n * serviceAuthType: ServiceAuth.ENTRA_ID,\n * os: ServiceOS.WINDOWS\n * }));\n * ```\n */\nconst createAzurePlaywrightConfig = (\n baseConfig: PlaywrightTestConfig,\n options?: PlaywrightServiceAdditionalOptions,\n): PlaywrightTestConfig => {\n validatePlaywrightVersion();\n validateServiceUrl();\n\n // Set environment variable to indicate user is using service config\n process.env[InternalEnvironmentVariables.USING_SERVICE_CONFIG] = \"true\";\n const playwrightVersionInfo = getVersionInfo(getPlaywrightVersion());\n const isMultipleGlobalFileSupported =\n playwrightVersionInfo.major >= 1 && playwrightVersionInfo.minor >= 49;\n if (options?.credential) {\n playwrightServiceEntra.entraIdAccessToken = options.credential;\n }\n\n // if global setup/teardown is string -\n // 1. if multiple global file is supported, convert it to array\n // 2. wrap playwright-service global setup/teardown with customer provided global setup/teardown\n\n // if global setup/teardown is array -\n // 1. if multiple global file is not supported, throw error\n // 2. append playwright-service global setup/teardown with customer provided global setup/teardown\n if (baseConfig && baseConfig.globalSetup) {\n if (typeof baseConfig.globalSetup === \"string\") {\n if (isMultipleGlobalFileSupported) {\n customerConfig.globalSetup = [baseConfig.globalSetup];\n } else {\n customerConfig.globalSetup = baseConfig.globalSetup;\n }\n } else {\n if (!isMultipleGlobalFileSupported) {\n throw new Error(\n ServiceErrorMessageConstants.MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR.message,\n );\n }\n customerConfig.globalSetup = baseConfig.globalSetup;\n }\n }\n\n if (baseConfig && baseConfig.globalTeardown) {\n if (typeof baseConfig.globalTeardown === \"string\") {\n if (isMultipleGlobalFileSupported) {\n customerConfig.globalTeardown = [baseConfig.globalTeardown];\n } else {\n customerConfig.globalTeardown = baseConfig.globalTeardown;\n }\n } else {\n if (!isMultipleGlobalFileSupported) {\n throw new Error(\n ServiceErrorMessageConstants.MULTIPLE_SETUP_FILE_PLAYWRIGHT_VERSION_ERROR.message,\n );\n }\n customerConfig.globalTeardown = baseConfig.globalTeardown;\n }\n }\n\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n playwrightServiceConfig.setOptions(options);\n playwrightServiceConfig.serviceAuthType =\n options?.serviceAuthType || DefaultConnectOptionsConstants.DEFAULT_SERVICE_AUTH_TYPE;\n\n const globalFunctions: any = {};\n\n if (options?.serviceAuthType === ServiceAuth.ACCESS_TOKEN) {\n // mpt PAT requested and set by the customer, no need to setup entra lifecycle handlers\n validateMptPAT(exitWithFailureMessage);\n }\n // If multiple global file is supported, append playwright-service global setup/teardown with customer provided global setup/teardown\n if (isMultipleGlobalFileSupported) {\n globalFunctions.globalSetup = [] as string[];\n globalFunctions.globalTeardown = [] as string[];\n if (customerConfig.globalSetup) {\n globalFunctions.globalSetup.push(...(customerConfig.globalSetup as string[]));\n }\n if (customerConfig.globalTeardown) {\n globalFunctions.globalTeardown.push(...(customerConfig.globalTeardown as string[]));\n }\n globalFunctions.globalSetup.push(globalPaths.setup);\n globalFunctions.globalTeardown.push(globalPaths.teardown);\n } else {\n // If multiple global file is not supported, wrap playwright-service global setup/teardown with customer provided global setup/teardown\n globalFunctions.globalSetup = globalPaths.setup;\n globalFunctions.globalTeardown = globalPaths.teardown;\n }\n performOneTimeOperation(options);\n if (options?.useCloudHostedBrowsers === false) {\n console.log(\"\\nRunning tests using local browsers.\");\n return {\n ...globalFunctions,\n };\n }\n if (!process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED]) {\n process.env[InternalEnvironmentVariables.MPT_CLOUD_HOSTED_BROWSER_USED] = \"true\";\n console.log(\"\\nRunning tests using Playwright workspaces.\");\n }\n\n return {\n use: {\n connectOptions: {\n wsEndpoint: getServiceWSEndpoint(\n playwrightServiceConfig.runId,\n playwrightServiceConfig.serviceOs,\n playwrightServiceConfig.apiVersion,\n playwrightServiceConfig.sourceType,\n ),\n headers: {\n Authorization: `Bearer ${getAccessToken()}`,\n \"x-ms-package-version\": `@azure/playwright/${getPackageVersion()}`,\n },\n timeout: playwrightServiceConfig.connectTimeout,\n exposeNetwork: playwrightServiceConfig.exposeNetwork,\n slowMo: playwrightServiceConfig.slowMo,\n },\n },\n ...globalFunctions,\n };\n};\n\n/**\n * @public\n *\n * Get connect options required to connect to Azure Playwright's cloud hosted browsers.\n *\n * @param options - additional options for the service\n * @returns BrowserConnectOptions\n *\n * @example\n * ```\n * import playwright, { test, expect, BrowserType } from \"@playwright/test\";\n * import { getConnectOptions } from \"@azure/playwright\";\n *\n * test('has title', async ({ browserName }) => {\n * const { wsEndpoint, options } = 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 */\nconst getConnectOptions = async (\n options?: PlaywrightServiceAdditionalOptions,\n): Promise<BrowserConnectOptions> => {\n const playwrightServiceConfig = PlaywrightServiceConfig.instance;\n\n playwrightServiceConfig.setOptions(options, true);\n performOneTimeOperation(options);\n playwrightServiceConfig.serviceAuthType =\n options?.serviceAuthType || DefaultConnectOptionsConstants.DEFAULT_SERVICE_AUTH_TYPE;\n\n let token: string | undefined;\n if (playwrightServiceConfig.serviceAuthType === ServiceAuth.ENTRA_ID) {\n if (!options?.credential) {\n throw new Error(ServiceErrorMessageConstants.NO_CRED_ENTRA_AUTH_ERROR.message);\n }\n playwrightServiceEntra.entraIdAccessToken = options.credential;\n token = await fetchOrValidateAccessToken(options.credential);\n } else if (playwrightServiceConfig.serviceAuthType === ServiceAuth.ACCESS_TOKEN) {\n validateMptPAT(throwErrorWithFailureMessage);\n token = getAccessToken();\n } else {\n throw new Error(ServiceErrorMessageConstants.INVALID_AUTH_TYPE_ERROR.message);\n }\n\n if (!token) {\n throw new Error(ServiceErrorMessageConstants.NO_AUTH_ERROR_PAT_TOKEN.message);\n }\n\n return {\n wsEndpoint: getServiceWSEndpoint(\n playwrightServiceConfig.runId,\n playwrightServiceConfig.serviceOs,\n playwrightServiceConfig.apiVersion,\n playwrightServiceConfig.sourceType,\n ),\n options: {\n headers: {\n Authorization: `Bearer ${token}`,\n \"x-ms-package-version\": `@azure/playwright/${getPackageVersion()}`,\n },\n timeout: playwrightServiceConfig.connectTimeout,\n exposeNetwork: playwrightServiceConfig.exposeNetwork,\n slowMo: playwrightServiceConfig.slowMo,\n },\n };\n};\n\nexport { createAzurePlaywrightConfig, getConnectOptions };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwrightServiceUtils-cjs.d.ts","sourceRoot":"","sources":["../../../src/core/playwrightServiceUtils-cjs.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW;;;CAGvB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.globalPaths = void 0;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
8
|
+
// Use .ts extension when running directly from source, .js when running from compiled dist
|
|
9
|
+
const ext = __dirname.replace(/\\/g, "/").includes("/src/") ? ".ts" : ".js";
|
|
10
|
+
exports.globalPaths = {
|
|
11
|
+
setup: node_path_1.default.join(__dirname, `./global/playwright-service-global-setup${ext}`),
|
|
12
|
+
teardown: node_path_1.default.join(__dirname, `./global/playwright-service-global-teardown${ext}`),
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=playwrightServiceUtils-cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwrightServiceUtils-cjs.js","sourceRoot":"","sources":["../../../src/core/playwrightServiceUtils-cjs.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,kEAA6B;AAE7B,2FAA2F;AAC3F,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAE/D,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,2CAA2C,GAAG,EAAE,CAAC;IAC7E,QAAQ,EAAE,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,8CAA8C,GAAG,EAAE,CAAC;CACpF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport path from \"node:path\";\n\n// Use .ts extension when running directly from source, .js when running from compiled dist\nconst ext = __dirname.replace(/\\\\/g, \"/\").includes(\"/src/\") ? \".ts\" : \".js\";\n\nexport const globalPaths = {\n setup: path.join(__dirname, `./global/playwright-service-global-setup${ext}`),\n teardown: path.join(__dirname, `./global/playwright-service-global-teardown${ext}`),\n};\n"]}
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
6
|
import { ServiceAuth, ServiceOS, ServiceEnvironmentVariable } from "./common/constants.js";
|
|
7
|
-
import type { OsType, AuthenticationType, BrowserConnectOptions, EndpointOptions, PlaywrightServiceAdditionalOptions } from "./common/types.js";
|
|
7
|
+
import type { OsType, AuthenticationType, BrowserConnectOptions, BrowserSessionSourceTypeValue, EndpointOptions, PlaywrightServiceAdditionalOptions } from "./common/types.js";
|
|
8
8
|
import { createAzurePlaywrightConfig, getConnectOptions } from "./core/playwrightService.js";
|
|
9
|
-
export { createAzurePlaywrightConfig, getConnectOptions, ServiceOS, ServiceAuth, ServiceEnvironmentVariable, type OsType, type AuthenticationType, type BrowserConnectOptions, type EndpointOptions, type PlaywrightServiceAdditionalOptions, };
|
|
9
|
+
export { createAzurePlaywrightConfig, getConnectOptions, ServiceOS, ServiceAuth, ServiceEnvironmentVariable, type OsType, type AuthenticationType, type BrowserConnectOptions, type BrowserSessionSourceTypeValue, type EndpointOptions, type PlaywrightServiceAdditionalOptions, };
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,eAAe,EACf,kCAAkC,EACnC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE7F,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,0BAA0B,EAC1B,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,kCAAkC,GACxC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAC3F,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,qBAAqB,EACrB,6BAA6B,EAC7B,eAAe,EACf,kCAAkC,EACnC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAE7F,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,0BAA0B,EAC1B,KAAK,MAAM,EACX,KAAK,kBAAkB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,6BAA6B,EAClC,KAAK,eAAe,EACpB,KAAK,kCAAkC,GACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;GAIG;AAEH,wDAA2F;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;;;GAIG;AAEH,wDAA2F;AAezF,4FAfO,0BAAW,OAeP;AADX,0FAdoB,wBAAS,OAcpB;AAET,2GAhB+B,yCAA0B,OAgB/B;AAP5B,sEAA6F;AAG3F,4GAHO,kDAA2B,OAGP;AAC3B,kGAJoC,wCAAiB,OAIpC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Library for integrating Azure Playwright with existing playwright projects.\n *\n * @packageDocumentation\n */\n\nimport { ServiceAuth, ServiceOS, ServiceEnvironmentVariable } from \"./common/constants.js\";\nimport type {\n OsType,\n AuthenticationType,\n BrowserConnectOptions,\n BrowserSessionSourceTypeValue,\n EndpointOptions,\n PlaywrightServiceAdditionalOptions,\n} from \"./common/types.js\";\nimport { createAzurePlaywrightConfig, getConnectOptions } from \"./core/playwrightService.js\";\n\nexport {\n createAzurePlaywrightConfig,\n getConnectOptions,\n ServiceOS,\n ServiceAuth,\n ServiceEnvironmentVariable,\n type OsType,\n type AuthenticationType,\n type BrowserConnectOptions,\n type BrowserSessionSourceTypeValue,\n type EndpointOptions,\n type PlaywrightServiceAdditionalOptions,\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;
|
|
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;AAgBtE;;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;IAuFhD;;OAEG;IAEG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAiCd,gBAAgB;IAsB9B,OAAO,CAAC,iCAAiC;IAsCzC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;CA+C3B"}
|