Merged all of the selenium webdriver .ts files.

The CI build was failing because it tries to compile each file
individually. To fix this I merged all of the files into one. I also
deleted the legacy files since those versions are no longer supported.
This commit is contained in:
Bill Armstrong
2014-12-18 09:40:18 -05:00
parent 31cec16179
commit 4c18f8fd52
14 changed files with 625 additions and 7328 deletions

View File

@@ -1,47 +0,0 @@
/// <reference path="selenium-webdriver.d.ts" />
function TestChromeDriver() {
var driver: chrome.Driver = new chrome.Driver();
driver = new chrome.Driver(webdriver.Capabilities.chrome());
driver = new chrome.Driver(webdriver.Capabilities.chrome(), new webdriver.promise.ControlFlow());
var baseDriver: webdriver.WebDriver = driver;
}
function TestChromeOptions() {
var options: chrome.Options = new chrome.Options();
options = chrome.Options.fromCapabilities(webdriver.Capabilities.chrome());
options = options.addArguments("a", "b", "c");
options = options.addExtensions("a", "b", "c");
options = options.detachDriver(true);
options = options.setChromeBinaryPath("path");
options = options.setChromeLogFile("logfile");
options = options.setLocalState("state");
options = options.setLoggingPrefs(new webdriver.logging.Preferences());
options = options.setProxy({ proxyType: "proxyType" });
options = options.setUserPreferences("preferences");
var capabilities: webdriver.Capabilities = options.toCapabilities();
capabilities = options.toCapabilities(webdriver.Capabilities.chrome());
var values: chrome.IOptionsValues = options.toJSON();
}
function TestServiceBuilder() {
var builder: chrome.ServiceBuilder = new chrome.ServiceBuilder();
builder = new chrome.ServiceBuilder("exe");
var anything: any = builder.build();
builder = builder.enableVerboseLogging();
builder = builder.loggingTo("path");
builder = builder.setNumHttpThreads(5);
builder = builder.setStdio("config");
builder = builder.setStdio(["A", "B"]);
builder = builder.setUrlBasePath("path");
builder = builder.usingPort(8080);
builder = builder.withEnvironment({ "A": "a", "B": "b" });
}
function TestChromeModule() {
var service: any = chrome.getDefaultService();
chrome.setDefaultService({});
}

View File

@@ -1,269 +0,0 @@
declare module chrome {
/**
* Creates a new WebDriver client for Chrome.
*
* @extends {webdriver.WebDriver}
*/
class Driver extends webdriver.WebDriver {
/**
* @param {(webdriver.Capabilities|Options)=} opt_config The configuration
* options.
* @param {remote.DriverService=} opt_service The session to use; will use
* the {@link getDefaultService default service} by default.
* @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or
* {@code null} to use the currently active flow.
* @constructor
*/
constructor(opt_config?: webdriver.Capabilities, opt_service?: any, opt_flow?: webdriver.promise.ControlFlow);
constructor(opt_config?: Options, opt_service?: any, opt_flow?: webdriver.promise.ControlFlow);
}
interface IOptionsValues {
args: string[];
binary?: string;
detach: boolean;
extensions: string[];
localState?: any;
logFile?: string;
prefs?: any;
}
/**
* Class for managing ChromeDriver specific options.
*/
class Options {
/**
* @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;
/**
* 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 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 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 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 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 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 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 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 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;
/**
* Converts this instance to its JSON wire protocol representation. Note this
* function is an implementation not intended for general use.
* @return {{args: !Array.<string>,
* binary: (string|undefined),
* detach: boolean,
* extensions: !Array.<string>,
* localState: (Object|undefined),
* logFile: (string|undefined),
* prefs: (Object|undefined)}} The JSON wire protocol representation
* of this instance.
*/
toJSON(): IOptionsValues;
}
/**
* Creates {@link remote.DriverService} instances that manage a ChromeDriver
* server.
*/
class ServiceBuilder {
/**
* @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 the port to start the ChromeDriver on.
* @param {number} port The port to use, or 0 for any free port.
* @return {!ServiceBuilder} A self reference.
* @throws {Error} If the port is invalid.
*/
usingPort(port: number): ServiceBuilder;
/**
* 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): ServiceBuilder;
/**
* Enables verbose logging.
* @return {!ServiceBuilder} A self reference.
*/
enableVerboseLogging(): ServiceBuilder;
/**
* 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): ServiceBuilder;
/**
* Sets the base path for WebDriver REST commands (e.g. "/wd/hub").
* By default, the driver will accept commands relative to "/".
* @param {string} path The base path to use.
* @return {!ServiceBuilder} A self reference.
*/
setUrlBasePath(path: string): ServiceBuilder;
/**
* Defines the stdio configuration for the driver service. See
* {@code child_process.spawn} for more information.
* @param {(string|!Array.<string|number|!Stream|null|undefined>)} config The
* configuration to use.
* @return {!ServiceBuilder} A self reference.
*/
setStdio(config: string): ServiceBuilder;
setStdio(config: any[]): ServiceBuilder;
/**
* Defines the environment to start the server under. This settings will be
* inherited by every browser session started by the server.
* @param {!Object.<string, string>} env The environment to use.
* @return {!ServiceBuilder} A self reference.
*/
withEnvironment(env: { [key: string]: string }): ServiceBuilder;
/**
* Creates a new DriverService using this instance's current configuration.
* @return {remote.DriverService} A new driver service using this instance's
* current configuration.
* @throws {Error} If the driver exectuable was not specified and a default
* could not be found on the current PATH.
*/
build(): any;
}
/**
* Returns the default ChromeDriver service. If such a service has not been
* configured, one will be constructed using the default configuration for
* a ChromeDriver executable found on the system PATH.
* @return {!remote.DriverService} The default ChromeDriver service.
*/
function getDefaultService(): any;
/**
* Sets the default service to use for new ChromeDriver instances.
* @param {!remote.DriverService} service The service to use.
* @throws {Error} If the default service is currently running.
*/
function setDefaultService(service: any): void;
}
declare module 'selenium-webdriver/chrome' {
export = chrome;
}

View File

@@ -1,8 +0,0 @@
/// <reference path="selenium-webdriver.d.ts" />
/// <reference path="executors.d.ts" />
function TestExecutors() {
var exec: webdriver.CommandExecutor = executors.createExecutor("url");
exec = executors.createExecutor(new webdriver.promise.Promise<string>());
}

View File

@@ -1,13 +0,0 @@
declare module executors {
/**
* Creates a command executor that uses WebDriver's JSON wire protocol.
* @param url The server's URL, or a promise that will resolve to that URL.
* @returns {!webdriver.CommandExecutor} The new command executor.
*/
function createExecutor(url: string): webdriver.CommandExecutor;
function createExecutor(url: webdriver.promise.Promise<string>): webdriver.CommandExecutor;
}
declare module 'selenium-webdriver/executors' {
export = executors;
}

View File

