@azure/playwright package
型エイリアス
| AuthenticationType |
Azure Playwright でサポートされている認証の種類。 |
| BrowserConnectOptions |
サービスのブラウザー接続オプション。 これには、エンドポイント オプションと接続オプションが含まれます。 例
|
| EndpointOptions |
サービスのエンドポイント オプション。 |
| OsType |
Azure Playwright でサポートされている OS の種類。 |
| PlaywrightServiceAdditionalOptions |
サービスの追加オプション。 |
関数
| get |
Azure Playwright のクラウドでホストされているブラウザーに接続するために必要な接続オプションを取得します。 例
|
| get |
Azure Playwright と統合された Playwright 構成を生成します。 例
例
|
変数
| Service |
Azure Playwrightでサポートされている認証タイプ |
| Service |
Azure Playwrightで使用される環境変数 |
| ServiceOS | Azure PlaywrightクラウドホストブラウザでサポートされているOSタイプ |
関数の詳細
getConnectOptions(PlaywrightServiceAdditionalOptions)
Azure Playwright のクラウドでホストされているブラウザーに接続するために必要な接続オプションを取得します。
例
import playwright, { test, expect, BrowserType } from "@playwright/test";
import { getConnectOptions } from "@azure/playwright";
test('has title', async ({ browserName }) => {
const { wsEndpoint, options } = await getConnectOptions();
const browser = await (playwright[browserName] as BrowserType).connect(wsEndpoint, options);
const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://playwright.dev/');
await expect(page).toHaveTitle(/Playwright/);
await page.close();
await context.close();
await browser.close();
});
function getConnectOptions(options?: PlaywrightServiceAdditionalOptions): Promise<BrowserConnectOptions>
パラメーター
サービスの追加オプション
戻り値
Promise<BrowserConnectOptions>
ブラウザコネクトオプション
getServiceConfig(PlaywrightTestConfig<{}, {}>, PlaywrightServiceAdditionalOptions)
Azure Playwright と統合された Playwright 構成を生成します。
例
import { defineConfig } from "playwright/test";
import { getServiceConfig } from "@azure/playwright";
import playwrightConfig from "./playwright.config";
export default defineConfig(playwrightConfig, getServiceConfig(playwrightConfig));
例
import { defineConfig } from "playwright/test";
import { getServiceConfig, ServiceOS } from "@azure/playwright";
import playwrightConfig from "./playwright.config";
export default defineConfig(playwrightConfig, getServiceConfig(playwrightConfig, {
runId: "custom run id",
os: ServiceOS.WINDOWS
}));
function getServiceConfig(config: PlaywrightTestConfig<{}, {}>, options?: PlaywrightServiceAdditionalOptions): PlaywrightTestConfig<{}, {}>
パラメーター
- config
-
PlaywrightTestConfig<{}, {}>
基本プレイライト構成
サービスの追加オプション
戻り値
PlaywrightTestConfig<{}, {}>
プレイライトコンフィグ
変数の詳細
ServiceAuth
Azure Playwrightでサポートされている認証タイプ
ServiceAuth: { ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
型
{ ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
ServiceEnvironmentVariable
Azure Playwrightで使用される環境変数
ServiceEnvironmentVariable: { PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }
型
{ PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }
ServiceOS
Azure PlaywrightクラウドホストブラウザでサポートされているOSタイプ
ServiceOS: { LINUX: "linux", WINDOWS: "windows" }
型
{ LINUX: "linux", WINDOWS: "windows" }