UNPKG

@serenity-js/playwright

Version:

Adapter that integrates @serenity-js/web with Playwright, enabling Serenity/JS reporting and using the Screenplay Pattern to write component and end-to-end test scenarios

32 lines 1.88 kB
import type { BrowserCapabilities } from '@serenity-js/web'; import { BrowsingSession, type Cookie, type CookieData } from '@serenity-js/web'; import type * as playwright from 'playwright-core'; import { type ExtraBrowserContextOptions } from '../../ExtraBrowserContextOptions'; import { SerenitySelectorEngines } from '../../selector-engines'; import { PlaywrightPage } from '../models'; /** * Playwright-specific implementation of [`BrowsingSession`](https://serenity-js.org/api/web/class/BrowsingSession/). * * @group Models */ export declare abstract class PlaywrightBrowsingSession extends BrowsingSession<PlaywrightPage> { protected readonly extraBrowserContextOptions: Partial<ExtraBrowserContextOptions>; protected readonly selectors: playwright.Selectors; protected readonly serenitySelectorEngines: SerenitySelectorEngines; private currentPlaywrightBrowserContext; protected constructor(extraBrowserContextOptions: Partial<ExtraBrowserContextOptions>, selectors: playwright.Selectors); /** * Returns [basic meta-data](https://serenity-js.org/api/web/interface/BrowserCapabilities/) about the browser associated with this ability. * * **Please note** that since Playwright does not expose information about the operating system * the tests are running on, **Serenity/JS assumes that the tests are running locally** * and therefore returns the value of Node.js `process.platform` for `platformName`. */ abstract browserCapabilities(): Promise<BrowserCapabilities>; cookie(name: string): Promise<Cookie>; setCookie(cookie: CookieData): Promise<void>; deleteAllCookies(): Promise<void>; protected browserContext(): Promise<playwright.BrowserContext>; protected abstract createBrowserContext(): Promise<playwright.BrowserContext>; } //# sourceMappingURL=PlaywrightBrowsingSession.d.ts.map