@@ -1,53 +0,0 @@
/// <reference path="selenium-webdriver.d.ts" />
function TestBinary() {
var binary: firefox.Binary = new firefox.Binary();
binary = new firefox.Binary("exe");
binary.addArguments("A", "B", "C");
var promise: webdriver.promise.Promise<void> = binary.kill();
binary.launch("profile").then(function (result: any) { });
}
function TestFirefoxDriver() {
var driver: firefox.Driver = new firefox.Driver();
driver = new chrome.Driver(webdriver.Capabilities.firefox());
driver = new chrome.Driver(webdriver.Capabilities.firefox(), new webdriver.promise.ControlFlow());
var baseDriver: webdriver.WebDriver = driver;
}
function TestFirefoxOptions() {
var options: firefox.Options = new firefox.Options();
options = options.setBinary("binary");
options = options.setBinary(new firefox.Binary());
options = options.setLoggingPreferences(new webdriver.logging.Preferences());
options = options.setProfile("profile");
options = options.setProfile(new firefox.Profile());
options = options.setProxy({ proxyType: "proxy" });
var capabilities: webdriver.Capabilities = options.toCapabilities();
var capabilities: webdriver.Capabilities = options.toCapabilities({});
}
function TestFirefoxProfile() {
var profile: firefox.Profile = new firefox.Profile();
profile = new firefox.Profile("dir");
var bool: boolean = profile.acceptUntrustedCerts();
profile.addExtension("ext");
bool = profile.assumeUntrustedCertIssuer();
profile.encode().then(function (prof: string) { });
var num: number = profile.getPort();
var anything: any = profile.getPreference("key");
bool = profile.nativeEventsEnabled();
profile.setAcceptUntrustedCerts(true);
profile.setAssumeUntrustedCertIssuer(true);
profile.setNativeEventsEnabled(true);
profile.setPort(8080);
profile.setPreference("key", "value");
profile.setPreference("key", 5);
profile.setPreference("key", true);
var stringPromise: webdriver.promise.Promise<string> = profile.writeToDisk();
stringPromise = profile.writeToDisk(true);
}

View File

@@ -1,238 +0,0 @@
declare module firefox {
/**
* Manages a Firefox subprocess configured for use with WebDriver.
*/
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>;
}
/**
* A WebDriver client for Firefox.
*
* @extends {webdriver.WebDriver}
*/
class Driver extends webdriver.WebDriver {
/**
* @param {(Options|webdriver.Capabilities|Object)=} opt_config The
* configuration options for this driver, specified as either an
* {@link Options} or {@link webdriver.Capabilities}, or as a raw hash
* object.
* @param {webdriver.promise.ControlFlow=} opt_flow The flow to
* schedule commands through. Defaults to the active flow object.
* @constructor
*/
constructor(opt_config?: webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow);
constructor(opt_config?: any, opt_flow?: webdriver.promise.ControlFlow);
}
/**
* Configuration options for the FirefoxDriver.
*/
class Options {
/**
* @constructor
*/
constructor();
/**
* 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;
setProfile(profile: Profile): 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): Options;
setBinary(binary: Binary): Options;
/**
* Sets the logging preferences for the new session.
* @param {webdriver.logging.Preferences} prefs The logging preferences.
* @return {!Options} A self reference.
*/
setLoggingPreferences(prefs: webdriver.logging.Preferences): Options;
/**
* Sets the proxy to use.
*
* @param {webdriver.ProxyConfig} proxy The proxy configuration to use.
* @return {!Options} A self reference.
*/
setProxy(proxy: webdriver.ProxyConfig): Options;
/**
* Converts these options to a {@link webdriver.Capabilities} instance.
*
* @return {!webdriver.Capabilities} A new capabilities object.
*/
toCapabilities(opt_remote?: any): webdriver.Capabilities;
}
/**
* Models a Firefox proifle directory for use with the FirefoxDriver. The
* {@code Proifle} directory uses an in-memory model until {@link #writeToDisk}
* is called.
*/
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>;
}
}
declare module 'selenium-webdriver/firefox' {
export = firefox;
}

View File

