@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
38 lines • 1.42 kB
TypeScript
import { RootLocator } from '@serenity-js/web';
import type * as playwright from 'playwright-core';
import { type PageFunction } from 'playwright-core/types/structs';
/**
* Playwright-specific implementation of [`RootLocator`](https://serenity-js.org/api/web/class/RootLocator/).
*
* @group Models
*/
export declare class PlaywrightRootLocator extends RootLocator<playwright.Locator> {
private readonly page;
private currentFrame;
constructor(page: playwright.Page);
isPresent(): Promise<boolean>;
nativeElement(): Promise<Pick<playwright.Locator, 'locator'>>;
/**
* Evaluates the given `pageFunction` in the context of the current frame.
* See [`playwright.Frame.evaluate`](https://playwright.dev/docs/api/class-frame#frame-evaluate).
*
* @param pageFunction
* @param arg
*/
evaluate<R, Arguments>(pageFunction: PageFunction<Arguments, R>, arg: Arguments): Promise<R>;
/**
* Switches the current context to the frame identified by the given locator.
*
* @param frame
*/
switchToFrame(frame: playwright.Locator): Promise<void>;
/**
* Switches the current context to the parent frame of the current frame.
*/
switchToParentFrame(): Promise<void>;
/**
* Switches the context to the top-level frame.
*/
switchToMainFrame(): Promise<void>;
}
//# sourceMappingURL=PlaywrightRootLocator.d.ts.map