UNPKG

3.96 kBTypeScriptView Raw
1export interface ChromePerfLoggingPrefs {
2 /**
3 * Default: true. Whether or not to collect events from Network domain.
4 */
5 enableNetwork?: boolean | undefined;
6
7 /**
8 * Default: true. Whether or not to collect events from Page domain.
9 */
10 enablePage?: boolean | undefined;
11
12 /**
13 * A comma-separated string of Chrome tracing categories for which trace events should be collected.
14 * An unspecified or empty string disables tracing.
15 */
16 traceCategories?: string | undefined;
17
18 /**
19 * Default: 1000. The requested number of milliseconds between DevTools trace buffer usage events. For example, if 1000,
20 * then once per second, DevTools will report how full the trace buffer is. If a report indicates the buffer usage is 100%,
21 * a warning will be issued.
22 */
23 bufferUsageReportingInterval?: number | undefined;
24}
25
26export interface ChromeOptions {
27 /**
28 * Whether to run Chromedriver using w3c protocol or the legacy JSONWire protocol.
29 *
30 * @deprecated Chromedriver now only supports w3c protocol.
31 */
32 w3c?: true;
33
34 /**
35 * List of command-line arguments to use when starting Chrome. Arguments with an associated value should be separated by a '=' sign
36 * (e.g., ['start-maximized', 'user-data-dir=/tmp/temp_profile']).
37 */
38 args?: string[] | undefined;
39
40 /**
41 * Path to the Chrome executable to use (on Mac OS X, this should be the actual binary, not just the app. e.g.,
42 * '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')
43 */
44 binary?: string | undefined;
45
46 /**
47 * A list of Chrome extensions to install on startup. Each item in the list should be a base-64 encoded packed Chrome extension (.crx)
48 */
49 extensions?: string[] | undefined;
50
51 /**
52 * A dictionary with each entry consisting of the name of the preference and its value. These preferences are applied
53 * to the Local State file in the user data folder.
54 */
55 localState?: Record<string, string> | undefined;
56
57 /**
58 * A dictionary with each entry consisting of the name of the preference and its value. These preferences are only applied
59 * to the user profile in use.
60 */
61 prefs?: Record<string, string> | undefined;
62
63 /**
64 * Default: false. If false, Chrome will be quit when ChromeDriver is killed, regardless of whether the session is quit.
65 * If true, Chrome will only be quit if the session is quit (or closed). Note, if true, and the session is not quit,
66 * ChromeDriver cannot clean up the temporary user data directory that the running Chrome instance is using.
67 */
68 detach?: boolean | undefined;
69
70 /**
71 * An address of a Chrome debugger server to connect to, in the form of <hostname/ip:port>, e.g. '127.0.0.1:38947'
72 */
73 debuggerAddress?: string | undefined;
74
75 /**
76 * List of Chrome command line switches to exclude that ChromeDriver by default passes when starting Chrome.
77 * Do not prefix switches with --.
78 */
79 excludeSwitches?: string[] | undefined;
80
81 /**
82 * Directory to store Chrome minidumps . (Supported only on Linux.)
83 */
84 minidumpPath?: string | undefined;
85
86 /**
87 * A dictionary with either a value for “deviceName,” or values for “deviceMetrics” and “userAgent.” Refer to Mobile Emulation for more information.
88 */
89 mobileEmulation?: Record<string, string> | undefined;
90
91 /**
92 * An optional dictionary that specifies performance logging preferences. See below for more information.
93 */
94 perfLoggingPrefs?: ChromePerfLoggingPrefs | undefined;
95
96 /**
97 * A list of window types that will appear in the list of window handles. For access to <webview> elements, include "webview" in this list.
98 */
99 windowTypes?: string[] | undefined;
100
101 /**
102 * Name of the Android package to do automation on. E.g., 'com.android.chrome'.
103 */
104 androidPackage?: string;
105
106 /**
107 * Serial number of the device to connect to via ADB. If not specified, the
108 * WebDriver server will select an unused device at random. An error will be
109 * returned if all devices already have active sessions.
110 */
111 androidDeviceSerial?: string;
112}