import { Element } from './index.js'; import { ActionSequence } from './interface/actions.js'; import { PrintOptions } from './interface/print.js'; import { TimeoutsDef } from './interface/timeouts.js'; import { Using } from './swd.js'; import { Window, WindowType } from './window.js'; export declare enum BrowserType { Chrome = "chrome", Chromium = "chromium", Edge = "msedge", Firefox = "firefox", Safari = "safari" } /** * An object which represent a webdriver session. */ export declare class Browser { readonly session: string; readonly browserType: BrowserType; readonly timeouts: TimeoutsDef; private _webdriver; private _closed; get closed(): boolean; /** * Close the current browser and all the related windows */ close(): Promise; /** * Retreive the current broswer's windows which has the focus * @return a window which has the focus */ getCurrentWindow(): Promise; /** * Retreive all the windows related to the browser * @return all the windows objects related to the open browser */ getAllWindows(): Promise; /** * * @returns the title of the current context */ getTitle(): Promise; /** * Open a new Window or Tab which will launch "about:blank" url * @param type Allow to chose if the new Window is a "Tab" type or "Window" type * @returns the newly created Window object */ newWindow(type: WindowType): Promise; /** * * @param using * @param value * @param timeout * @returns */ findElement(using: Using, value: string, timeout?: number, fromElement?: Element): Promise; /** * * @param using * @param value * @param timeout * @returns */ findElements(using: Using, value: string, timeout?: number, fromElement?: Element): Promise; /** * * @param script * @param args * @returns */ executeSync(script: string | Function, ...args: any[]): Promise; /** * * @param script * @param args * @returns */ executeAsync(script: string | Function, ...args: any[]): Promise; /** * * @returns */ navigate(): { refresh: () => Promise; to: (url: string) => Promise; getCurrentURL: () => Promise; back: () => Promise; forward: () => Promise; }; screenshot(): Promise; frame(): { switch: (frameId: string | number | null) => Promise; parent: () => Promise; }; /** * */ cookie(): { get: (name: string) => Promise; getAll: () => Promise; create: (cookie: import("./interface.js").CookieDef) => Promise; update: (cookie: import("./interface.js").CookieDef) => Promise; delete: (name: string) => Promise; deleteAll: () => Promise; }; /** * Get current session timeouts */ getTimeouts(): Promise; /** * Set session timeouts */ setTimeouts(timeouts: { implicit?: number; pageLoad?: number; script?: number; }): Promise; /** * Get the page source of the current document */ getPageSource(): Promise; /** * Print the current page to PDF * @returns a base64-encoded PDF string */ printPage(options?: PrintOptions): Promise; /** * Perform a sequence of input actions */ performActions(actions: ActionSequence[]): Promise; /** * Release all keys and pointer buttons currently held */ releaseActions(): Promise; }