appium-android-driver 6.0.0 → 6.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,528 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DEVTOOLS_SOCKET_PATTERN = exports.KNOWN_CHROME_PACKAGE_NAMES = exports.CHROMIUM_WIN = exports.WEBVIEW_BASE = exports.WEBVIEW_WIN = exports.NATIVE_WIN = exports.helpers = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const logger_1 = __importDefault(require("./logger"));
9
- const axios_1 = __importDefault(require("axios"));
10
- const support_1 = require("@appium/support");
11
- const portscanner_1 = require("portscanner");
12
- const lru_cache_1 = __importDefault(require("lru-cache"));
13
- const bluebird_1 = __importDefault(require("bluebird"));
14
- const path_1 = __importDefault(require("path"));
15
- const os_1 = __importDefault(require("os"));
16
- const NATIVE_WIN = 'NATIVE_APP';
17
- exports.NATIVE_WIN = NATIVE_WIN;
18
- const WEBVIEW_WIN = 'WEBVIEW';
19
- exports.WEBVIEW_WIN = WEBVIEW_WIN;
20
- const CHROMIUM_WIN = 'CHROMIUM';
21
- exports.CHROMIUM_WIN = CHROMIUM_WIN;
22
- const WEBVIEW_BASE = `${WEBVIEW_WIN}_`;
23
- exports.WEBVIEW_BASE = WEBVIEW_BASE;
24
- const WEBVIEW_PID_PATTERN = new RegExp(`^${WEBVIEW_BASE}(\\d+)`);
25
- const WEBVIEW_PKG_PATTERN = new RegExp(`^${WEBVIEW_BASE}([^\\d\\s][\\w.]*)`);
26
- const DEVTOOLS_SOCKET_PATTERN = /@[\w.]+_devtools_remote_?([\w.]+_)?(\d+)?\b/;
27
- exports.DEVTOOLS_SOCKET_PATTERN = DEVTOOLS_SOCKET_PATTERN;
28
- const CROSSWALK_SOCKET_PATTERN = /@([\w.]+)_devtools_remote\b/;
29
- const CHROMIUM_DEVTOOLS_SOCKET = 'chrome_devtools_remote';
30
- const CHROME_PACKAGE_NAME = 'com.android.chrome';
31
- const KNOWN_CHROME_PACKAGE_NAMES = [
32
- CHROME_PACKAGE_NAME,
33
- 'com.chrome.beta',
34
- 'com.chrome.dev',
35
- 'com.chrome.canary',
36
- ];
37
- exports.KNOWN_CHROME_PACKAGE_NAMES = KNOWN_CHROME_PACKAGE_NAMES;
38
- const DEVTOOLS_PORTS_RANGE = [10900, 11000];
39
- const WEBVIEWS_DETAILS_CACHE = new lru_cache_1.default({
40
- max: 100,
41
- updateAgeOnGet: true,
42
- });
43
- const CDP_REQ_TIMEOUT = 2000; // ms
44
- const DEVTOOLS_PORT_ALLOCATION_GUARD = support_1.util.getLockFileGuard(path_1.default.resolve(os_1.default.tmpdir(), 'android_devtools_port_guard'), { timeout: 7, tryRecovery: true });
45
- const helpers = {};
46
- exports.helpers = helpers;
47
- function toDetailsCacheKey(adb, webview) {
48
- return `${adb?.curDeviceId}:${webview}`;
49
- }
50
- /**
51
- * This function gets a list of android system processes and returns ones
52
- * that look like webviews
53
- * See https://cs.chromium.org/chromium/src/chrome/browser/devtools/device/android_device_info_query.cc
54
- * for more details
55
- *
56
- * @param {object} adb - an ADB instance
57
- *
58
- * @return {Array.<string>} - a list of matching webview socket names (including the leading '@')
59
- */
60
- async function getPotentialWebviewProcs(adb) {
61
- const out = await adb.shell(['cat', '/proc/net/unix']);
62
- const names = [];
63
- const allMatches = [];
64
- for (const line of out.split('\n')) {
65
- // Num RefCount Protocol Flags Type St Inode Path
66
- const [, , , flags, , st, , sockPath] = line.trim().split(/\s+/);
67
- if (!sockPath) {
68
- continue;
69
- }
70
- if (sockPath.startsWith('@')) {
71
- allMatches.push(line.trim());
72
- }
73
- if (flags !== '00010000' || st !== '01') {
74
- continue;
75
- }
76
- if (!DEVTOOLS_SOCKET_PATTERN.test(sockPath)) {
77
- continue;
78
- }
79
- names.push(sockPath);
80
- }
81
- if (lodash_1.default.isEmpty(names)) {
82
- logger_1.default.debug('Found no active devtools sockets');
83
- if (!lodash_1.default.isEmpty(allMatches)) {
84
- logger_1.default.debug(`Other sockets are: ${JSON.stringify(allMatches, null, 2)}`);
85
- }
86
- }
87
- else {
88
- logger_1.default.debug(`Parsed ${names.length} active devtools ${support_1.util.pluralize('socket', names.length, false)}: ` +
89
- JSON.stringify(names));
90
- }
91
- // sometimes the webview process shows up multiple times per app
92
- return lodash_1.default.uniq(names);
93
- }
94
- /**
95
- * @typedef {Object} WebviewProc
96
- * @property {string} proc - The webview process name (as returned by
97
- * getPotentialWebviewProcs
98
- * @property {string} webview - The actual webview context name
99
- */
100
- /**
101
- * This function retrieves a list of system processes that look like webviews,
102
- * and returns them along with the webview context name appropriate for it.
103
- * If we pass in a deviceSocket, we only attempt to find webviews which match
104
- * that socket name (this is for apps which embed Chromium, which isn't the
105
- * same as chrome-backed webviews).
106
- *
107
- * @param {object} adb - an ADB instance
108
- * @param {?string} deviceSocket - the explictly-named device socket to use
109
- *
110
- * @return {Array.<WebviewProc>}
111
- */
112
- async function webviewsFromProcs(adb, deviceSocket = null) {
113
- const socketNames = await getPotentialWebviewProcs(adb);
114
- const webviews = [];
115
- for (const socketName of socketNames) {
116
- if (deviceSocket === CHROMIUM_DEVTOOLS_SOCKET && socketName === `@${deviceSocket}`) {
117
- webviews.push({
118
- proc: socketName,
119
- webview: CHROMIUM_WIN,
120
- });
121
- continue;
122
- }
123
- const socketNameMatch = DEVTOOLS_SOCKET_PATTERN.exec(socketName);
124
- if (!socketNameMatch) {
125
- continue;
126
- }
127
- const matchedSocketName = socketNameMatch[2];
128
- const crosswalkMatch = CROSSWALK_SOCKET_PATTERN.exec(socketName);
129
- if (!matchedSocketName && !crosswalkMatch) {
130
- continue;
131
- }
132
- if ((deviceSocket && socketName === `@${deviceSocket}`) || !deviceSocket) {
133
- webviews.push({
134
- proc: socketName,
135
- webview: matchedSocketName
136
- ? `${WEBVIEW_BASE}${matchedSocketName}`
137
- : `${WEBVIEW_BASE}${crosswalkMatch[1]}`,
138
- });
139
- }
140
- }
141
- return webviews;
142
- }
143
- /**
144
- * Allocates a local port for devtools communication
145
- *
146
- * @param {ADB} adb ADB instance
147
- * @param {string} socketName The remote Unix socket name
148
- * @param {?number} webviewDevtoolsPort The local port number or null to apply
149
- * autodetection
150
- * @returns {number} The local port number if the remote socket has been forwarded
151
- * successfully or `null` otherwise
152
- * @throws {Error} If there was an error while allocating the local port
153
- */
154
- async function allocateDevtoolsPort(adb, socketName, webviewDevtoolsPort = null) {
155
- // socket names come with '@', but this should not be a part of the abstract
156
- // remote port, so remove it
157
- const remotePort = socketName.replace(/^@/, '');
158
- let [startPort, endPort] = DEVTOOLS_PORTS_RANGE;
159
- if (webviewDevtoolsPort) {
160
- endPort = webviewDevtoolsPort + (endPort - startPort);
161
- startPort = webviewDevtoolsPort;
162
- }
163
- logger_1.default.debug(`Forwarding remote port ${remotePort} to a local ` + `port in range ${startPort}..${endPort}`);
164
- if (!webviewDevtoolsPort) {
165
- logger_1.default.debug(`You could use the 'webviewDevtoolsPort' capability to customize ` +
166
- `the starting port number`);
167
- }
168
- return await DEVTOOLS_PORT_ALLOCATION_GUARD(async () => {
169
- let localPort;
170
- try {
171
- localPort = await (0, portscanner_1.findAPortNotInUse)(startPort, endPort);
172
- }
173
- catch (e) {
174
- throw new Error(`Cannot find any free port to forward the Devtools socket ` +
175
- `in range ${startPort}..${endPort}. You could set the starting port number ` +
176
- `manually by providing the 'webviewDevtoolsPort' capability`);
177
- }
178
- await adb.adbExec(['forward', `tcp:${localPort}`, `localabstract:${remotePort}`]);
179
- return localPort;
180
- });
181
- }
182
- /**
183
- * @typedef {Object} WebviewProps
184
- * @property {string} proc The name of the Devtools Unix socket
185
- * @property {string} webview The web view alias. Looks like `WEBVIEW_`
186
- * prefix plus PID or package name
187
- * @property {?Object} info Webview information as it is retrieved by
188
- * /json/version CDP endpoint
189
- * @property {?Array<Object>} pages Webview pages list as it is retrieved by
190
- * /json/list CDP endpoint
191
- */
192
- /**
193
- * @typedef {Object} DetailCollectionOptions
194
- * @property {?string|number} webviewDevtoolsPort The starting port to use for webview page
195
- * presence check (if not the default of 9222).
196
- * @property {?boolean} ensureWebviewsHavePages Whether to check for webview
197
- * pages presence
198
- * @property {boolean} enableWebviewDetailsCollection Whether to collect
199
- * web view details and send them to Chromedriver constructor, so it could
200
- * select a binary more precisely based on this info.
201
- */
202
- /**
203
- * This is a wrapper for Chrome Debugger Protocol data collection.
204
- * No error is thrown if CDP request fails - in such case no data will be
205
- * recorded into the corresponding `webviewsMapping` item.
206
- *
207
- * @param {ADB} adb The ADB instance
208
- * @param {Array<WebviewProps>} webviewsMapping The current webviews mapping
209
- * !!! Each item of this array gets mutated (`info`/`pages` properties get added
210
- * based on the provided `opts`) if the requested details have been
211
- * successfully retrieved for it !!!
212
- * @param {DetailCollectionOptions} opts If both `ensureWebviewsHavePages` and
213
- * `enableWebviewDetailsCollection` properties are falsy then no details collection
214
- * is performed
215
- */
216
- async function collectWebviewsDetails(adb, webviewsMapping, opts = {}) {
217
- if (lodash_1.default.isEmpty(webviewsMapping)) {
218
- return;
219
- }
220
- const { webviewDevtoolsPort = null, ensureWebviewsHavePages = null, enableWebviewDetailsCollection = null, } = opts;
221
- if (!ensureWebviewsHavePages) {
222
- logger_1.default.info(`Not checking whether webviews have active pages; use the ` +
223
- `'ensureWebviewsHavePages' cap to turn this check on`);
224
- }
225
- if (!enableWebviewDetailsCollection) {
226
- logger_1.default.info(`Not collecting web view details. Details collection might help ` +
227
- `to make Chromedriver initialization more precise. Use the 'enableWebviewDetailsCollection' ` +
228
- `cap to turn it on`);
229
- }
230
- if (!ensureWebviewsHavePages && !enableWebviewDetailsCollection) {
231
- return;
232
- }
233
- // Connect to each devtools socket and retrieve web view details
234
- logger_1.default.debug(`Collecting CDP data of ${support_1.util.pluralize('webview', webviewsMapping.length, true)}`);
235
- const detailCollectors = [];
236
- for (const item of webviewsMapping) {
237
- detailCollectors.push((async () => {
238
- let localPort;
239
- try {
240
- localPort = await allocateDevtoolsPort(adb, item.proc, webviewDevtoolsPort);
241
- if (enableWebviewDetailsCollection) {
242
- item.info = await cdpInfo(localPort);
243
- }
244
- if (ensureWebviewsHavePages) {
245
- item.pages = await cdpList(localPort);
246
- }
247
- }
248
- catch (e) {
249
- logger_1.default.debug(e);
250
- }
251
- finally {
252
- if (localPort) {
253
- try {
254
- await adb.removePortForward(localPort);
255
- }
256
- catch (e) {
257
- logger_1.default.debug(e);
258
- }
259
- }
260
- }
261
- })());
262
- }
263
- await bluebird_1.default.all(detailCollectors);
264
- logger_1.default.debug(`CDP data collection completed`);
265
- }
266
- // https://chromedevtools.github.io/devtools-protocol/
267
- async function cdpList(localPort) {
268
- return (await (0, axios_1.default)({
269
- url: `http://127.0.0.1:${localPort}/json/list`,
270
- timeout: CDP_REQ_TIMEOUT,
271
- })).data;
272
- }
273
- // https://chromedevtools.github.io/devtools-protocol/
274
- async function cdpInfo(localPort) {
275
- return (await (0, axios_1.default)({
276
- url: `http://127.0.0.1:${localPort}/json/version`,
277
- timeout: CDP_REQ_TIMEOUT,
278
- })).data;
279
- }
280
- /**
281
- * Take a webview name like WEBVIEW_4296 and use 'adb shell ps' to figure out
282
- * which app package is associated with that webview. One of the reasons we
283
- * want to do this is to make sure we're listing webviews for the actual AUT,
284
- * not some other running app
285
- *
286
- * @param {object} adb - an ADB instance
287
- * @param {string} webview - a webview process name
288
- *
289
- * @returns {string} - the package name of the app running the webview
290
- * @throws {Error} If there was a failure while retrieving the process name
291
- */
292
- helpers.procFromWebview = async function procFromWebview(adb, webview) {
293
- const pidMatch = WEBVIEW_PID_PATTERN.exec(webview);
294
- if (!pidMatch) {
295
- throw new Error(`Could not find PID for webview '${webview}'`);
296
- }
297
- const pid = pidMatch[1];
298
- logger_1.default.debug(`${webview} mapped to pid ${pid}`);
299
- logger_1.default.debug(`Getting process name for webview '${webview}'`);
300
- const pkg = await adb.getNameByPid(pid);
301
- logger_1.default.debug(`Got process name: '${pkg}'`);
302
- return pkg;
303
- };
304
- /**
305
- * Parse webview names for getContexts
306
- *
307
- * @param {Array<WebviewsMapping>} webviewsMapping See note on getWebViewsMapping
308
- * @param {GetWebviewsOpts} opts See note on getWebViewsMapping
309
- * @return {Array.<string>} - a list of webview names
310
- */
311
- helpers.parseWebviewNames = function parseWebviewNames(webviewsMapping, { ensureWebviewsHavePages = true, isChromeSession = false } = {}) {
312
- if (isChromeSession) {
313
- return [CHROMIUM_WIN];
314
- }
315
- const result = [];
316
- for (const { webview, pages, proc, webviewName } of webviewsMapping) {
317
- if (ensureWebviewsHavePages && pages?.length === 0) {
318
- logger_1.default.info(`Skipping the webview '${webview}' at '${proc}' ` +
319
- `since it has reported having zero pages`);
320
- continue;
321
- }
322
- if (webviewName) {
323
- result.push(webviewName);
324
- }
325
- }
326
- logger_1.default.debug(`Found ${support_1.util.pluralize('webview', result.length, true)}: ${JSON.stringify(result)}`);
327
- return result;
328
- };
329
- /**
330
- * @typedef {Object} GetWebviewsOpts
331
- * @property {string} androidDeviceSocket [null] - device socket name
332
- * @property {boolean} ensureWebviewsHavePages [true] - whether to check for webview
333
- * page presence
334
- * @property {number} webviewDevtoolsPort [9222] - port to use for webview page
335
- * presence check.
336
- * @property {boolean} enableWebviewDetailsCollection [true] - whether to collect
337
- * web view details and send them to Chromedriver constructor, so it could
338
- * select a binary more precisely based on this info.
339
- */
340
- /**
341
- * @typedef {Object} WebviewsMapping
342
- * @property {string} proc See note on WebviewProps
343
- * @property {string} webview See note on WebviewProps
344
- * @property {?Object} info See note on WebviewProps
345
- * @property {?Array<Object>} pages See note on WebviewProps
346
- * @propery {?string} webviewName An actual webview name for switching context
347
- */
348
- /**
349
- * Get a list of available webviews mapping by introspecting processes with adb,
350
- * where webviews are listed. It's possible to pass in a 'deviceSocket' arg, which
351
- * limits the webview possibilities to the one running on the Chromium devtools
352
- * socket we're interested in (see note on webviewsFromProcs). We can also
353
- * direct this method to verify whether a particular webview process actually
354
- * has any pages (if a process exists but no pages are found, Chromedriver will
355
- * not actually be able to connect to it, so this serves as a guard for that
356
- * strange failure mode). The strategy for checking whether any pages are
357
- * active involves sending a request to the remote debug server on the device,
358
- * hence it is also possible to specify the port on the host machine which
359
- * should be used for this communication.
360
- *
361
- * @param {object} adb - an ADB instance
362
- * @param {GetWebviewsOpts} opts
363
- *
364
- * @return {Array<WebviewsMapping>} webviewsMapping
365
- */
366
- helpers.getWebViewsMapping = async function getWebViewsMapping(adb, { androidDeviceSocket = null, ensureWebviewsHavePages = true, webviewDevtoolsPort = null, enableWebviewDetailsCollection = true, } = {}) {
367
- logger_1.default.debug('Getting a list of available webviews');
368
- const webviewsMapping = await webviewsFromProcs(adb, androidDeviceSocket);
369
- await collectWebviewsDetails(adb, webviewsMapping, {
370
- ensureWebviewsHavePages,
371
- enableWebviewDetailsCollection,
372
- webviewDevtoolsPort,
373
- });
374
- for (const webviewMapping of webviewsMapping) {
375
- const { webview, info } = webviewMapping;
376
- webviewMapping.webviewName = null;
377
- let wvName = webview;
378
- let process = undefined;
379
- if (!androidDeviceSocket) {
380
- const pkgMatch = WEBVIEW_PKG_PATTERN.exec(webview);
381
- try {
382
- // web view name could either be suffixed with PID or the package name
383
- // package names could not start with a digit
384
- const pkg = pkgMatch ? pkgMatch[1] : await helpers.procFromWebview(adb, webview);
385
- wvName = `${WEBVIEW_BASE}${pkg}`;
386
- const pidMatch = WEBVIEW_PID_PATTERN.exec(webview);
387
- process = {
388
- name: pkg,
389
- id: pidMatch ? pidMatch[1] : null,
390
- };
391
- }
392
- catch (e) {
393
- logger_1.default.warn(e.message);
394
- continue;
395
- }
396
- }
397
- webviewMapping.webviewName = wvName;
398
- const key = toDetailsCacheKey(adb, wvName);
399
- if (info || process) {
400
- WEBVIEWS_DETAILS_CACHE.set(key, { info, process });
401
- }
402
- else if (WEBVIEWS_DETAILS_CACHE.has(key)) {
403
- WEBVIEWS_DETAILS_CACHE.delete(key);
404
- }
405
- }
406
- return webviewsMapping;
407
- };
408
- /**
409
- * @typedef {Object} ProcessInfo
410
- * @property {string} name The process name
411
- * @property {?string} id The process id (if could be retrieved)
412
- */
413
- /**
414
- * @typedef {Object} WebViewDetails
415
- * @property {?ProcessInfo} process - Web view process details
416
- * @property {Object} info - Web view details as returned by /json/version CDP endpoint, for example:
417
- * {
418
- * "Browser": "Chrome/72.0.3601.0",
419
- * "Protocol-Version": "1.3",
420
- * "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3601.0 Safari/537.36",
421
- * "V8-Version": "7.2.233",
422
- * "WebKit-Version": "537.36 (@cfede9db1d154de0468cb0538479f34c0755a0f4)",
423
- * "webSocketDebuggerUrl": "ws://localhost:9222/devtools/browser/b0b8a4fb-bb17-4359-9533-a8d9f3908bd8"
424
- * }
425
- */
426
- /**
427
- * Retrieves web view details previously cached by `getWebviews` call
428
- *
429
- * @param {ADB} adb ADB instance
430
- * @param {string} webview The name of the web view
431
- * @returns {?WebViewDetails} Either `undefined` or the recent web view details
432
- */
433
- helpers.getWebviewDetails = function getWebviewDetails(adb, webview) {
434
- const key = toDetailsCacheKey(adb, webview);
435
- return WEBVIEWS_DETAILS_CACHE.get(key);
436
- };
437
- /**
438
- * Create Chrome driver capabilities based on the provided
439
- * Appium capabilities
440
- *
441
- * @param {Object} opts User-provided capabilities object
442
- * @param {string} deviceId The identifier of the Android device under test
443
- * @param {?WebViewDetails} webViewDetails
444
- * @returns {Object} The capabilities object.
445
- * See https://chromedriver.chromium.org/capabilities for more details.
446
- */
447
- helpers.createChromedriverCaps = function createChromedriverCaps(opts, deviceId, webViewDetails) {
448
- const caps = { chromeOptions: {} };
449
- const androidPackage = opts.chromeOptions?.androidPackage ||
450
- opts.appPackage ||
451
- webViewDetails?.info?.['Android-Package'];
452
- if (androidPackage) {
453
- // chromedriver raises an invalid argument error when androidPackage is 'null'
454
- caps.chromeOptions.androidPackage = androidPackage;
455
- }
456
- if (lodash_1.default.isBoolean(opts.chromeUseRunningApp)) {
457
- caps.chromeOptions.androidUseRunningApp = opts.chromeUseRunningApp;
458
- }
459
- if (opts.chromeAndroidPackage) {
460
- caps.chromeOptions.androidPackage = opts.chromeAndroidPackage;
461
- }
462
- if (opts.chromeAndroidActivity) {
463
- caps.chromeOptions.androidActivity = opts.chromeAndroidActivity;
464
- }
465
- if (opts.chromeAndroidProcess) {
466
- caps.chromeOptions.androidProcess = opts.chromeAndroidProcess;
467
- }
468
- else if (webViewDetails?.process?.name && webViewDetails?.process?.id) {
469
- caps.chromeOptions.androidProcess = webViewDetails.process.name;
470
- }
471
- if (lodash_1.default.toLower(opts.browserName) === 'chromium-webview') {
472
- caps.chromeOptions.androidActivity = opts.appActivity;
473
- }
474
- if (opts.pageLoadStrategy) {
475
- caps.pageLoadStrategy = opts.pageLoadStrategy;
476
- }
477
- const isChrome = lodash_1.default.toLower(caps.chromeOptions.androidPackage) === 'chrome';
478
- if (lodash_1.default.includes(KNOWN_CHROME_PACKAGE_NAMES, caps.chromeOptions.androidPackage) || isChrome) {
479
- // if we have extracted package from context name, it could come in as bare
480
- // "chrome", and so we should make sure the details are correct, including
481
- // not using an activity or process id
482
- if (isChrome) {
483
- caps.chromeOptions.androidPackage = CHROME_PACKAGE_NAME;
484
- }
485
- delete caps.chromeOptions.androidActivity;
486
- delete caps.chromeOptions.androidProcess;
487
- }
488
- // add device id from adb
489
- caps.chromeOptions.androidDeviceSerial = deviceId;
490
- if (lodash_1.default.isPlainObject(opts.loggingPrefs) || lodash_1.default.isPlainObject(opts.chromeLoggingPrefs)) {
491
- if (opts.loggingPrefs) {
492
- logger_1.default.warn(`The 'loggingPrefs' cap is deprecated; use the 'chromeLoggingPrefs' cap instead`);
493
- }
494
- caps.loggingPrefs = opts.chromeLoggingPrefs || opts.loggingPrefs;
495
- }
496
- if (opts.enablePerformanceLogging) {
497
- logger_1.default.warn(`The 'enablePerformanceLogging' cap is deprecated; simply use ` +
498
- `the 'chromeLoggingPrefs' cap instead, with a 'performance' key set to 'ALL'`);
499
- const newPref = { performance: 'ALL' };
500
- // don't overwrite other logging prefs that have been sent in if they exist
501
- caps.loggingPrefs = caps.loggingPrefs ? Object.assign({}, caps.loggingPrefs, newPref) : newPref;
502
- }
503
- if (opts.chromeOptions?.Arguments) {
504
- // merge `Arguments` and `args`
505
- opts.chromeOptions.args = [...(opts.chromeOptions.args || []), ...opts.chromeOptions.Arguments];
506
- delete opts.chromeOptions.Arguments;
507
- }
508
- logger_1.default.debug('Precalculated Chromedriver capabilities: ' + JSON.stringify(caps.chromeOptions, null, 2));
509
- const protectedCapNames = [];
510
- for (const [opt, val] of lodash_1.default.toPairs(opts.chromeOptions)) {
511
- if (lodash_1.default.isUndefined(caps.chromeOptions[opt])) {
512
- caps.chromeOptions[opt] = val;
513
- }
514
- else {
515
- protectedCapNames.push(opt);
516
- }
517
- }
518
- if (!lodash_1.default.isEmpty(protectedCapNames)) {
519
- logger_1.default.info('The following Chromedriver capabilities cannot be overridden ' +
520
- 'by the provided chromeOptions:');
521
- for (const optName of protectedCapNames) {
522
- logger_1.default.info(` ${optName} (${JSON.stringify(opts.chromeOptions[optName])})`);
523
- }
524
- }
525
- return caps;
526
- };
527
- exports.default = helpers;
528
- //# sourceMappingURL=webview-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webview-helpers.js","sourceRoot":"","sources":["../../lib/webview-helpers.js"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AACvB,sDAA8B;AAC9B,kDAA0B;AAC1B,6CAAqC;AACrC,6CAA8C;AAC9C,0DAA4B;AAC5B,wDAAyB;AACzB,gDAAwB;AACxB,4CAAoB;AAEpB,MAAM,UAAU,GAAG,YAAY,CAAC;AAykB9B,gCAAU;AAxkBZ,MAAM,WAAW,GAAG,SAAS,CAAC;AAykB5B,kCAAW;AAxkBb,MAAM,YAAY,GAAG,UAAU,CAAC;AA0kB9B,oCAAY;AAzkBd,MAAM,YAAY,GAAG,GAAG,W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