import { Locator, Page } from '@playwright/test'; import { Ability, Actor } from '@testla/screenplay'; import { FrameSelector, Selector, SelectorOptions } from '../types'; /** * This class represents the actor's ability to use a Browser. */ export declare class BrowseTheWeb extends Ability { private page; /** * Initialize this Ability by passing an already existing Playwright Page object. * * @param {Page} page the Playwright Page that will be used to browse. * @return {BrowseTheWeb} Returns the ability to use a browser */ static using(page: Page): BrowseTheWeb; /** * Use this Ability as an Actor. * * @param {Actor} actor Actor is using this ability * @param {string} alias defined the alias to be used for the given ability * @return {BrowseTheWeb} The ability to use BrowseTheWeb as the actor */ static as(actor: Actor, alias?: string): BrowseTheWeb; /** * Initialize this Ability by passing an already existing Playwright Page object. * * @param {Page} page the Playwright Page that will be used to browse. */ private constructor(); /** * Get the page object * * @returns {Page} the page object */ getPage(): Page; /** * Filters an existing locator based on sublocator and/or text * @param locator parent locator * @param subLocator sub locator to be checked for * @param text to be checked for * @returns filtered locator */ private static filterLocator; /** * Calls a callback function based on the selectors type * @param selector The selector determining the further proceeding * @param proceedOptions Options to proceed based on types string, function or Locator * @returns Result of the proceeding function */ private static typeBasedProceeding; /** * Recursively resolves subSelectors starting with a Locator * @param param Object with all required parameters * @returns Promise where Locator is a Playwright Locator */ private static subLocatorLookup; /** * Recursively resolves frames starting with Page Object * @param page Plawrights page object * @param frameTree An array of FrameLocators * @returns FrameLocator */ private static recursiveFrameLookup; /** * Use the page mouse to hover over the specified element. * * @param {Selector} selector the selector of the element. * @param {SelectorOptions} options (optional) advanced selector lookup options. * @param {FrameSelector[]} [frameTree] - An array of frame selector(s). * @return {Locator} Returns resolved Locator(s) as per Playwright definition. */ resolveSelectorToLocator(selector: Selector, options?: SelectorOptions, frameTree?: FrameSelector[]): Promise; }