playwright-elements
Version:
This is Playwright extension.
52 lines (51 loc) • 2 kB
TypeScript
import { LaunchOptions, BrowserContext, Page, Browser, BrowserContextOptions } from 'playwright-core';
export declare function usePage<T>(page: Page, callBack: () => Promise<T>): Promise<T>;
export declare enum BrowserName {
CHROMIUM = "chromium",
CHROME = "chrome",
CHROME_BETA = "chrome-beta",
FIREFOX = "firefox",
WEBKIT = "webkit",
MSEDGE = "msedge",
MSEDGE_BETA = "msedge-beta",
MSEDGE_DEV = "msedge-dev"
}
export declare class Context {
private readonly context;
private _pages;
private _previousPage;
private _isMobile;
constructor(context: BrowserContext);
get get(): BrowserContext;
get pages(): Page[];
get previousPage(): Page;
set previousPage(page: Page);
get isMobile(): boolean;
set isMobile(isMobile: boolean);
}
export declare class BrowserInstance {
static browserName: BrowserName | undefined;
private static _browser;
private static _currentContext;
private static _currentPage;
private constructor();
static get isContextMobile(): boolean;
static set isContextMobile(isMobile: boolean);
static get currentPage(): Page;
static set currentPage(page: Page | undefined);
static withPage(page: Page): void;
private static get context();
static get currentContext(): BrowserContext;
static set currentContext(context: BrowserContext | undefined);
static withContext(context: BrowserContext): void;
static get browser(): Browser;
static set browser(browser: Browser | undefined);
static withBrowser(browser: Browser): void;
private static launch;
static start(browserName?: BrowserName, options?: LaunchOptions): Promise<Browser>;
static startNewContext(options?: BrowserContextOptions): Promise<BrowserContext>;
static startNewPage(options?: BrowserContextOptions): Promise<Page>;
static close(): Promise<void>;
static switchToPreviousTab(): Promise<void>;
static switchToTabByIndex(index: number): Promise<void>;
}