selenium-webdriver 4.1.0 → 4.1.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/remote/index.js CHANGED
@@ -33,12 +33,12 @@ const portprober = require('../net/portprober')
33
33
  /**
34
34
  * @typedef {(string|!Array<string|number|!stream.Stream|null|undefined>)}
35
35
  */
36
- var StdIoOptions // eslint-disable-line
36
+ let StdIoOptions // eslint-disable-line
37
37
 
38
38
  /**
39
39
  * @typedef {(string|!IThenable<string>)}
40
40
  */
41
- var CommandLineFlag // eslint-disable-line
41
+ let CommandLineFlag // eslint-disable-line
42
42
 
43
43
  /**
44
44
  * A record object that defines the configuration options for a DriverService
@@ -196,8 +196,8 @@ class DriverService {
196
196
  return this.address_
197
197
  }
198
198
 
199
- var timeout = opt_timeoutMs || DriverService.DEFAULT_START_TIMEOUT_MS
200
- var self = this
199
+ const timeout = opt_timeoutMs || DriverService.DEFAULT_START_TIMEOUT_MS
200
+ const self = this
201
201
 
202
202
  let resolveCommand
203
203
  this.command_ = new Promise((resolve) => (resolveCommand = resolve))
@@ -567,7 +567,7 @@ SeleniumServer.Options = class {
567
567
  * When a file path on the local machine running this script is entered with
568
568
  * {@link webdriver.WebElement#sendKeys WebElement#sendKeys}, this file detector
569
569
  * will transfer the specified file to the Selenium server's host; the sendKeys
570
- * command will be updated to use the transfered file's path.
570
+ * command will be updated to use the transferred file's path.
571
571
  *
572
572
  * __Note:__ This class depends on a non-standard command supported on the
573
573
  * Java Selenium server. The file detector will fail if used with a server that
@@ -618,7 +618,10 @@ class FileDetector extends input.FileDetector {
618
618
 
619
619
  // PUBLIC API
620
620
 
621
- exports.DriverService = DriverService
622
- exports.FileDetector = FileDetector
623
- exports.SeleniumServer = SeleniumServer
624
- exports.ServiceOptions = ServiceOptions // Exported for API docs.
621
+ module.exports = {
622
+ DriverService,
623
+ FileDetector,
624
+ SeleniumServer,
625
+ // Exported for API docs.
626
+ ServiceOptions,
627
+ }
package/safari.js CHANGED
@@ -154,9 +154,9 @@ class Driver extends webdriver.WebDriver {
154
154
  service.start().then((url) => new http.HttpClient(url))
155
155
  )
156
156
 
157
- return /** @type {!Driver} */ (super.createSession(executor, caps, () =>
158
- service.kill()
159
- ))
157
+ return /** @type {!Driver} */ (
158
+ super.createSession(executor, caps, () => service.kill())
159
+ )
160
160
  }
161
161
  }
162
162
 
package/testing/index.js CHANGED
@@ -89,7 +89,7 @@ function warn(msg) {
89
89
  * Extracts the browsers for a test suite to target from the `SELENIUM_BROWSER`
90
90
  * environment variable.
91
91
  *
92
- * @return {!Array<!TargetBrowser>} the browsers to target.
92
+ * @return {{name: string, version: string, platform: string}[]} the browsers to target.
93
93
  */
94
94
  function getBrowsersToTestFromEnv() {
95
95
  let browsers = process.env['SELENIUM_BROWSER']
@@ -272,7 +272,7 @@ class Environment {
272
272
  * @return {function(): boolean} a new predicate function.
273
273
  */
274
274
  browsers(...browsersToIgnore) {
275
- return () => browsersToIgnore.indexOf(this.browser.name) != -1
275
+ return () => browsersToIgnore.indexOf(this.browser.name) !== -1
276
276
  }
277
277
 
278
278
  /**
@@ -286,12 +286,19 @@ class Environment {
286
286
  const builder = new Builder()
287
287
  builder.disableEnvironmentOverrides()
288
288
 
289
+
290
+
289
291
  const realBuild = builder.build
290
292
  builder.build = function () {
291
- builder.withCapabilities(Capabilities[browser.name].apply(Capabilities))
293
+ builder.forBrowser(browser.name, browser.version, browser.platform);
294
+
292
295
 
293
296
  if (browser.capabilities) {
294
- builder.getCapabilities().merge(browser.capabilities)
297
+ builder.getCapabilities().merge(browser.capabilities);
298
+ }
299
+
300
+ if(browser.name === 'firefox') {
301
+ builder.setCapability('moz:debuggerAddress', true);
295
302
  }
296
303
 
297
304
  if (typeof urlOrServer === 'string') {