import { Condition } from '../page/Condition' ; import { Page , Frame , ViewportSize , BrowserContext , Cookie } from 'playwright' ; import { ElementHandle , ScreenshotOptions , NavigationOptions , EvaluateFn , ClickOptions , CookiesFilterParams , Locator , ScrollDirection , } from '../page/types' ; import { NullableLocatable } from '../runtime/Locatable' ; import { TargetLocator } from '../page/TargetLocator' ; import Mouse from '../page/Mouse' ; import { TestSettings } from '../runtime/Settings' ; import { DeviceDescriptor } from '../page/Device' ; import { Point } from '../page/Point' ; /**
 * Browser is the main entry point in each <[step]>, it's your direct connection to the browser running the test.
 *
 * ```typescript
 * import { step } from "@flood/element"
 * export default () => {
 *   step("Start", async browser => {
 *     await browser.visit("https://challenge.flood.io")
 *   })
 * }
 * ```
 *
 */ export interface Browser { settings : TestSettings ; internal private beforeFunc : ( browser : Browser , name : string , args ? : string ) => Promise < void > ; internal private afterFunc : ( browser : Browser , name : string , args ? : string ) => Promise < void > ; title ( ) : Promise < string > ; /**
     * The current puppeteer Page
     */ page : Page ; /**
     * The list of current playwright Pages in the browser
     */ pages : Page [ ] ; /**
     * The list of puppeteer Frames
     */ frames : Frame [ ] ; /**
     * Sets the HTTP Authentication details to use if the page is presented with an authentication prompt.
     *
     * Call without any args to disable authentication.
     */ authenticate ( username ? , password ? ) : Promise < void > ; /**
     * Clear browser cookies.
     */ clearBrowserCookies ( ) : Promise < any > ; /**
     * Clear browser cache.
     */ clearBrowserCache ( ) : Promise < any > ; /**
     * Configure Browser to emulate a given device
     */ emulateDevice ( device ) : Promise < void > ; /**
     * Set Browser to send a custom User Agent (UA) string
     */ setUserAgent ( userAgent ) : Promise < void > ; setExtraHTTPHeaders ( headers ) : Promise < void > ; param url param options visit ( url , options ? ) : Promise < void > ; /**
     * Creates a waiter which will pause the test until a condition is met or a timeout is reached. This can be used for validation or control flow.
     *
     * Check out <[Until]> for a rich set of wait <[Condition]>s.
     *
     * **Example:**
     *
     * ```typescript
     * step("Start", async browser => {
     *   await browser.wait(Until.elementIsVisible(By.css('h1.title')))
     * })
     * ```
     *
     * You can use either a numeric value in seconds to wait for a specific time,
     * or a <[Condition]>, for more flexible conditions.
     */ wait ( timeoutOrCondition ) : Promise < boolean > ; waitForNavigation ( ) : Promise < any > ; evaluate ( fn , ... args ) : Promise < any > ; /**
     * Sends a click event to the element located at `selector`. If the element is
     * currently outside the viewport it will first scroll to that element.
     *
     * **Example:**
     *
     * ```typescript
     * step("Start", async browser => {
     *   await browser.click(By.partialLinkText('Start'))
     * })
     * ```
     *
     * In this example we're constructing a <[Locatable]> using the `By.partialLinkText()` Locator, which will match the first `<a>` tag which contains the text "Start".
     *
     */ click ( locatable , options ? ) : Promise < void > ; /**
     * Sends a double-click event to the element located by the supplied Locator or `selector`. If the element is
     * currently outside the viewport it will first scroll to that element.
     */ doubleClick ( locatable , options ? ) : Promise < void > ; /**
     * Selects an option within a `<select>` tag using the value of the `<option>` element.
     */ selectByValue ( locatable , ... values ) : Promise < string [ ] > ; /**
     * Selects an option within a `<select>` tag by its index in the list.
     */ selectByIndex ( locatable , index ) : Promise < string [ ] > ; /**
     * Selects an option within a `<select>` tag by matching its visible text.
     */ selectByText ( locatable , text ) : Promise < string [ ] > ; /**
     * Clears the selected value of an input or select control.
     */ clear ( locatable ) : Promise < void > ; /**
     * Types a string into an `<input>` control, key press by key press. Use this to fill inputs as though it was typed by the user.
     *
     * **Example:**
     * ```typescript
     * step("Step 1", async browser => {
     *   await browser.type(By.css("#email"), "user@example.com")
     * })
     * ```
     *
     */ type ( locatable , text , options ? ) : Promise < void > ; param locator returns { Promise < void > } memberof blur ( locator ) : Promise < void > ; param locator returns { Promise < void > } memberof focus ( locator ) : Promise < void > ; /**
     * Presses a key on the keyboard specified by key code. For example, <[Key.ALT]>
     */ press ( /**
     * The key code to send.
     */ keyCode , options ? ) : Promise < void > ; /**
     * `sendKeys` simulates typing a list of strings on the keyboard.
     *
     * If a string is a member of <[Key]> it is pressed individually. Otherwise the string is typed.
     * This allows sendKeys to simulate a user typing control keys such as `Key.ENTER`.
     *
     * **Example:**
     * ```typescript
     * await browser.click("#input_address")
     * await browser.sendKeys("Hello, World!", Key.ENTER)
     * ```
     */ sendKeys ( ... keys ) : Promise < void > ; /**
     * `sendKeyCombinations` simulates the key combinations.
     *
     * **Example:**
     * ```typescript
     * await browser.sendKeyCombination(Key.SHIFT, 'A')
     * await browser.sendKeyCombination(Key.SHIFT, 'KeyA')
     * ```
     */ sendKeyCombinations ( ... keys ) : Promise < void > ; /**
     * The Mouse class operates in main-frame CSS pixels relative to the top-left corner of the viewport.
     * Every page has its own <[Mouse]>, accessible with `browser.mouse`.
     */ mouse : Mouse ; /**
     * Takes a screenshot of the whole page and saves it to the `flood/results` folder with a random sequential name. You can download the archive of your test results at the end of the test to retrieve these screenshots.
     */ takeScreenshot ( options ? ) : Promise < void > ; /**
     * Highlight an element. Useful in concert with takeScreenshot to tweak your locators.
     */ highlightElement ( element ) : Promise < void > ; /**
     * Uses the provided locator to find the first element it matches, returning an ElementHandle.
     */ maybeFindElement ( locator ) : Promise < ElementHandle | null > ; /**
     * Uses the provided locator to find the first element it matches, returning an ElementHandle.
     * If no element is found throws an error.
     */ findElement ( locator ) : Promise < ElementHandle > ; /**
     * Uses the provided locator to find all elements matching the locator condition, returning an array of ElementHandles
     */ findElements ( locator ) : Promise < ElementHandle [ ] > ; /**
     * Switch the focus of the browser to another frame, tab, or window.
     */ switchTo ( ) : TargetLocator ; setViewport ( viewport ) : Promise < void > ; /**
     * Wait for a new page to be opened in the browser then return that page.
     */ waitForNewPage ( ) : Promise < Page > ; close ( ) : Promise < void > ; context ( ) : BrowserContext ; param filterBy getCookies ( filterBy ? ) : Promise < Cookie [ ] > ; /**
     * Get the current URL of the page
     */ getUrl ( ) : string ; param x param y param scrollOptions scrollBy ( x , y , scrollOptions ? ) : Promise < void > ; param target param behavior scrollTo ( target , scrollOptions ? ) : Promise < void > ; /**
     * Drag an element into another element
     */ drag ( from , to ) : Promise < void > ; param filePath getMimeType ( filePath ) : string | false ; } /**
 * Driver is an alias to Browser. Please use Browser when possible.
 */ export type Driver = Browser ;