UNPKG

playwright-cucumber-ts-steps

Version:

A collection of reusable Playwright step definitions for Cucumber in TypeScript, designed to streamline end-to-end testing across web, API, and mobile applications.

35 lines (34 loc) 1.14 kB
import { World, ITestCaseHookParameter } from "@cucumber/cucumber"; import { Browser, Page, BrowserContext, Locator, FrameLocator } from "@playwright/test"; export interface TestConfig { enableScreenshots: boolean; enableVisualTest: boolean; artifactDir: string; } export declare class CustomWorld extends World { browser: Browser; context: BrowserContext; page: Page; elements?: Locator; element?: Locator; frame?: FrameLocator; currentLocator?: Locator; data: Record<string, any>; logs: string[]; testName?: string; fakeTimersActive: boolean; config: TestConfig; constructor(options: import("@cucumber/cucumber").IWorldOptions); init(testInfo?: ITestCaseHookParameter): Promise<void>; /** * Returns the current interaction scope: either the main page or active frame. */ getScope(): Page | FrameLocator; /** * Returns a Locator scoped to the current iframe or page. */ getLocator(selector: string): Locator; exitIframe(): void; log: (message: string) => void; cleanup(testInfo?: ITestCaseHookParameter): Promise<void>; }