From 7e7335f867fa43d4cbe6389c641fbcd44efaf9d7 Mon Sep 17 00:00:00 2001 From: Aleksey Chemakin Date: Tue, 15 Oct 2019 06:06:26 +0700 Subject: [PATCH] Added setBrowserName and setBrowserVersions Capabilities methods description for selenium-webdriver module. (#38978) --- types/selenium-webdriver/index.d.ts | 17 +++++++++++++++++ types/selenium-webdriver/test/index.ts | 3 +++ 2 files changed, 20 insertions(+) diff --git a/types/selenium-webdriver/index.d.ts b/types/selenium-webdriver/index.d.ts index be68a178ac..c02f48a237 100644 --- a/types/selenium-webdriver/index.d.ts +++ b/types/selenium-webdriver/index.d.ts @@ -7,6 +7,7 @@ // Ben Dixon , // Ziyu // Johann Wolf +// Aleksey Chemakin // 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 diff --git a/types/selenium-webdriver/test/index.ts b/types/selenium-webdriver/test/index.ts index 2bb5c9b4ea..7223a4ae5f 100644 --- a/types/selenium-webdriver/test/index.ts +++ b/types/selenium-webdriver/test/index.ts @@ -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();