diff --git a/types/selenium-webdriver/firefox.d.ts b/types/selenium-webdriver/firefox.d.ts index ce8a14216e..fcb8e74520 100644 --- a/types/selenium-webdriver/firefox.d.ts +++ b/types/selenium-webdriver/firefox.d.ts @@ -149,6 +149,15 @@ export class Profile { * 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)} args The arguments to include. + * @return {!Options} A self reference. + */ + addArguments(...args: string[]): Options; + /** * Sets the browser to be in headless mode. * @@ -156,6 +165,33 @@ export class Options { */ headless(): 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; + + /** + * 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 diff --git a/types/selenium-webdriver/test/firefox.ts b/types/selenium-webdriver/test/firefox.ts index 0a8cabda41..ee5b55bbaa 100644 --- a/types/selenium-webdriver/test/firefox.ts +++ b/types/selenium-webdriver/test/firefox.ts @@ -25,6 +25,12 @@ function TestFirefoxDriver() { function TestFirefoxOptions() { let options: firefox.Options = new firefox.Options(); + options = options.addArguments('foo', 'bar'); + options = options.windowSize({ width: 320, height: 480 }); + options = options.addExtensions('foo', 'bar'); + options = options.setPreference('a', 1); + options = options.setPreference('a', true); + options = options.setPreference('a', '1'); options = options.setBinary('binary'); options = options.setBinary(new firefox.Binary()); options = options.setLoggingPreferences(new webdriver.logging.Preferences());