@azure/playwright package
Tür Diğer Adları
| AuthenticationType |
Azure Playwright tarafından desteklenen kimlik doğrulama türleri. |
| BrowserConnectOptions |
Hizmet için tarayıcı bağlantı seçenekleri. Buna uç nokta seçenekleri ve bağlantı seçenekleri dahildir. Örnek
|
| BrowserSessionSourceTypeValue |
|
| EndpointOptions |
Hizmet için uç nokta seçenekleri. |
| OsType |
Azure Playwright tarafından desteklenen işletim sistemi türleri. |
| PlaywrightServiceAdditionalOptions |
Hizmet için ek seçenekler. |
İşlevler
| create |
Azure Playwright ile tümleştirilmiş oyun yazarı yapılandırması oluşturun. Örnek
Örnek
|
| get |
Azure Playwright'ın bulutta barındırılan tarayıcılarına bağlanmak için gereken bağlantı seçeneklerini edinin. Örnek
|
Değişkenler
| Service |
Azure Playwright'ta desteklenen authentication types |
| Service |
Azure Playwright tarafından kullanılan environment variables |
| ServiceOS | Azure Playwright cloud hosted browser'da desteklenen OS types |
İşlev Ayrıntıları
createAzurePlaywrightConfig(PlaywrightTestConfig<{}, {}>, PlaywrightServiceAdditionalOptions)
Azure Playwright ile tümleştirilmiş oyun yazarı yapılandırması oluşturun.
Örnek
import { defineConfig } from "playwright/test";
import { createAzurePlaywrightConfig } from "@azure/playwright";
import playwrightConfig from "./playwright.config";
export default defineConfig(playwrightConfig, createAzurePlaywrightConfig(playwrightConfig));
Örnek
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<{}, {}>
Parametreler
- baseConfig
-
PlaywrightTestConfig<{}, {}>
Temel oyun yazarı yapılandırması
Hizmet için ek seçenekler
Döndürülenler
PlaywrightTestConfig<{}, {}>
Oyun YazarıYapılandırması
getConnectOptions(PlaywrightServiceAdditionalOptions)
Azure Playwright'ın bulutta barındırılan tarayıcılarına bağlanmak için gereken bağlantı seçeneklerini edinin.
Örnek
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>
Parametreler
Hizmet için ek seçenekler
Döndürülenler
Promise<BrowserConnectOptions>
BrowserConnectOptions
Değişken Ayrıntıları
ServiceAuth
Azure Playwright'ta desteklenen authentication types
ServiceAuth: { ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
Tür
{ ACCESS_TOKEN: "ACCESS_TOKEN", ENTRA_ID: "ENTRA_ID" }
ServiceEnvironmentVariable
Azure Playwright tarafından kullanılan environment variables
ServiceEnvironmentVariable: { PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }
Tür
{ PLAYWRIGHT_SERVICE_ACCESS_TOKEN: string, PLAYWRIGHT_SERVICE_URL: string }
ServiceOS
Azure Playwright cloud hosted browser'da desteklenen OS types
ServiceOS: { LINUX: "linux", WINDOWS: "windows" }
Tür
{ LINUX: "linux", WINDOWS: "windows" }