@azure/playwright package

형식 별칭

AuthenticationType

Azure Playwright에서 지원하는 인증 유형입니다.

BrowserConnectOptions

서비스에 대한 브라우저 연결 옵션. 여기에는 엔드포인트 옵션 및 연결 옵션이 포함됩니다.

예시

import playwright, { test, expect, BrowserType } from "@playwright/test";
import { getConnectOptions, BrowserConnectOptions } from "@azure/playwright";

test("has title", async ({ browserName }) => {
 const { wsEndpoint, options } : BrowserConnectOptions = 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();
});
BrowserSessionSourceTypeValue

sourceType 옵션에 대해 Azure Playwright가 인정하는 소스 식별자 값.

EndpointOptions

서비스에 대한 엔드포인트 옵션입니다.

OsType

Azure Playwright에서 지원하는 OS 유형입니다.

PlaywrightServiceAdditionalOptions

서비스에 대한 추가 옵션.

함수

createAzurePlaywrightConfig(PlaywrightTestConfig<{}, {}>, PlaywrightServiceAdditionalOptions)

Azure Playwright와 통합된 극작가 구성을 생성합니다.

예시

import { defineConfig } from "playwright/test";
import { createAzurePlaywrightConfig } from "@azure/playwright";
import playwrightConfig from "./playwright.config";

export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig));

예시

import { defineConfig } from "playwright/test";
import { createAzurePlaywrightConfig, ServiceOS, ServiceAuth } from "@azure/playwright";
import playwrightConfig from "./playwright.config";
import { DefaultAzureCredential } from '@azure/identity';

export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig, {
 credential: new DefaultAzureCredential(),
 serviceAuthType: ServiceAuth.ENTRA_ID,
 os: ServiceOS.WINDOWS
}));
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();
});

변수

ServiceAuth

Azure Playwright에서 지원되는 인증 유형

ServiceEnvironmentVariable

Azure Playwright가 사용하는 환경 변수

ServiceOS

Azure Playwright 클라우드 호스팅 브라우저에서 지원되는 OS 유형

함수 세부 정보

createAzurePlaywrightConfig(PlaywrightTestConfig<{}, {}>, PlaywrightServiceAdditionalOptions)

Azure Playwright와 통합된 극작가 구성을 생성합니다.

예시

import { defineConfig } from "playwright/test";
import { createAzurePlaywrightConfig } from "@azure/playwright";
import playwrightConfig from "./playwright.config";

export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig));

예시

import { defineConfig } from "playwright/test";
import { createAzurePlaywrightConfig, ServiceOS, ServiceAuth } from "@azure/playwright";
import playwrightConfig from "./playwright.config";
import { DefaultAzureCredential } from '@azure/identity';

export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig, {
 credential: new DefaultAzureCredential(),
 serviceAuthType: ServiceAuth.ENTRA_ID,
 os: ServiceOS.WINDOWS
}));
function createAzurePlaywrightConfig(baseConfig: PlaywrightTestConfig<{}, {}>, options?: PlaywrightServiceAdditionalOptions): PlaywrightTestConfig<{}, {}>

매개 변수

baseConfig

PlaywrightTestConfig<{}, {}>

기본 극작가 구성

options
PlaywrightServiceAdditionalOptions

서비스에 대한 추가 옵션

반품

PlaywrightTestConfig<{}, {}>

PlaywrightConfig (극작 구성 )

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>

매개 변수

options
PlaywrightServiceAdditionalOptions

서비스에 대한 추가 옵션

반품

브라우저연결 옵션

변수 세부 정보

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" }