@types/selenium-webdriver
Advanced tools
Comparing version 3.0.15 to 4.0.0
@@ -0,4 +1,4 @@ | ||
import * as http from './http'; | ||
import * as webdriver from './index'; | ||
import * as remote from './remote'; | ||
import * as http from './http'; | ||
@@ -11,34 +11,34 @@ /** | ||
export class Driver extends webdriver.WebDriver { | ||
/** | ||
* Creates a new session with the ChromeDriver. | ||
* | ||
* @param {(Capabilities|Options)=} opt_config The configuration options. | ||
* @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either | ||
* a DriverService to use for the remote end, or a preconfigured executor | ||
* for an externally managed endpoint. If neither is provided, the | ||
* {@linkplain ##getDefaultService default service} will be used by | ||
* default. | ||
* @param {promise.ControlFlow=} opt_flow The control flow to use, or `null` | ||
* to use the currently active flow. | ||
* @return {!Driver} A new driver instance. | ||
*/ | ||
static createSession(opt_config?: Options | webdriver.CreateSessionCapabilities, opt_service?: remote.DriverService | http.Executor, opt_flow?: webdriver.promise.ControlFlow): Driver; | ||
/** | ||
* Creates a new session with the ChromeDriver. | ||
* | ||
* @param {(Capabilities|Options)=} opt_config The configuration options. | ||
* @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either | ||
* a DriverService to use for the remote end, or a preconfigured executor | ||
* for an externally managed endpoint. If neither is provided, the | ||
* {@linkplain ##getDefaultService default service} will be used by | ||
* default. | ||
* @return {!Driver} A new driver instance. | ||
*/ | ||
static createSession( | ||
opt_config?: Options|webdriver.CreateSessionCapabilities, | ||
opt_service?: remote.DriverService|http.Executor): Driver; | ||
} | ||
export interface IOptionsValues { | ||
args: string[]; | ||
binary?: string; | ||
detach: boolean; | ||
extensions: string[]; | ||
localState?: any; | ||
logFile?: string; | ||
prefs?: any; | ||
args: string[]; | ||
binary?: string; | ||
detach: boolean; | ||
extensions: string[]; | ||
localState?: any; | ||
logFile?: string; | ||
prefs?: any; | ||
} | ||
export interface IPerfLoggingPrefs { | ||
enableNetwork: boolean; | ||
enablePage: boolean; | ||
enableTimeline: boolean; | ||
tracingCategories: string; | ||
bufferUsageReportingInterval: number; | ||
enableNetwork: boolean; | ||
enablePage: boolean; | ||
enableTimeline: boolean; | ||
tracingCategories: string; | ||
bufferUsageReportingInterval: number; | ||
} | ||
@@ -49,253 +49,241 @@ | ||
*/ | ||
export class Options { | ||
/** | ||
* @constructor | ||
*/ | ||
constructor(); | ||
export class Options extends webdriver.Capabilities { | ||
/** | ||
* @constructor | ||
*/ | ||
constructor(); | ||
/** | ||
* Extracts the ChromeDriver specific options from the given capabilities | ||
* object. | ||
* @param {!webdriver.Capabilities} capabilities The capabilities object. | ||
* @return {!Options} The ChromeDriver options. | ||
*/ | ||
static fromCapabilities(capabilities: webdriver.Capabilities): Options; | ||
/** | ||
* Extracts the ChromeDriver specific options from the given capabilities | ||
* object. | ||
* @param {!webdriver.Capabilities} capabilities The capabilities object. | ||
* @return {!Options} The ChromeDriver options. | ||
*/ | ||
static fromCapabilities(capabilities: webdriver.Capabilities): Options; | ||
/** | ||
* Add additional command line arguments to use when launching the Chrome | ||
* browser. Each argument may be specified with or without the '--' prefix | ||
* (e.g. '--foo' and 'foo'). Arguments with an associated value should be | ||
* delimited by an '=': 'foo=bar'. | ||
* @param {...(string|!Array.<string>)} var_args The arguments to add. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addArguments(...var_args: string[]): Options; | ||
/** | ||
* Add additional command line arguments to use when launching the Chrome | ||
* browser. Each argument may be specified with or without the '--' prefix | ||
* (e.g. '--foo' and 'foo'). Arguments with an associated value should be | ||
* delimited by an '=': 'foo=bar'. | ||
* @param {...(string|!Array.<string>)} var_args The arguments to add. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addArguments(...var_args: string[]): Options; | ||
/** | ||
* Configures the chromedriver to start Chrome in headless mode. | ||
* | ||
* > __NOTE:__ Resizing the browser window in headless mode is only supported | ||
* > in Chrome 60. Users are encouraged to set an initial window size with | ||
* > the {@link #windowSize windowSize({width, height})} option. | ||
* | ||
* @return {!Options} A self reference. | ||
*/ | ||
headless(): Options; | ||
/** | ||
* Configures the chromedriver to start Chrome in headless mode. | ||
* | ||
* > __NOTE:__ Resizing the browser window in headless mode is only supported | ||
* > in Chrome 60. Users are encouraged to set an initial window size with | ||
* > the {@link #windowSize windowSize({width, height})} option. | ||
* | ||
* @return {!Options} A self reference. | ||
*/ | ||
headless(): Options; | ||
/** | ||
* List of Chrome command line switches to exclude that ChromeDriver by default | ||
* passes when starting Chrome. Do not prefix switches with '--'. | ||
* | ||
* @param {...(string|!Array<string>)} var_args The switches to exclude. | ||
* @return {!Options} A self reference. | ||
*/ | ||
excludeSwitches(...var_args: string[]): Options; | ||
/** | ||
* Sets the initial window size. | ||
* | ||
* @param {{width: number, height: number}} size The desired window size. | ||
* @return {!Options} A self reference. | ||
* @throws {TypeError} if width or height is unspecified, not a number, or | ||
* less than or equal to 0. | ||
*/ | ||
windowSize(size: {width: number, height: number}): Options; | ||
/** | ||
* Add additional extensions to install when launching Chrome. Each extension | ||
* should be specified as the path to the packed CRX file, or a Buffer for an | ||
* extension. | ||
* @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The | ||
* extensions to add. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addExtensions(...var_args: any[]): Options; | ||
/** | ||
* List of Chrome command line switches to exclude that ChromeDriver by | ||
* default passes when starting Chrome. Do not prefix switches with '--'. | ||
* | ||
* @param {...(string|!Array<string>)} var_args The switches to exclude. | ||
* @return {!Options} A self reference. | ||
*/ | ||
excludeSwitches(...var_args: string[]): Options; | ||
/** | ||
* Sets the path to the Chrome binary to use. On Mac OS X, this path should | ||
* reference the actual Chrome executable, not just the application binary | ||
* (e.g. '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'). | ||
* | ||
* The binary path be absolute or relative to the chromedriver server | ||
* executable, but it must exist on the machine that will launch Chrome. | ||
* | ||
* @param {string} path The path to the Chrome binary to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setChromeBinaryPath(path: string): Options; | ||
/** | ||
* Add additional extensions to install when launching Chrome. Each extension | ||
* should be specified as the path to the packed CRX file, or a Buffer for an | ||
* extension. | ||
* @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The | ||
* extensions to add. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addExtensions(...var_args: any[]): Options; | ||
/** | ||
* Sets whether to leave the started Chrome browser running if the controlling | ||
* ChromeDriver service is killed before {@link webdriver.WebDriver#quit()} is | ||
* called. | ||
* @param {boolean} detach Whether to leave the browser running if the | ||
* chromedriver service is killed before the session. | ||
* @return {!Options} A self reference. | ||
*/ | ||
detachDriver(detach: boolean): Options; | ||
/** | ||
* Sets the path to the Chrome binary to use. On Mac OS X, this path should | ||
* reference the actual Chrome executable, not just the application binary | ||
* (e.g. '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'). | ||
* | ||
* The binary path be absolute or relative to the chromedriver server | ||
* executable, but it must exist on the machine that will launch Chrome. | ||
* | ||
* @param {string} path The path to the Chrome binary to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setChromeBinaryPath(path: string): Options; | ||
/** | ||
* Sets the user preferences for Chrome's user profile. See the 'Preferences' | ||
* file in Chrome's user data directory for examples. | ||
* @param {!Object} prefs Dictionary of user preferences to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setUserPreferences(prefs: any): Options; | ||
/** | ||
* Sets whether to leave the started Chrome browser running if the controlling | ||
* ChromeDriver service is killed before {@link webdriver.WebDriver#quit()} is | ||
* called. | ||
* @param {boolean} detach Whether to leave the browser running if the | ||
* chromedriver service is killed before the session. | ||
* @return {!Options} A self reference. | ||
*/ | ||
detachDriver(detach: boolean): Options; | ||
/** | ||
* Sets the logging preferences for the new session. | ||
* @param {!webdriver.logging.Preferences} prefs The logging preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; | ||
/** | ||
* Sets the user preferences for Chrome's user profile. See the 'Preferences' | ||
* file in Chrome's user data directory for examples. | ||
* @param {!Object} prefs Dictionary of user preferences to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setUserPreferences(prefs: any): Options; | ||
/** | ||
* Sets the performance logging preferences. Options include: | ||
* | ||
* - `enableNetwork`: Whether or not to collect events from Network domain. | ||
* - `enablePage`: Whether or not to collect events from Page domain. | ||
* - `enableTimeline`: Whether or not to collect events from Timeline domain. | ||
* Note: when tracing is enabled, Timeline domain is implicitly disabled, | ||
* unless `enableTimeline` is explicitly set to true. | ||
* - `tracingCategories`: A comma-separated string of Chrome tracing categories | ||
* for which trace events should be collected. An unspecified or empty | ||
* string disables tracing. | ||
* - `bufferUsageReportingInterval`: The requested number of milliseconds | ||
* between DevTools trace buffer usage events. For example, if 1000, then | ||
* once per second, DevTools will report how full the trace buffer is. If a | ||
* report indicates the buffer usage is 100%, a warning will be issued. | ||
* | ||
* @param {{enableNetwork: boolean, | ||
* enablePage: boolean, | ||
* enableTimeline: boolean, | ||
* tracingCategories: string, | ||
* bufferUsageReportingInterval: number}} prefs The performance | ||
* logging preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setPerfLoggingPrefs(prefs: IPerfLoggingPrefs): Options; | ||
/** | ||
* Sets the performance logging preferences. Options include: | ||
* | ||
* - `enableNetwork`: Whether or not to collect events from Network domain. | ||
* - `enablePage`: Whether or not to collect events from Page domain. | ||
* - `enableTimeline`: Whether or not to collect events from Timeline domain. | ||
* Note: when tracing is enabled, Timeline domain is implicitly disabled, | ||
* unless `enableTimeline` is explicitly set to true. | ||
* - `tracingCategories`: A comma-separated string of Chrome tracing | ||
* categories for which trace events should be collected. An unspecified or | ||
* empty string disables tracing. | ||
* - `bufferUsageReportingInterval`: The requested number of milliseconds | ||
* between DevTools trace buffer usage events. For example, if 1000, then | ||
* once per second, DevTools will report how full the trace buffer is. If | ||
* a report indicates the buffer usage is 100%, a warning will be issued. | ||
* | ||
* @param {{enableNetwork: boolean, | ||
* enablePage: boolean, | ||
* enableTimeline: boolean, | ||
* tracingCategories: string, | ||
* bufferUsageReportingInterval: number}} prefs The performance | ||
* logging preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setPerfLoggingPrefs(prefs: IPerfLoggingPrefs): Options; | ||
/** | ||
* Sets preferences for the 'Local State' file in Chrome's user data | ||
* directory. | ||
* @param {!Object} state Dictionary of local state preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLocalState(state: any): Options; | ||
/** | ||
* Sets preferences for the 'Local State' file in Chrome's user data | ||
* directory. | ||
* @param {!Object} state Dictionary of local state preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLocalState(state: any): Options; | ||
/** | ||
* Sets the name of the activity hosting a Chrome-based Android WebView. This | ||
* option must be set to connect to an [Android WebView]( | ||
* https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android) | ||
* | ||
* @param {string} name The activity name. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidActivity(name: string): Options; | ||
/** | ||
* Sets the name of the activity hosting a Chrome-based Android WebView. This | ||
* option must be set to connect to an [Android WebView]( | ||
* https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android) | ||
* | ||
* @param {string} name The activity name. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidActivity(name: string): Options; | ||
/** | ||
* Sets the device serial number to connect to via ADB. If not specified, the | ||
* ChromeDriver will select an unused device at random. An error will be | ||
* returned if all devices already have active sessions. | ||
* | ||
* @param {string} serial The device serial number to connect to. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidDeviceSerial(serial: string): Options; | ||
/** | ||
* Sets the device serial number to connect to via ADB. If not specified, the | ||
* ChromeDriver will select an unused device at random. An error will be | ||
* returned if all devices already have active sessions. | ||
* | ||
* @param {string} serial The device serial number to connect to. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidDeviceSerial(serial: string): Options; | ||
/** | ||
* Configures the ChromeDriver to launch Chrome on Android via adb. This | ||
* function is shorthand for | ||
* {@link #androidPackage options.androidPackage('com.android.chrome')}. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidChrome(): Options; | ||
/** | ||
* Configures the ChromeDriver to launch Chrome on Android via adb. This | ||
* function is shorthand for | ||
* {@link #androidPackage options.androidPackage('com.android.chrome')}. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidChrome(): Options; | ||
/** | ||
* Sets the package name of the Chrome or WebView app. | ||
* | ||
* @param {?string} pkg The package to connect to, or `null` to disable Android | ||
* and switch back to using desktop Chrome. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidPackage(pkg: string): Options; | ||
/** | ||
* Sets the package name of the Chrome or WebView app. | ||
* | ||
* @param {?string} pkg The package to connect to, or `null` to disable | ||
* Android and switch back to using desktop Chrome. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidPackage(pkg: string): Options; | ||
/** | ||
* Sets the process name of the Activity hosting the WebView (as given by `ps`). | ||
* If not specified, the process name is assumed to be the same as | ||
* {@link #androidPackage}. | ||
* | ||
* @param {string} processName The main activity name. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidProcess(processName: string): Options; | ||
/** | ||
* Sets the process name of the Activity hosting the WebView (as given by | ||
* `ps`). If not specified, the process name is assumed to be the same as | ||
* {@link #androidPackage}. | ||
* | ||
* @param {string} processName The main activity name. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidProcess(processName: string): Options; | ||
/** | ||
* Sets whether to connect to an already-running instead of the specified | ||
* {@linkplain #androidProcess app} instead of launching the app with a clean | ||
* data directory. | ||
* | ||
* @param {boolean} useRunning Whether to connect to a running instance. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidUseRunningApp(useRunning: boolean): Options; | ||
/** | ||
* Sets whether to connect to an already-running instead of the specified | ||
* {@linkplain #androidProcess app} instead of launching the app with a clean | ||
* data directory. | ||
* | ||
* @param {boolean} useRunning Whether to connect to a running instance. | ||
* @return {!Options} A self reference. | ||
*/ | ||
androidUseRunningApp(useRunning: boolean): Options; | ||
/** | ||
* Sets the path to Chrome's log file. This path should exist on the machine | ||
* that will launch Chrome. | ||
* @param {string} path Path to the log file to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setChromeLogFile(path: string): Options; | ||
/** | ||
* Sets the path to Chrome's log file. This path should exist on the machine | ||
* that will launch Chrome. | ||
* @param {string} path Path to the log file to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setChromeLogFile(path: string): Options; | ||
/** | ||
* Sets the directory to store Chrome minidumps in. This option is only | ||
* supported when ChromeDriver is running on Linux. | ||
* @param {string} path The directory path. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setChromeMinidumpPath(path: string): Options; | ||
/** | ||
* Sets the directory to store Chrome minidumps in. This option is only | ||
* supported when ChromeDriver is running on Linux. | ||
* @param {string} path The directory path. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setChromeMinidumpPath(path: string): Options; | ||
/** | ||
* Configures Chrome to emulate a mobile device. For more information, refer | ||
* to the ChromeDriver project page on [mobile emulation][em]. Configuration | ||
* options include: | ||
* | ||
* - `deviceName`: The name of a pre-configured [emulated device][devem] | ||
* - `width`: screen width, in pixels | ||
* - `height`: screen height, in pixels | ||
* - `pixelRatio`: screen pixel ratio | ||
* | ||
* __Example 1: Using a Pre-configured Device__ | ||
* | ||
* let options = new chrome.Options().setMobileEmulation( | ||
* {deviceName: 'Google Nexus 5'}); | ||
* | ||
* let driver = new chrome.Driver(options); | ||
* | ||
* __Example 2: Using Custom Screen Configuration__ | ||
* | ||
* let options = new chrome.Options().setMobileEmulation({ | ||
* width: 360, | ||
* height: 640, | ||
* pixelRatio: 3.0 | ||
* }); | ||
* | ||
* let driver = new chrome.Driver(options); | ||
* | ||
* | ||
* [em]: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation | ||
* [devem]: https://developer.chrome.com/devtools/docs/device-mode | ||
* | ||
* @param {?({deviceName: string}| | ||
* {width: number, height: number, pixelRatio: number})} config The | ||
* mobile emulation configuration, or `null` to disable emulation. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setMobileEmulation(config: any): Options; | ||
/** | ||
* Sets the proxy settings for the new session. | ||
* @param {webdriver.ProxyConfig} proxy The proxy configuration to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProxy(proxy: webdriver.ProxyConfig): Options; | ||
/** | ||
* Converts this options instance to a {@link webdriver.Capabilities} object. | ||
* @param {webdriver.Capabilities=} opt_capabilities The capabilities to merge | ||
* these options into, if any. | ||
* @return {!webdriver.Capabilities} The capabilities. | ||
*/ | ||
toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; | ||
/** | ||
* Configures Chrome to emulate a mobile device. For more information, refer | ||
* to the ChromeDriver project page on [mobile emulation][em]. Configuration | ||
* options include: | ||
* | ||
* - `deviceName`: The name of a pre-configured [emulated device][devem] | ||
* - `width`: screen width, in pixels | ||
* - `height`: screen height, in pixels | ||
* - `pixelRatio`: screen pixel ratio | ||
* | ||
* __Example 1: Using a Pre-configured Device__ | ||
* | ||
* let options = new chrome.Options().setMobileEmulation( | ||
* {deviceName: 'Google Nexus 5'}); | ||
* | ||
* let driver = new chrome.Driver(options); | ||
* | ||
* __Example 2: Using Custom Screen Configuration__ | ||
* | ||
* let options = new chrome.Options().setMobileEmulation({ | ||
* width: 360, | ||
* height: 640, | ||
* pixelRatio: 3.0 | ||
* }); | ||
* | ||
* let driver = new chrome.Driver(options); | ||
* | ||
* | ||
* [em]: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation | ||
* [devem]: https://developer.chrome.com/devtools/docs/device-mode | ||
* | ||
* @param {?({deviceName: string}| | ||
* {width: number, height: number, pixelRatio: number})} config The | ||
* mobile emulation configuration, or `null` to disable emulation. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setMobileEmulation(config: any): Options; | ||
} | ||
@@ -308,43 +296,43 @@ | ||
export class ServiceBuilder extends remote.DriverService.Builder { | ||
/** | ||
* @param {string=} opt_exe Path to the server executable to use. If omitted, | ||
* the builder will attempt to locate the chromedriver on the current | ||
* PATH. | ||
* @throws {Error} If provided executable does not exist, or the chromedriver | ||
* cannot be found on the PATH. | ||
* @constructor | ||
*/ | ||
constructor(opt_exe?: string); | ||
/** | ||
* @param {string=} opt_exe Path to the server executable to use. If omitted, | ||
* the builder will attempt to locate the chromedriver on the current | ||
* PATH. | ||
* @throws {Error} If provided executable does not exist, or the chromedriver | ||
* cannot be found on the PATH. | ||
* @constructor | ||
*/ | ||
constructor(opt_exe?: string); | ||
/** | ||
* Sets which port adb is listening to. _The ChromeDriver will connect to adb | ||
* if an {@linkplain Options#androidPackage Android session} is requested, but | ||
* adb **must** be started beforehand._ | ||
* | ||
* @param {number} port Which port adb is running on. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
setAdbPort(port: number): this; | ||
/** | ||
* Sets which port adb is listening to. _The ChromeDriver will connect to adb | ||
* if an {@linkplain Options#androidPackage Android session} is requested, but | ||
* adb **must** be started beforehand._ | ||
* | ||
* @param {number} port Which port adb is running on. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
setAdbPort(port: number): this; | ||
/** | ||
* Sets the path of the log file the driver should log to. If a log file is | ||
* not specified, the driver will log to stderr. | ||
* @param {string} path Path of the log file to use. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
loggingTo(path: string): this; | ||
/** | ||
* Sets the path of the log file the driver should log to. If a log file is | ||
* not specified, the driver will log to stderr. | ||
* @param {string} path Path of the log file to use. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
loggingTo(path: string): this; | ||
/** | ||
* Enables verbose logging. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
enableVerboseLogging(): this; | ||
/** | ||
* Enables verbose logging. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
enableVerboseLogging(): this; | ||
/** | ||
* Sets the number of threads the driver should use to manage HTTP requests. | ||
* By default, the driver will use 4 threads. | ||
* @param {number} n The number of threads to use. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
setNumHttpThreads(n: number): this; | ||
/** | ||
* Sets the number of threads the driver should use to manage HTTP requests. | ||
* By default, the driver will use 4 threads. | ||
* @param {number} n The number of threads to use. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
setNumHttpThreads(n: number): this; | ||
} | ||
@@ -351,0 +339,0 @@ |
@@ -5,21 +5,20 @@ import * as webdriver from './index'; | ||
export class Driver extends webdriver.WebDriver { | ||
/** | ||
* Creates a new browser session for Microsoft's Edge browser. | ||
* | ||
* @param {(capabilities.Capabilities|Options)=} opt_config The configuration | ||
* options. | ||
* @param {remote.DriverService=} opt_service The session to use; will use | ||
* 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. | ||
*/ | ||
static createSession(opt_config?: webdriver.CreateSessionCapabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; | ||
/** | ||
* Creates a new browser session for Microsoft's Edge browser. | ||
* | ||
* @param {(capabilities.Capabilities|Options)=} opt_config The configuration | ||
* options. | ||
* @param {remote.DriverService=} opt_service The session to use; will use | ||
* the {@linkplain #getDefaultService default service} by default. | ||
* @return {!Driver} A new driver instance. | ||
*/ | ||
static createSession( | ||
opt_config?: webdriver.CreateSessionCapabilities, opt_service?: remote.DriverService): Driver; | ||
/** | ||
* This function is a no-op as file detectors are not supported by this | ||
* implementation. | ||
* @override | ||
*/ | ||
setFileDetector(): void; | ||
/** | ||
* This function is a no-op as file detectors are not supported by this | ||
* implementation. | ||
* @override | ||
*/ | ||
setFileDetector(): void; | ||
} | ||
@@ -30,35 +29,18 @@ | ||
*/ | ||
export class Options { | ||
/** | ||
* Extracts the MicrosoftEdgeDriver specific options from the given | ||
* capabilities object. | ||
* @param {!capabilities.Capabilities} caps The capabilities object. | ||
* @return {!Options} The MicrosoftEdgeDriver options. | ||
*/ | ||
static fromCapabilities(cap: webdriver.Capabilities): Options; | ||
export class Options extends webdriver.Capabilities { | ||
/** | ||
* Sets the proxy settings for the new session. | ||
* @param {capabilities.ProxyConfig} proxy The proxy configuration to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProxy(proxy: webdriver.ProxyConfig): Options; | ||
/** | ||
* Sets the proxy settings for the new session. | ||
* @param {capabilities.ProxyConfig} proxy The proxy configuration to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProxy(proxy: webdriver.ProxyConfig): Options; | ||
/** | ||
* Sets the page load strategy for Edge. | ||
* Supported values are 'normal', 'eager', and 'none'; | ||
* | ||
* @param {string} pageLoadStrategy The page load strategy to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setPageLoadStrategy(pageLoadStrategy: string): Options; | ||
/** | ||
* Converts this options instance to a {@link capabilities.Capabilities} | ||
* object. | ||
* @param {capabilities.Capabilities=} opt_capabilities The capabilities to | ||
* merge these options into, if any. | ||
* @return {!capabilities.Capabilities} The capabilities. | ||
*/ | ||
toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; | ||
/** | ||
* Sets the page load strategy for Edge. | ||
* Supported values are 'normal', 'eager', and 'none'; | ||
* | ||
* @param {string} pageLoadStrategy The page load strategy to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setPageLoadStrategy(pageLoadStrategy: string): Options; | ||
} | ||
@@ -71,10 +53,10 @@ | ||
export class ServiceBuilder extends remote.DriverService.Builder { | ||
/** | ||
* @param {string=} opt_exe Path to the server executable to use. If omitted, | ||
* the builder will attempt to locate the MicrosoftEdgeDriver on the current | ||
* PATH. | ||
* @throws {Error} If provided executable does not exist, or the | ||
* MicrosoftEdgeDriver cannot be found on the PATH. | ||
*/ | ||
constructor(opt_exe?: string); | ||
/** | ||
* @param {string=} opt_exe Path to the server executable to use. If omitted, | ||
* the builder will attempt to locate the MicrosoftEdgeDriver on the current | ||
* PATH. | ||
* @throws {Error} If provided executable does not exist, or the | ||
* MicrosoftEdgeDriver cannot be found on the PATH. | ||
*/ | ||
constructor(opt_exe?: string); | ||
} | ||
@@ -81,0 +63,0 @@ |
@@ -0,244 +1,44 @@ | ||
import * as http from './http'; | ||
import * as webdriver from './index'; | ||
import * as remote from './remote'; | ||
import * as http from './http'; | ||
/** | ||
* Manages a Firefox subprocess configured for use with WebDriver. | ||
*/ | ||
export class Binary { | ||
/** | ||
* @param {string=} opt_exe Path to the Firefox binary to use. If not | ||
* specified, will attempt to locate Firefox on the current system. | ||
* @constructor | ||
*/ | ||
constructor(opt_exe?: string); | ||
/** | ||
* Add arguments to the command line used to start Firefox. | ||
* @param {...(string|!Array.<string>)} var_args Either the arguments to add as | ||
* varargs, or the arguments as an array. | ||
*/ | ||
addArguments(...var_args: string[]): void; | ||
/** | ||
* Launches Firefox and eturns a promise that will be fulfilled when the process | ||
* terminates. | ||
* @param {string} profile Path to the profile directory to use. | ||
* @return {!promise.Promise.<!exec.Result>} A promise for the process result. | ||
* @throws {Error} If this instance has already been started. | ||
*/ | ||
launch(profile: string): webdriver.promise.Promise<any>; | ||
/** | ||
* Kills the managed Firefox process. | ||
* @return {!promise.Promise} A promise for when the process has terminated. | ||
*/ | ||
kill(): webdriver.promise.Promise<void>; | ||
} | ||
/** | ||
* Models a Firefox proifle directory for use with the FirefoxDriver. The | ||
* {@code Proifle} directory uses an in-memory model until {@link #writeToDisk} | ||
* is called. | ||
*/ | ||
export class Profile { | ||
/** | ||
* @param {string=} opt_dir Path to an existing Firefox profile directory to | ||
* use a template for this profile. If not specified, a blank profile will | ||
* be used. | ||
* @constructor | ||
*/ | ||
constructor(opt_dir?: string); | ||
/** | ||
* Registers an extension to be included with this profile. | ||
* @param {string} extension Path to the extension to include, as either an | ||
* unpacked extension directory or the path to a xpi file. | ||
*/ | ||
addExtension(extension: string): void; | ||
/** | ||
* Sets a desired preference for this profile. | ||
* @param {string} key The preference key. | ||
* @param {(string|number|boolean)} value The preference value. | ||
* @throws {Error} If attempting to set a frozen preference. | ||
*/ | ||
setPreference(key: string, value: string): void; | ||
setPreference(key: string, value: number): void; | ||
setPreference(key: string, value: boolean): void; | ||
/** | ||
* Returns the currently configured value of a profile preference. This does | ||
* not include any defaults defined in the profile's template directory user.js | ||
* file (if a template were specified on construction). | ||
* @param {string} key The desired preference. | ||
* @return {(string|number|boolean|undefined)} The current value of the | ||
* requested preference. | ||
*/ | ||
getPreference(key: string): any; | ||
/** | ||
* @return {number} The port this profile is currently configured to use, or | ||
* 0 if the port will be selected at random when the profile is written | ||
* to disk. | ||
*/ | ||
getPort(): number; | ||
/** | ||
* Sets the port to use for the WebDriver extension loaded by this profile. | ||
* @param {number} port The desired port, or 0 to use any free port. | ||
*/ | ||
setPort(port: number): void; | ||
/** | ||
* @return {boolean} Whether the FirefoxDriver is configured to automatically | ||
* accept untrusted SSL certificates. | ||
*/ | ||
acceptUntrustedCerts(): boolean; | ||
/** | ||
* Sets whether the FirefoxDriver should automatically accept untrusted SSL | ||
* certificates. | ||
* @param {boolean} value . | ||
*/ | ||
setAcceptUntrustedCerts(value: boolean): void; | ||
/** | ||
* Sets whether to assume untrusted certificates come from untrusted issuers. | ||
* @param {boolean} value . | ||
*/ | ||
setAssumeUntrustedCertIssuer(value: boolean): void; | ||
/** | ||
* @return {boolean} Whether to assume untrusted certs come from untrusted | ||
* issuers. | ||
*/ | ||
assumeUntrustedCertIssuer(): boolean; | ||
/** | ||
* Sets whether to use native events with this profile. | ||
* @param {boolean} enabled . | ||
*/ | ||
setNativeEventsEnabled(enabled: boolean): void; | ||
/** | ||
* Returns whether native events are enabled in this profile. | ||
* @return {boolean} . | ||
*/ | ||
nativeEventsEnabled(): boolean; | ||
/** | ||
* Writes this profile to disk. | ||
* @param {boolean=} opt_excludeWebDriverExt Whether to exclude the WebDriver | ||
* extension from the generated profile. Used to reduce the size of an | ||
* {@link #encode() encoded profile} since the server will always install | ||
* the extension itself. | ||
* @return {!promise.Promise.<string>} A promise for the path to the new | ||
* profile directory. | ||
*/ | ||
writeToDisk(opt_excludeWebDriverExt?: boolean): webdriver.promise.Promise<string>; | ||
/** | ||
* Encodes this profile as a zipped, base64 encoded directory. | ||
* @return {!promise.Promise.<string>} A promise for the encoded profile. | ||
*/ | ||
encode(): webdriver.promise.Promise<string>; | ||
} | ||
/** | ||
* Configuration options for the FirefoxDriver. | ||
*/ | ||
export class Options { | ||
/** | ||
* Specify additional command line arguments that should be used when starting | ||
* the Firefox browser. | ||
* | ||
* @param {...(string|!Array<string>)} args The arguments to include. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addArguments(...args: string[]): Options; | ||
export class Options extends webdriver.Capabilities { | ||
/** | ||
* Sets the profile to use. The profile may be specified as a | ||
* {@link Profile} object or as the path to an existing Firefox profile to use | ||
* as a template. | ||
* | ||
* @param {(string|!Profile)} profile The profile to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProfile(profile: string): Options; | ||
/** | ||
* Sets the browser to be in headless mode. | ||
* | ||
* @return {!Options} A self reference. | ||
*/ | ||
headless(): Options; | ||
/** | ||
* Sets the binary to use. The binary may be specified as the path to a | ||
* Firefox executable, or as a {@link Binary} object. | ||
* | ||
* @param {(string|!Binary)} binary The binary to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setBinary(binary: string|any): Options; | ||
/** | ||
* Sets the initial window size when running in | ||
* {@linkplain #headless headless} mode. | ||
* | ||
* @param {{width: number, height: number}} size The desired window size. | ||
* @return {!Options} A self reference. | ||
* @throws {TypeError} if width or height is unspecified, not a number, or | ||
* less than or equal to 0. | ||
*/ | ||
windowSize(size: { width: number, height: number }): Options; | ||
/** | ||
* Sets the proxy to use. | ||
* | ||
* @param {capabilities.ProxyConfig} proxy The proxy configuration to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProxy(proxy: webdriver.ProxyConfig): Options; | ||
/** | ||
* Add extensions that should be installed when starting Firefox. | ||
* | ||
* @param {...string} paths The paths to the extension XPI files to install. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addExtensions(...paths: string[]): Options; | ||
/** | ||
* @param {string} key the preference key. | ||
* @param {(string|number|boolean)} value the preference value. | ||
* @return {!Options} A self reference. | ||
* @throws {TypeError} if either the key or value has an invalid type. | ||
*/ | ||
setPreference(key: string, value: string | number | boolean): Options; | ||
/** | ||
* Sets the profile to use. The profile may be specified as a | ||
* {@link Profile} object or as the path to an existing Firefox profile to use | ||
* as a template. | ||
* | ||
* @param {(string|!Profile)} profile The profile to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProfile(profile: string | any): Options; | ||
/** | ||
* Sets the binary to use. The binary may be specified as the path to a Firefox | ||
* executable, or as a {@link Binary} object. | ||
* | ||
* @param {(string|!Binary)} binary The binary to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setBinary(binary: string | any): Options; | ||
/** | ||
* Sets the logging preferences for the new session. | ||
* @param {logging.Preferences} prefs The logging preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLoggingPreferences(prefs: webdriver.logging.Preferences): Options; | ||
/** | ||
* Sets the proxy to use. | ||
* | ||
* @param {capabilities.ProxyConfig} proxy The proxy configuration to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProxy(proxy: webdriver.ProxyConfig): Options; | ||
/** | ||
* Sets whether to use Mozilla's geckodriver to drive the browser. This option | ||
* is enabled by default and required for Firefox 47+. | ||
* | ||
* @param {boolean} enable Whether to enable the geckodriver. | ||
* @see https://github.com/mozilla/geckodriver | ||
*/ | ||
useGeckoDriver(enable: boolean): Options; | ||
/** | ||
* Converts these options to a {@link capabilities.Capabilities} instance. | ||
* | ||
* @return {!capabilities.Capabilities} A new capabilities object. | ||
*/ | ||
toCapabilities(): webdriver.Capabilities; | ||
/** | ||
* Sets whether to use Mozilla's geckodriver to drive the browser. This option | ||
* is enabled by default and required for Firefox 47+. | ||
* | ||
* @param {boolean} enable Whether to enable the geckodriver. | ||
* @see https://github.com/mozilla/geckodriver | ||
*/ | ||
useGeckoDriver(enable: boolean): Options; | ||
} | ||
@@ -256,3 +56,3 @@ | ||
*/ | ||
export function createWiresService(binary: string | any): remote.DriverService; | ||
export function createWiresService(binary: string|any): remote.DriverService; | ||
@@ -264,3 +64,3 @@ /** | ||
*/ | ||
export function prepareProfile(profile: string | any, port: number): any; | ||
export function prepareProfile(profile: string|any, port: number): any; | ||
@@ -271,35 +71,34 @@ /** | ||
export class Driver extends webdriver.WebDriver { | ||
/** | ||
* 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 {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. | ||
*/ | ||
static createSession(opt_config?: Options | webdriver.Capabilities, opt_executor?: http.Executor | remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; | ||
/** | ||
* 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._ | ||
* @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): Driver; | ||
/** | ||
* This function is a no-op as file detectors are not supported by this | ||
* implementation. | ||
* @override | ||
*/ | ||
setFileDetector(): void; | ||
/** | ||
* This function is a no-op as file detectors are not supported by this | ||
* implementation. | ||
* @override | ||
*/ | ||
setFileDetector(): void; | ||
} | ||
@@ -313,27 +112,27 @@ | ||
export class ServiceBuilder extends remote.DriverService.Builder { | ||
/** | ||
* @param {string=} opt_exe Path to the server executable to use. If omitted, | ||
* the builder will attempt to locate the geckodriver on the system PATH. | ||
*/ | ||
constructor(opt_exe?: string); | ||
/** | ||
* @param {string=} opt_exe Path to the server executable to use. If omitted, | ||
* the builder will attempt to locate the geckodriver on the system PATH. | ||
*/ | ||
constructor(opt_exe?: string); | ||
/** | ||
* Enables verbose logging. | ||
* | ||
* @param {boolean=} opt_trace Whether to enable trace-level logging. By | ||
* default, only debug logging is enabled. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
enableVerboseLogging(opt_trace?: boolean): this; | ||
/** | ||
* Enables verbose logging. | ||
* | ||
* @param {boolean=} opt_trace Whether to enable trace-level logging. By | ||
* default, only debug logging is enabled. | ||
* @return {!ServiceBuilder} A self reference. | ||
*/ | ||
enableVerboseLogging(opt_trace?: boolean): this; | ||
/** | ||
* Sets the path to the executable Firefox binary that the geckodriver should | ||
* use. If this method is not called, this builder will attempt to locate | ||
* Firefox in the default installation location for the current platform. | ||
* | ||
* @param {(string|!Binary)} binary Path to the executable Firefox binary to use. | ||
* @return {!ServiceBuilder} A self reference. | ||
* @see Binary#locate() | ||
*/ | ||
setFirefoxBinary(binary: string | Binary): this; | ||
/** | ||
* Sets the path to the executable Firefox binary that the geckodriver should | ||
* use. If this method is not called, this builder will attempt to locate | ||
* Firefox in the default installation location for the current platform. | ||
* | ||
* @param {(string|!Binary)} binary Path to the executable Firefox binary to use. | ||
* @return {!ServiceBuilder} A self reference. | ||
* @see Binary#locate() | ||
*/ | ||
setFirefoxBinary(binary: string): this; | ||
} |
@@ -17,16 +17,11 @@ import * as webdriver from './index'; | ||
export class Request { | ||
/** | ||
* @param {string} method The HTTP method to use for the request. | ||
* @param {string} path The path on the server to send the request to. | ||
* @param {Object=} opt_data This request's non-serialized JSON payload data. | ||
*/ | ||
constructor(method: string, path: string, opt_data?: Object); | ||
/** | ||
* @param {string} method The HTTP method to use for the request. | ||
* @param {string} path The path on the server to send the request to. | ||
* @param {Object=} opt_data This request's non-serialized JSON payload data. | ||
*/ | ||
constructor(method: string, path: string, opt_data?: Object); | ||
headers: Map<string, string>; | ||
method: string; | ||
path: string; | ||
data: Object; | ||
/** @override */ | ||
toString(): string; | ||
/** @override */ | ||
toString(): string; | ||
} | ||
@@ -39,16 +34,12 @@ | ||
export class Response { | ||
/** | ||
* @param {number} status The response code. | ||
* @param {!Object<string>} headers The response headers. All header names | ||
* will be converted to lowercase strings for consistent lookups. | ||
* @param {string} body The response body. | ||
*/ | ||
constructor(status: number, headers: Object, body: string); | ||
/** | ||
* @param {number} status The response code. | ||
* @param {!Object<string>} headers The response headers. All header names | ||
* will be converted to lowercase strings for consistent lookups. | ||
* @param {string} body The response body. | ||
*/ | ||
constructor(status: number, headers: Object, body: string); | ||
status: number; | ||
body: string; | ||
headers: Map<string, string>; | ||
/** @override */ | ||
toString(): string; | ||
/** @override */ | ||
toString(): string; | ||
} | ||
@@ -65,21 +56,21 @@ | ||
export class HttpClient { | ||
/** | ||
* @param {string} serverUrl URL for the WebDriver server to send commands to. | ||
* @param {http.Agent=} opt_agent The agent to use for each request. | ||
* Defaults to `http.globalAgent`. | ||
* @param {?string=} opt_proxy The proxy to use for the connection to the | ||
* server. Default is to use no proxy. | ||
*/ | ||
constructor(serverUrl: string, opt_agent?: any, opt_proxy?: string); | ||
/** | ||
* @param {string} serverUrl URL for the WebDriver server to send commands to. | ||
* @param {http.Agent=} opt_agent The agent to use for each request. | ||
* Defaults to `http.globalAgent`. | ||
* @param {?string=} opt_proxy The proxy to use for the connection to the | ||
* server. Default is to use no proxy. | ||
*/ | ||
constructor(serverUrl: string, opt_agent?: any, opt_proxy?: string); | ||
/** | ||
* Sends a request to the server. The client will automatically follow any | ||
* redirects returned by the server, fulfilling the returned promise with the | ||
* final response. | ||
* | ||
* @param {!HttpRequest} httpRequest The request to send. | ||
* @return {!promise.Promise<HttpResponse>} A promise that will be fulfilled | ||
* with the server's response. | ||
*/ | ||
send(httpRequest: Request): webdriver.promise.Promise<Response>; | ||
/** | ||
* Sends a request to the server. The client will automatically follow any | ||
* redirects returned by the server, fulfilling the returned promise with | ||
* the final response. | ||
* | ||
* @param {!HttpRequest} httpRequest The request to send. | ||
* @return {!Promise<HttpResponse>} A promise that will be fulfilled | ||
* with the server's response. | ||
*/ | ||
send(httpRequest: Request): Promise<Response>; | ||
} | ||
@@ -96,3 +87,4 @@ | ||
*/ | ||
export function sendRequest(options: Object, onOk: any, onError: any, opt_data?: string, opt_proxy?: string): any; | ||
export function sendRequest( | ||
options: Object, onOk: any, onError: any, opt_data?: string, opt_proxy?: string): any; | ||
@@ -113,26 +105,26 @@ /** | ||
export class Executor { | ||
/** | ||
* @param {!(HttpClient|IThenable<!HttpClient>)} client The client to use for sending | ||
* requests to the server, or a promise-like object that will resolve to | ||
* to the client. | ||
*/ | ||
constructor(client: HttpClient | webdriver.promise.IThenable<HttpClient>); | ||
/** | ||
* @param {!(HttpClient|IThenable<!HttpClient>)} client The client to use for sending | ||
* requests to the server, or a promise-like object that will resolve to | ||
* to the client. | ||
*/ | ||
constructor(client: HttpClient|Promise<HttpClient>); | ||
/** | ||
* Defines a new command for use with this executor. When a command is sent, | ||
* the {@code path} will be preprocessed using the command's parameters; any | ||
* path segments prefixed with ':' will be replaced by the parameter of the | ||
* same name. For example, given '/person/:name' and the parameters | ||
* '{name: 'Bob'}', the final command path will be '/person/Bob'. | ||
* | ||
* @param {string} name The command name. | ||
* @param {string} method The HTTP method to use when sending this command. | ||
* @param {string} path The path to send the command to, relative to | ||
* the WebDriver server's command root and of the form | ||
* '/path/:variable/segment'. | ||
*/ | ||
defineCommand(name: string, method: string, path: string): void; | ||
/** | ||
* Defines a new command for use with this executor. When a command is sent, | ||
* the {@code path} will be preprocessed using the command's parameters; any | ||
* path segments prefixed with ':' will be replaced by the parameter of the | ||
* same name. For example, given '/person/:name' and the parameters | ||
* '{name: 'Bob'}', the final command path will be '/person/Bob'. | ||
* | ||
* @param {string} name The command name. | ||
* @param {string} method The HTTP method to use when sending this command. | ||
* @param {string} path The path to send the command to, relative to | ||
* the WebDriver server's command root and of the form | ||
* '/path/:variable/segment'. | ||
*/ | ||
defineCommand(name: string, method: string, path: string): void; | ||
/** @override */ | ||
execute(command: any): any; | ||
/** @override */ | ||
execute(command: any): any; | ||
} | ||
@@ -139,0 +131,0 @@ |
@@ -7,19 +7,17 @@ import * as webdriver from './index'; | ||
export class Driver extends webdriver.WebDriver { | ||
/** | ||
* 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. | ||
*/ | ||
static createSession(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow): Driver; | ||
/** | ||
* Creates a new session for Microsoft's Internet Explorer. | ||
* | ||
* @param {(capabilities.Capabilities|Options)=} opt_config The configuration | ||
* options. | ||
* @return {!Driver} A new driver instance. | ||
*/ | ||
static createSession(opt_config?: webdriver.Capabilities|Options): Driver; | ||
/** | ||
* This function is a no-op as file detectors are not supported by this | ||
* implementation. | ||
* @override | ||
*/ | ||
setFileDetector(): void; | ||
/** | ||
* This function is a no-op as file detectors are not supported by this | ||
* implementation. | ||
* @override | ||
*/ | ||
setFileDetector(): void; | ||
} | ||
@@ -30,181 +28,166 @@ | ||
*/ | ||
export class Options { | ||
constructor(); | ||
export class Options extends webdriver.Capabilities { | ||
constructor(); | ||
/** | ||
* Extracts the IEDriver specific options from the given capabilities | ||
* object. | ||
* @param {!capabilities.Capabilities} caps The capabilities object. | ||
* @return {!Options} The IEDriver options. | ||
*/ | ||
static fromCapabilities(caps: webdriver.Capabilities): Options; | ||
/** | ||
* Whether to disable the protected mode settings check when the session is | ||
* created. Disbling this setting may lead to significant instability as the | ||
* browser may become unresponsive/hang. Only 'best effort' support is | ||
* provided when using this capability. | ||
* | ||
* For more information, refer to the IEDriver's | ||
* [required system configuration](http://goo.gl/eH0Yi3). | ||
* | ||
* @param {boolean} ignoreSettings Whether to ignore protected mode settings. | ||
* @return {!Options} A self reference. | ||
*/ | ||
introduceFlakinessByIgnoringProtectedModeSettings(ignoreSettings: boolean): Options; | ||
/** | ||
* Whether to disable the protected mode settings check when the session is | ||
* created. Disbling this setting may lead to significant instability as the | ||
* browser may become unresponsive/hang. Only 'best effort' support is provided | ||
* when using this capability. | ||
* | ||
* For more information, refer to the IEDriver's | ||
* [required system configuration](http://goo.gl/eH0Yi3). | ||
* | ||
* @param {boolean} ignoreSettings Whether to ignore protected mode settings. | ||
* @return {!Options} A self reference. | ||
*/ | ||
introduceFlakinessByIgnoringProtectedModeSettings(ignoreSettings: boolean): Options; | ||
/** | ||
* Indicates whether to skip the check that the browser's zoom level is set to | ||
* 100%. | ||
* | ||
* @param {boolean} ignore Whether to ignore the browser's zoom level | ||
* settings. | ||
* @return {!Options} A self reference. | ||
*/ | ||
ignoreZoomSetting(ignore: boolean): Options; | ||
/** | ||
* Indicates whether to skip the check that the browser's zoom level is set to | ||
* 100%. | ||
* | ||
* @param {boolean} ignore Whether to ignore the browser's zoom level settings. | ||
* @return {!Options} A self reference. | ||
*/ | ||
ignoreZoomSetting(ignore: boolean): Options; | ||
/** | ||
* Sets the initial URL loaded when IE starts. This is intended to be used | ||
* with | ||
* {@link #ignoreProtectedModeSettings} to allow the user to initialize IE in | ||
* the proper Protected Mode zone. Setting this option may cause browser | ||
* instability or flaky and unresponsive code. Only 'best effort' support is | ||
* provided when using this option. | ||
* | ||
* @param {string} url The initial browser URL. | ||
* @return {!Options} A self reference. | ||
*/ | ||
initialBrowserUrl(url: string): Options; | ||
/** | ||
* Sets the initial URL loaded when IE starts. This is intended to be used with | ||
* {@link #ignoreProtectedModeSettings} to allow the user to initialize IE in | ||
* the proper Protected Mode zone. Setting this option may cause browser | ||
* instability or flaky and unresponsive code. Only 'best effort' support is | ||
* provided when using this option. | ||
* | ||
* @param {string} url The initial browser URL. | ||
* @return {!Options} A self reference. | ||
*/ | ||
initialBrowserUrl(url: string): Options; | ||
/** | ||
* Configures whether to enable persistent mouse hovering (true by default). | ||
* Persistent hovering is achieved by continuously firing mouse over events at | ||
* the last location the mouse cursor has been moved to. | ||
* | ||
* @param {boolean} enable Whether to enable persistent hovering. | ||
* @return {!Options} A self reference. | ||
*/ | ||
enablePersistentHover(enable: boolean): Options; | ||
/** | ||
* Configures whether to enable persistent mouse hovering (true by default). | ||
* Persistent hovering is achieved by continuously firing mouse over events at | ||
* the last location the mouse cursor has been moved to. | ||
* | ||
* @param {boolean} enable Whether to enable persistent hovering. | ||
* @return {!Options} A self reference. | ||
*/ | ||
enablePersistentHover(enable: boolean): Options; | ||
/** | ||
* Configures whether the driver should attempt to remove obsolete | ||
* {@linkplain webdriver.WebElement WebElements} from its internal cache on | ||
* page navigation (true by default). Disabling this option will cause the | ||
* driver to run with a larger memory footprint. | ||
* | ||
* @param {boolean} enable Whether to enable element reference cleanup. | ||
* @return {!Options} A self reference. | ||
*/ | ||
enableElementCacheCleanup(enable: boolean): Options; | ||
/** | ||
* Configures whether the driver should attempt to remove obsolete | ||
* {@linkplain webdriver.WebElement WebElements} from its internal cache on | ||
* page navigation (true by default). Disabling this option will cause the | ||
* driver to run with a larger memory footprint. | ||
* | ||
* @param {boolean} enable Whether to enable element reference cleanup. | ||
* @return {!Options} A self reference. | ||
*/ | ||
enableElementCacheCleanup(enable: boolean): Options; | ||
/** | ||
* Configures whether to require the IE window to have input focus before | ||
* performing any user interactions (i.e. mouse or keyboard events). This | ||
* option is disabled by default, but delivers much more accurate interaction | ||
* events when enabled. | ||
* | ||
* @param {boolean} require Whether to require window focus. | ||
* @return {!Options} A self reference. | ||
*/ | ||
requireWindowFocus(require: boolean): Options; | ||
/** | ||
* Configures whether to require the IE window to have input focus before | ||
* performing any user interactions (i.e. mouse or keyboard events). This | ||
* option is disabled by default, but delivers much more accurate interaction | ||
* events when enabled. | ||
* | ||
* @param {boolean} require Whether to require window focus. | ||
* @return {!Options} A self reference. | ||
*/ | ||
requireWindowFocus(require: boolean): Options; | ||
/** | ||
* Configures the timeout, in milliseconds, that the driver will attempt to | ||
* located and attach to a newly opened instance of Internet Explorer. The | ||
* default is zero, which indicates waiting indefinitely. | ||
* | ||
* @param {number} timeout How long to wait for IE. | ||
* @return {!Options} A self reference. | ||
*/ | ||
browserAttachTimeout(timeout: number): Options; | ||
/** | ||
* Configures the timeout, in milliseconds, that the driver will attempt to | ||
* located and attach to a newly opened instance of Internet Explorer. The | ||
* default is zero, which indicates waiting indefinitely. | ||
* | ||
* @param {number} timeout How long to wait for IE. | ||
* @return {!Options} A self reference. | ||
*/ | ||
browserAttachTimeout(timeout: number): Options; | ||
/** | ||
* Configures whether to launch Internet Explorer using the CreateProcess API. | ||
* If this option is not specified, IE is launched using IELaunchURL, if | ||
* available. For IE 8 and above, this option requires the TabProcGrowth | ||
* registry value to be set to 0. | ||
* | ||
* @param {boolean} force Whether to use the CreateProcess API. | ||
* @return {!Options} A self reference. | ||
*/ | ||
forceCreateProcessApi(force: boolean): Options; | ||
/** | ||
* Configures whether to launch Internet Explorer using the CreateProcess API. | ||
* If this option is not specified, IE is launched using IELaunchURL, if | ||
* available. For IE 8 and above, this option requires the TabProcGrowth | ||
* registry value to be set to 0. | ||
* | ||
* @param {boolean} force Whether to use the CreateProcess API. | ||
* @return {!Options} A self reference. | ||
*/ | ||
forceCreateProcessApi(force: boolean): Options; | ||
/** | ||
* Specifies command-line switches to use when launching Internet Explorer. | ||
* This is only valid when used with {@link #forceCreateProcessApi}. | ||
* | ||
* @param {...(string|!Array.<string>)} var_args The arguments to add. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addArguments(...var_args: string[]): Options; | ||
/** | ||
* Specifies command-line switches to use when launching Internet Explorer. | ||
* This is only valid when used with {@link #forceCreateProcessApi}. | ||
* | ||
* @param {...(string|!Array.<string>)} var_args The arguments to add. | ||
* @return {!Options} A self reference. | ||
*/ | ||
addArguments(...var_args: string[]): Options; | ||
/** | ||
* Configures whether proxies should be configured on a per-process basis. If | ||
* not set, setting a {@linkplain #setProxy proxy} will configure the system | ||
* proxy. The default behavior is to use the system proxy. | ||
* | ||
* @param {boolean} enable Whether to enable per-process proxy settings. | ||
* @return {!Options} A self reference. | ||
*/ | ||
usePerProcessProxy(enable: boolean): Options; | ||
/** | ||
* Configures whether proxies should be configured on a per-process basis. If | ||
* not set, setting a {@linkplain #setProxy proxy} will configure the system | ||
* proxy. The default behavior is to use the system proxy. | ||
* | ||
* @param {boolean} enable Whether to enable per-process proxy settings. | ||
* @return {!Options} A self reference. | ||
*/ | ||
usePerProcessProxy(enable: boolean): Options; | ||
/** | ||
* Configures whether to clear the cache, cookies, history, and saved form | ||
* data before starting the browser. _Using this capability will clear session | ||
* data for all running instances of Internet Explorer, including those | ||
* started manually._ | ||
* | ||
* @param {boolean} cleanSession Whether to clear all session data on startup. | ||
* @return {!Options} A self reference. | ||
*/ | ||
ensureCleanSession(cleanSession: boolean): Options; | ||
/** | ||
* Configures whether to clear the cache, cookies, history, and saved form data | ||
* before starting the browser. _Using this capability will clear session data | ||
* for all running instances of Internet Explorer, including those started | ||
* manually._ | ||
* | ||
* @param {boolean} cleanSession Whether to clear all session data on startup. | ||
* @return {!Options} A self reference. | ||
*/ | ||
ensureCleanSession(cleanSession: boolean): Options; | ||
/** | ||
* Sets the path to the log file the driver should log to. | ||
* @param {string} file The log file path. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLogFile(file: string): Options; | ||
/** | ||
* Sets the path to the log file the driver should log to. | ||
* @param {string} file The log file path. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLogFile(file: string): Options; | ||
/** | ||
* Sets the IEDriverServer's logging {@linkplain Level level}. | ||
* @param {Level} level The logging level. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLogLevel(level: webdriver.logging.Level): Options; | ||
/** | ||
* Sets the IEDriverServer's logging {@linkplain Level level}. | ||
* @param {Level} level The logging level. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLogLevel(level: webdriver.logging.Level): Options; | ||
/** | ||
* Sets the IP address of the driver's host adapter. | ||
* @param {string} host The IP address to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setHost(host: string): Options; | ||
/** | ||
* Sets the IP address of the driver's host adapter. | ||
* @param {string} host The IP address to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setHost(host: string): Options; | ||
/** | ||
* Sets the path of the temporary data directory to use. | ||
* @param {string} path The log file path. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setExtractPath(path: string): Options; | ||
/** | ||
* Sets the path of the temporary data directory to use. | ||
* @param {string} path The log file path. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setExtractPath(path: string): Options; | ||
/** | ||
* Sets whether the driver should start in silent mode. | ||
* @param {boolean} silent Whether to run in silent mode. | ||
* @return {!Options} A self reference. | ||
*/ | ||
silent(silent: boolean): Options; | ||
/** | ||
* Sets whether the driver should start in silent mode. | ||
* @param {boolean} silent Whether to run in silent mode. | ||
* @return {!Options} A self reference. | ||
*/ | ||
silent(silent: boolean): Options; | ||
/** | ||
* Sets the proxy settings for the new session. | ||
* @param {capabilities.ProxyConfig} proxy The proxy configuration to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProxy(proxy: webdriver.ProxyConfig): Options; | ||
/** | ||
* Converts this options instance to a {@link capabilities.Capabilities} | ||
* object. | ||
* @param {capabilities.Capabilities=} opt_capabilities The capabilities to | ||
* merge these options into, if any. | ||
* @return {!capabilities.Capabilities} The capabilities. | ||
*/ | ||
toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; | ||
/** | ||
* Sets the proxy settings for the new session. | ||
* @param {capabilities.ProxyConfig} proxy The proxy configuration to use. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setProxy(proxy: webdriver.ProxyConfig): Options; | ||
} |
{ | ||
"name": "@types/selenium-webdriver", | ||
"version": "3.0.15", | ||
"version": "4.0.0", | ||
"description": "TypeScript definitions for Selenium WebDriverJS", | ||
@@ -42,8 +42,9 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/selenium-webdriver" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "29b1f873c17d1f212dda5e5b693fa0a73c42b3eba34fc7a2d0dc47f438c911da", | ||
"typeScriptVersion": "2.3" | ||
"typesPublisherContentHash": "8f405a034bfe48d62921e30d94eb30ed1573639f81a8b8b023468861905968a9", | ||
"typeScriptVersion": "2.4" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for Selenium WebDriverJS ( https://github.com/SeleniumHQ/selenium/tree/master/javascript/node/selenium-webdriver ). | ||
This package contains type definitions for Selenium WebDriverJS ( https://github.com/SeleniumHQ/selenium ). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Wed, 13 Feb 2019 21:06:21 GMT | ||
* Last updated: Wed, 03 Apr 2019 01:26:43 GMT | ||
* Dependencies: none | ||
@@ -15,0 +15,0 @@ * Global values: none |
@@ -9,3 +9,3 @@ import * as webdriver from './index'; | ||
*/ | ||
export interface ServiceOptions { } | ||
export interface ServiceOptions {} | ||
@@ -21,140 +21,132 @@ /** | ||
export class DriverService { | ||
/** | ||
* @param {string} executable Path to the executable to run. | ||
* @param {!ServiceOptions} options Configuration options for the service. | ||
*/ | ||
constructor(executable: string, options: ServiceOptions); | ||
/** | ||
* @return {!promise.Promise<string>} A promise that resolves to | ||
* the server's address. | ||
* @throws {Error} If the server has not been started. | ||
*/ | ||
address(): Promise<string>; | ||
/** | ||
* Returns whether the underlying process is still running. This does not take | ||
* into account whether the process is in the process of shutting down. | ||
* @return {boolean} Whether the underlying service process is running. | ||
*/ | ||
isRunning(): boolean; | ||
/** | ||
* Starts the server if it is not already running. | ||
* @param {number=} opt_timeoutMs How long to wait, in milliseconds, for the | ||
* server to start accepting requests. Defaults to 30 seconds. | ||
* @return {!promise.Promise<string>} A promise that will resolve | ||
* to the server's base URL when it has started accepting requests. If the | ||
* timeout expires before the server has started, the promise will be | ||
* rejected. | ||
*/ | ||
start(opt_timeoutMs?: number): Promise<string>; | ||
/** | ||
* Stops the service if it is not currently running. This function will kill | ||
* the server immediately. To synchronize with the active control flow, use | ||
* {@link #stop()}. | ||
* @return {!promise.Promise} A promise that will be resolved when | ||
* the server has been stopped. | ||
*/ | ||
kill(): Promise<any>; | ||
} | ||
export namespace DriverService { | ||
/** | ||
* Creates {@link DriverService} objects that manage a WebDriver server in a | ||
* child process. | ||
*/ | ||
class Builder { | ||
/** | ||
* @param {string} executable Path to the executable to run. | ||
* @param {!ServiceOptions} options Configuration options for the service. | ||
* @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(executable: string, options: ServiceOptions); | ||
constructor(exe: string); | ||
/** | ||
* @return {!promise.Promise<string>} A promise that resolves to | ||
* the server's address. | ||
* @throws {Error} If the server has not been started. | ||
* 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 | ||
*/ | ||
address(): webdriver.promise.Promise<string>; | ||
addArguments(...var_args: string[]): this; | ||
/** | ||
* Returns whether the underlying process is still running. This does not take | ||
* into account whether the process is in the process of shutting down. | ||
* @return {boolean} Whether the underlying service process is running. | ||
* 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. | ||
*/ | ||
isRunning(): boolean; | ||
setHostname(hostname: string): this; | ||
/** | ||
* Starts the server if it is not already running. | ||
* @param {number=} opt_timeoutMs How long to wait, in milliseconds, for the | ||
* server to start accepting requests. Defaults to 30 seconds. | ||
* @return {!promise.Promise<string>} A promise that will resolve | ||
* to the server's base URL when it has started accepting requests. If the | ||
* timeout expires before the server has started, the promise will be | ||
* rejected. | ||
* Sets whether the service should be accessed at this host's loopback | ||
* address. | ||
* | ||
* @param {boolean} loopback | ||
* @return {!DriverService.Builder} A self reference. | ||
*/ | ||
start(opt_timeoutMs?: number): webdriver.promise.Promise<string>; | ||
setLoopback(loopback: boolean): this; | ||
/** | ||
* Stops the service if it is not currently running. This function will kill | ||
* the server immediately. To synchronize with the active control flow, use | ||
* {@link #stop()}. | ||
* @return {!promise.Promise} A promise that will be resolved when | ||
* the server has been stopped. | ||
* 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. | ||
*/ | ||
kill(): webdriver.promise.Promise<any>; | ||
setPath(basePath: string|null): this; | ||
/** | ||
* Schedules a task in the current control flow to stop the server if it is | ||
* currently running. | ||
* @return {!promise.Promise} A promise that will be resolved when | ||
* the server has been stopped. | ||
* 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. | ||
*/ | ||
stop(): webdriver.promise.Promise<any>; | ||
} | ||
setPort(port: number): this; | ||
export namespace DriverService { | ||
/** | ||
* Creates {@link DriverService} objects that manage a WebDriver server in a | ||
* child process. | ||
* 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<string, string>|Object<string, string>|null)} env The desired | ||
* environment to use, or `null` if the server should inherit the | ||
* current environment. | ||
* @return {!DriverService.Builder} A self reference. | ||
*/ | ||
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); | ||
setEnvironment(env: Map<string, string>|{[name: string]: string}|null): this; | ||
/** | ||
* 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; | ||
/** | ||
* 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; | ||
/** | ||
* 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<string, string>|Object<string, string>|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<string, string> | {[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; | ||
} | ||
/** | ||
* Creates a new DriverService using this instance's current configuration. | ||
* | ||
* @return {!DriverService} A new driver service. | ||
*/ | ||
build(): DriverService; | ||
} | ||
} | ||
@@ -168,40 +160,40 @@ | ||
export class SeleniumServer extends DriverService { | ||
/** | ||
* @param {string} jar Path to the Selenium server jar. | ||
* @param {SeleniumServer.Options=} opt_options Configuration options for the | ||
* server. | ||
* @throws {Error} If the path to the Selenium jar is not specified or if an | ||
* invalid port is specified. | ||
**/ | ||
constructor(jar: string, opt_options?: SeleniumServer.Options); | ||
/** | ||
* @param {string} jar Path to the Selenium server jar. | ||
* @param {SeleniumServer.Options=} opt_options Configuration options for the | ||
* server. | ||
* @throws {Error} If the path to the Selenium jar is not specified or if an | ||
* invalid port is specified. | ||
**/ | ||
constructor(jar: string, opt_options?: SeleniumServer.Options); | ||
} | ||
export namespace SeleniumServer { | ||
/** | ||
* Options for the Selenium server | ||
*/ | ||
interface Options { | ||
/** Whether the server should only be accessed on this host's loopback address.*/ | ||
loopback?: boolean; | ||
/** | ||
* Options for the Selenium server | ||
*/ | ||
interface Options { | ||
/** Whether the server should only be accessed on this host's loopback address.*/ | ||
loopback?: boolean; | ||
/** The port to start the server on (must be > 0). If the port is provided | ||
as a promise, the service will wait for the promise to resolve before starting. */ | ||
port?: number|webdriver.promise.IThenable<number>; | ||
/** The port to start the server on (must be > 0). If the port is provided | ||
as a promise, the service will wait for the promise to resolve before starting. */ | ||
port?: number|Promise<number>; | ||
/** The arguments to pass to the service. If a promise is provided, the | ||
service will wait for it to resolve before starting. */ | ||
args?: string[]|webdriver.promise.IThenable<string[]>; | ||
/** The arguments to pass to the service. If a promise is provided, the | ||
service will wait for it to resolve before starting. */ | ||
args?: string[]|Promise<string[]>; | ||
/** The arguments to pass to the JVM. If a promise is provided, the service | ||
will wait for it to resolve before starting. */ | ||
jvmArgs?: string[]|webdriver.promise.IThenable<string[]>; | ||
/** The arguments to pass to the JVM. If a promise is provided, the service | ||
will wait for it to resolve before starting. */ | ||
jvmArgs?: string[]|Promise<string[]>; | ||
/** The environment variables that should be visible to the server process. | ||
Defaults to inheriting the current process's environment.*/ | ||
env?: {[key: string]: string}; | ||
/** The environment variables that should be visible to the server process. | ||
Defaults to inheriting the current process's environment.*/ | ||
env?: {[key: string]: string}; | ||
/** IO configuration for the spawned server process. For more information, | ||
refer to the documentation of `child_process.spawn`*/ | ||
stdio?: string|Array<string|number>; | ||
} | ||
/** IO configuration for the spawned server process. For more information, | ||
refer to the documentation of `child_process.spawn`*/ | ||
stdio?: string|Array<string|number>; | ||
} | ||
} | ||
@@ -226,21 +218,21 @@ | ||
export class FileDetector extends webdriver.FileDetector { | ||
/** | ||
* @constructor | ||
**/ | ||
constructor(); | ||
/** | ||
* @constructor | ||
**/ | ||
constructor(); | ||
/** | ||
* Prepares a `file` for use with the remote browser. If the provided path | ||
* does not reference a normal file (i.e. it does not exist or is a | ||
* directory), then the promise returned by this method will be resolved with | ||
* the original file path. Otherwise, this method will upload the file to the | ||
* remote server, which will return the file's path on the remote system so | ||
* it may be referenced in subsequent commands. | ||
* | ||
* @param {!webdriver.WebDriver} driver The driver for the current browser. | ||
* @param {string} file The path of the file to process. | ||
* @return {!webdriver.promise.Promise<string>} A promise for the processed | ||
* file path. | ||
*/ | ||
handleFile(driver: webdriver.WebDriver, file: string): webdriver.promise.Promise<string>; | ||
/** | ||
* Prepares a `file` for use with the remote browser. If the provided path | ||
* does not reference a normal file (i.e. it does not exist or is a | ||
* directory), then the promise returned by this method will be resolved | ||
* with the original file path. Otherwise, this method will upload the file | ||
* to the remote server, which will return the file's path on the remote | ||
* system so it may be referenced in subsequent commands. | ||
* | ||
* @param {!webdriver.WebDriver} driver The driver for the current browser. | ||
* @param {string} file The path of the file to process. | ||
* @return {!Promise<string>} A promise for the processed | ||
* file path. | ||
*/ | ||
handleFile(driver: webdriver.WebDriver, file: string): Promise<string>; | ||
} |
import * as webdriver from './index'; | ||
export class Server { } | ||
export class Server {} | ||
@@ -9,3 +9,3 @@ /** | ||
*/ | ||
export function findSafariExecutable(): any; | ||
export function findSafariDriver(): any; | ||
@@ -32,4 +32,3 @@ /** | ||
*/ | ||
export class CommandExecutor { | ||
} | ||
export class CommandExecutor {} | ||
@@ -39,34 +38,9 @@ /** | ||
*/ | ||
export class Options { | ||
/** | ||
* Extracts the SafariDriver specific options from the given capabilities | ||
* object. | ||
* @param {!Capabilities} capabilities The capabilities object. | ||
* @return {!Options} The ChromeDriver options. | ||
*/ | ||
static fromCapabilities(capabilities: webdriver.Capabilities): Options; | ||
/** | ||
* Sets whether to force Safari to start with a clean session. Enabling this | ||
* option will cause all global browser data to be deleted. | ||
* @param {boolean} clean Whether to make sure the session has no cookies, | ||
* cache entries, local storage, or databases. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setCleanSession(clean: boolean): Options; | ||
/** | ||
* Sets the logging preferences for the new session. | ||
* @param {!./lib/logging.Preferences} prefs The logging preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; | ||
/** | ||
* Converts this options instance to a {@link Capabilities} object. | ||
* @param {Capabilities=} opt_capabilities The capabilities to | ||
* merge these options into, if any. | ||
* @return {!Capabilities} The capabilities. | ||
*/ | ||
toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; | ||
export class Options extends webdriver.Capabilities { | ||
/** | ||
* Sets the logging preferences for the new session. | ||
* @param {!./lib/logging.Preferences} prefs The logging preferences. | ||
* @return {!Options} A self reference. | ||
*/ | ||
setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; | ||
} | ||
@@ -84,12 +58,10 @@ | ||
export class Driver extends webdriver.WebDriver { | ||
/** | ||
* Creates a new Safari session. | ||
* | ||
* @param {(Options|Capabilities)=} opt_config The configuration | ||
* options for the new session. | ||
* @param {promise.ControlFlow=} opt_flow The control flow to create | ||
* the driver under. | ||
* @return {!Driver} A new driver instance. | ||
*/ | ||
static createSession(opt_config?: Options | webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow): Driver; | ||
/** | ||
* Creates a new Safari session. | ||
* | ||
* @param {(Options|Capabilities)=} opt_config The configuration | ||
* options for the new session. | ||
* @return {!Driver} A new driver instance. | ||
*/ | ||
static createSession(opt_config?: Options|webdriver.Capabilities): Driver; | ||
} |
Sorry, the diff of this file is too big to display
16
189809
4943