selenium-webdriver 4.15.0 → 4.17.0
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.
- package/CHANGES.md +29 -0
- package/LICENSE +1 -1
- package/NOTICE +1 -1
- package/bidi/browsingContext.js +23 -1
- package/bidi/input.js +100 -0
- package/bidi/networkInspector.js +4 -0
- package/bidi/protocolType.js +1 -0
- package/bidi/protocolValue.js +56 -6
- package/bidi/realmInfo.js +1 -0
- package/bidi/scriptManager.js +52 -1
- package/bidi/scriptTypes.js +58 -0
- package/bin/linux/selenium-manager +0 -0
- package/bin/macos/selenium-manager +0 -0
- package/bin/windows/selenium-manager.exe +0 -0
- package/chrome.js +1 -6
- package/chromium.js +1 -34
- package/common/seleniumManager.js +7 -5
- package/devtools/CDPConnection.js +1 -1
- package/example/headless.js +2 -2
- package/firefox.js +54 -74
- package/index.js +3 -3
- package/lib/atoms/find-elements.js +3 -2
- package/lib/atoms/get-attribute.js +6 -100
- package/lib/atoms/is-displayed.js +2 -1
- package/lib/capabilities.js +7 -0
- package/lib/command.js +4 -0
- package/lib/http.js +5 -1
- package/lib/input.js +12 -0
- package/lib/webdriver.js +57 -1
- package/package.json +1 -1
- package/example/firefox_channels.js +0 -84
package/firefox.js
CHANGED
|
@@ -63,28 +63,19 @@
|
|
|
63
63
|
*
|
|
64
64
|
* For Linux, Firefox will always be located on the PATH: `$(where firefox)`.
|
|
65
65
|
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* install location for a non-release channel. If the requested channel cannot
|
|
69
|
-
* be found in its default location, WebDriver will fallback to searching your
|
|
70
|
-
* PATH. _Note:_ on Linux, Firefox is _always_ located on your path, regardless
|
|
71
|
-
* of the requested channel.
|
|
66
|
+
* You can provide a custom location for Firefox by setting the binary in the
|
|
67
|
+
* {@link Options}:setBinary method.
|
|
72
68
|
*
|
|
73
69
|
* const {Builder} = require('selenium-webdriver');
|
|
74
70
|
* const firefox = require('selenium-webdriver/firefox');
|
|
75
71
|
*
|
|
76
|
-
*
|
|
72
|
+
* let options = new firefox.Options()
|
|
73
|
+
* .setBinary('/my/firefox/install/dir/firefox');
|
|
77
74
|
* let driver = new Builder()
|
|
78
75
|
* .forBrowser('firefox')
|
|
79
76
|
* .setFirefoxOptions(options)
|
|
80
77
|
* .build();
|
|
81
78
|
*
|
|
82
|
-
* On all platforms, you may configure WebDriver to use a Firefox specific
|
|
83
|
-
* executable:
|
|
84
|
-
*
|
|
85
|
-
* let options = new firefox.Options()
|
|
86
|
-
* .setBinary('/my/firefox/install/dir/firefox-bin');
|
|
87
|
-
*
|
|
88
79
|
* __Remote Testing__
|
|
89
80
|
*
|
|
90
81
|
* You may customize the Firefox binary and profile when running against a
|
|
@@ -102,7 +93,7 @@
|
|
|
102
93
|
*
|
|
103
94
|
* let options = new firefox.Options()
|
|
104
95
|
* .setProfile('/profile/path/on/remote/host')
|
|
105
|
-
* .setBinary('/install/dir/on/remote/host/firefox
|
|
96
|
+
* .setBinary('/install/dir/on/remote/host/firefox');
|
|
106
97
|
*
|
|
107
98
|
* let driver = new Builder()
|
|
108
99
|
* .forBrowser('firefox')
|
|
@@ -136,7 +127,7 @@ const FIREFOX_CAPABILITY_KEY = 'moz:firefoxOptions'
|
|
|
136
127
|
*/
|
|
137
128
|
class AddonFormatError extends Error {
|
|
138
129
|
/** @param {string} msg The error message. */
|
|
139
|
-
constructor(msg) {
|
|
130
|
+
constructor (msg) {
|
|
140
131
|
super(msg)
|
|
141
132
|
/** @override */
|
|
142
133
|
this.name = this.constructor.name
|
|
@@ -150,7 +141,7 @@ class AddonFormatError extends Error {
|
|
|
150
141
|
* @return {!Promise<string>} A promise for the add-on ID once
|
|
151
142
|
* installed.
|
|
152
143
|
*/
|
|
153
|
-
async function installExtension(extension, dir) {
|
|
144
|
+
async function installExtension (extension, dir) {
|
|
154
145
|
const ext = extension.slice(-4)
|
|
155
146
|
if (ext !== '.xpi' && ext !== '.zip') {
|
|
156
147
|
throw Error('File name does not end in ".zip" or ".xpi": ' + ext)
|
|
@@ -188,7 +179,7 @@ async function installExtension(extension, dir) {
|
|
|
188
179
|
}
|
|
189
180
|
|
|
190
181
|
class Profile {
|
|
191
|
-
constructor() {
|
|
182
|
+
constructor () {
|
|
192
183
|
/** @private {?string} */
|
|
193
184
|
this.template_ = null
|
|
194
185
|
|
|
@@ -196,7 +187,7 @@ class Profile {
|
|
|
196
187
|
this.extensions_ = []
|
|
197
188
|
}
|
|
198
189
|
|
|
199
|
-
addExtensions(/** !Array<string> */ paths) {
|
|
190
|
+
addExtensions (/** !Array<string> */ paths) {
|
|
200
191
|
this.extensions_ = this.extensions_.concat(...paths)
|
|
201
192
|
}
|
|
202
193
|
|
|
@@ -204,7 +195,7 @@ class Profile {
|
|
|
204
195
|
* @return {(!Promise<string>|undefined)} a promise for a base64 encoded
|
|
205
196
|
* profile, or undefined if there's no data to include.
|
|
206
197
|
*/
|
|
207
|
-
[Symbols.serialize]() {
|
|
198
|
+
[Symbols.serialize] () {
|
|
208
199
|
if (this.template_ || this.extensions_.length) {
|
|
209
200
|
return buildProfile(this.template_, this.extensions_)
|
|
210
201
|
}
|
|
@@ -218,7 +209,7 @@ class Profile {
|
|
|
218
209
|
* profile.
|
|
219
210
|
* @return {!Promise<string>} a promise for the base64 encoded profile.
|
|
220
211
|
*/
|
|
221
|
-
async function buildProfile(template, extensions) {
|
|
212
|
+
async function buildProfile (template, extensions) {
|
|
222
213
|
let dir = template
|
|
223
214
|
|
|
224
215
|
if (extensions.length) {
|
|
@@ -254,7 +245,7 @@ class Options extends Capabilities {
|
|
|
254
245
|
* @param {(Capabilities|Map<string, ?>|Object)=} other Another set of
|
|
255
246
|
* capabilities to initialize this instance from.
|
|
256
247
|
*/
|
|
257
|
-
constructor(other) {
|
|
248
|
+
constructor (other) {
|
|
258
249
|
super(other)
|
|
259
250
|
this.setBrowserName(Browser.FIREFOX)
|
|
260
251
|
}
|
|
@@ -263,7 +254,7 @@ class Options extends Capabilities {
|
|
|
263
254
|
* @return {!Object}
|
|
264
255
|
* @private
|
|
265
256
|
*/
|
|
266
|
-
firefoxOptions_() {
|
|
257
|
+
firefoxOptions_ () {
|
|
267
258
|
let options = this.get(FIREFOX_CAPABILITY_KEY)
|
|
268
259
|
if (!options) {
|
|
269
260
|
options = {}
|
|
@@ -276,7 +267,7 @@ class Options extends Capabilities {
|
|
|
276
267
|
* @return {!Profile}
|
|
277
268
|
* @private
|
|
278
269
|
*/
|
|
279
|
-
profile_() {
|
|
270
|
+
profile_ () {
|
|
280
271
|
let options = this.firefoxOptions_()
|
|
281
272
|
if (!options.profile) {
|
|
282
273
|
options.profile = new Profile()
|
|
@@ -291,7 +282,7 @@ class Options extends Capabilities {
|
|
|
291
282
|
* @param {...(string|!Array<string>)} args The arguments to include.
|
|
292
283
|
* @return {!Options} A self reference.
|
|
293
284
|
*/
|
|
294
|
-
addArguments(...args) {
|
|
285
|
+
addArguments (...args) {
|
|
295
286
|
if (args.length) {
|
|
296
287
|
let options = this.firefoxOptions_()
|
|
297
288
|
options.args = options.args ? options.args.concat(...args) : args
|
|
@@ -300,33 +291,20 @@ class Options extends Capabilities {
|
|
|
300
291
|
}
|
|
301
292
|
|
|
302
293
|
/**
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* options.addArguments('-headless');
|
|
306
|
-
* @example
|
|
307
|
-
* Configures the geckodriver to start Firefox in headless mode.
|
|
308
|
-
*
|
|
309
|
-
* @return {!Options} A self reference.
|
|
310
|
-
*/
|
|
311
|
-
headless() {
|
|
312
|
-
return this.addArguments('-headless')
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Sets the initial window size when running in
|
|
317
|
-
* {@linkplain #headless headless} mode.
|
|
294
|
+
* Sets the initial window size
|
|
318
295
|
*
|
|
319
296
|
* @param {{width: number, height: number}} size The desired window size.
|
|
320
297
|
* @return {!Options} A self reference.
|
|
321
298
|
* @throws {TypeError} if width or height is unspecified, not a number, or
|
|
322
299
|
* less than or equal to 0.
|
|
323
300
|
*/
|
|
324
|
-
windowSize({ width, height }) {
|
|
325
|
-
function checkArg(arg) {
|
|
301
|
+
windowSize ({ width, height }) {
|
|
302
|
+
function checkArg (arg) {
|
|
326
303
|
if (typeof arg !== 'number' || arg <= 0) {
|
|
327
304
|
throw TypeError('Arguments must be {width, height} with numbers > 0')
|
|
328
305
|
}
|
|
329
306
|
}
|
|
307
|
+
|
|
330
308
|
checkArg(width)
|
|
331
309
|
checkArg(height)
|
|
332
310
|
return this.addArguments(`--width=${width}`, `--height=${height}`)
|
|
@@ -338,7 +316,7 @@ class Options extends Capabilities {
|
|
|
338
316
|
* @param {...string} paths The paths to the extension XPI files to install.
|
|
339
317
|
* @return {!Options} A self reference.
|
|
340
318
|
*/
|
|
341
|
-
addExtensions(...paths) {
|
|
319
|
+
addExtensions (...paths) {
|
|
342
320
|
this.profile_().addExtensions(paths)
|
|
343
321
|
return this
|
|
344
322
|
}
|
|
@@ -349,7 +327,7 @@ class Options extends Capabilities {
|
|
|
349
327
|
* @return {!Options} A self reference.
|
|
350
328
|
* @throws {TypeError} if either the key or value has an invalid type.
|
|
351
329
|
*/
|
|
352
|
-
setPreference(key, value) {
|
|
330
|
+
setPreference (key, value) {
|
|
353
331
|
if (typeof key !== 'string') {
|
|
354
332
|
throw TypeError(`key must be a string, but got ${typeof key}`)
|
|
355
333
|
}
|
|
@@ -377,7 +355,7 @@ class Options extends Capabilities {
|
|
|
377
355
|
* @return {!Options} A self reference.
|
|
378
356
|
* @throws {TypeError} if profile is not a string.
|
|
379
357
|
*/
|
|
380
|
-
setProfile(profile) {
|
|
358
|
+
setProfile (profile) {
|
|
381
359
|
if (typeof profile !== 'string') {
|
|
382
360
|
throw TypeError(`profile must be a string, but got ${typeof profile}`)
|
|
383
361
|
}
|
|
@@ -387,18 +365,18 @@ class Options extends Capabilities {
|
|
|
387
365
|
|
|
388
366
|
/**
|
|
389
367
|
* Sets the binary to use. The binary may be specified as the path to a
|
|
390
|
-
* Firefox executable
|
|
368
|
+
* Firefox executable.
|
|
391
369
|
*
|
|
392
|
-
* @param {(string
|
|
370
|
+
* @param {(string)} binary The binary to use.
|
|
393
371
|
* @return {!Options} A self reference.
|
|
394
372
|
* @throws {TypeError} If `binary` is an invalid type.
|
|
395
373
|
*/
|
|
396
|
-
setBinary(binary) {
|
|
374
|
+
setBinary (binary) {
|
|
397
375
|
if (binary instanceof Channel || typeof binary === 'string') {
|
|
398
376
|
this.firefoxOptions_().binary = binary
|
|
399
377
|
return this
|
|
400
378
|
}
|
|
401
|
-
throw TypeError('binary must be a string path
|
|
379
|
+
throw TypeError('binary must be a string path ')
|
|
402
380
|
}
|
|
403
381
|
|
|
404
382
|
/**
|
|
@@ -407,7 +385,7 @@ class Options extends Capabilities {
|
|
|
407
385
|
* @param {string} androidPackage The package to use
|
|
408
386
|
* @return {!Options} A self reference
|
|
409
387
|
*/
|
|
410
|
-
enableMobile(
|
|
388
|
+
enableMobile (
|
|
411
389
|
androidPackage = 'org.mozilla.firefox',
|
|
412
390
|
androidActivity = null,
|
|
413
391
|
deviceSerial = null
|
|
@@ -426,7 +404,7 @@ class Options extends Capabilities {
|
|
|
426
404
|
/**
|
|
427
405
|
* Enables moz:debuggerAddress for firefox cdp
|
|
428
406
|
*/
|
|
429
|
-
enableDebugger() {
|
|
407
|
+
enableDebugger () {
|
|
430
408
|
return this.set('moz:debuggerAddress', true)
|
|
431
409
|
}
|
|
432
410
|
|
|
@@ -434,7 +412,7 @@ class Options extends Capabilities {
|
|
|
434
412
|
* Enable bidi connection
|
|
435
413
|
* @returns {!Capabilities}
|
|
436
414
|
*/
|
|
437
|
-
enableBidi() {
|
|
415
|
+
enableBidi () {
|
|
438
416
|
return this.set('webSocketUrl', true)
|
|
439
417
|
}
|
|
440
418
|
}
|
|
@@ -460,7 +438,7 @@ const Context = {
|
|
|
460
438
|
* @return {!Promise<?string>} A promise for the located executable.
|
|
461
439
|
* The promise will resolve to {@code null} if Firefox was not found.
|
|
462
440
|
*/
|
|
463
|
-
function findInProgramFiles(file) {
|
|
441
|
+
function findInProgramFiles (file) {
|
|
464
442
|
let files = [
|
|
465
443
|
process.env['PROGRAMFILES'] || 'C:\\Program Files',
|
|
466
444
|
process.env['PROGRAMFILES(X86)'] || 'C:\\Program Files (x86)',
|
|
@@ -469,8 +447,8 @@ function findInProgramFiles(file) {
|
|
|
469
447
|
return exists
|
|
470
448
|
? files[0]
|
|
471
449
|
: io.exists(files[1]).then(function (exists) {
|
|
472
|
-
|
|
473
|
-
|
|
450
|
+
return exists ? files[1] : null
|
|
451
|
+
})
|
|
474
452
|
})
|
|
475
453
|
}
|
|
476
454
|
|
|
@@ -487,7 +465,7 @@ const ExtensionCommand = {
|
|
|
487
465
|
* @param {!Promise<string>} serverUrl The server's URL.
|
|
488
466
|
* @return {!command.Executor} The new command executor.
|
|
489
467
|
*/
|
|
490
|
-
function createExecutor(serverUrl) {
|
|
468
|
+
function createExecutor (serverUrl) {
|
|
491
469
|
let client = serverUrl.then((url) => new http.HttpClient(url))
|
|
492
470
|
let executor = new http.Executor(client)
|
|
493
471
|
configureExecutor(executor)
|
|
@@ -498,7 +476,7 @@ function createExecutor(serverUrl) {
|
|
|
498
476
|
* Configures the given executor with Firefox-specific commands.
|
|
499
477
|
* @param {!http.Executor} executor the executor to configure.
|
|
500
478
|
*/
|
|
501
|
-
function configureExecutor(executor) {
|
|
479
|
+
function configureExecutor (executor) {
|
|
502
480
|
executor.defineCommand(
|
|
503
481
|
ExtensionCommand.GET_CONTEXT,
|
|
504
482
|
'GET',
|
|
@@ -534,7 +512,7 @@ class ServiceBuilder extends remote.DriverService.Builder {
|
|
|
534
512
|
* @param {string=} opt_exe Path to the server executable to use. If omitted,
|
|
535
513
|
* the builder will attempt to locate the geckodriver on the system PATH.
|
|
536
514
|
*/
|
|
537
|
-
constructor(opt_exe) {
|
|
515
|
+
constructor (opt_exe) {
|
|
538
516
|
super(opt_exe)
|
|
539
517
|
this.setLoopback(true) // Required.
|
|
540
518
|
}
|
|
@@ -546,7 +524,7 @@ class ServiceBuilder extends remote.DriverService.Builder {
|
|
|
546
524
|
* default, only debug logging is enabled.
|
|
547
525
|
* @return {!ServiceBuilder} A self reference.
|
|
548
526
|
*/
|
|
549
|
-
enableVerboseLogging(opt_trace) {
|
|
527
|
+
enableVerboseLogging (opt_trace) {
|
|
550
528
|
return this.addArguments(opt_trace ? '-vv' : '-v')
|
|
551
529
|
}
|
|
552
530
|
}
|
|
@@ -577,7 +555,7 @@ class Driver extends webdriver.WebDriver {
|
|
|
577
555
|
* configured to use the legacy FirefoxDriver from the Selenium project.
|
|
578
556
|
* @return {!Driver} A new driver instance.
|
|
579
557
|
*/
|
|
580
|
-
static createSession(opt_config, opt_executor) {
|
|
558
|
+
static createSession (opt_config, opt_executor) {
|
|
581
559
|
let caps =
|
|
582
560
|
opt_config instanceof Capabilities ? opt_config : new Options(opt_config)
|
|
583
561
|
|
|
@@ -626,14 +604,14 @@ class Driver extends webdriver.WebDriver {
|
|
|
626
604
|
* implementation.
|
|
627
605
|
* @override
|
|
628
606
|
*/
|
|
629
|
-
setFileDetector() {}
|
|
607
|
+
setFileDetector () {}
|
|
630
608
|
|
|
631
609
|
/**
|
|
632
610
|
* Get the context that is currently in effect.
|
|
633
611
|
*
|
|
634
612
|
* @return {!Promise<Context>} Current context.
|
|
635
613
|
*/
|
|
636
|
-
getContext() {
|
|
614
|
+
getContext () {
|
|
637
615
|
return this.execute(new command.Command(ExtensionCommand.GET_CONTEXT))
|
|
638
616
|
}
|
|
639
617
|
|
|
@@ -651,7 +629,7 @@ class Driver extends webdriver.WebDriver {
|
|
|
651
629
|
*
|
|
652
630
|
* @param {!Promise<void>} ctx The context to switch to.
|
|
653
631
|
*/
|
|
654
|
-
setContext(ctx) {
|
|
632
|
+
setContext (ctx) {
|
|
655
633
|
return this.execute(
|
|
656
634
|
new command.Command(ExtensionCommand.SET_CONTEXT).setParameter(
|
|
657
635
|
'context',
|
|
@@ -674,7 +652,7 @@ class Driver extends webdriver.WebDriver {
|
|
|
674
652
|
* newly installed addon.
|
|
675
653
|
* @see #uninstallAddon
|
|
676
654
|
*/
|
|
677
|
-
async installAddon(path, temporary = false) {
|
|
655
|
+
async installAddon (path, temporary = false) {
|
|
678
656
|
let stats = fs.statSync(path)
|
|
679
657
|
let buf
|
|
680
658
|
if (stats.isDirectory()) {
|
|
@@ -699,7 +677,7 @@ class Driver extends webdriver.WebDriver {
|
|
|
699
677
|
* completed.
|
|
700
678
|
* @see #installAddon
|
|
701
679
|
*/
|
|
702
|
-
async uninstallAddon(id) {
|
|
680
|
+
async uninstallAddon (id) {
|
|
703
681
|
id = await Promise.resolve(id)
|
|
704
682
|
return this.execute(
|
|
705
683
|
new command.Command(ExtensionCommand.UNINSTALL_ADDON).setParameter(
|
|
@@ -714,7 +692,9 @@ class Driver extends webdriver.WebDriver {
|
|
|
714
692
|
* Provides methods for locating the executable for a Firefox release channel
|
|
715
693
|
* on Windows and MacOS. For other systems (i.e. Linux), Firefox will always
|
|
716
694
|
* be located on the system PATH.
|
|
717
|
-
*
|
|
695
|
+
* @deprecated Instead of using this class, you should configure the
|
|
696
|
+
* {@link Options} with the appropriate binary location or let Selenium
|
|
697
|
+
* Manager handle it for you.
|
|
718
698
|
* @final
|
|
719
699
|
*/
|
|
720
700
|
class Channel {
|
|
@@ -722,7 +702,7 @@ class Channel {
|
|
|
722
702
|
* @param {string} darwin The path to check when running on MacOS.
|
|
723
703
|
* @param {string} win32 The path to check when running on Windows.
|
|
724
704
|
*/
|
|
725
|
-
constructor(darwin, win32) {
|
|
705
|
+
constructor (darwin, win32) {
|
|
726
706
|
/** @private @const */ this.darwin_ = darwin
|
|
727
707
|
/** @private @const */ this.win32_ = win32
|
|
728
708
|
/** @private {Promise<string>} */
|
|
@@ -738,7 +718,7 @@ class Channel {
|
|
|
738
718
|
* @return {!Promise<string>} A promise for the location of the located
|
|
739
719
|
* Firefox executable.
|
|
740
720
|
*/
|
|
741
|
-
locate() {
|
|
721
|
+
locate () {
|
|
742
722
|
if (this.found_) {
|
|
743
723
|
return this.found_
|
|
744
724
|
}
|
|
@@ -773,7 +753,7 @@ class Channel {
|
|
|
773
753
|
}
|
|
774
754
|
|
|
775
755
|
/** @return {!Promise<string>} */
|
|
776
|
-
[Symbols.serialize]() {
|
|
756
|
+
[Symbols.serialize] () {
|
|
777
757
|
return this.locate()
|
|
778
758
|
}
|
|
779
759
|
}
|
|
@@ -781,10 +761,10 @@ class Channel {
|
|
|
781
761
|
/**
|
|
782
762
|
* Firefox's developer channel.
|
|
783
763
|
* @const
|
|
784
|
-
* @see <https://www.mozilla.org/en-US/firefox/channel/desktop/#
|
|
764
|
+
* @see <https://www.mozilla.org/en-US/firefox/channel/desktop/#developer>
|
|
785
765
|
*/
|
|
786
|
-
Channel.
|
|
787
|
-
'/Applications/
|
|
766
|
+
Channel.DEV = new Channel(
|
|
767
|
+
'/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox',
|
|
788
768
|
'Firefox Developer Edition\\firefox.exe'
|
|
789
769
|
)
|
|
790
770
|
|
|
@@ -796,7 +776,7 @@ Channel.AURORA = new Channel(
|
|
|
796
776
|
* @see <https://www.mozilla.org/en-US/firefox/channel/desktop/#beta>
|
|
797
777
|
*/
|
|
798
778
|
Channel.BETA = new Channel(
|
|
799
|
-
'/Applications/Firefox.app/Contents/MacOS/firefox
|
|
779
|
+
'/Applications/Firefox.app/Contents/MacOS/firefox',
|
|
800
780
|
'Mozilla Firefox\\firefox.exe'
|
|
801
781
|
)
|
|
802
782
|
|
|
@@ -806,7 +786,7 @@ Channel.BETA = new Channel(
|
|
|
806
786
|
* @see <https://www.mozilla.org/en-US/firefox/desktop/>
|
|
807
787
|
*/
|
|
808
788
|
Channel.RELEASE = new Channel(
|
|
809
|
-
'/Applications/Firefox.app/Contents/MacOS/firefox
|
|
789
|
+
'/Applications/Firefox.app/Contents/MacOS/firefox',
|
|
810
790
|
'Mozilla Firefox\\firefox.exe'
|
|
811
791
|
)
|
|
812
792
|
|
|
@@ -816,7 +796,7 @@ Channel.RELEASE = new Channel(
|
|
|
816
796
|
* @see <https://www.mozilla.org/en-US/firefox/channel/desktop/#nightly>
|
|
817
797
|
*/
|
|
818
798
|
Channel.NIGHTLY = new Channel(
|
|
819
|
-
'/Applications/Firefox Nightly.app/Contents/MacOS/firefox
|
|
799
|
+
'/Applications/Firefox Nightly.app/Contents/MacOS/firefox',
|
|
820
800
|
'Nightly\\firefox.exe'
|
|
821
801
|
)
|
|
822
802
|
|
package/index.js
CHANGED
|
@@ -41,7 +41,7 @@ const webdriver = require('./lib/webdriver')
|
|
|
41
41
|
const select = require('./lib/select')
|
|
42
42
|
const LogInspector = require('./bidi/logInspector')
|
|
43
43
|
const BrowsingContext = require('./bidi/browsingContext')
|
|
44
|
-
const
|
|
44
|
+
const BrowsingContextInspector = require('./bidi/browsingContextInspector')
|
|
45
45
|
const ScriptManager = require('./bidi/scriptManager')
|
|
46
46
|
const NetworkInspector = require('./bidi/networkInspector')
|
|
47
47
|
|
|
@@ -720,7 +720,7 @@ class Builder {
|
|
|
720
720
|
/**
|
|
721
721
|
* In the 3.x releases, the various browser option classes
|
|
722
722
|
* (e.g. firefox.Options) had to be manually set as an option using the
|
|
723
|
-
*
|
|
723
|
+
* Capabilities class:
|
|
724
724
|
*
|
|
725
725
|
* let ffo = new firefox.Options();
|
|
726
726
|
* // Configure firefox options...
|
|
@@ -802,6 +802,6 @@ exports.until = until
|
|
|
802
802
|
exports.Select = select.Select
|
|
803
803
|
exports.LogInspector = LogInspector
|
|
804
804
|
exports.BrowsingContext = BrowsingContext
|
|
805
|
-
exports.
|
|
805
|
+
exports.BrowsingContextInspector = BrowsingContextInspector
|
|
806
806
|
exports.ScriptManager = ScriptManager
|
|
807
807
|
exports.NetworkInspector = NetworkInspector
|
|
@@ -98,7 +98,8 @@ Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255
|
|
|
98
98
|
function $c(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&ea(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(a=Zc(a))?$c(a,b):null}
|
|
99
99
|
function ad(a,b,c){function d(g){var h=W(g);return 0<h.height&&0<h.width?!0:S(g,"PATH")&&(0<h.height||0<h.width)?(g=V(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=V(g,"overflow")&&sa(g.childNodes,function(n){return 3==n.nodeType||S(n)&&d(n)})}function e(g){return bd(g)==X&&ta(g.childNodes,function(h){return!S(h)||e(h)||!d(h)})}if(!S(a))throw Error("Argument to isShown must be of type Element");if(S(a,"BODY"))return!0;if(S(a,"OPTION")||S(a,"OPTGROUP"))return a=lb(a,function(g){return S(g,"SELECT")}),
|
|
100
100
|
!!a&&ad(a,!0,c);var f=cd(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&ad(f.image,b,c);if(S(a,"INPUT")&&"hidden"==a.type.toLowerCase()||S(a,"NOSCRIPT"))return!1;f=V(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=dd(a))&&d(a)?!e(a):!1}
|
|
101
|
-
function ed(a){function b(c){if(S(c)&&"none"==V(c,"display"))return!1;var d;if((d=c.parentNode)&&d.shadowRoot&&void 0!==c.assignedSlot)d=c.assignedSlot?c.assignedSlot.parentNode:null;else if(c.getDestinationInsertionPoints){var e=c.getDestinationInsertionPoints();0<e.length&&(d=e[e.length-1])}if(Yc&&d instanceof ShadowRoot){if(d.host.shadowRoot!==d)return!1;d=d.host}return!d||9!=d.nodeType&&11!=d.nodeType?d&&S(d,"DETAILS")&&!d.open&&!S(c,"SUMMARY")?!1:!!d&&b(d):!0}return ad(a,!1,
|
|
101
|
+
function ed(a){function b(c){if(S(c)&&"none"==V(c,"display"))return!1;var d;if((d=c.parentNode)&&d.shadowRoot&&void 0!==c.assignedSlot)d=c.assignedSlot?c.assignedSlot.parentNode:null;else if(c.getDestinationInsertionPoints){var e=c.getDestinationInsertionPoints();0<e.length&&(d=e[e.length-1])}if(Yc&&d instanceof ShadowRoot){if(d.host.shadowRoot&&d.host.shadowRoot!==d)return!1;d=d.host}return!d||9!=d.nodeType&&11!=d.nodeType?d&&S(d,"DETAILS")&&!d.open&&!S(c,"SUMMARY")?!1:!!d&&b(d):!0}return ad(a,!1,
|
|
102
|
+
b)}var X="hidden";
|
|
102
103
|
function bd(a){function b(m){function v(Ab){if(Ab==g)return!0;var pc=V(Ab,"display");return 0==pc.lastIndexOf("inline",0)||"contents"==pc||"absolute"==qc&&"static"==V(Ab,"position")?!1:!0}var qc=V(m,"position");if("fixed"==qc)return u=!0,m==g?null:g;for(m=Zc(m);m&&!v(m);)m=Zc(m);return m}function c(m){var v=m;if("visible"==n)if(m==g&&h)v=h;else if(m==h)return{x:"visible",y:"visible"};v={x:V(v,"overflow-x"),y:V(v,"overflow-y")};m==g&&(v.x="visible"==v.x?"auto":v.x,v.y="visible"==v.y?"auto":v.y);return v}
|
|
103
104
|
function d(m){if(m==g){var v=(new fb(f)).a;m=v.scrollingElement?v.scrollingElement:Oa||"CSS1Compat"!=v.compatMode?v.body||v.documentElement:v.documentElement;v=v.parentWindow||v.defaultView;m=t&&Ua("10")&&v.pageYOffset!=m.scrollTop?new cb(m.scrollLeft,m.scrollTop):new cb(v.pageXOffset||m.scrollLeft,v.pageYOffset||m.scrollTop)}else m=new cb(m.scrollLeft,m.scrollTop);return m}var e=fd(a),f=A(a),g=f.documentElement,h=f.body,n=V(g,"overflow"),u;for(a=b(a);a;a=b(a)){var p=c(a);if("visible"!=p.x||"visible"!=
|
|
104
105
|
p.y){var G=W(a);if(0==G.width||0==G.height)return X;var R=e.a<G.a,fa=e.b<G.b;if(R&&"hidden"==p.x||fa&&"hidden"==p.y)return X;if(R&&"visible"!=p.x||fa&&"visible"!=p.y){R=d(a);fa=e.b<G.b-R.y;if(e.a<G.a-R.x&&"visible"!=p.x||fa&&"visible"!=p.x)return X;e=bd(a);return e==X?X:"scroll"}R=e.f>=G.a+G.width;G=e.c>=G.b+G.height;if(R&&"hidden"==p.x||G&&"hidden"==p.y)return X;if(R&&"visible"!=p.x||G&&"visible"!=p.y){if(u&&(p=d(a),e.f>=g.scrollWidth-p.x||e.a>=g.scrollHeight-p.y))return X;e=bd(a);return e==X?X:
|
|
@@ -111,7 +112,7 @@ function ld(a,b,c){if(S(a,"BR"))b.push("");else{var d=S(a,"TD"),e=V(a,"display")
|
|
|
111
112
|
za(a)||(b[b.length-1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function kd(a,b){ld(a,b,function(c,d,e,f,g){3==c.nodeType&&e?nd(c,d,f,g):S(c)&&kd(c,d)})}var md="inline inline-block inline-table none table-cell table-column table-column-group".split(" ");
|
|
112
113
|
function nd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(t?/(^|\s|\b)(\S)/g:/(^|[^\d\p{L}\p{S}])([\p{Ll}|\p{S}])/gu,function(e,f,g){return f+g.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";za(c)&&0==a.lastIndexOf(" ",
|
|
113
114
|
0)&&(a=a.substr(1));b.push(c+a)}function dd(a){if(Mc){if("relative"==V(a,"position"))return 1;a=V(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return od(a)}function od(a){var b=1,c=V(a,"opacity");c&&(b=Number(c));(a=Zc(a))&&(b*=od(a));return b}
|
|
114
|
-
function pd(a,b,c,d,e){if(3==a.nodeType&&c)nd(a,b,d,e);else if(S(a))if(S(a,"CONTENT")||S(a,"SLOT")){for(var f=a;f.parentNode;)f=f.parentNode;f instanceof ShadowRoot?(
|
|
115
|
+
function pd(a,b,c,d,e){if(3==a.nodeType&&c)nd(a,b,d,e);else if(S(a))if(S(a,"CONTENT")||S(a,"SLOT")){for(var f=a;f.parentNode;)f=f.parentNode;f instanceof ShadowRoot?(f=S(a,"CONTENT")?a.getDistributedNodes():a.assignedNodes(),l(0<f.length?f:a.childNodes,function(g){pd(g,b,c,d,e)})):jd(a,b)}else if(S(a,"SHADOW")){for(f=a;f.parentNode;)f=f.parentNode;if(f instanceof ShadowRoot&&(a=f))for(a=a.olderShadowRoot;a;)l(a.childNodes,function(g){pd(g,b,c,d,e)}),a=a.olderShadowRoot}else jd(a,b)}
|
|
115
116
|
function jd(a,b){a.shadowRoot&&l(a.shadowRoot.childNodes,function(c){pd(c,b,!0,null,null)});ld(a,b,function(c,d,e,f,g){var h=null;1==c.nodeType?h=c:3==c.nodeType&&(h=c);null!=h&&(null!=h.assignedSlot||h.getDestinationInsertionPoints&&0<h.getDestinationInsertionPoints().length)||pd(c,d,e,f,g)})};var qd={C:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},o:function(a,b){var c=eb(b),d="string"===typeof a?c.a.getElementById(a):a;return d?Uc(d,"id")==a&&b!=d&&hb(b,d)?d:ua(mb(c,"*"),function(e){return Uc(e,"id")==a&&b!=e&&hb(b,e)}):null},j:function(a,b){if(!a)return[];if(qd.C(b,a))try{return b.querySelectorAll("#"+qd.T(a))}catch(c){return[]}b=mb(eb(b),"*",null,b);return pa(b,function(c){return Uc(c,"id")==a})},T:function(a){return a.replace(/([\s'"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g,
|
|
116
117
|
"\\$1")}};var Y={},rd={};Y.N=function(a,b,c){try{var d=Nc.j("a",b)}catch(e){d=mb(eb(b),"A",null,b)}return ua(d,function(e){e=id(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};Y.K=function(a,b,c){try{var d=Nc.j("a",b)}catch(e){d=mb(eb(b),"A",null,b)}return pa(d,function(e){e=id(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};Y.o=function(a,b){return Y.N(a,b,!1)};Y.j=function(a,b){return Y.K(a,b,!1)};rd.o=function(a,b){return Y.N(a,b,!0)};
|
|
117
118
|
rd.j=function(a,b){return Y.K(a,b,!0)};var Z={F:function(a,b){return function(c){var d=Z.u(a);d=W(d);c=W(c);return b.call(null,d,c)}},R:function(a){return Z.F(a,function(b,c){return c.b+c.height<b.b})},S:function(a){return Z.F(a,function(b,c){return b.b+b.height<c.b})},V:function(a){return Z.F(a,function(b,c){return c.a+c.width<b.a})},aa:function(a){return Z.F(a,function(b,c){return b.a+b.width<c.a})},W:function(a,b){var c;b?c=b:"number"==typeof a.distance&&(c=a.distance);c||(c=50);return function(d){var e=Z.u(a);if(e===d)return!1;e=W(e);
|