UNPKG

3.08 kBTypeScriptView Raw
1import * as webdriver from "./index";
2import * as remote from "./remote";
3
4/**
5 * Creates a new WebDriver client for Microsoft's Edge.
6 */
7export class Driver extends webdriver.chromium.ChromiumWebDriver {
8 /**
9 * Creates a new browser session for Microsoft's Edge browser.
10 *
11 * @param {(Capabilities|Options)=} opt_config The configuration options.
12 * @param {remote.DriverService=} opt_serviceExecutor The service to use; will create
13 * a new Legacy or Chromium service based on {@linkplain Options} by default.
14 * @return {!Driver} A new driver instance.
15 */
16 static createSession(
17 opt_config?: webdriver.Capabilities | Options,
18 opt_serviceExecutor?: remote.DriverService,
19 ): Driver;
20
21 /**
22 * returns new instance of edge driver service
23 * @returns {remote.DriverService}
24 */
25 static getDefaultService(): remote.DriverService;
26
27 /**
28 * This function is a no-op as file detectors are not supported by this
29 * implementation.
30 * @override
31 */
32 setFileDetector(): void;
33}
34
35export interface IOptionsValues {
36 args: string[];
37 binary?: string | undefined;
38 detach: boolean;
39 extensions: string[];
40 localState?: any;
41 logFile?: string | undefined;
42 prefs?: any;
43}
44
45export interface IPerfLoggingPrefs {
46 enableNetwork?: boolean | undefined;
47 enablePage?: boolean | undefined;
48 enableTimeline?: boolean | undefined;
49 traceCategories?: string | undefined;
50 bufferUsageReportingInterval?: number | undefined;
51}
52
53/**
54 * Class for managing MicrosoftEdgeDriver specific options.
55 */
56export class Options extends webdriver.chromium.Options {
57 /**
58 * Sets the path to the edge binary to use
59 *
60 * The binary path be absolute or relative to the msedgedriver server
61 * executable, but it must exist on the machine that will launch edge chromium.
62 * @param {string} path The path to the edgedriver binary to use.
63 * @return {!Options} A self reference.
64 */
65 setEdgeChromiumBinaryPath(path: string): Options;
66
67 /**
68 * Changes the browser name to 'webview2' to enable
69 * <a href="https://learn.microsoft.com/en-us/microsoft-edge/webview2/how-to/webdriver">
70 * test automation of WebView2 apps with Microsoft Edge WebDriver
71 * </a>
72 *
73 * @param {boolean} enable flag to enable or disable the 'webview2' usage
74 */
75 useWebView(enable: boolean): void;
76}
77
78/**
79 * Creates {@link selenium-webdriver/remote.DriverService} instances that manage
80 * a [MSEdgeDriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
81 * server in a child process.
82 */
83export class ServiceBuilder extends webdriver.chromium.ServiceBuilder {
84 /**
85 * @param {string=} opt_exe Path to the server executable to use. If omitted,
86 * the builder will attempt to locate the MicrosoftEdgeDriver on the current
87 * PATH.
88 * @throws {Error} If provided executable does not exist, or the
89 * MicrosoftEdgeDriver cannot be found on the PATH.
90 */
91 constructor(opt_exe?: string);
92}