@azure/microsoft-playwright-testing package
Interfaces
| MPTReporterConfig |
Configuración opcional para MPT Reporter. de ejemplo de
|
Alias de tipos
| AuthenticationType |
Tipos de autenticación admitidos por Microsoft Playwright Testing. |
| BrowserConnectOptions |
Opciones de conexión del explorador para el servicio. Esto incluye las opciones de punto de conexión y las opciones de conexión. de ejemplo de
|
| ConnectOptions |
Opciones de conexión para el servicio. |
| EndpointOptions |
Opciones de punto de conexión para el servicio. |
| OsType |
Tipos de sistema operativo compatibles con Microsoft Playwright Testing. |
| PlaywrightServiceAdditionalOptions |
Opciones adicionales para el servicio. |
Funciones
| get |
Obtenga las opciones de conexión necesarias para conectarse a los exploradores hospedados en la nube de Microsoft Playwright Testing. de ejemplo de
|
| get |
Genere la configuración de playwright integrada con Microsoft Playwright Testing. de ejemplo de
de ejemplo de
|
Variables
| Service |
Tipos de autenticación soportados en Microsoft Playwright Testing |
| Service |
Variables de entorno utilizadas por Microsoft Playwright Testing |
| ServiceOS | Tipos de sistemas operativos compatibles con navegadores alojados en la nube de Microsoft Playwright Testing |
Detalles de la función
getConnectOptions(Omit<PlaywrightServiceAdditionalOptions, "serviceAuthType">)
Obtenga las opciones de conexión necesarias para conectarse a los exploradores hospedados en la nube de Microsoft Playwright Testing.
de ejemplo de
import playwright, { test, expect, BrowserType } from "@playwright/test";
import { getConnectOptions } from "@azure/microsoft-playwright-testing";
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?: Omit<PlaywrightServiceAdditionalOptions, "serviceAuthType">): Promise<BrowserConnectOptions>
Parámetros
- options
-
Omit<PlaywrightServiceAdditionalOptions, "serviceAuthType">
opciones adicionales para el servicio
Devoluciones
Promise<BrowserConnectOptions>
BrowserConnectOptions
getServiceConfig(PlaywrightTestConfig<{}, {}>, PlaywrightServiceAdditionalOptions)
Genere la configuración de playwright integrada con Microsoft Playwright Testing.
de ejemplo de
import { defineConfig } from "playwright/test";
import { getServiceConfig } from "@azure/microsoft-playwright-testing";
import playwrightConfig from "./playwright.config";
export default defineConfig(playwrightConfig, getServiceConfig(playwrightConfig));
de ejemplo de
import { defineConfig } from "playwright/test";
import { getServiceConfig, ServiceOS } from "@azure/microsoft-playwright-testing";
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<{}, {}>
Parámetros
- config
-
PlaywrightTestConfig<{}, {}>
configuración de playwright base
opciones adicionales para el servicio
Devoluciones
PlaywrightTestConfig<{}, {}>
PlaywrightConfig
Variable Details
ServiceAuth
Tipos de autenticación soportados en Microsoft Playwright Testing
ServiceAuth: { ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
Tipo
{ ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
ServiceEnvironmentVariable
Variables de entorno utilizadas por Microsoft Playwright Testing
ServiceEnvironmentVariable: { PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: string, PLAYWRIGHT_SERVICE_OS: string, PLAYWRIGHT_SERVICE_REPORTING_URL: string, PLAYWRIGHT_SERVICE_URL: string }
Tipo
{ PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_EXPOSE_NETWORK_ENVIRONMENT_VARIABLE: string, PLAYWRIGHT_SERVICE_OS: string, PLAYWRIGHT_SERVICE_REPORTING_URL: string, PLAYWRIGHT_SERVICE_URL: string }
ServiceOS
Tipos de sistemas operativos compatibles con navegadores alojados en la nube de Microsoft Playwright Testing
ServiceOS: { LINUX: "linux", WINDOWS: "windows" }
Tipo
{ LINUX: "linux", WINDOWS: "windows" }