@azure/playwright package

Típusaliasok

AuthenticationType

Az Azure Playwright által támogatott hitelesítési típusok.

BrowserConnectOptions

A szolgáltatás böngészőcsatlakozási lehetőségei. Ez magában foglalja a végponti beállításokat és a csatlakozási lehetőségeket.

Example

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();
});
EndpointOptions

A szolgáltatás végponti beállításai.

OsType

Az Azure Playwright által támogatott operációsrendszer-típusok.

PlaywrightServiceAdditionalOptions

A szolgáltatás további lehetőségei.

Függvények

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

Az Azure Playwrighttal integrált drámaíró-konfiguráció létrehozása.

Example

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

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

Example

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)

Az Azure Playwright felhőben üzemeltetett böngészőihez való csatlakozáshoz szükséges csatlakozási lehetőségek lekérése.

Example

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();
});

Változók

ServiceAuth

Azure Playwright-on támogatott hitelesítési típusok

ServiceEnvironmentVariable

Azure Playwright által használt környezeti változók

ServiceOS

Az Azure Playwright felhőalapú böngészőn támogatott OS típusok

Függvény adatai

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

Az Azure Playwrighttal integrált drámaíró-konfiguráció létrehozása.

Example

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

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

Example

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<{}, {}>

Paraméterek

baseConfig

PlaywrightTestConfig<{}, {}>

Alap drámaíró konfiguráció

options
PlaywrightServiceAdditionalOptions

A szolgáltatás további lehetőségei

Válaszok

PlaywrightTestConfig<{}, {}>

Játékíró konfigurációja

getConnectOptions(PlaywrightServiceAdditionalOptions)

Az Azure Playwright felhőben üzemeltetett böngészőihez való csatlakozáshoz szükséges csatlakozási lehetőségek lekérése.

Example

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>

Paraméterek

options
PlaywrightServiceAdditionalOptions

A szolgáltatás további lehetőségei

Válaszok

BrowserConnectOptions

Változó részletei

ServiceAuth

Azure Playwright-on támogatott hitelesítési típusok

ServiceAuth: { ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }

Típus

{ ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }

ServiceEnvironmentVariable

Azure Playwright által használt környezeti változók

ServiceEnvironmentVariable: { PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }

Típus

{ PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }

ServiceOS

Az Azure Playwright felhőalapú böngészőn támogatott OS típusok

ServiceOS: { LINUX: "linux", WINDOWS: "windows" }

Típus

{ LINUX: "linux", WINDOWS: "windows" }