selenium-webdriver
Advanced tools
Comparing version 4.3.0 to 4.3.1
280
CHANGES.md
@@ -0,1 +1,6 @@ | ||
## v4.3.1 | ||
* create new default service for every driver instance in chromium (#10796) | ||
* Updated jsdoc for move action (#10816) | ||
## v4.3.0 | ||
@@ -95,3 +100,3 @@ | ||
* Add the debuggerAddress option to chromium.js (#9561) [Author: Brandon Walderman] | ||
* Adds http client options (#9638)[Author: Dharin Shah] | ||
* Adds http client options [#9638](Author: Dharin Shah) | ||
* Updating edge.js to extend chromium.driver (fixes #9626) | ||
@@ -128,3 +133,3 @@ | ||
* JS Binding support for WebDriver Bidi in Firefox | ||
- This requires Firefox 87 and Geckodriver 0.29 to be able to work | ||
* This requires Firefox 87 and Geckodriver 0.29 to be able to work | ||
* Update the supported CDP versions | ||
@@ -143,7 +148,7 @@ * Update tmp package version (#9155) | ||
* Added new ieOptions capabilities: | ||
- fileUploadDialogTimeout | ||
- setEdgePath | ||
- setEdgeChromium | ||
- setScrollBehavior | ||
- For consistent naming, deprecating `addArguments(...args)` in favor of `addBrowserCommandSwitches(...args)` | ||
* fileUploadDialogTimeout | ||
* setEdgePath | ||
* setEdgeChromium | ||
* setScrollBehavior | ||
* For consistent naming, deprecating `addArguments(...args)` in favor of `addBrowserCommandSwitches(...args)` | ||
@@ -221,7 +226,7 @@ * Added relative locators | ||
* The core WebDriver API no longer uses promise manager | ||
- Removed `index.Builder#setControlFlow()` | ||
- The following thenable types no longer have a `cancel()` method: | ||
- The dynamically generated thenable WebDrivers created by `index.Builder` | ||
- `lib/webdriver.AlertPromise` | ||
- `lib/webdriver.WebElementPromise` | ||
* Removed `index.Builder#setControlFlow()` | ||
* The following thenable types no longer have a `cancel()` method: | ||
* The dynamically generated thenable WebDrivers created by `index.Builder` | ||
* `lib/webdriver.AlertPromise` | ||
* `lib/webdriver.WebElementPromise` | ||
* Removed `remote/index.DriverService.prototype.stop()` (use `#kill()` instead) | ||
@@ -234,53 +239,53 @@ * Removed the `lib/actions` module | ||
exported names (replacements, if any, in parentheses): | ||
- CancellableThenable | ||
- CancellationError | ||
- ControlFlow | ||
- Deferred | ||
- LONG_STACK_TRACES | ||
- MultipleUnhandledRejectionError | ||
- Promise (use native Promises) | ||
- Resolver | ||
- Scheduler | ||
- Thenable | ||
- USE_PROMISE_MANAGER | ||
- all (use Promise.all) | ||
- asap (use Promise.resolve) | ||
- captureStackTrace (use Error.captureStackTrace) | ||
- consume (use async functions) | ||
- controlFlow | ||
- createPromise (use new Promise) | ||
- defer | ||
- fulfilled (use Promise.resolve) | ||
- isGenerator | ||
- rejected (use Promise.reject) | ||
- setDefaultFlow | ||
- when (use Promise.resolve) | ||
* CancellableThenable | ||
* CancellationError | ||
* ControlFlow | ||
* Deferred | ||
* LONG_STACK_TRACES | ||
* MultipleUnhandledRejectionError | ||
* Promise (use native Promises) | ||
* Resolver | ||
* Scheduler | ||
* Thenable | ||
* USE_PROMISE_MANAGER | ||
* all (use Promise.all) | ||
* asap (use Promise.resolve) | ||
* captureStackTrace (use Error.captureStackTrace) | ||
* consume (use async functions) | ||
* controlFlow | ||
* createPromise (use new Promise) | ||
* defer | ||
* fulfilled (use Promise.resolve) | ||
* isGenerator | ||
* rejected (use Promise.reject) | ||
* setDefaultFlow | ||
* when (use Promise.resolve) | ||
* Changes to the `Builder` class: | ||
- Added setChromeService, setEdgeService, & setFirefoxService | ||
- Removed setEnableNativeEvents | ||
- Removed setScrollBehavior | ||
* Added setChromeService, setEdgeService, & setFirefoxService | ||
* Removed setEnableNativeEvents | ||
* Removed setScrollBehavior | ||
* Changes to `chrome.Driver` | ||
- Added sendDevToolsCommand | ||
- Added setDownloadPath | ||
* Added sendDevToolsCommand | ||
* Added setDownloadPath | ||
* Changes to `chrome.Options` | ||
- Now extends the `Capabilities` class | ||
- Removed from/toCapabilities | ||
* Now extends the `Capabilities` class | ||
* Removed from/toCapabilities | ||
* Changes to `edge.Options` | ||
- Now extends the `Capabilities` class | ||
- Removed from/toCapabilities | ||
* Now extends the `Capabilities` class | ||
* Removed from/toCapabilities | ||
* Changes to `ie.Options` | ||
- Now extends the `Capabilities` class | ||
- Removed from/toCapabilities | ||
* Now extends the `Capabilities` class | ||
* Removed from/toCapabilities | ||
* Removed the `firefox.Binary` class. Custom binaries can still be selected using `firefox.Options#setBinary()`. Likewise, custom binary arguments can be specified | ||
with `firefox.Options#addArguments()`. | ||
* Changes to `firefox.Driver` | ||
- Added installAddon(path) | ||
- Added uninstallAddon(id) | ||
* Added installAddon(path) | ||
* Added uninstallAddon(id) | ||
* Changes to `firefox.Options` | ||
- Now extends the `Capabilities` class | ||
- Removed from/toCapabilities | ||
- Removed setLoggingPreferences (was a no-op) | ||
- setProfile now only accepts a path to an existing profile | ||
- Added addExtensions | ||
- Added setPreference | ||
* Now extends the `Capabilities` class | ||
* Removed from/toCapabilities | ||
* Removed setLoggingPreferences (was a no-op) | ||
* setProfile now only accepts a path to an existing profile | ||
* Added addExtensions | ||
* Added setPreference | ||
* Removed the `firefox.Profile` class. All of its functionality is now provided directly by `firefox.Options` | ||
@@ -290,64 +295,64 @@ * Removed the `firefox/binary` module | ||
* Changes to `safari.Options` | ||
- Now extends the `Capabilities` class | ||
- Removed from/toCapabilities | ||
- Removed setCleanSession (was a no-op) | ||
* Now extends the `Capabilities` class | ||
* Removed from/toCapabilities | ||
* Removed setCleanSession (was a no-op) | ||
* Changes to `lib/capabilities.Browser`: | ||
- Removed several enum values. | ||
- ANDROID (use Chrome for Android; see docs on the chrome module) | ||
- IPAD (no support available) | ||
- IPHONE (no support available) | ||
- OPERA (use Chrome) | ||
- PHANTOM_JS (use Chrome or Firefox in headless mode) | ||
- HTMLUNIT (use Chrome or Firefox in headless mode) | ||
* Removed several enum values. | ||
* ANDROID (use Chrome for Android; see docs on the chrome module) | ||
* IPAD (no support available) | ||
* IPHONE (no support available) | ||
* OPERA (use Chrome) | ||
* PHANTOM_JS (use Chrome or Firefox in headless mode) | ||
* HTMLUNIT (use Chrome or Firefox in headless mode) | ||
* Changes to `lib/capabilities.Capabilities`: | ||
- Removed static factory methods android(), ipad(), iphone(), opera(), phantomjs(), htmlunit(), | ||
* Removed static factory methods android(), ipad(), iphone(), opera(), phantomjs(), htmlunit(), | ||
and htmlunitwithjs(). Users can still manually configure capabilities for these, but their use | ||
is not recommended and they will no longer be surfaced in the API. | ||
* Changes to `lib/error`: | ||
- Added | ||
- ElementClickInterceptedError | ||
- InsecureCertificateError | ||
- InvalidCoordinatesError | ||
- NoSuchCookieError | ||
- Removed | ||
- ElementNotVisibleError | ||
- InvalidElementCoordinatesError | ||
* Added | ||
* ElementClickInterceptedError | ||
* InsecureCertificateError | ||
* InvalidCoordinatesError | ||
* NoSuchCookieError | ||
* Removed | ||
* ElementNotVisibleError | ||
* InvalidElementCoordinatesError | ||
* Changes to `lib/webdriver.WebDriver`: | ||
- Dropped support for "requiredCapabilities" from WebDriver.createSession | ||
- actions() now returns the new `lib/input.Actions` class | ||
- Removed touchActions | ||
- Renamed schedule to execute | ||
- Removed the `WebDriver.attachToSession()` factory method. Users can just the `WebDriver` | ||
* Dropped support for "requiredCapabilities" from WebDriver.createSession | ||
* actions() now returns the new `lib/input.Actions` class | ||
* Removed touchActions | ||
* Renamed schedule to execute | ||
* Removed the `WebDriver.attachToSession()` factory method. Users can just the `WebDriver` | ||
constructor directly instead. | ||
- Removed the `call()` method. This was used to inject custom function calls into the control | ||
* Removed the `call()` method. This was used to inject custom function calls into the control | ||
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 | ||
call functions directly instead of through `driver.call()`. | ||
* Changes to `lib/webdriver.WebElement`: | ||
- Replaced getSize & getLocation with getRect | ||
* Replaced getSize & getLocation with getRect | ||
* Changes to `lib/webdriver.Alert`: | ||
- Removed authenticateAs | ||
* Removed authenticateAs | ||
* Changes to `lib/webdriver.Options` (`driver.manage()`): | ||
- Removed timeouts (use get/setTimeouts) | ||
* Removed timeouts (use get/setTimeouts) | ||
* Changes to `lib/webdriver.Window` (`driver.manage().window()`): | ||
- Added | ||
- getRect | ||
- setRect | ||
- fullscreen | ||
- minimize | ||
- Removed (use the getRect/setRect methods) | ||
- getPosition | ||
- setPosition | ||
- getSize | ||
- setSize | ||
* Added | ||
* getRect | ||
* setRect | ||
* fullscreen | ||
* minimize | ||
* Removed (use the getRect/setRect methods) | ||
* getPosition | ||
* setPosition | ||
* getSize | ||
* setSize | ||
* Removed the `testing/assert` module | ||
* Changes to `testing/index` | ||
- Since the promise manager has been removed, it is no longer necessary to wrap the Mocha test | ||
* Since the promise manager has been removed, it is no longer necessary to wrap the Mocha test | ||
hooks; instead, users can simply use async functions. The following have all been removed: | ||
- describe | ||
- before | ||
- beforeEach | ||
- after | ||
- afterEach | ||
- it | ||
- Added the `suite` function. For details, refer to the jsdoc or | ||
* describe | ||
* before | ||
* beforeEach | ||
* after | ||
* afterEach | ||
* it | ||
* Added the `suite` function. For details, refer to the jsdoc or | ||
`example/google_search_test.js` | ||
@@ -369,5 +374,5 @@ | ||
* Added new methods to `selenium-webdriver/firefox.Options`: | ||
- addArguments() | ||
- headless() | ||
- windowSize() | ||
* addArguments() | ||
* headless() | ||
* windowSize() | ||
* Deprecated `selenium-webdriver/firefox/binary.Binary` | ||
@@ -378,6 +383,6 @@ * Removed `selenium-webdriver/firefox.Options#useGeckoDriver()` | ||
for the legacy FirefoxDriver was dropped in 3.5.0: | ||
- setNativeEventsEnabled | ||
- nativeEventsEnabled | ||
- getPort | ||
- setPort | ||
* setNativeEventsEnabled | ||
* nativeEventsEnabled | ||
* getPort | ||
* setPort | ||
* Removed `selenium-webdriver/firefox.ServiceBuilder#setFirefoxBinary()`; custom binaries should be | ||
@@ -404,5 +409,5 @@ configured through the `firefox.Options` class. | ||
* Removed native support for Firefox 46 and older. | ||
- The `SELENIUM_MARIONETTE` enviornment variable no longer has an effect. | ||
- `selenium-webdriver/firefox.Capability.MARIONETTE` is deprecated. | ||
- `selenium-webdriver/firefox.Options#useGeckoDriver()` is deprecated and now a no-op. | ||
* The `SELENIUM_MARIONETTE` enviornment variable no longer has an effect. | ||
* `selenium-webdriver/firefox.Capability.MARIONETTE` is deprecated. | ||
* `selenium-webdriver/firefox.Options#useGeckoDriver()` is deprecated and now a no-op. | ||
* `firefox.Options` will no longer discard the `"moz:firefoxOptions"` set in user provided | ||
@@ -452,2 +457,3 @@ capabilities (via `Builder.withCapabilities({})`). When both are used, the settings in `firefox.Options` will be applied _last_. | ||
``` | ||
* If the `JAVA_HOME` environment variable is set, use it to locate java.exe. | ||
@@ -479,4 +485,4 @@ | ||
* More API adjustments to align with native Promises | ||
- Deprecated `promise.fulfilled(value)`, use `promise.Promise#resolve(value)` | ||
- Deprecated `promise.rejected(reason)`, use `promise.Promise#reject(reason)` | ||
* Deprecated `promise.fulfilled(value)`, use `promise.Promise#resolve(value)` | ||
* Deprecated `promise.rejected(reason)`, use `promise.Promise#reject(reason)` | ||
* When a `wait()` condition times out, the returned promise will now be rejected with an `error.TimeoutError` instead of a generic `Error` object. | ||
@@ -516,5 +522,5 @@ * `WebDriver#wait()` will now throw a TypeError if an invalid wait condition is provided. | ||
* Reduced the API on `promise.Thenable` for compatibility with native promises: | ||
- Removed `#isPending()` | ||
- Removed `#cancel()` | ||
- Removed `#finally()` | ||
* Removed `#isPending()` | ||
* Removed `#cancel()` | ||
* Removed `#finally()` | ||
* Changed all subclasses of `webdriver.WebDriver` to overload the static function `WebDriver.createSession()` instead of doing work in the constructor. All constructors | ||
@@ -598,28 +604,28 @@ now inherit the base class' function signature. Users are still encouraged to use the `Builder` | ||
* Removed deprecated modules: | ||
- `selenium-webdriver/error` (use `selenium-webdriver/lib/error`,\ | ||
* `selenium-webdriver/error` (use `selenium-webdriver/lib/error`,\ | ||
or the `error` property exported by `selenium-webdriver`) | ||
- `selenium-webdriver/executors` — this was not previously deprecated, but is no longer used. | ||
* `selenium-webdriver/executors` — this was not previously deprecated, but is no longer used. | ||
* Removed deprecated types: | ||
- `command.DeferredExecutor` — this was not previously deprecated, but is no longer used. It can | ||
* `command.DeferredExecutor` — this was not previously deprecated, but is no longer used. It can | ||
be trivially implemented by clients should it be needed. | ||
- `error.InvalidSessionIdError` (use `error.NoSuchSessionError`) | ||
- `executors.DeferredExecutor` | ||
- `until.Condition` (use `webdriver.Condition`) | ||
- `until.WebElementCondition` (use `webdriver.WebElementCondition`) | ||
- `webdriver.UnhandledAlertError` (use `error.UnexpectedAlertOpenError`) | ||
* `error.InvalidSessionIdError` (use `error.NoSuchSessionError`) | ||
* `executors.DeferredExecutor` | ||
* `until.Condition` (use `webdriver.Condition`) | ||
* `until.WebElementCondition` (use `webdriver.WebElementCondition`) | ||
* `webdriver.UnhandledAlertError` (use `error.UnexpectedAlertOpenError`) | ||
* Removed deprecated functions: | ||
- `Deferred#cancel()` | ||
- `Deferred#catch()` | ||
- `Deferred#finally()` | ||
- `Deferred#isPending()` | ||
- `Deferred#then()` | ||
- `Promise#thenCatch()` | ||
- `Promise#thenFinally()` | ||
- `WebDriver#isElementPresent()` | ||
- `WebElement#getInnerHtml()` | ||
- `WebElement#getOuterHtml()` | ||
- `WebElement#getRawId()` | ||
- `WebElement#isElementPresent()` | ||
* `Deferred#cancel()` | ||
* `Deferred#catch()` | ||
* `Deferred#finally()` | ||
* `Deferred#isPending()` | ||
* `Deferred#then()` | ||
* `Promise#thenCatch()` | ||
* `Promise#thenFinally()` | ||
* `WebDriver#isElementPresent()` | ||
* `WebElement#getInnerHtml()` | ||
* `WebElement#getOuterHtml()` | ||
* `WebElement#getRawId()` | ||
* `WebElement#isElementPresent()` | ||
* Removed deprecated properties: | ||
- `WebDriverError#code` | ||
* `WebDriverError#code` | ||
@@ -865,3 +871,3 @@ ## v2.53.2 | ||
* Updated how errors are annotated on failures. When a task fails, the stacktrace from when that | ||
task was scheduled is appended to the rejection reason with a `From: ` prefix (if it is an Error | ||
task was scheduled is appended to the rejection reason with a `From:` prefix (if it is an Error | ||
object). For example: | ||
@@ -868,0 +874,0 @@ |
@@ -143,3 +143,2 @@ // Licensed to the Software Freedom Conservancy (SFC) under one | ||
/** @type {remote.DriverService} */ | ||
let defaultService = null | ||
@@ -244,2 +243,10 @@ /** | ||
} | ||
/** | ||
* returns new instance chrome driver service | ||
* @returns {remote.DriverService} | ||
*/ | ||
static getDefaultService() { | ||
return new ServiceBuilder().build() | ||
} | ||
} | ||
@@ -257,37 +264,7 @@ | ||
/** | ||
* Sets the default service to use for new ChromeDriver instances. | ||
* @param {!remote.DriverService} service The service to use. | ||
* @throws {Error} If the default service is currently running. | ||
*/ | ||
function setDefaultService(service) { | ||
if (defaultService && defaultService.isRunning()) { | ||
throw Error( | ||
`The previously configured ChromeDriver service is still running. ` + | ||
`You must shut it down before you may adjust its configuration.` | ||
) | ||
} | ||
defaultService = service | ||
} | ||
/** | ||
* Returns the default ChromeDriver service. If such a service has not been | ||
* configured, one will be constructed using the default configuration for | ||
* a ChromeDriver executable found on the system PATH. | ||
* @return {!remote.DriverService} The default ChromeDriver service. | ||
*/ | ||
function getDefaultService() { | ||
if (!defaultService) { | ||
defaultService = new ServiceBuilder().build() | ||
} | ||
return defaultService | ||
} | ||
Options.prototype.CAPABILITY_KEY = 'goog:chromeOptions' | ||
Options.prototype.BROWSER_NAME_VALUE = Browser.CHROME | ||
Driver.getDefaultService = getDefaultService | ||
Driver.prototype.VENDOR_COMMAND_PREFIX = 'goog' | ||
// PUBLIC API | ||
module.exports = { | ||
@@ -297,5 +274,3 @@ Driver: Driver, | ||
ServiceBuilder, | ||
getDefaultService, | ||
setDefaultService, | ||
locateSynchronously, | ||
} |
@@ -664,2 +664,3 @@ // Licensed to the Software Freedom Conservancy (SFC) under one | ||
let executor | ||
let onQuit | ||
if (opt_serviceExecutor instanceof http.Executor) { | ||
@@ -670,2 +671,3 @@ executor = opt_serviceExecutor | ||
let service = opt_serviceExecutor || this.getDefaultService() | ||
onQuit = () => service.kill() | ||
executor = createExecutor(service.start(), this.VENDOR_COMMAND_PREFIX) | ||
@@ -684,3 +686,3 @@ } | ||
return /** @type {!Driver} */ (super.createSession(executor, caps)) | ||
return /** @type {!Driver} */ (super.createSession(executor, caps, onQuit)) | ||
} | ||
@@ -687,0 +689,0 @@ |
40
edge.js
@@ -93,3 +93,2 @@ // Licensed to the Software Freedom Conservancy (SFC) under one | ||
/** @type {remote.DriverService} */ | ||
let defaultService = null | ||
@@ -162,2 +161,10 @@ /** | ||
/** | ||
* returns new instance of edge driver service | ||
* @returns {remote.DriverService} | ||
*/ | ||
static getDefaultService() { | ||
return new ServiceBuilder().build() | ||
} | ||
/** | ||
* This function is a no-op as file detectors are not supported by this | ||
@@ -171,30 +178,2 @@ * implementation. | ||
/** | ||
* Sets the default service to use for new Edge instances. | ||
* @param {!remote.DriverService} service The service to use. | ||
* @throws {Error} If the default service is currently running. | ||
*/ | ||
function setDefaultService(service) { | ||
if (defaultService && defaultService.isRunning()) { | ||
throw Error( | ||
'The previously configured EdgeDriver service is still running. ' + | ||
'You must shut it down before you may adjust its configuration.' | ||
) | ||
} | ||
defaultService = service | ||
} | ||
/** | ||
* Returns the default Microsoft Edge driver service. If such a service has | ||
* not been configured, one will be constructed using the default configuration | ||
* for a MicrosoftWebDriver executable found on the system PATH. | ||
* @return {!remote.DriverService} The default Microsoft Edge driver service. | ||
*/ | ||
function getDefaultService() { | ||
if (!defaultService) { | ||
defaultService = new ServiceBuilder().build() | ||
} | ||
return defaultService | ||
} | ||
/** | ||
* _Synchronously_ attempts to locate the chromedriver executable on the current | ||
@@ -212,3 +191,2 @@ * system. | ||
Driver.prototype.VENDOR_CAPABILITY_PREFIX = 'ms' | ||
Driver.getDefaultService = getDefaultService | ||
@@ -221,5 +199,3 @@ // PUBLIC API | ||
ServiceBuilder, | ||
getDefaultService, | ||
setDefaultService, | ||
locateSynchronously, | ||
} |
@@ -860,5 +860,5 @@ // Licensed to the Software Freedom Conservancy (SFC) under one | ||
* specified `origin`. The `origin` may be defined as the mouse's | ||
* {@linkplain ./input.Origin.POINTER current position}, the | ||
* {@linkplain ./input.Origin.POINTER current position}, the top-left corner of the | ||
* {@linkplain ./input.Origin.VIEWPORT viewport}, or the center of a specific | ||
* {@linkplain ./webdriver.WebElement WebElement}. | ||
* {@linkplain ./webdriver.WebElement WebElement}. Default is top left corner of the view-port if origin is not specified | ||
* | ||
@@ -865,0 +865,0 @@ * You may adjust how long the remote end should take, in milliseconds, to |
{ | ||
"name": "selenium-webdriver", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "The official WebDriver JavaScript bindings from the Selenium project", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
687691
14937