selenium-webdriver 4.3.0 → 4.3.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.
- package/CHANGES.md +143 -137
- package/chrome.js +8 -33
- package/chromium.js +3 -1
- package/edge.js +8 -32
- package/lib/input.js +2 -2
- package/package.json +1 -1
package/CHANGES.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## v4.3.1
|
|
2
|
+
|
|
3
|
+
* create new default service for every driver instance in chromium (#10796)
|
|
4
|
+
* Updated jsdoc for move action (#10816)
|
|
5
|
+
|
|
1
6
|
## v4.3.0
|
|
2
7
|
|
|
3
8
|
* Fix: using fulfillRequest when intercepting (#10764)
|
|
@@ -92,7 +97,7 @@
|
|
|
92
97
|
ServiceBuilder, similarly to the other options provided by ChromeDriver.
|
|
93
98
|
|
|
94
99
|
* Add the debuggerAddress option to chromium.js (#9561) [Author: Brandon Walderman]
|
|
95
|
-
* Adds http client options
|
|
100
|
+
* Adds http client options [#9638](Author: Dharin Shah)
|
|
96
101
|
* Updating edge.js to extend chromium.driver (fixes #9626)
|
|
97
102
|
|
|
98
103
|
## v4.0.0-beta.4
|
|
@@ -124,7 +129,7 @@
|
|
|
124
129
|
## v4.0.0-beta.1
|
|
125
130
|
|
|
126
131
|
* JS Binding support for WebDriver Bidi in Firefox
|
|
127
|
-
|
|
132
|
+
* This requires Firefox 87 and Geckodriver 0.29 to be able to work
|
|
128
133
|
* Update the supported CDP versions
|
|
129
134
|
* Update tmp package version (#9155)
|
|
130
135
|
* Adding support for /computedlabel (getAccessibleName) (#9073)
|
|
@@ -138,11 +143,11 @@
|
|
|
138
143
|
|
|
139
144
|
* Rolling back native support for Opera Browser
|
|
140
145
|
* Added new ieOptions capabilities:
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
* fileUploadDialogTimeout
|
|
147
|
+
* setEdgePath
|
|
148
|
+
* setEdgeChromium
|
|
149
|
+
* setScrollBehavior
|
|
150
|
+
* For consistent naming, deprecating `addArguments(...args)` in favor of `addBrowserCommandSwitches(...args)`
|
|
146
151
|
|
|
147
152
|
* Added relative locators
|
|
148
153
|
* Added Chrome DevTools Protocol (CDP) support
|
|
@@ -215,11 +220,11 @@ mode (see `example/headless.js`)
|
|
|
215
220
|
### API Changes
|
|
216
221
|
|
|
217
222
|
* The core WebDriver API no longer uses promise manager
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
* Removed `index.Builder#setControlFlow()`
|
|
224
|
+
* The following thenable types no longer have a `cancel()` method:
|
|
225
|
+
* The dynamically generated thenable WebDrivers created by `index.Builder`
|
|
226
|
+
* `lib/webdriver.AlertPromise`
|
|
227
|
+
* `lib/webdriver.WebElementPromise`
|
|
223
228
|
* Removed `remote/index.DriverService.prototype.stop()` (use `#kill()` instead)
|
|
224
229
|
* Removed the `lib/actions` module
|
|
225
230
|
* Removed the `lib/events` module
|
|
@@ -227,123 +232,123 @@ mode (see `example/headless.js`)
|
|
|
227
232
|
* Removed the 'opera' module
|
|
228
233
|
* Removed the promise manager from `lib/promise`, which includes the removal of the following
|
|
229
234
|
exported names (replacements, if any, in parentheses):
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
235
|
+
* CancellableThenable
|
|
236
|
+
* CancellationError
|
|
237
|
+
* ControlFlow
|
|
238
|
+
* Deferred
|
|
239
|
+
* LONG_STACK_TRACES
|
|
240
|
+
* MultipleUnhandledRejectionError
|
|
241
|
+
* Promise (use native Promises)
|
|
242
|
+
* Resolver
|
|
243
|
+
* Scheduler
|
|
244
|
+
* Thenable
|
|
245
|
+
* USE_PROMISE_MANAGER
|
|
246
|
+
* all (use Promise.all)
|
|
247
|
+
* asap (use Promise.resolve)
|
|
248
|
+
* captureStackTrace (use Error.captureStackTrace)
|
|
249
|
+
* consume (use async functions)
|
|
250
|
+
* controlFlow
|
|
251
|
+
* createPromise (use new Promise)
|
|
252
|
+
* defer
|
|
253
|
+
* fulfilled (use Promise.resolve)
|
|
254
|
+
* isGenerator
|
|
255
|
+
* rejected (use Promise.reject)
|
|
256
|
+
* setDefaultFlow
|
|
257
|
+
* when (use Promise.resolve)
|
|
253
258
|
* Changes to the `Builder` class:
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
* Added setChromeService, setEdgeService, & setFirefoxService
|
|
260
|
+
* Removed setEnableNativeEvents
|
|
261
|
+
* Removed setScrollBehavior
|
|
257
262
|
* Changes to `chrome.Driver`
|
|
258
|
-
|
|
259
|
-
|
|
263
|
+
* Added sendDevToolsCommand
|
|
264
|
+
* Added setDownloadPath
|
|
260
265
|
* Changes to `chrome.Options`
|
|
261
|
-
|
|
262
|
-
|
|
266
|
+
* Now extends the `Capabilities` class
|
|
267
|
+
* Removed from/toCapabilities
|
|
263
268
|
* Changes to `edge.Options`
|
|
264
|
-
|
|
265
|
-
|
|
269
|
+
* Now extends the `Capabilities` class
|
|
270
|
+
* Removed from/toCapabilities
|
|
266
271
|
* Changes to `ie.Options`
|
|
267
|
-
|
|
268
|
-
|
|
272
|
+
* Now extends the `Capabilities` class
|
|
273
|
+
* Removed from/toCapabilities
|
|
269
274
|
* Removed the `firefox.Binary` class. Custom binaries can still be selected using `firefox.Options#setBinary()`. Likewise, custom binary arguments can be specified
|
|
270
275
|
with `firefox.Options#addArguments()`.
|
|
271
276
|
* Changes to `firefox.Driver`
|
|
272
|
-
|
|
273
|
-
|
|
277
|
+
* Added installAddon(path)
|
|
278
|
+
* Added uninstallAddon(id)
|
|
274
279
|
* Changes to `firefox.Options`
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
280
|
+
* Now extends the `Capabilities` class
|
|
281
|
+
* Removed from/toCapabilities
|
|
282
|
+
* Removed setLoggingPreferences (was a no-op)
|
|
283
|
+
* setProfile now only accepts a path to an existing profile
|
|
284
|
+
* Added addExtensions
|
|
285
|
+
* Added setPreference
|
|
281
286
|
* Removed the `firefox.Profile` class. All of its functionality is now provided directly by `firefox.Options`
|
|
282
287
|
* Removed the `firefox/binary` module
|
|
283
288
|
* Removed the `firefox/profile` module
|
|
284
289
|
* Changes to `safari.Options`
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
290
|
+
* Now extends the `Capabilities` class
|
|
291
|
+
* Removed from/toCapabilities
|
|
292
|
+
* Removed setCleanSession (was a no-op)
|
|
288
293
|
* Changes to `lib/capabilities.Browser`:
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
* Removed several enum values.
|
|
295
|
+
* ANDROID (use Chrome for Android; see docs on the chrome module)
|
|
296
|
+
* IPAD (no support available)
|
|
297
|
+
* IPHONE (no support available)
|
|
298
|
+
* OPERA (use Chrome)
|
|
299
|
+
* PHANTOM_JS (use Chrome or Firefox in headless mode)
|
|
300
|
+
* HTMLUNIT (use Chrome or Firefox in headless mode)
|
|
296
301
|
* Changes to `lib/capabilities.Capabilities`:
|
|
297
|
-
|
|
302
|
+
* Removed static factory methods android(), ipad(), iphone(), opera(), phantomjs(), htmlunit(),
|
|
298
303
|
and htmlunitwithjs(). Users can still manually configure capabilities for these, but their use
|
|
299
304
|
is not recommended and they will no longer be surfaced in the API.
|
|
300
305
|
* Changes to `lib/error`:
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
* Added
|
|
307
|
+
* ElementClickInterceptedError
|
|
308
|
+
* InsecureCertificateError
|
|
309
|
+
* InvalidCoordinatesError
|
|
310
|
+
* NoSuchCookieError
|
|
311
|
+
* Removed
|
|
312
|
+
* ElementNotVisibleError
|
|
313
|
+
* InvalidElementCoordinatesError
|
|
309
314
|
* Changes to `lib/webdriver.WebDriver`:
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
+
* Dropped support for "requiredCapabilities" from WebDriver.createSession
|
|
316
|
+
* actions() now returns the new `lib/input.Actions` class
|
|
317
|
+
* Removed touchActions
|
|
318
|
+
* Renamed schedule to execute
|
|
319
|
+
* Removed the `WebDriver.attachToSession()` factory method. Users can just the `WebDriver`
|
|
315
320
|
constructor directly instead.
|
|
316
|
-
|
|
321
|
+
* Removed the `call()` method. This was used to inject custom function calls into the control
|
|
317
322
|
flow. Now that the promise manager is no longer used, this method is no longer necessary. Users are now responsible for coordinating actions (ideally with async functions) and can just
|
|
318
323
|
call functions directly instead of through `driver.call()`.
|
|
319
324
|
* Changes to `lib/webdriver.WebElement`:
|
|
320
|
-
|
|
325
|
+
* Replaced getSize & getLocation with getRect
|
|
321
326
|
* Changes to `lib/webdriver.Alert`:
|
|
322
|
-
|
|
327
|
+
* Removed authenticateAs
|
|
323
328
|
* Changes to `lib/webdriver.Options` (`driver.manage()`):
|
|
324
|
-
|
|
329
|
+
* Removed timeouts (use get/setTimeouts)
|
|
325
330
|
* Changes to `lib/webdriver.Window` (`driver.manage().window()`):
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
331
|
+
* Added
|
|
332
|
+
* getRect
|
|
333
|
+
* setRect
|
|
334
|
+
* fullscreen
|
|
335
|
+
* minimize
|
|
336
|
+
* Removed (use the getRect/setRect methods)
|
|
337
|
+
* getPosition
|
|
338
|
+
* setPosition
|
|
339
|
+
* getSize
|
|
340
|
+
* setSize
|
|
336
341
|
* Removed the `testing/assert` module
|
|
337
342
|
* Changes to `testing/index`
|
|
338
|
-
|
|
343
|
+
* Since the promise manager has been removed, it is no longer necessary to wrap the Mocha test
|
|
339
344
|
hooks; instead, users can simply use async functions. The following have all been removed:
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
* describe
|
|
346
|
+
* before
|
|
347
|
+
* beforeEach
|
|
348
|
+
* after
|
|
349
|
+
* afterEach
|
|
350
|
+
* it
|
|
351
|
+
* Added the `suite` function. For details, refer to the jsdoc or
|
|
347
352
|
`example/google_search_test.js`
|
|
348
353
|
|
|
349
354
|
## v3.6.0
|
|
@@ -360,18 +365,18 @@ mode (see `example/headless.js`)
|
|
|
360
365
|
### API Changes
|
|
361
366
|
|
|
362
367
|
* Added new methods to `selenium-webdriver/firefox.Options`:
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
368
|
+
* addArguments()
|
|
369
|
+
* headless()
|
|
370
|
+
* windowSize()
|
|
366
371
|
* Deprecated `selenium-webdriver/firefox/binary.Binary`
|
|
367
372
|
* Removed `selenium-webdriver/firefox.Options#useGeckoDriver()`
|
|
368
373
|
* Removed the unused `selenium-webdriver/firefox/profile.decode()`
|
|
369
374
|
* Removed methods from `selenium-webdriver/firefox/profile.Profile` that had no effect since support
|
|
370
375
|
for the legacy FirefoxDriver was dropped in 3.5.0:
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
376
|
+
* setNativeEventsEnabled
|
|
377
|
+
* nativeEventsEnabled
|
|
378
|
+
* getPort
|
|
379
|
+
* setPort
|
|
375
380
|
* Removed `selenium-webdriver/firefox.ServiceBuilder#setFirefoxBinary()`; custom binaries should be
|
|
376
381
|
configured through the `firefox.Options` class.
|
|
377
382
|
* Removed `selenium-webdriver/firefox.Capability`. These hold overs from the legacy FirefoxDriver
|
|
@@ -393,9 +398,9 @@ to a remote Selenium server that supports Firefox 45.
|
|
|
393
398
|
### Changes
|
|
394
399
|
|
|
395
400
|
* Removed native support for Firefox 46 and older.
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
401
|
+
* The `SELENIUM_MARIONETTE` enviornment variable no longer has an effect.
|
|
402
|
+
* `selenium-webdriver/firefox.Capability.MARIONETTE` is deprecated.
|
|
403
|
+
* `selenium-webdriver/firefox.Options#useGeckoDriver()` is deprecated and now a no-op.
|
|
399
404
|
* `firefox.Options` will no longer discard the `"moz:firefoxOptions"` set in user provided
|
|
400
405
|
capabilities (via `Builder.withCapabilities({})`). When both are used, the settings in `firefox.Options` will be applied _last_.
|
|
401
406
|
* Added `chrome.Options#headless()` and `chrome.Options#windowSize()`, which may be used to start
|
|
@@ -440,6 +445,7 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
440
445
|
logging.installConsoleHandler();
|
|
441
446
|
logging.getLogger('promise.ControlFlow').setLevel(logging.Level.WARNING);
|
|
442
447
|
```
|
|
448
|
+
|
|
443
449
|
* If the `JAVA_HOME` environment variable is set, use it to locate java.exe.
|
|
444
450
|
|
|
445
451
|
## v3.2.0
|
|
@@ -466,8 +472,8 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
466
472
|
## v3.0.1
|
|
467
473
|
|
|
468
474
|
* More API adjustments to align with native Promises
|
|
469
|
-
|
|
470
|
-
|
|
475
|
+
* Deprecated `promise.fulfilled(value)`, use `promise.Promise#resolve(value)`
|
|
476
|
+
* Deprecated `promise.rejected(reason)`, use `promise.Promise#reject(reason)`
|
|
471
477
|
* When a `wait()` condition times out, the returned promise will now be rejected with an `error.TimeoutError` instead of a generic `Error` object.
|
|
472
478
|
* `WebDriver#wait()` will now throw a TypeError if an invalid wait condition is provided.
|
|
473
479
|
* Properly catch unhandled promise rejections with an action sequence (only impacts when the promise
|
|
@@ -502,9 +508,9 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
502
508
|
|
|
503
509
|
* Removed `safari.Options#useLegacyDriver()`
|
|
504
510
|
* Reduced the API on `promise.Thenable` for compatibility with native promises:
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
511
|
+
* Removed `#isPending()`
|
|
512
|
+
* Removed `#cancel()`
|
|
513
|
+
* Removed `#finally()`
|
|
508
514
|
* Changed all subclasses of `webdriver.WebDriver` to overload the static function `WebDriver.createSession()` instead of doing work in the constructor. All constructors
|
|
509
515
|
now inherit the base class' function signature. Users are still encouraged to use the `Builder`
|
|
510
516
|
class instead of creating drivers directly.
|
|
@@ -583,32 +589,32 @@ This release requires [geckodriver 0.15.0](https://github.com/mozilla/geckodrive
|
|
|
583
589
|
_seconds_ since epoch. When retrieving cookies, the expiration is always returned in seconds.
|
|
584
590
|
* Renamed `firefox.Options#useMarionette` to `firefox.Options#useGeckoDriver`
|
|
585
591
|
* Removed deprecated modules:
|
|
586
|
-
|
|
592
|
+
* `selenium-webdriver/error` (use `selenium-webdriver/lib/error`,\
|
|
587
593
|
or the `error` property exported by `selenium-webdriver`)
|
|
588
|
-
|
|
594
|
+
* `selenium-webdriver/executors` — this was not previously deprecated, but is no longer used.
|
|
589
595
|
* Removed deprecated types:
|
|
590
|
-
|
|
596
|
+
* `command.DeferredExecutor` — this was not previously deprecated, but is no longer used. It can
|
|
591
597
|
be trivially implemented by clients should it be needed.
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
598
|
+
* `error.InvalidSessionIdError` (use `error.NoSuchSessionError`)
|
|
599
|
+
* `executors.DeferredExecutor`
|
|
600
|
+
* `until.Condition` (use `webdriver.Condition`)
|
|
601
|
+
* `until.WebElementCondition` (use `webdriver.WebElementCondition`)
|
|
602
|
+
* `webdriver.UnhandledAlertError` (use `error.UnexpectedAlertOpenError`)
|
|
597
603
|
* Removed deprecated functions:
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
604
|
+
* `Deferred#cancel()`
|
|
605
|
+
* `Deferred#catch()`
|
|
606
|
+
* `Deferred#finally()`
|
|
607
|
+
* `Deferred#isPending()`
|
|
608
|
+
* `Deferred#then()`
|
|
609
|
+
* `Promise#thenCatch()`
|
|
610
|
+
* `Promise#thenFinally()`
|
|
611
|
+
* `WebDriver#isElementPresent()`
|
|
612
|
+
* `WebElement#getInnerHtml()`
|
|
613
|
+
* `WebElement#getOuterHtml()`
|
|
614
|
+
* `WebElement#getRawId()`
|
|
615
|
+
* `WebElement#isElementPresent()`
|
|
610
616
|
* Removed deprecated properties:
|
|
611
|
-
|
|
617
|
+
* `WebDriverError#code`
|
|
612
618
|
|
|
613
619
|
## v2.53.2
|
|
614
620
|
|
|
@@ -849,7 +855,7 @@ major version release (i.e. 1.0.0).
|
|
|
849
855
|
The `promise.ControlFlow` class has been updated to track the asynchronous breaks required by
|
|
850
856
|
Promises/A+, so there are no changes to task execution order.
|
|
851
857
|
* Updated how errors are annotated on failures. When a task fails, the stacktrace from when that
|
|
852
|
-
task was scheduled is appended to the rejection reason with a `From
|
|
858
|
+
task was scheduled is appended to the rejection reason with a `From:` prefix (if it is an Error
|
|
853
859
|
object). For example:
|
|
854
860
|
|
|
855
861
|
var driver = new webdriver.Builder().forBrowser('chrome').build();
|
package/chrome.js
CHANGED
|
@@ -140,7 +140,6 @@ const CHROMEDRIVER_EXE =
|
|
|
140
140
|
process.platform === 'win32' ? 'chromedriver.exe' : 'chromedriver'
|
|
141
141
|
|
|
142
142
|
/** @type {remote.DriverService} */
|
|
143
|
-
let defaultService = null
|
|
144
143
|
|
|
145
144
|
/**
|
|
146
145
|
* Creates {@link selenium-webdriver/remote.DriverService} instances that manage
|
|
@@ -240,6 +239,14 @@ class Driver extends chromium.Driver {
|
|
|
240
239
|
super.createSession(caps, opt_serviceExecutor)
|
|
241
240
|
)
|
|
242
241
|
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* returns new instance chrome driver service
|
|
245
|
+
* @returns {remote.DriverService}
|
|
246
|
+
*/
|
|
247
|
+
static getDefaultService() {
|
|
248
|
+
return new ServiceBuilder().build()
|
|
249
|
+
}
|
|
243
250
|
}
|
|
244
251
|
|
|
245
252
|
/**
|
|
@@ -252,46 +259,14 @@ function locateSynchronously() {
|
|
|
252
259
|
return io.findInPath(CHROMEDRIVER_EXE, true)
|
|
253
260
|
}
|
|
254
261
|
|
|
255
|
-
/**
|
|
256
|
-
* Sets the default service to use for new ChromeDriver instances.
|
|
257
|
-
* @param {!remote.DriverService} service The service to use.
|
|
258
|
-
* @throws {Error} If the default service is currently running.
|
|
259
|
-
*/
|
|
260
|
-
function setDefaultService(service) {
|
|
261
|
-
if (defaultService && defaultService.isRunning()) {
|
|
262
|
-
throw Error(
|
|
263
|
-
`The previously configured ChromeDriver service is still running. ` +
|
|
264
|
-
`You must shut it down before you may adjust its configuration.`
|
|
265
|
-
)
|
|
266
|
-
}
|
|
267
|
-
defaultService = service
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Returns the default ChromeDriver service. If such a service has not been
|
|
272
|
-
* configured, one will be constructed using the default configuration for
|
|
273
|
-
* a ChromeDriver executable found on the system PATH.
|
|
274
|
-
* @return {!remote.DriverService} The default ChromeDriver service.
|
|
275
|
-
*/
|
|
276
|
-
function getDefaultService() {
|
|
277
|
-
if (!defaultService) {
|
|
278
|
-
defaultService = new ServiceBuilder().build()
|
|
279
|
-
}
|
|
280
|
-
return defaultService
|
|
281
|
-
}
|
|
282
|
-
|
|
283
262
|
Options.prototype.CAPABILITY_KEY = 'goog:chromeOptions'
|
|
284
263
|
Options.prototype.BROWSER_NAME_VALUE = Browser.CHROME
|
|
285
|
-
Driver.getDefaultService = getDefaultService
|
|
286
264
|
Driver.prototype.VENDOR_COMMAND_PREFIX = 'goog'
|
|
287
265
|
|
|
288
266
|
// PUBLIC API
|
|
289
|
-
|
|
290
267
|
module.exports = {
|
|
291
268
|
Driver: Driver,
|
|
292
269
|
Options,
|
|
293
270
|
ServiceBuilder,
|
|
294
|
-
getDefaultService,
|
|
295
|
-
setDefaultService,
|
|
296
271
|
locateSynchronously,
|
|
297
272
|
}
|
package/chromium.js
CHANGED
|
@@ -661,11 +661,13 @@ class Driver extends webdriver.WebDriver {
|
|
|
661
661
|
*/
|
|
662
662
|
static createSession(caps, opt_serviceExecutor) {
|
|
663
663
|
let executor
|
|
664
|
+
let onQuit
|
|
664
665
|
if (opt_serviceExecutor instanceof http.Executor) {
|
|
665
666
|
executor = opt_serviceExecutor
|
|
666
667
|
configureExecutor(executor, this.VENDOR_COMMAND_PREFIX)
|
|
667
668
|
} else {
|
|
668
669
|
let service = opt_serviceExecutor || this.getDefaultService()
|
|
670
|
+
onQuit = () => service.kill()
|
|
669
671
|
executor = createExecutor(service.start(), this.VENDOR_COMMAND_PREFIX)
|
|
670
672
|
}
|
|
671
673
|
|
|
@@ -679,7 +681,7 @@ class Driver extends webdriver.WebDriver {
|
|
|
679
681
|
}
|
|
680
682
|
}
|
|
681
683
|
|
|
682
|
-
return /** @type {!Driver} */ (super.createSession(executor, caps))
|
|
684
|
+
return /** @type {!Driver} */ (super.createSession(executor, caps, onQuit))
|
|
683
685
|
}
|
|
684
686
|
|
|
685
687
|
/**
|
package/edge.js
CHANGED
|
@@ -90,7 +90,6 @@ const EDGEDRIVER_CHROMIUM_EXE =
|
|
|
90
90
|
process.platform === 'win32' ? 'msedgedriver.exe' : 'msedgedriver'
|
|
91
91
|
|
|
92
92
|
/** @type {remote.DriverService} */
|
|
93
|
-
let defaultService = null
|
|
94
93
|
|
|
95
94
|
/**
|
|
96
95
|
* Creates {@link selenium-webdriver/remote.DriverService} instances that manage
|
|
@@ -157,6 +156,14 @@ class Driver extends chromium.Driver {
|
|
|
157
156
|
)
|
|
158
157
|
}
|
|
159
158
|
|
|
159
|
+
/**
|
|
160
|
+
* returns new instance of edge driver service
|
|
161
|
+
* @returns {remote.DriverService}
|
|
162
|
+
*/
|
|
163
|
+
static getDefaultService() {
|
|
164
|
+
return new ServiceBuilder().build()
|
|
165
|
+
}
|
|
166
|
+
|
|
160
167
|
/**
|
|
161
168
|
* This function is a no-op as file detectors are not supported by this
|
|
162
169
|
* implementation.
|
|
@@ -165,34 +172,6 @@ class Driver extends chromium.Driver {
|
|
|
165
172
|
setFileDetector() {}
|
|
166
173
|
}
|
|
167
174
|
|
|
168
|
-
/**
|
|
169
|
-
* Sets the default service to use for new Edge instances.
|
|
170
|
-
* @param {!remote.DriverService} service The service to use.
|
|
171
|
-
* @throws {Error} If the default service is currently running.
|
|
172
|
-
*/
|
|
173
|
-
function setDefaultService(service) {
|
|
174
|
-
if (defaultService && defaultService.isRunning()) {
|
|
175
|
-
throw Error(
|
|
176
|
-
'The previously configured EdgeDriver service is still running. ' +
|
|
177
|
-
'You must shut it down before you may adjust its configuration.'
|
|
178
|
-
)
|
|
179
|
-
}
|
|
180
|
-
defaultService = service
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/**
|
|
184
|
-
* Returns the default Microsoft Edge driver service. If such a service has
|
|
185
|
-
* not been configured, one will be constructed using the default configuration
|
|
186
|
-
* for a MicrosoftWebDriver executable found on the system PATH.
|
|
187
|
-
* @return {!remote.DriverService} The default Microsoft Edge driver service.
|
|
188
|
-
*/
|
|
189
|
-
function getDefaultService() {
|
|
190
|
-
if (!defaultService) {
|
|
191
|
-
defaultService = new ServiceBuilder().build()
|
|
192
|
-
}
|
|
193
|
-
return defaultService
|
|
194
|
-
}
|
|
195
|
-
|
|
196
175
|
/**
|
|
197
176
|
* _Synchronously_ attempts to locate the chromedriver executable on the current
|
|
198
177
|
* system.
|
|
@@ -206,7 +185,6 @@ function locateSynchronously() {
|
|
|
206
185
|
Options.prototype.BROWSER_NAME_VALUE = Browser.EDGE
|
|
207
186
|
Options.prototype.CAPABILITY_KEY = 'ms:edgeOptions'
|
|
208
187
|
Driver.prototype.VENDOR_CAPABILITY_PREFIX = 'ms'
|
|
209
|
-
Driver.getDefaultService = getDefaultService
|
|
210
188
|
|
|
211
189
|
// PUBLIC API
|
|
212
190
|
|
|
@@ -214,7 +192,5 @@ module.exports = {
|
|
|
214
192
|
Driver,
|
|
215
193
|
Options,
|
|
216
194
|
ServiceBuilder,
|
|
217
|
-
getDefaultService,
|
|
218
|
-
setDefaultService,
|
|
219
195
|
locateSynchronously,
|
|
220
196
|
}
|
package/lib/input.js
CHANGED
|
@@ -857,9 +857,9 @@ class Actions {
|
|
|
857
857
|
/**
|
|
858
858
|
* Inserts an action for moving the mouse `x` and `y` pixels relative to the
|
|
859
859
|
* specified `origin`. The `origin` may be defined as the mouse's
|
|
860
|
-
* {@linkplain ./input.Origin.POINTER current position}, the
|
|
860
|
+
* {@linkplain ./input.Origin.POINTER current position}, the top-left corner of the
|
|
861
861
|
* {@linkplain ./input.Origin.VIEWPORT viewport}, or the center of a specific
|
|
862
|
-
* {@linkplain ./webdriver.WebElement WebElement}.
|
|
862
|
+
* {@linkplain ./webdriver.WebElement WebElement}. Default is top left corner of the view-port if origin is not specified
|
|
863
863
|
*
|
|
864
864
|
* You may adjust how long the remote end should take, in milliseconds, to
|
|
865
865
|
* perform the move using the `duration` parameter (defaults to 100 ms).
|