@@ -1,917 +0,0 @@
/// <reference path="selenium-webdriver-2.39.0.d.ts" />
function TestAbstractBuilder() {
var builder: webdriver.AbstractBuilder = new webdriver.AbstractBuilder();
var driver: webdriver.WebDriver = builder.build();
var capabilities: webdriver.Capabilities = builder.getCapabilities();
url = builder.getServerUrl();
var otherBuilder: webdriver.AbstractBuilder = builder.usingServer(url);
otherBuilder = builder.withCapabilities(webdriver.Capabilities.android());
var objCapabilities: { [index: string]: string; } = {};
objCapabilities[webdriver.Capability.BROWSER_NAME] = webdriver.Browser.PHANTOM_JS;
otherBuilder = builder.withCapabilities(objCapabilities);
var url: string = webdriver.AbstractBuilder.DEFAULT_SERVER_URL;
var env: string = webdriver.AbstractBuilder.SERVER_URL_ENV;
}
function TestBuilder() {
var builder: webdriver.Builder = new webdriver.Builder();
var abstractBuilder: webdriver.AbstractBuilder = builder;
var driver: webdriver.WebDriver = builder.build();
var session: string = builder.getSession();
abstractBuilder = builder.usingSession("ID");
var env: string = webdriver.Builder.SESSION_ID_ENV;
}
function TestActionSequence() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var sequence: webdriver.ActionSequence = new webdriver.ActionSequence(driver);
var element: webdriver.WebElement = new webdriver.WebElement(driver, 'id');
// Click
sequence = sequence.click();
sequence = sequence.click(webdriver.Button.LEFT);
sequence = sequence.click(element);
sequence = sequence.click(element, webdriver.Button.LEFT);
// DoubleClick
sequence = sequence.doubleClick();
sequence = sequence.doubleClick(webdriver.Button.LEFT);
sequence = sequence.doubleClick(element);
sequence = sequence.doubleClick(element, webdriver.Button.LEFT);
// DragAndDrop
sequence = sequence.dragAndDrop(element, element);
sequence = sequence.dragAndDrop(element, {x: 1, y: 2});
// KeyDown
sequence = sequence.keyDown(webdriver.Key.ADD);
// KeyUp
sequence = sequence.keyUp(webdriver.Key.ADD);
// MouseDown
sequence = sequence.mouseDown();
sequence = sequence.mouseDown(webdriver.Button.LEFT);
sequence = sequence.mouseDown(element);
sequence = sequence.mouseDown(element, webdriver.Button.LEFT);
// MouseMove
sequence = sequence.mouseMove(element);
sequence = sequence.mouseMove({x: 1, y: 1});
sequence = sequence.mouseMove(element, {x: 1, y: 2});
// MouseUp
sequence = sequence.mouseUp();
sequence = sequence.mouseUp(webdriver.Button.LEFT);
sequence = sequence.mouseUp(element);
sequence = sequence.mouseUp(element, webdriver.Button.LEFT);
// SendKeys
sequence = sequence.sendKeys("A", "B", "C");
sequence = sequence.sendKeys(["A", "B", "C"]);
var promise: webdriver.promise.Promise = sequence.perform();
}
function TestAlert() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var promise: webdriver.promise.Promise = new webdriver.promise.Promise();
var alert: webdriver.Alert = new webdriver.Alert(driver, 'ABC');
alert = new webdriver.Alert(driver, promise);
var deferred: webdriver.promise.Deferred = alert;
promise = alert.accept();
promise = alert.dismiss();
promise = alert.getText();
promise = alert.sendKeys("ABC");
}
function TestBrowser() {
var browser: string;
browser = webdriver.Browser.ANDROID;
browser = webdriver.Browser.CHROME;
browser = webdriver.Browser.FIREFOX;
browser = webdriver.Browser.HTMLUNIT;
browser = webdriver.Browser.INTERNET_EXPLORER;
browser = webdriver.Browser.IPAD;
browser = webdriver.Browser.IPHONE;
browser = webdriver.Browser.OPERA;
browser = webdriver.Browser.PHANTOM_JS;
browser = webdriver.Browser.SAFARI;
}
function TestButton() {
var button: number;
button = webdriver.Button.LEFT;
button = webdriver.Button.MIDDLE;
button = webdriver.Button.RIGHT;
}
function TestCapabilities() {
var capabilities: webdriver.Capabilities = new webdriver.Capabilities();
capabilities = new webdriver.Capabilities(webdriver.Capabilities.chrome());
var objCapabilities: any = {};
objCapabilities[webdriver.Capability.BROWSER_NAME] = webdriver.Browser.PHANTOM_JS;
capabilities = new webdriver.Capabilities(objCapabilities);
var anything: any = capabilities.get(webdriver.Capability.SECURE_SSL);
var check: boolean = capabilities.has(webdriver.Capability.SECURE_SSL);
capabilities = capabilities.merge(capabilities);
capabilities = capabilities.merge(objCapabilities);
capabilities = capabilities.set(webdriver.Capability.VERSION, { abc: 'def' });
capabilities = capabilities.set(webdriver.Capability.VERSION, null);
anything = capabilities.toJSON();
capabilities = webdriver.Capabilities.android();
capabilities = webdriver.Capabilities.chrome();
capabilities = webdriver.Capabilities.firefox();
capabilities = webdriver.Capabilities.htmlunit();
capabilities = webdriver.Capabilities.htmlunitwithjs();
capabilities = webdriver.Capabilities.ie();
capabilities = webdriver.Capabilities.ipad();
capabilities = webdriver.Capabilities.iphone();
capabilities = webdriver.Capabilities.opera();
capabilities = webdriver.Capabilities.phantomjs();
capabilities = webdriver.Capabilities.safari();
}
function TestCapability() {
var capability: string;
capability = webdriver.Capability.ACCEPT_SSL_CERTS;
capability = webdriver.Capability.BROWSER_NAME;
capability = webdriver.Capability.HANDLES_ALERTS;
capability = webdriver.Capability.LOGGING_PREFS;
capability = webdriver.Capability.PLATFORM;
capability = webdriver.Capability.PROXY;
capability = webdriver.Capability.ROTATABLE;
capability = webdriver.Capability.SECURE_SSL;
capability = webdriver.Capability.SUPPORTS_APPLICATION_CACHE;
capability = webdriver.Capability.SUPPORTS_BROWSER_CONNECTION;
capability = webdriver.Capability.SUPPORTS_CSS_SELECTORS;
capability = webdriver.Capability.SUPPORTS_JAVASCRIPT;
capability = webdriver.Capability.SUPPORTS_LOCATION_CONTEXT;
capability = webdriver.Capability.TAKES_SCREENSHOT;
capability = webdriver.Capability.UNEXPECTED_ALERT_BEHAVIOR;
capability = webdriver.Capability.VERSION;
}
function TestCommand() {
var command: webdriver.Command = new webdriver.Command(webdriver.CommandName.ADD_COOKIE);
var name: string = command.getName();
var param: any = command.getParameter("param");
var params: any = command.getParameters();
command = command.setParameter("param", 123);
command = command.setParameters({ param: 123 });
}
function TestCommandExecutor() {
var c: webdriver.CommandExecutor = { execute: function(command: webdriver.Command, callback: (error: Error, obj: any) => any) {} };
}
function TestCommandName() {
var command: string;
command = webdriver.CommandName.ACCEPT_ALERT;
command = webdriver.CommandName.ADD_COOKIE;
command = webdriver.CommandName.CLEAR_APP_CACHE;
command = webdriver.CommandName.CLEAR_ELEMENT;
command = webdriver.CommandName.CLEAR_LOCAL_STORAGE;
command = webdriver.CommandName.CLEAR_SESSION_STORAGE;
command = webdriver.CommandName.CLICK;
command = webdriver.CommandName.CLICK_ELEMENT;
command = webdriver.CommandName.CLOSE;
command = webdriver.CommandName.DELETE_ALL_COOKIES;
command = webdriver.CommandName.DELETE_COOKIE;
command = webdriver.CommandName.DESCRIBE_SESSION;
command = webdriver.CommandName.DISMISS_ALERT;
command = webdriver.CommandName.DOUBLE_CLICK;
command = webdriver.CommandName.ELEMENT_EQUALS;
command = webdriver.CommandName.EXECUTE_ASYNC_SCRIPT;
command = webdriver.CommandName.EXECUTE_SCRIPT;
command = webdriver.CommandName.EXECUTE_SQL;
command = webdriver.CommandName.FIND_CHILD_ELEMENT;
command = webdriver.CommandName.FIND_CHILD_ELEMENTS;
command = webdriver.CommandName.FIND_ELEMENT;
command = webdriver.CommandName.FIND_ELEMENTS;
command = webdriver.CommandName.GET;
command = webdriver.CommandName.GET_ACTIVE_ELEMENT;
command = webdriver.CommandName.GET_ALERT_TEXT;
command = webdriver.CommandName.GET_ALL_COOKIES;
command = webdriver.CommandName.GET_APP_CACHE;
command = webdriver.CommandName.GET_APP_CACHE_STATUS;
command = webdriver.CommandName.GET_AVAILABLE_LOG_TYPES;
command = webdriver.CommandName.GET_COOKIE;
command = webdriver.CommandName.GET_CURRENT_URL;
command = webdriver.CommandName.GET_CURRENT_WINDOW_HANDLE;
command = webdriver.CommandName.GET_ELEMENT_ATTRIBUTE;
command = webdriver.CommandName.GET_ELEMENT_LOCATION;
command = webdriver.CommandName.GET_ELEMENT_LOCATION_IN_VIEW;
command = webdriver.CommandName.GET_ELEMENT_SIZE;
command = webdriver.CommandName.GET_ELEMENT_TAG_NAME;
command = webdriver.CommandName.GET_ELEMENT_TEXT;
command = webdriver.CommandName.GET_ELEMENT_VALUE_OF_CSS_PROPERTY;
command = webdriver.CommandName.GET_LOCAL_STORAGE_ITEM;
command = webdriver.CommandName.GET_LOCAL_STORAGE_KEYS;
command = webdriver.CommandName.GET_LOCAL_STORAGE_SIZE;
command = webdriver.CommandName.GET_LOCATION;
command = webdriver.CommandName.GET_LOG;
command = webdriver.CommandName.GET_PAGE_SOURCE;
command = webdriver.CommandName.GET_SCREEN_ORIENTATION;
command = webdriver.CommandName.GET_SERVER_STATUS;
command = webdriver.CommandName.GET_SESSION_LOGS;
command = webdriver.CommandName.GET_SESSION_STORAGE_ITEM;
command = webdriver.CommandName.GET_SESSION_STORAGE_KEYS;
command = webdriver.CommandName.GET_SESSION_STORAGE_SIZE;
command = webdriver.CommandName.GET_SESSIONS;
command = webdriver.CommandName.GET_TITLE;
command = webdriver.CommandName.GET_WINDOW_HANDLES;
command = webdriver.CommandName.GET_WINDOW_POSITION;
command = webdriver.CommandName.GET_WINDOW_SIZE;
command = webdriver.CommandName.GO_BACK;
command = webdriver.CommandName.GO_FORWARD;
command = webdriver.CommandName.IMPLICITLY_WAIT;
command = webdriver.CommandName.IS_BROWSER_ONLINE;
command = webdriver.CommandName.IS_ELEMENT_DISPLAYED;
command = webdriver.CommandName.IS_ELEMENT_ENABLED;
command = webdriver.CommandName.IS_ELEMENT_SELECTED;
command = webdriver.CommandName.MAXIMIZE_WINDOW;
command = webdriver.CommandName.MOUSE_DOWN;
command = webdriver.CommandName.MOUSE_UP;
command = webdriver.CommandName.MOVE_TO;
command = webdriver.CommandName.NEW_SESSION;
command = webdriver.CommandName.QUIT;
command = webdriver.CommandName.REFRESH;
command = webdriver.CommandName.REMOVE_LOCAL_STORAGE_ITEM;
command = webdriver.CommandName.REMOVE_SESSION_STORAGE_ITEM;
command = webdriver.CommandName.SCREENSHOT;
command = webdriver.CommandName.SEND_KEYS_TO_ACTIVE_ELEMENT;
command = webdriver.CommandName.SEND_KEYS_TO_ELEMENT;
command = webdriver.CommandName.SET_ALERT_TEXT;
command = webdriver.CommandName.SET_BROWSER_ONLINE;
command = webdriver.CommandName.SET_LOCAL_STORAGE_ITEM;
command = webdriver.CommandName.SET_LOCATION;
command = webdriver.CommandName.SET_SCREEN_ORIENTATION;
command = webdriver.CommandName.SET_SCRIPT_TIMEOUT;
command = webdriver.CommandName.SET_SESSION_STORAGE_ITEM;
command = webdriver.CommandName.SET_TIMEOUT;
command = webdriver.CommandName.SET_WINDOW_POSITION;
command = webdriver.CommandName.SET_WINDOW_SIZE;
command = webdriver.CommandName.SUBMIT_ELEMENT;
command = webdriver.CommandName.SWITCH_TO_FRAME;
command = webdriver.CommandName.SWITCH_TO_WINDOW;
command = webdriver.CommandName.TOUCH_DOUBLE_TAP;
command = webdriver.CommandName.TOUCH_DOWN;
command = webdriver.CommandName.TOUCH_FLICK;
command = webdriver.CommandName.TOUCH_LONG_PRESS;
command = webdriver.CommandName.TOUCH_MOVE;
command = webdriver.CommandName.TOUCH_SCROLL;
command = webdriver.CommandName.TOUCH_SINGLE_TAP;
command = webdriver.CommandName.TOUCH_UP;
}
function TestEventEmitter() {
var emitter: webdriver.EventEmitter = new webdriver.EventEmitter();
var callback = function (a: number, b: number, c: number) {};
emitter = emitter.addListener('ABC', callback);
emitter.emit('ABC', 1, 2, 3);
var listeners = emitter.listeners('ABC');
var length: number = listeners.length;
var listenerInfo = listeners[0];
if (listenerInfo.oneshot) {
listenerInfo.fn.apply(listenerInfo.scope, [1, 2, 3]);
}
emitter = emitter.on('ABC', callback);
emitter = emitter.once('ABC', callback);
emitter = emitter.removeListener('ABC', callback);
emitter.removeAllListeners('ABC');
emitter.removeAllListeners();
}
function TestFirefoxDomExecutor() {
if (webdriver.FirefoxDomExecutor.isAvailable()) {
var executor: webdriver.CommandExecutor = new webdriver.FirefoxDomExecutor();
var callback = function(error: Error, responseObject: any) {};
executor.execute(new webdriver.Command(webdriver.CommandName.CLICK), callback);
}
}
function TestKey() {
var key: string;
key = webdriver.Key.ADD;
key = webdriver.Key.ALT;
key = webdriver.Key.ARROW_DOWN;
key = webdriver.Key.ARROW_LEFT;
key = webdriver.Key.ARROW_RIGHT;
key = webdriver.Key.ARROW_UP;
key = webdriver.Key.BACK_SPACE;
key = webdriver.Key.CANCEL;
key = webdriver.Key.CLEAR;
key = webdriver.Key.COMMAND;
key = webdriver.Key.CONTROL;
key = webdriver.Key.DECIMAL;
key = webdriver.Key.DELETE;
key = webdriver.Key.DIVIDE;
key = webdriver.Key.DOWN;
key = webdriver.Key.END;
key = webdriver.Key.ENTER;
key = webdriver.Key.EQUALS;
key = webdriver.Key.ESCAPE;
key = webdriver.Key.F1;
key = webdriver.Key.F2;
key = webdriver.Key.F3;
key = webdriver.Key.F4;
key = webdriver.Key.F5;
key = webdriver.Key.F6;
key = webdriver.Key.F7;
key = webdriver.Key.F8;
key = webdriver.Key.F9;
key = webdriver.Key.F10;
key = webdriver.Key.F11;
key = webdriver.Key.F12;
key = webdriver.Key.HELP;
key = webdriver.Key.HOME;
key = webdriver.Key.INSERT;
key = webdriver.Key.LEFT;
key = webdriver.Key.META;
key = webdriver.Key.MULTIPLY;
key = webdriver.Key.NULL;
key = webdriver.Key.NUMPAD0;
key = webdriver.Key.NUMPAD1;
key = webdriver.Key.NUMPAD2;
key = webdriver.Key.NUMPAD3;
key = webdriver.Key.NUMPAD4;
key = webdriver.Key.NUMPAD5;
key = webdriver.Key.NUMPAD6;
key = webdriver.Key.NUMPAD7;
key = webdriver.Key.NUMPAD8;
key = webdriver.Key.NUMPAD9;
key = webdriver.Key.PAGE_DOWN;
key = webdriver.Key.PAGE_UP;
key = webdriver.Key.PAUSE;
key = webdriver.Key.RETURN;
key = webdriver.Key.RIGHT;
key = webdriver.Key.SEMICOLON;
key = webdriver.Key.SEPARATOR;
key = webdriver.Key.SHIFT;
key = webdriver.Key.SPACE;
key = webdriver.Key.SUBTRACT;
key = webdriver.Key.TAB;
key = webdriver.Key.UP;
key = webdriver.Key.chord(webdriver.Key.NUMPAD0, webdriver.Key.NUMPAD1);
}
function TestLocator() {
var locator: webdriver.Locator = new webdriver.Locator('id', 'ABC');
var locatorStr: string = locator.toString();
var using: string = locator.using;
var value: string = locator.value;
locator = webdriver.Locator.checkLocator(webdriver.Locator.Strategy.id('ABC'));
locator = webdriver.Locator.checkLocator({id: 'ABC'});
locator = webdriver.Locator.createFromObj({id: 'ABC'});
locator = webdriver.Locator.Strategy.id('ABC');
locator = webdriver.By.id('ABC');
}
function TestSession() {
var session: webdriver.Session = new webdriver.Session('ABC', webdriver.Capabilities.android());
var capabilitiesObj: any = {};
capabilitiesObj[webdriver.Capability.BROWSER_NAME] = webdriver.Browser.ANDROID;
capabilitiesObj[webdriver.Capability.PLATFORM] = 'ANDROID';
session = new webdriver.Session('ABC', capabilitiesObj);
var capabilities: webdriver.Capabilities = session.getCapabilities();
var capability: any = session.getCapability(webdriver.Capability.BROWSER_NAME);
var id: string = session.getId();
var data: string = session.toJSON();
}
function TestUnhandledAlertError() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var promise: webdriver.promise.Promise = new webdriver.promise.Promise();
var alert: webdriver.Alert = new webdriver.Alert(driver, 'ABC');
var error = new webdriver.UnhandledAlertError('An error', alert);
var baseError: webdriver.error.Error = error;
alert = error.getAlert();
}
function TestWebDriverLogs() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var logs: webdriver.WebDriverLogs = webdriver.WebDriver.Logs;
var promise: webdriver.promise.Promise;
promise = logs.get(webdriver.logging.Type.BROWSER);
promise = logs.getAvailableLogTypes();
}
function TestWebDriverNavigation() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var navigation: webdriver.WebDriverNavigation = webdriver.WebDriver.Navigation;
var promise: webdriver.promise.Promise;
promise = navigation.back();
promise = navigation.forward();
promise = navigation.refresh();
promise = navigation.to('http://google.com');
}
function TestWebDriverOptions() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var options: webdriver.WebDriverOptions = webdriver.WebDriver.Options;
var promise: webdriver.promise.Promise;
// Add Cookie
promise = options.addCookie('name', 'value');
promise = options.addCookie('name', 'value', 'path');
promise = options.addCookie('name', 'value', 'path', 'domain');
promise = options.addCookie('name', 'value', 'path', 'domain', true);
promise = options.addCookie('name', 'value', 'path', 'domain', true, 123);
promise = options.addCookie('name', 'value', 'path', 'domain', true, Date.now());
promise = options.deleteAllCookies();
promise = options.deleteCookie('name');
promise = options.getCookie('name');
promise = options.getCookies();
var logs: webdriver.WebDriverLogs = options.logs();
var timeouts: webdriver.WebDriverTimeouts = options.timeouts();
var window: webdriver.WebDriverWindow = options.window();
}
function TestWebDriverTargetLocator() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var locator: webdriver.WebDriverTargetLocator = webdriver.WebDriver.TargetLocator;
var promise: webdriver.promise.Promise;
var element: webdriver.WebElement = locator.activeElement();
var alert: webdriver.Alert = locator.alert();
promise = locator.defaultContent();
promise = locator.frame('name');
promise = locator.frame(1);
promise = locator.window('nameOrHandle');
}
function TestWebDriverTimeouts() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var timeouts: webdriver.WebDriverTimeouts = webdriver.WebDriver.Timeouts;
var promise: webdriver.promise.Promise;
promise = timeouts.implicitlyWait(123);
promise = timeouts.pageLoadTimeout(123);
promise = timeouts.setScriptTimeout(123);
}
function TestWebDriverWindow() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var window: webdriver.WebDriverWindow = webdriver.WebDriver.Window;
var promise: webdriver.promise.Promise;
promise = window.getPosition();
promise = window.getSize();
promise = window.maximize();
promise = window.setPosition(12, 34);
promise = window.setSize(12, 34);
}
function TestWebDriver() {
var session: webdriver.Session = new webdriver.Session('ABC', webdriver.Capabilities.android());
var promise: webdriver.promise.Promise = new webdriver.promise.Promise();
var executor: webdriver.CommandExecutor = new webdriver.FirefoxDomExecutor();
var flow: webdriver.promise.ControlFlow = new webdriver.promise.ControlFlow();
var driver: webdriver.WebDriver = new webdriver.WebDriver(session, executor);
driver = new webdriver.WebDriver(session, executor, flow);
driver = new webdriver.WebDriver(promise, executor);
driver = new webdriver.WebDriver(promise, executor, flow);
// Call
var actions: webdriver.ActionSequence = driver.actions();
promise = driver.call(function(){});
promise = driver.call(function(){ var d: any = this;}, driver);
promise = driver.call(function(a: number){}, driver, 1);
promise = driver.close();
flow = driver.controlFlow();
// ExecuteAsyncScript
promise = driver.executeAsyncScript('function(){}');
promise = driver.executeAsyncScript('function(){}', 1, 2, 3);
promise = driver.executeAsyncScript(function(){});
promise = driver.executeAsyncScript(function(a: number){}, 1);
// ExecuteScript
promise = driver.executeScript('function(){}');
promise = driver.executeScript('function(){}', 1, 2, 3);
promise = driver.executeScript(function(){});
promise = driver.executeScript(function(a: number){}, 1);
var element: webdriver.WebElement;
element = driver.findElement(webdriver.By.id('ABC'));
element = driver.findElement({id: 'ABC'});
element = driver.findElement(webdriver.By.js('function(){}'), 1, 2, 3);
element = driver.findElement({js: 'function(){}'}, 1, 2, 3);
promise = driver.findElements(webdriver.By.className('ABC'));
promise = driver.findElements({className: 'ABC'});
promise = driver.findElements(webdriver.By.js('function(){}'), 1, 2, 3);
promise = driver.findElements({js: 'function(){}'}, 1, 2, 3);
promise = driver.get('http://www.google.com');
promise = driver.getAllWindowHandles();
promise = driver.getCapabilities();
promise = driver.getCurrentUrl();
promise = driver.getPageSource()
promise = driver.getSession();
promise = driver.getTitle();
promise = driver.getWindowHandle();
promise = driver.isElementPresent(webdriver.By.className('ABC'));
promise = driver.isElementPresent({className: 'ABC'});
promise = driver.isElementPresent(webdriver.By.js('function(){}'), 1, 2, 3);
promise = driver.isElementPresent({js: 'function(){}'}, 1, 2, 3);
var options: webdriver.WebDriverOptions = driver.manage();
var navigation: webdriver.WebDriverNavigation = driver.navigate();
var locator: webdriver.WebDriverTargetLocator = driver.switchTo();
promise = driver.quit();
promise = driver.schedule(new webdriver.Command(webdriver.CommandName.CLICK), 'ABC');
promise = driver.sleep(123);
promise = driver.takeScreenshot();
promise = driver.wait(function() { return true; }, 123);
promise = driver.wait(function() { return true; }, 123, 'Message');
promise = driver.wait(function() { return promise; }, 123);
promise = driver.wait(function() { return promise; }, 123, 'Message');
driver = webdriver.WebDriver.attachToSession(executor, 'ABC');
driver = webdriver.WebDriver.createSession(executor, webdriver.Capabilities.android());
}
function TestWebElement() {
var driver: webdriver.WebDriver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
var element: webdriver.WebElement;
var promise: webdriver.promise.Promise = new webdriver.promise.Promise();
element = new webdriver.WebElement(driver, 'ID');
element = new webdriver.WebElement(driver, promise);
var deferred: webdriver.promise.Deferred = element;
promise = element.clear();
promise = element.click();
element = element.findElement(webdriver.By.id('ABC'));
element = element.findElement({id: 'ABC'});
element = element.findElement(webdriver.By.js('function(){}'), 1, 2, 3);
element = element.findElement({js: 'function(){}'}, 1, 2, 3);
promise = element.findElements(webdriver.By.className('ABC'));
promise = element.findElements({className: 'ABC'});
promise = element.findElements(webdriver.By.js('function(){}'), 1, 2, 3);
promise = element.findElements({js: 'function(){}'}, 1, 2, 3);
promise = element.isElementPresent(webdriver.By.className('ABC'));
promise = element.isElementPresent({className: 'ABC'});
promise = element.isElementPresent(webdriver.By.js('function(){}'), 1, 2, 3);
promise = element.isElementPresent({js: 'function(){}'}, 1, 2, 3);
promise = element.getAttribute('class');
promise = element.getCssValue('display');
driver = element.getDriver();
promise = element.getInnerHtml();
promise = element.getLocation();
promise = element.getOuterHtml();
promise = element.getSize();
promise = element.getTagName();
promise = element.getText();
promise = element.isDisplayed();
promise = element.isEnabled();
promise = element.isSelected();
promise = element.sendKeys('A', 'B', 'C');
promise = element.submit();
promise = element.toWireValue();
promise = webdriver.WebElement.equals(element, new webdriver.WebElement(driver, 'ID2'));
var key: string = webdriver.WebElement.ELEMENT_KEY;
}
function TestLogging() {
webdriver.logging.Preferences['name'] = 'ABC';
var level: webdriver.logging.Level = webdriver.logging.getLevel('OFF');
level = webdriver.logging.getLevel(1);
level = webdriver.logging.Level.ALL;
level = webdriver.logging.Level.DEBUG;
level = webdriver.logging.Level.INFO;
level = webdriver.logging.Level.OFF;
level = webdriver.logging.Level.SEVERE;
level = webdriver.logging.Level.WARNING;
var name: string = level.name;
var value: number = level.value;
name = webdriver.logging.LevelName.ALL;
name = webdriver.logging.LevelName.DEBUG;
name = webdriver.logging.LevelName.INFO;
name = webdriver.logging.LevelName.OFF;
name = webdriver.logging.LevelName.SEVERE;
name = webdriver.logging.LevelName.WARNING;
var type: string;
type = webdriver.logging.Type.BROWSER;
type = webdriver.logging.Type.CLIENT;
type = webdriver.logging.Type.DRIVER;
type = webdriver.logging.Type.PERFORMANCE;
type = webdriver.logging.Type.SERVER;
}
function TestLoggingEntry() {
var entry: webdriver.logging.Entry;
entry = new webdriver.logging.Entry(webdriver.logging.Level.ALL, 'ABC');
entry = new webdriver.logging.Entry('ALL', 'ABC');
entry = new webdriver.logging.Entry(webdriver.logging.Level.ALL, 'ABC', 123);
entry = new webdriver.logging.Entry('ALL', 'ABC', 123);
entry = new webdriver.logging.Entry(webdriver.logging.Level.ALL, 'ABC', 123, webdriver.logging.Type.BROWSER);
entry = new webdriver.logging.Entry('ALL', 'ABC', 123, webdriver.logging.Type.BROWSER);
var entryObj: any = entry.toJSON();
var message: string = entry.message;
var timestamp: number = entry.timestamp;
var type: string = entry.type;
entry = webdriver.logging.Entry.fromClosureLogRecord({});
entry = webdriver.logging.Entry.fromClosureLogRecord({}, webdriver.logging.Type.DRIVER);
}
function TestProcess() {
var isNative: boolean = webdriver.process.isNative();
var value: string;
value = webdriver.process.getEnv('name');
value = webdriver.process.getEnv('name', 'default');
webdriver.process.setEnv('name', 'value');
webdriver.process.setEnv('name', 123);
}
function TestPromise() {
var promise: webdriver.promise.Promise = new webdriver.promise.Promise();
webdriver.promise.asap(promise, function(value: any){ return true; });
webdriver.promise.asap(promise, function(value: any){}, function(err: any) { return 'ABC'; });
promise = webdriver.promise.checkedNodeCall(function(err: any, value: any) { return 123; });
var flow: webdriver.promise.ControlFlow = webdriver.promise.controlFlow();
promise = webdriver.promise.createFlow(function(newFlow: webdriver.promise.ControlFlow) { });
var deferred: webdriver.promise.Deferred;
deferred = webdriver.promise.defer(function() {});
deferred = webdriver.promise.defer(function(reason?: any) {});
promise = webdriver.promise.delayed(123);
promise = webdriver.promise.fulfilled();
promise = webdriver.promise.fulfilled({a: 123});
promise = webdriver.promise.fullyResolved({a: 123});
var isPromise: boolean = webdriver.promise.isPromise('ABC');
promise = webdriver.promise.rejected({a: 123});
webdriver.promise.setDefaultFlow(new webdriver.promise.ControlFlow());
promise = webdriver.promise.when(promise, function(value: any) { return 123; }, function(err: Error) { return 123; });
}
function TestControlFlow() {
var flow: webdriver.promise.ControlFlow;
flow = new webdriver.promise.ControlFlow();
flow = new webdriver.promise.ControlFlow({clearInterval: function(a: number) {},
clearTimeout: function(a: number) {},
setInterval: function(a: () => void, b: number) { return 2; },
setTimeout: function(a: () => void, b: number) { return 2; }});
var emitter: webdriver.EventEmitter = flow;
var eventType: string;
eventType = webdriver.promise.ControlFlow.EventType.IDLE;
eventType = webdriver.promise.ControlFlow.EventType.SCHEDULE_TASK;
eventType = webdriver.promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION;
var e: any = flow.annotateError(new Error('Error'));
var promise: webdriver.promise.Promise;
promise = flow.await(promise);
flow.clearHistory();
promise = flow.execute(function() { return promise; });
promise = flow.execute(function() { return promise; }, 'Description');
var history: string[] = flow.getHistory();
var schedule: string = flow.getSchedule();
flow.reset();
promise = flow.timeout(123);
promise = flow.timeout(123, 'Description');
promise = flow.wait(function() { return true; }, 123);
promise = flow.wait(function() { return true; }, 123, 'Timeout Message');
promise = flow.wait(function() { return promise; }, 123, 'Timeout Message');
var timer: webdriver.promise.IControlFlowTimer = flow.timer;
timer = webdriver.promise.ControlFlow.defaultTimer;
var loopFrequency: number = webdriver.promise.ControlFlow.EVENT_LOOP_FREQUENCY;
}
function TestDeferred() {
var deferred: webdriver.promise.Deferred;
deferred = new webdriver.promise.Deferred();
deferred = new webdriver.promise.Deferred(function() {});
deferred = new webdriver.promise.Deferred(function(reason: any) { });
deferred = new webdriver.promise.Deferred(function() {}, new webdriver.promise.ControlFlow());
var promise: webdriver.promise.Promise = deferred;
deferred.errback(new Error('Error'));
deferred.errback('Error');
deferred.fulfill(123);
deferred.reject(new Error('Error'));
deferred.reject('Error');
deferred.removeAll();
promise = deferred.promise;
}
function TestPromiseClass() {
var promise: webdriver.promise.Promise = new webdriver.promise.Promise();
var obj = {
a: 5
}
promise = promise.addBoth(function( a: any ) { });
promise = promise.addBoth(function( a: any ) { return 123; });
promise = promise.addBoth(function( a: any ) { }, obj);
promise = promise.addCallback(function( a: any ) { });
promise = promise.addCallback(function( a: any ) { return 123; });
promise = promise.addCallback(function( a: any ) { }, obj);
promise = promise.addErrback(function( e: any ) { });
promise = promise.addErrback(function( e: any ) { return 123; });
promise = promise.addErrback(function( e: any ) { }, obj);
promise.cancel(obj);
var isPending: boolean = promise.isPending();
promise = promise.then();
promise = promise.then(function( a: any ) { });
promise = promise.then(function( a: any ) { return 123; });
promise = promise.then(function( a: any ) {}, function( e: any) {});
promise = promise.then(function( a: any ) {}, function( e: any) { return 123; });
}
function TestErrorCode() {
var errorCode: number;
errorCode = webdriver.error.ErrorCode.ELEMENT_NOT_SELECTABLE;
errorCode = webdriver.error.ErrorCode.ELEMENT_NOT_VISIBLE;
errorCode = webdriver.error.ErrorCode.IME_ENGINE_ACTIVATION_FAILED;
errorCode = webdriver.error.ErrorCode.IME_NOT_AVAILABLE;
errorCode = webdriver.error.ErrorCode.INVALID_COOKIE_DOMAIN;
errorCode = webdriver.error.ErrorCode.INVALID_ELEMENT_COORDINATES;
errorCode = webdriver.error.ErrorCode.INVALID_ELEMENT_STATE;
errorCode = webdriver.error.ErrorCode.INVALID_SELECTOR_ERROR;
errorCode = webdriver.error.ErrorCode.INVALID_XPATH_SELECTOR;
errorCode = webdriver.error.ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPE;
errorCode = webdriver.error.ErrorCode.JAVASCRIPT_ERROR;
errorCode = webdriver.error.ErrorCode.METHOD_NOT_ALLOWED;
errorCode = webdriver.error.ErrorCode.MODAL_DIALOG_OPENED;
errorCode = webdriver.error.ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS;
errorCode = webdriver.error.ErrorCode.NO_MODAL_DIALOG_OPEN;
errorCode = webdriver.error.ErrorCode.NO_SUCH_ELEMENT;
errorCode = webdriver.error.ErrorCode.NO_SUCH_FRAME;
errorCode = webdriver.error.ErrorCode.NO_SUCH_WINDOW;
errorCode = webdriver.error.ErrorCode.SCRIPT_TIMEOUT;
errorCode = webdriver.error.ErrorCode.SESSION_NOT_CREATED;
errorCode = webdriver.error.ErrorCode.SQL_DATABASE_ERROR;
errorCode = webdriver.error.ErrorCode.STALE_ELEMENT_REFERENCE;
errorCode = webdriver.error.ErrorCode.SUCCESS;
errorCode = webdriver.error.ErrorCode.TIMEOUT;
errorCode = webdriver.error.ErrorCode.UNABLE_TO_SET_COOKIE;
errorCode = webdriver.error.ErrorCode.UNKNOWN_COMMAND;
errorCode = webdriver.error.ErrorCode.UNKNOWN_ERROR;
errorCode = webdriver.error.ErrorCode.UNSUPPORTED_OPERATION;
errorCode = webdriver.error.ErrorCode.XPATH_LOOKUP_ERROR;
}
function TestError() {
var error: webdriver.error.Error;
error = new webdriver.error.Error(webdriver.error.ErrorCode.ELEMENT_NOT_SELECTABLE);
error = new webdriver.error.Error(webdriver.error.ErrorCode.ELEMENT_NOT_SELECTABLE, 'Message');
var code: number = error.code;
var state: string = error.state;
var message: string = error.message;
var name: string = error.name;
var stack: string = error.stack;
var isAutomationError: boolean = error.isAutomationError;
var errorStr: string = error.toString();
state = webdriver.error.Error.State.ELEMENT_NOT_SELECTABLE
state = webdriver.error.Error.State.ELEMENT_NOT_VISIBLE;
state = webdriver.error.Error.State.IME_ENGINE_ACTIVATION_FAILED;
state = webdriver.error.Error.State.IME_NOT_AVAILABLE;
state = webdriver.error.Error.State.INVALID_COOKIE_DOMAIN;
state = webdriver.error.Error.State.INVALID_ELEMENT_COORDINATES;
state = webdriver.error.Error.State.INVALID_ELEMENT_STATE;
state = webdriver.error.Error.State.INVALID_SELECTOR;
state = webdriver.error.Error.State.JAVASCRIPT_ERROR;
state = webdriver.error.Error.State.MOVE_TARGET_OUT_OF_BOUNDS;
state = webdriver.error.Error.State.NO_SUCH_ALERT;
state = webdriver.error.Error.State.NO_SUCH_DOM
state = webdriver.error.Error.State.NO_SUCH_ELEMENT;
state = webdriver.error.Error.State.NO_SUCH_FRAME;
state = webdriver.error.Error.State.NO_SUCH_WINDOW;
state = webdriver.error.Error.State.SCRIPT_TIMEOUT;
state = webdriver.error.Error.State.SESSION_NOT_CREATED;
state = webdriver.error.Error.State.STALE_ELEMENT_REFERENCE;
state = webdriver.error.Error.State.SUCCESS;
state = webdriver.error.Error.State.TIMEOUT;
state = webdriver.error.Error.State.UNABLE_TO_SET_COOKIE;
state = webdriver.error.Error.State.UNEXPECTED_ALERT_OPEN
state = webdriver.error.Error.State.UNKNOWN_COMMAND;
state = webdriver.error.Error.State.UNKNOWN_ERROR;
state = webdriver.error.Error.State.UNSUPPORTED_OPERATION;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,107 @@
/// <reference path="selenium-webdriver.d.ts" />
/// <reference path="executors.d.ts" />
function TestChromeDriver() {
var driver: chrome.Driver = new chrome.Driver();
driver = new chrome.Driver(webdriver.Capabilities.chrome());
driver = new chrome.Driver(webdriver.Capabilities.chrome(), new webdriver.promise.ControlFlow());
var baseDriver: webdriver.WebDriver = driver;
}
function TestChromeOptions() {
var options: chrome.Options = new chrome.Options();
options = chrome.Options.fromCapabilities(webdriver.Capabilities.chrome());
options = options.addArguments("a", "b", "c");
options = options.addExtensions("a", "b", "c");
options = options.detachDriver(true);
options = options.setChromeBinaryPath("path");
options = options.setChromeLogFile("logfile");
options = options.setLocalState("state");
options = options.setLoggingPrefs(new webdriver.logging.Preferences());
options = options.setProxy({ proxyType: "proxyType" });
options = options.setUserPreferences("preferences");
var capabilities: webdriver.Capabilities = options.toCapabilities();
capabilities = options.toCapabilities(webdriver.Capabilities.chrome());
var values: chrome.IOptionsValues = options.toJSON();
}
function TestServiceBuilder() {
var builder: chrome.ServiceBuilder = new chrome.ServiceBuilder();
builder = new chrome.ServiceBuilder("exe");
var anything: any = builder.build();
builder = builder.enableVerboseLogging();
builder = builder.loggingTo("path");
builder = builder.setNumHttpThreads(5);
builder = builder.setStdio("config");
builder = builder.setStdio(["A", "B"]);
builder = builder.setUrlBasePath("path");
builder = builder.usingPort(8080);
builder = builder.withEnvironment({ "A": "a", "B": "b" });
}
function TestChromeModule() {
var service: any = chrome.getDefaultService();
chrome.setDefaultService({});
}
function TestBinary() {
var binary: firefox.Binary = new firefox.Binary();
binary = new firefox.Binary("exe");
binary.addArguments("A", "B", "C");
var promise: webdriver.promise.Promise<void> = binary.kill();
binary.launch("profile").then(function (result: any) { });
}
function TestFirefoxDriver() {
var driver: firefox.Driver = new firefox.Driver();
driver = new chrome.Driver(webdriver.Capabilities.firefox());
driver = new chrome.Driver(webdriver.Capabilities.firefox(), new webdriver.promise.ControlFlow());
var baseDriver: webdriver.WebDriver = driver;
}
function TestFirefoxOptions() {
var options: firefox.Options = new firefox.Options();
options = options.setBinary("binary");
options = options.setBinary(new firefox.Binary());
options = options.setLoggingPreferences(new webdriver.logging.Preferences());
options = options.setProfile("profile");
options = options.setProfile(new firefox.Profile());
options = options.setProxy({ proxyType: "proxy" });
var capabilities: webdriver.Capabilities = options.toCapabilities();
var capabilities: webdriver.Capabilities = options.toCapabilities({});
}
function TestFirefoxProfile() {
var profile: firefox.Profile = new firefox.Profile();
profile = new firefox.Profile("dir");
var bool: boolean = profile.acceptUntrustedCerts();
profile.addExtension("ext");
bool = profile.assumeUntrustedCertIssuer();
profile.encode().then(function (prof: string) { });
var num: number = profile.getPort();
var anything: any = profile.getPreference("key");
bool = profile.nativeEventsEnabled();
profile.setAcceptUntrustedCerts(true);
profile.setAssumeUntrustedCertIssuer(true);
profile.setNativeEventsEnabled(true);
profile.setPort(8080);
profile.setPreference("key", "value");
profile.setPreference("key", 5);
profile.setPreference("key", true);
var stringPromise: webdriver.promise.Promise<string> = profile.writeToDisk();
stringPromise = profile.writeToDisk(true);
}
function TestExecutors() {
var exec: webdriver.CommandExecutor = executors.createExecutor("url");
exec = executors.createExecutor(new webdriver.promise.Promise<string>());
}
function TestBuilder() {
var builder: webdriver.Builder = new webdriver.Builder();

View File

@@ -3,8 +3,516 @@
// Definitions by: Bill Armstrong <https://github.com/BillArmstrong>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="chrome.d.ts" />
/// <reference path="firefox.d.ts" />
declare module chrome {
/**
* Creates a new WebDriver client for Chrome.
*
* @extends {webdriver.WebDriver}
*/
class Driver extends webdriver.WebDriver {
/**
* @param {(webdriver.Capabilities|Options)=} opt_config The configuration
* options.
* @param {remote.DriverService=} opt_service The session to use; will use
* the {@link getDefaultService default service} by default.
* @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or
* {@code null} to use the currently active flow.
* @constructor
*/
constructor(opt_config?: webdriver.Capabilities, opt_service?: any, opt_flow?: webdriver.promise.ControlFlow);
constructor(opt_config?: Options, opt_service?: any, opt_flow?: webdriver.promise.ControlFlow);
}
interface IOptionsValues {
args: string[];
binary?: string;
detach: boolean;
extensions: string[];
localState?: any;
logFile?: string;
prefs?: any;
}
/**
* Class for managing ChromeDriver specific options.
*/
class Options {
/**
* @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;
/**
* 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 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 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 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 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 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 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 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 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;
/**
* Converts this instance to its JSON wire protocol representation. Note this
* function is an implementation not intended for general use.
* @return {{args: !Array.<string>,
* binary: (string|undefined),
* detach: boolean,
* extensions: !Array.<string>,
* localState: (Object|undefined),
* logFile: (string|undefined),
* prefs: (Object|undefined)}} The JSON wire protocol representation
* of this instance.
*/
toJSON(): IOptionsValues;
}
/**
* Creates {@link remote.DriverService} instances that manage a ChromeDriver
* server.
*/
class ServiceBuilder {
/**
* @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 the port to start the ChromeDriver on.
* @param {number} port The port to use, or 0 for any free port.
* @return {!ServiceBuilder} A self reference.
* @throws {Error} If the port is invalid.
*/
usingPort(port: number): ServiceBuilder;
/**
* 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): ServiceBuilder;
/**
* Enables verbose logging.
* @return {!ServiceBuilder} A self reference.
*/
enableVerboseLogging(): ServiceBuilder;
/**
* 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): ServiceBuilder;
/**
* Sets the base path for WebDriver REST commands (e.g. "/wd/hub").
* By default, the driver will accept commands relative to "/".
* @param {string} path The base path to use.
* @return {!ServiceBuilder} A self reference.
*/
setUrlBasePath(path: string): ServiceBuilder;
/**
* Defines the stdio configuration for the driver service. See
* {@code child_process.spawn} for more information.
* @param {(string|!Array.<string|number|!Stream|null|undefined>)} config The
* configuration to use.
* @return {!ServiceBuilder} A self reference.
*/
setStdio(config: string): ServiceBuilder;
setStdio(config: any[]): ServiceBuilder;
/**
* Defines the environment to start the server under. This settings will be
* inherited by every browser session started by the server.
* @param {!Object.<string, string>} env The environment to use.
* @return {!ServiceBuilder} A self reference.
*/
withEnvironment(env: { [key: string]: string }): ServiceBuilder;
/**
* Creates a new DriverService using this instance's current configuration.
* @return {remote.DriverService} A new driver service using this instance's
* current configuration.
* @throws {Error} If the driver exectuable was not specified and a default
* could not be found on the current PATH.
*/
build(): any;
}
/**
* Returns the default ChromeDriver service. If such a service has not been
* configured, one will be constructed using the default configuration for
* a ChromeDriver executable found on the system PATH.
* @return {!remote.DriverService} The default ChromeDriver service.
*/
function getDefaultService(): any;
/**
* Sets the default service to use for new ChromeDriver instances.
* @param {!remote.DriverService} service The service to use.
* @throws {Error} If the default service is currently running.
*/
function setDefaultService(service: any): void;
}
declare module firefox {
/**
* Manages a Firefox subprocess configured for use with WebDriver.
*/
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>;
}
/**
* A WebDriver client for Firefox.
*
* @extends {webdriver.WebDriver}
*/
class Driver extends webdriver.WebDriver {
/**
* @param {(Options|webdriver.Capabilities|Object)=} opt_config The
* configuration options for this driver, specified as either an
* {@link Options} or {@link webdriver.Capabilities}, or as a raw hash
* object.
* @param {webdriver.promise.ControlFlow=} opt_flow The flow to
* schedule commands through. Defaults to the active flow object.
* @constructor
*/
constructor(opt_config?: webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow);
constructor(opt_config?: any, opt_flow?: webdriver.promise.ControlFlow);
}
/**
* Configuration options for the FirefoxDriver.
*/
class Options {
/**
* @constructor
*/
constructor();
/**
* 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;
setProfile(profile: Profile): 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): Options;
setBinary(binary: Binary): Options;
/**
* Sets the logging preferences for the new session.
* @param {webdriver.logging.Preferences} prefs The logging preferences.
* @return {!Options} A self reference.
*/
setLoggingPreferences(prefs: webdriver.logging.Preferences): Options;
/**
* Sets the proxy to use.
*
* @param {webdriver.ProxyConfig} proxy The proxy configuration to use.
* @return {!Options} A self reference.
*/
setProxy(proxy: webdriver.ProxyConfig): Options;
/**
* Converts these options to a {@link webdriver.Capabilities} instance.
*
* @return {!webdriver.Capabilities} A new capabilities object.
*/
toCapabilities(opt_remote?: any): webdriver.Capabilities;
}
/**
* Models a Firefox proifle directory for use with the FirefoxDriver. The
* {@code Proifle} directory uses an in-memory model until {@link #writeToDisk}
* is called.
*/
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>;
}
}
declare module executors {
/**
* Creates a command executor that uses WebDriver's JSON wire protocol.
* @param url The server's URL, or a promise that will resolve to that URL.
* @returns {!webdriver.CommandExecutor} The new command executor.
*/
function createExecutor(url: string): webdriver.CommandExecutor;
function createExecutor(url: webdriver.promise.Promise<string>): webdriver.CommandExecutor;
}
declare module webdriver {
@@ -4219,6 +4727,18 @@ declare module webdriver {
}
}
declare module 'selenium-webdriver/chrome' {
export = chrome;
}
declare module 'selenium-webdriver/firefox' {
export = firefox;
}
declare module 'selenium-webdriver/executors' {
export = executors;
}
declare module 'selenium-webdriver' {
export = webdriver;
}