Added setBrowserName and setBrowserVersions Capabilities methods description for selenium-webdriver module. (#38978)

This commit is contained in:
Aleksey Chemakin 2019-10-15 06:06:26 +07:00 committed by Andrew Branch
parent f293f702e8
commit 7e7335f867
2 changed files with 20 additions and 0 deletions

View File

@ -7,6 +7,7 @@
// Ben Dixon <https://github.com/bendxn>,
// Ziyu <https://github.com/oddui>
// Johann Wolf <https://github.com/beta-vulgaris>
// Aleksey Chemakin <https://github.com/Dzenly>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
@ -1392,6 +1393,22 @@ export class Capabilities {
*/
set(key: string, value: any): Capabilities;
/**
* Sets the name of the target browser.
*
* @param {(Browser|string)} name the browser name.
* @return {!Capabilities} a self reference.
*/
setBrowserName(name: string): Capabilities;
/**
* Sets the desired version of the target browser.
*
* @param {string} version the desired version.
* @return {!Capabilities} a self reference.
*/
setBrowserVersion(version: string): Capabilities;
/**
* Sets the logging preferences. Preferences may be specified as a
* {@link logging.Preferences} instance, or a as a map of log-type to

View File

@ -112,6 +112,9 @@ function TestCapabilities() {
capabilities = capabilities.setScrollBehavior(1);
capabilities = capabilities.setAlertBehavior('accept');
capabilities = capabilities.setAlertBehavior();
capabilities = capabilities.setBrowserName('myBrowserName');
capabilities = capabilities.setBrowserName(webdriver.Browser.ANDROID);
capabilities = capabilities.setBrowserVersion('10.3.4');
anything = capabilities.toJSON();