1 | import playwright, { Browser, Page, LaunchOptions, BrowserContext } from 'playwright';
|
2 | import { BrowserLauncher, TestRunnerCoreConfig } from '@web/test-runner-core';
|
3 | import { PlaywrightLauncherPage } from './PlaywrightLauncherPage';
|
4 | export type ProductType = 'chromium' | 'firefox' | 'webkit';
|
5 | interface CreateArgs {
|
6 | browser: Browser;
|
7 | config: TestRunnerCoreConfig;
|
8 | }
|
9 | export type CreateBrowserContextFn = (args: CreateArgs) => BrowserContext | Promise<BrowserContext>;
|
10 | export type CreatePageFn = (args: CreateArgs & {
|
11 | context: BrowserContext;
|
12 | }) => Promise<Page>;
|
13 | export declare class PlaywrightLauncher implements BrowserLauncher {
|
14 | name: string;
|
15 | type: string;
|
16 | concurrency?: number;
|
17 | private product;
|
18 | private launchOptions;
|
19 | private createBrowserContextFn;
|
20 | private createPageFn;
|
21 | private config?;
|
22 | private testFiles?;
|
23 | private browser?;
|
24 | private debugBrowser?;
|
25 | private activePages;
|
26 | private activeDebugPages;
|
27 | private testCoveragePerSession;
|
28 | private __launchBrowserPromise?;
|
29 | __experimentalWindowFocus__: boolean;
|
30 | constructor(product: ProductType, launchOptions: LaunchOptions, createBrowserContextFn: CreateBrowserContextFn, createPageFn: CreatePageFn, __experimentalWindowFocus__?: boolean, concurrency?: number);
|
31 | initialize(config: TestRunnerCoreConfig, testFiles: string[]): Promise<void>;
|
32 | stop(): Promise<void>;
|
33 | startSession(sessionId: string, url: string): Promise<void>;
|
34 | isActive(sessionId: string): boolean;
|
35 | getBrowserUrl(sessionId: string): string;
|
36 | startDebugSession(sessionId: string, url: string): Promise<void>;
|
37 | createNewPage(browser: Browser): Promise<PlaywrightLauncherPage>;
|
38 | stopSession(sessionId: string): Promise<import("@web/test-runner-core").SessionResult>;
|
39 | private getOrStartBrowser;
|
40 | getPage(sessionId: string): playwright.Page;
|
41 | }
|
42 | export {};
|
43 |
|
\ | No newline at end of file |