diff --git a/selenium-webdriver/edge.d.ts b/selenium-webdriver/edge.d.ts index fbbbe343c3..3fb3408b1f 100644 --- a/selenium-webdriver/edge.d.ts +++ b/selenium-webdriver/edge.d.ts @@ -11,7 +11,7 @@ export class Driver extends webdriver.WebDriver { * the {@linkplain #getDefaultService default service} by default. * @param {promise.ControlFlow=} opt_flow The control flow to use, or * {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: webdriver.CreateSessionCapabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/firefox.d.ts b/selenium-webdriver/firefox.d.ts index 47753558e8..6746c3c683 100644 --- a/selenium-webdriver/firefox.d.ts +++ b/selenium-webdriver/firefox.d.ts @@ -238,29 +238,29 @@ export function prepareProfile(profile: string | any, port: number): any; */ export class Driver extends webdriver.WebDriver { /** - * Creates a new Firefox session. - * + * Creates a new Firefox session. + * * @param {(Options|capabilities.Capabilities|Object)=} opt_config The * configuration options for this driver, specified as either an * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash * object. - * @param {(http.Executor|remote.DriverService)=} opt_executor Either a - * pre-configured command executor to use for communicating with an - * externally managed remote end (which is assumed to already be running), - * or the `DriverService` to use to start the geckodriver in a child - * process. - * - * If an executor is provided, care should e taken not to use reuse it with - * other clients as its internal command mappings will be updated to support - * Firefox-specific commands. - * - * _This parameter may only be used with Mozilla's GeckoDriver._ - * + * @param {(http.Executor|remote.DriverService)=} opt_executor Either a + * pre-configured command executor to use for communicating with an + * externally managed remote end (which is assumed to already be running), + * or the `DriverService` to use to start the geckodriver in a child + * process. + * + * If an executor is provided, care should e taken not to use reuse it with + * other clients as its internal command mappings will be updated to support + * Firefox-specific commands. + * + * _This parameter may only be used with Mozilla's GeckoDriver._ + * * @param {promise.ControlFlow=} opt_flow The flow to * schedule commands through. Defaults to the active flow object. - * @throws {Error} If a custom command executor is provided and the driver is - * configured to use the legacy FirefoxDriver from the Selenium project. - * @return {!Driver} A new driver instance. + * @throws {Error} If a custom command executor is provided and the driver is + * configured to use the legacy FirefoxDriver from the Selenium project. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: Options | webdriver.Capabilities, opt_executor?: http.Executor | remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/ie.d.ts b/selenium-webdriver/ie.d.ts index f30f50afb3..bf3932450e 100644 --- a/selenium-webdriver/ie.d.ts +++ b/selenium-webdriver/ie.d.ts @@ -5,13 +5,13 @@ import * as webdriver from './index'; */ export class Driver extends webdriver.WebDriver { /** - * Creates a new session for Microsoft's Internet Explorer. - * + * Creates a new session for Microsoft's Internet Explorer. + * * @param {(capabilities.Capabilities|Options)=} opt_config The configuration * options. * @param {promise.ControlFlow=} opt_flow The control flow to use, * or {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 3d52c8d3b1..bfd583302e 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -1,6 +1,9 @@ -// Type definitions for Selenium WebDriverJS 3.0.1 +// Type definitions for Selenium WebDriverJS 3.0 // Project: https://github.com/SeleniumHQ/selenium/tree/master/javascript/node/selenium-webdriver -// Definitions by: Bill Armstrong , Yuki Kokubun , Craig Nishina , Simon Gellis +// Definitions by: Bill Armstrong , +// Yuki Kokubun , +// Craig Nishina , +// Simon Gellis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -1307,7 +1310,7 @@ export class Condition { export class WebElementCondition extends Condition { // add an unused private member so the compiler treats this // class distinct from other Conditions - private _nominal: void; + private _nominal: undefined; } export namespace until { @@ -2113,9 +2116,9 @@ interface ProxyConfig { httpProxy?: string; sslProxy?: string; noProxy?: string; - socksProxy?: string, - socksUsername?: string, - socksPassword?: string + socksProxy?: string, + socksUsername?: string, + socksPassword?: string } /** @@ -2348,15 +2351,15 @@ export class Builder { setScrollBehavior(behavior: number): Builder; /** - * Sets the http agent to use for each request. - * If this method is not called, the Builder will use http.globalAgent by default. - * - * @param {http.Agent} agent The agent to use for each request. - * @return {!Builder} A self reference. - */ - usingHttpAgent(agent: any): Builder; + * Sets the http agent to use for each request. + * If this method is not called, the Builder will use http.globalAgent by default. + * + * @param {http.Agent} agent The agent to use for each request. + * @return {!Builder} A self reference. + */ + usingHttpAgent(agent: any): Builder; - /** + /** * Sets the URL of a remote WebDriver server to use. Once a remote URL has been * specified, the builder direct all new clients to that server. If this method * is never called, the Builder will attempt to create all clients locally. @@ -3910,10 +3913,10 @@ export class WebDriver { * whether the condition has been satisified. Note the resolution time for * a promise is factored into whether a wait has timed out. * - * Note, if the provided condition is a {@link WebElementCondition}, then - * the wait will return a {@link WebElementPromise} that will resolve to the - * element that satisified the condition. - * + * Note, if the provided condition is a {@link WebElementCondition}, then + * the wait will return a {@link WebElementPromise} that will resolve to the + * element that satisified the condition. + * * *Example:* waiting up to 10 seconds for an element to be present and visible * on the page. * diff --git a/selenium-webdriver/opera.d.ts b/selenium-webdriver/opera.d.ts index 2fb57cf13e..b4d118f6a7 100644 --- a/selenium-webdriver/opera.d.ts +++ b/selenium-webdriver/opera.d.ts @@ -163,7 +163,7 @@ export class Driver extends webdriver.WebDriver { * the {@link getDefaultService default service} by default. * @param {promise.ControlFlow=} opt_flow The control flow to use, * or {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/remote.d.ts b/selenium-webdriver/remote.d.ts index 24a6840a60..15303a6d7f 100644 --- a/selenium-webdriver/remote.d.ts +++ b/selenium-webdriver/remote.d.ts @@ -66,6 +66,100 @@ export class DriverService { stop(): webdriver.promise.Promise; } +export module DriverService { + + /** + * Creates {@link DriverService} objects that manage a WebDriver server in a + * child process. + */ + export class Builder { + /** + * @param {string} exe Path to the executable to use. This executable must + * accept the `--port` flag for defining the port to start the server on. + * @throws {Error} If the provided executable path does not exist. + */ + constructor(exe: string); + + /** + * Define additional command line arguments to use when starting the server. + * + * @param {...CommandLineFlag} var_args The arguments to include. + * @return {!THIS} A self reference. + * @this {THIS} + * @template THIS + */ + addArguments(...var_args: string[]): this; + + + /** + * Sets the host name to access the server on. If specified, the + * {@linkplain #setLoopback() loopback} setting will be ignored. + * + * @param {string} hostname + * @return {!DriverService.Builder} A self reference. + */ + setHostname(hostname: string): this; + + /** + * Sets whether the service should be accessed at this host's loopback + * address. + * + * @param {boolean} loopback + * @return {!DriverService.Builder} A self reference. + */ + setLoopback(loopback: boolean): this; + + /** + * Sets the base path for WebDriver REST commands (e.g. "/wd/hub"). + * By default, the driver will accept commands relative to "/". + * + * @param {?string} basePath The base path to use, or `null` to use the + * default. + * @return {!DriverService.Builder} A self reference. + */ + setPath(basePath: string | null): this; + + + /** + * Sets the port to start the server on. + * + * @param {number} port The port to use, or 0 for any free port. + * @return {!DriverService.Builder} A self reference. + * @throws {Error} If an invalid port is specified. + */ + setPort(port: number): this; + + /** + * Defines the environment to start the server under. This setting will be + * inherited by every browser session started by the server. By default, the + * server will inherit the enviroment of the current process. + * + * @param {(Map|Object|null)} env The desired + * environment to use, or `null` if the server should inherit the + * current environment. + * @return {!DriverService.Builder} A self reference. + */ + setEnvironment(env: Map | {[name: string]: string} | null): this; + + /** + * IO configuration for the spawned server process. For more information, + * refer to the documentation of `child_process.spawn`. + * + * @param {StdIoOptions} config The desired IO configuration. + * @return {!DriverService.Builder} A self reference. + * @see https://nodejs.org/dist/latest-v4.x/docs/api/child_process.html#child_process_options_stdio + */ + setStdio(config: any): this; + + /** + * Creates a new DriverService using this instance's current configuration. + * + * @return {!DriverService} A new driver service. + */ + build(): DriverService; + } +} + /** * A {@link webdriver.FileDetector} that may be used when running * against a remote @@ -103,95 +197,3 @@ export class FileDetector extends webdriver.FileDetector { */ handleFile(driver: webdriver.WebDriver, file: string): webdriver.promise.Promise; } - module DriverService { - /** - * Creates {@link DriverService} objects that manage a WebDriver server in a - * child process. - */ - export class Builder { - /** - * @param {string} exe Path to the executable to use. This executable must - * accept the `--port` flag for defining the port to start the server on. - * @throws {Error} If the provided executable path does not exist. - */ - constructor(exe: string); - - /** - * Define additional command line arguments to use when starting the server. - * - * @param {...CommandLineFlag} var_args The arguments to include. - * @return {!THIS} A self reference. - * @this {THIS} - * @template THIS - */ - addArguments(...var_args: string[]): this; - - - /** - * Sets the host name to access the server on. If specified, the - * {@linkplain #setLoopback() loopback} setting will be ignored. - * - * @param {string} hostname - * @return {!DriverService.Builder} A self reference. - */ - setHostname(hostname: string): this; - - /** - * Sets whether the service should be accessed at this host's loopback - * address. - * - * @param {boolean} loopback - * @return {!DriverService.Builder} A self reference. - */ - setLoopback(loopback: boolean): this; - - /** - * Sets the base path for WebDriver REST commands (e.g. "/wd/hub"). - * By default, the driver will accept commands relative to "/". - * - * @param {?string} basePath The base path to use, or `null` to use the - * default. - * @return {!DriverService.Builder} A self reference. - */ - setPath(basePath: string | null): this; - - - /** - * Sets the port to start the server on. - * - * @param {number} port The port to use, or 0 for any free port. - * @return {!DriverService.Builder} A self reference. - * @throws {Error} If an invalid port is specified. - */ - setPort(port: number): this; - - /** - * Defines the environment to start the server under. This setting will be - * inherited by every browser session started by the server. By default, the - * server will inherit the enviroment of the current process. - * - * @param {(Map|Object|null)} env The desired - * environment to use, or `null` if the server should inherit the - * current environment. - * @return {!DriverService.Builder} A self reference. - */ - setEnvironment(env: Map | {[name:string]: string} | null): this; - - /** - * IO configuration for the spawned server process. For more information, - * refer to the documentation of `child_process.spawn`. - * - * @param {StdIoOptions} config The desired IO configuration. - * @return {!DriverService.Builder} A self reference. - * @see https://nodejs.org/dist/latest-v4.x/docs/api/child_process.html#child_process_options_stdio - */ - setStdio(config: any): this; - - /** - * Creates a new DriverService using this instance's current configuration. - * - * @return {!DriverService} A new driver service. - */ - build(): DriverService; - } - } diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 749c22d5a3..2556e7e2a8 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -518,10 +518,10 @@ function TestWebDriverOptions() { promise = options.deleteAllCookies(); promise = options.deleteCookie('name'); - options.getCookie('name').then(function (cookie: webdriver.IWebDriverCookie) { + options.getCookie('name').then((cookie: webdriver.IWebDriverCookie) => { var expiry: number = cookie.expiry; }); - options.getCookies().then(function (cookies: webdriver.IWebDriverCookie[]) { }); + options.getCookies().then((cookies: webdriver.IWebDriverCookie[]) => { }); var logs: webdriver.Logs = options.logs(); var timeouts: webdriver.Timeouts = options.timeouts(); @@ -852,7 +852,7 @@ function TestUntilModule() { withCapabilities(webdriver.Capabilities.chrome()). build(); - var conditionB: webdriver.Condition = new webdriver.Condition('message', function (driver: webdriver.WebDriver) { return true; }); + var conditionB: webdriver.Condition = new webdriver.Condition('message', (driver: webdriver.WebDriver) => true); var conditionBBase: webdriver.Condition = conditionB; var conditionWebElement: webdriver.WebElementCondition; var conditionWebElements: webdriver.Condition; diff --git a/selenium-webdriver/tslint.json b/selenium-webdriver/tslint.json index eb0befd093..93fffac84e 100644 --- a/selenium-webdriver/tslint.json +++ b/selenium-webdriver/tslint.json @@ -3,7 +3,7 @@ "rules": { "callable-types": false, "forbidden-types": false, - "interface-name": false, + "interface-name": [false], "no-empty-interface": false, "unified-signatures": false } diff --git a/selenium-webdriver/v2/chrome.d.ts b/selenium-webdriver/v2/chrome.d.ts index 2ecff8d2f8..f22e83fa13 100644 --- a/selenium-webdriver/v2/chrome.d.ts +++ b/selenium-webdriver/v2/chrome.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/edge.d.ts b/selenium-webdriver/v2/edge.d.ts index fd59756c3d..4120629e41 100644 --- a/selenium-webdriver/v2/edge.d.ts +++ b/selenium-webdriver/v2/edge.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/executors.d.ts b/selenium-webdriver/v2/executors.d.ts index 6cded31fec..4e21eeadae 100644 --- a/selenium-webdriver/v2/executors.d.ts +++ b/selenium-webdriver/v2/executors.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace executors { diff --git a/selenium-webdriver/v2/firefox.d.ts b/selenium-webdriver/v2/firefox.d.ts index 25542f144f..b84c9ec9f1 100644 --- a/selenium-webdriver/v2/firefox.d.ts +++ b/selenium-webdriver/v2/firefox.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/http.d.ts b/selenium-webdriver/v2/http.d.ts index b4ade88430..7e2ce068c1 100644 --- a/selenium-webdriver/v2/http.d.ts +++ b/selenium-webdriver/v2/http.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace http { diff --git a/selenium-webdriver/v2/ie.d.ts b/selenium-webdriver/v2/ie.d.ts index 5d9b51c64d..ec22531fc1 100644 --- a/selenium-webdriver/v2/ie.d.ts +++ b/selenium-webdriver/v2/ie.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace ie { diff --git a/selenium-webdriver/v2/index.d.ts b/selenium-webdriver/v2/index.d.ts index 374d63f740..9637b696f9 100644 --- a/selenium-webdriver/v2/index.d.ts +++ b/selenium-webdriver/v2/index.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // Type definitions for Selenium WebDriverJS 2.53.1 // Project: https://github.com/SeleniumHQ/selenium/tree/master/javascript/node/selenium-webdriver // Definitions by: Bill Armstrong , Yuki Kokubun , Craig Nishina diff --git a/selenium-webdriver/v2/opera.d.ts b/selenium-webdriver/v2/opera.d.ts index 0d3aee1a13..85e0788e4c 100644 --- a/selenium-webdriver/v2/opera.d.ts +++ b/selenium-webdriver/v2/opera.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/remote.d.ts b/selenium-webdriver/v2/remote.d.ts index d3cadb746a..e9e8b2ad0d 100644 --- a/selenium-webdriver/v2/remote.d.ts +++ b/selenium-webdriver/v2/remote.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace remote { diff --git a/selenium-webdriver/v2/safari.d.ts b/selenium-webdriver/v2/safari.d.ts index 82fd835b20..ac7569286a 100644 --- a/selenium-webdriver/v2/safari.d.ts +++ b/selenium-webdriver/v2/safari.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace safari { diff --git a/selenium-webdriver/v2/test/chrome.ts b/selenium-webdriver/v2/test/chrome.ts index 2fce6bf6ca..6654a3685c 100644 --- a/selenium-webdriver/v2/test/chrome.ts +++ b/selenium-webdriver/v2/test/chrome.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as chrome from 'selenium-webdriver/chrome'; import * as remote from 'selenium-webdriver/remote'; import * as webdriver from 'selenium-webdriver'; diff --git a/selenium-webdriver/v2/test/firefox.ts b/selenium-webdriver/v2/test/firefox.ts index 7ebe0aa856..ce97c7ce68 100644 --- a/selenium-webdriver/v2/test/firefox.ts +++ b/selenium-webdriver/v2/test/firefox.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as firefox from 'selenium-webdriver/firefox'; import * as remote from 'selenium-webdriver/remote'; import * as webdriver from 'selenium-webdriver'; diff --git a/selenium-webdriver/v2/test/index.ts b/selenium-webdriver/v2/test/index.ts index ba2acb91ef..ed7606ce98 100644 --- a/selenium-webdriver/v2/test/index.ts +++ b/selenium-webdriver/v2/test/index.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from 'selenium-webdriver'; import * as chrome from 'selenium-webdriver/chrome'; import * as firefox from 'selenium-webdriver/firefox'; diff --git a/selenium-webdriver/v2/testing.d.ts b/selenium-webdriver/v2/testing.d.ts index e17c8e0f21..32c9259094 100644 --- a/selenium-webdriver/v2/testing.d.ts +++ b/selenium-webdriver/v2/testing.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ declare namespace testing { /** * Registers a new test suite. @@ -60,4 +61,4 @@ declare namespace testing { function xit(name: string, fn: Function): void; } -export = testing; \ No newline at end of file +export = testing;