@azure/playwright package
Alias de tipos
| AuthenticationType |
Tipos de autenticación admitidos por Azure Playwright. |
| BrowserConnectOptions |
Opciones de conexión del navegador para el servicio. Esto incluye opciones de punto final y opciones de conexión. Ejemplo
|
| BrowserSessionSourceTypeValue |
Valores identificadores de origen aceptados por Azure dramaturgo para la opción |
| EndpointOptions |
Opciones de punto de conexión para el servicio. |
| OsType |
Tipos de sistema operativo compatibles con Azure Playwright. |
| PlaywrightServiceAdditionalOptions |
Opciones adicionales para el servicio. |
Funciones
| create |
Genere la configuración de dramaturgo integrada con Azure Playwright. Ejemplo
Ejemplo
|
| get |
Obtenga las opciones de conexión necesarias para conectarse a los exploradores hospedados en la nube de Azure Playwright. Ejemplo
|
Variables
| Service |
Tipos de autenticación compatibles con Azure Playwright |
| Service |
Variables de entorno utilizadas por Azure Playwright |
| ServiceOS | Tipos de sistemas operativos compatibles con navegadores alojados en la nube de Azure Playwright |
Detalles de la función
createAzurePlaywrightConfig(PlaywrightTestConfig<{}, {}>, PlaywrightServiceAdditionalOptions)
Genere la configuración de dramaturgo integrada con Azure Playwright.
Ejemplo
import { defineConfig } from "playwright/test";
import { createAzurePlaywrightConfig } from "@azure/playwright";
import playwrightConfig from "./playwright.config";
export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig));
Ejemplo
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<{}, {}>
Parámetros
- baseConfig
-
PlaywrightTestConfig<{}, {}>
Configuración básica del dramaturgo
Opciones adicionales para el servicio
Devoluciones
PlaywrightTestConfig<{}, {}>
PlaywrightConfig
getConnectOptions(PlaywrightServiceAdditionalOptions)
Obtenga las opciones de conexión necesarias para conectarse a los exploradores hospedados en la nube de Azure Playwright.
Ejemplo
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>
Parámetros
Opciones adicionales para el servicio
Devoluciones
Promise<BrowserConnectOptions>
Opciones de conexión del navegador
Detalles de variables
ServiceAuth
Tipos de autenticación compatibles con Azure Playwright
ServiceAuth: { ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
Tipo
{ ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
ServiceEnvironmentVariable
Variables de entorno utilizadas por Azure Playwright
ServiceEnvironmentVariable: { PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }
Tipo
{ PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }
ServiceOS
Tipos de sistemas operativos compatibles con navegadores alojados en la nube de Azure Playwright
ServiceOS: { LINUX: "linux", WINDOWS: "windows" }
Tipo
{ LINUX: "linux", WINDOWS: "windows" }