@azure/microsoft-playwright-testing package
Interfaces
MPTReporterConfig |
Configuration facultative pour MPT Reporter. exemple de
|
Alias de type
AuthenticationType |
Types d’authentification pris en charge par microsoft Playwright Testing. |
BrowserConnectOptions |
Options de connexion du navigateur pour le service. Cela inclut les options de point de terminaison et les options de connexion. exemple de
|
ConnectOptions |
Options de connexion pour le service. |
EndpointOptions |
Options de point de terminaison pour le service. |
OsType |
Types de système d’exploitation pris en charge par les tests Microsoft Playwright. |
PlaywrightServiceAdditionalOptions |
Options supplémentaires pour le service. |
Functions
get |
Obtenez les options de connexion requises pour vous connecter aux navigateurs hébergés dans le cloud de Microsoft Playwright Testing. exemple de
|
get |
Générez la configuration playwright intégrée à Microsoft Playwright Testing. exemple de
exemple de
|
Informations relatives à la fonction
getConnectOptions(Omit<PlaywrightServiceAdditionalOptions, "serviceAuthType">)
Obtenez les options de connexion requises pour vous connecter aux navigateurs hébergés dans le cloud de Microsoft Playwright Testing.
exemple 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>
Paramètres
- options
-
Omit<PlaywrightServiceAdditionalOptions, "serviceAuthType">
options supplémentaires pour le service
Retours
Promise<BrowserConnectOptions>
BrowserConnectOptions
getServiceConfig(PlaywrightTestConfig<{}, {}>, PlaywrightServiceAdditionalOptions)
Générez la configuration playwright intégrée à Microsoft Playwright Testing.
exemple de
import { defineConfig } from "playwright/test";
import { getServiceConfig } from "@azure/microsoft-playwright-testing";
import playwrightConfig from "./playwright.config";
export default defineConfig(playwrightConfig, getServiceConfig(playwrightConfig));
exemple 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<{}, {}>
Paramètres
- config
-
PlaywrightTestConfig<{}, {}>
configuration du playwright de base
options supplémentaires pour le service
Retours
PlaywrightTestConfig<{}, {}>
PlaywrightConfig