diff --git a/javascript/node/selenium-webdriver/CHANGES.md b/javascript/node/selenium-webdriver/CHANGES.md index 19edb66a50fff..c3b05b9e1bc77 100644 --- a/javascript/node/selenium-webdriver/CHANGES.md +++ b/javascript/node/selenium-webdriver/CHANGES.md @@ -78,6 +78,19 @@ mode. - Removed setCleanSession (was a no-op) - Removed setLoggingPreferences (was a no-op) - Removed setProxy (was a no-op) +* Changes to `lib/capabilities.Browser`: + - Removed several enum values. + - ANDROID (use Chrome for Android; see docs on the chrome module) + - IPAD (no support available) + - IPHONE (no support available) + - OPERA (use Chrome) + - PHANTOM_JS (use Chrome or Firefox in headless mode) + - HTMLUNIT (use Chrome or Firefox in headless mode) +* Changes to `lib/capabilities.Capabilities`: + - Removed static factory methods android(), ipad(), iphone(), opera(), + phantomjs(), htmlunit(), and htmlunitwithjs(). Users can still manually + configure capabilities for these, but their use is not recommended and + they will no longer be surfaced in the API. * Changes to `lib/error`: - Added - ElementClickInterceptedError diff --git a/javascript/node/selenium-webdriver/lib/capabilities.js b/javascript/node/selenium-webdriver/lib/capabilities.js index 8e741408cc318..8da025db2b6f2 100644 --- a/javascript/node/selenium-webdriver/lib/capabilities.js +++ b/javascript/node/selenium-webdriver/lib/capabilities.js @@ -31,18 +31,12 @@ const Symbols = require('./symbols'); * @enum {string} */ const Browser = { - ANDROID: 'android', CHROME: 'chrome', EDGE: 'MicrosoftEdge', FIREFOX: 'firefox', IE: 'internet explorer', INTERNET_EXPLORER: 'internet explorer', - IPAD: 'iPad', - IPHONE: 'iPhone', - OPERA: 'opera', - PHANTOM_JS: 'phantomjs', SAFARI: 'safari', - HTMLUNIT: 'htmlunit' }; @@ -255,13 +249,6 @@ class Capabilities { this.map_ = new Map(other); } - /** - * @return {!Capabilities} A basic set of capabilities for Android. - */ - static android() { - return new Capabilities().setBrowserName(Browser.ANDROID); - } - /** * @return {!Capabilities} A basic set of capabilities for Chrome. */ @@ -290,34 +277,6 @@ class Capabilities { return new Capabilities().setBrowserName(Browser.INTERNET_EXPLORER); } - /** - * @return {!Capabilities} A basic set of capabilities for iPad. - */ - static ipad() { - return new Capabilities().setBrowserName(Browser.IPAD); - } - - /** - * @return {!Capabilities} A basic set of capabilities for iPhone. - */ - static iphone() { - return new Capabilities().setBrowserName(Browser.IPHONE); - } - - /** - * @return {!Capabilities} A basic set of capabilities for Opera. - */ - static opera() { - return new Capabilities().setBrowserName(Browser.OPERA); - } - - /** - * @return {!Capabilities} A basic set of capabilities for PhantomJS. - */ - static phantomjs() { - return new Capabilities().setBrowserName(Browser.PHANTOM_JS); - } - /** * @return {!Capabilities} A basic set of capabilities for Safari. */ @@ -325,23 +284,6 @@ class Capabilities { return new Capabilities().setBrowserName(Browser.SAFARI); } - /** - * @return {!Capabilities} A basic set of capabilities for HTMLUnit. - */ - static htmlunit() { - return new Capabilities().setBrowserName(Browser.HTMLUNIT); - } - - /** - * @return {!Capabilities} A basic set of capabilities for HTMLUnit - * with enabled Javascript. - */ - static htmlunitwithjs() { - return new Capabilities() - .setBrowserName(Browser.HTMLUNIT) - .set('javascriptEnabled', true); - } - /** * @return {!Object} The JSON representation of this instance. * Note, the returned object may contain nested promised values. diff --git a/javascript/node/selenium-webdriver/test/cookie_test.js b/javascript/node/selenium-webdriver/test/cookie_test.js index 0e39fd72509b5..0a6e812a5c68b 100644 --- a/javascript/node/selenium-webdriver/test/cookie_test.js +++ b/javascript/node/selenium-webdriver/test/cookie_test.js @@ -150,7 +150,6 @@ suite(function(env) { }); ignore(env.browsers( - Browser.ANDROID, Browser.FIREFOX, Browser.IE)). it('should retain cookie expiry', async function() { diff --git a/javascript/node/selenium-webdriver/test/page_loading_test.js b/javascript/node/selenium-webdriver/test/page_loading_test.js index b7e8571178b34..82ecd8f924e94 100644 --- a/javascript/node/selenium-webdriver/test/page_loading_test.js +++ b/javascript/node/selenium-webdriver/test/page_loading_test.js @@ -63,7 +63,6 @@ test.suite(function(env) { await driver.findElement(By.id('id1')); }); - test.ignore(browsers(Browser.IPAD, Browser.IPHONE)). it('should wait for all frames to load in a frameset', async function() { await driver.get(Pages.framesetPage); await driver.switchTo().frame(0); @@ -141,10 +140,6 @@ test.suite(function(env) { } }); - test.ignore(browsers( - Browser.IPAD, - Browser.IPHONE, - Browser.OPERA)). it('should timeout if page load timeout is set', async function() { await driver.manage().setTimeouts({pageLoad: 1}); return driver.get(Pages.sleepingPage + '?time=3') diff --git a/javascript/node/selenium-webdriver/test/proxy_test.js b/javascript/node/selenium-webdriver/test/proxy_test.js index de7504c717143..386987c639ade 100644 --- a/javascript/node/selenium-webdriver/test/proxy_test.js +++ b/javascript/node/selenium-webdriver/test/proxy_test.js @@ -111,7 +111,7 @@ test.suite(function(env) { } // Proxy support not implemented. - test.ignore(env.browsers(Browser.IE, Browser.OPERA, Browser.SAFARI)). + test.ignore(env.browsers(Browser.IE, Browser.SAFARI)). describe('manual proxy settings', function() { it('can configure HTTP proxy host', async function() { await createDriver(proxy.manual({ @@ -154,7 +154,7 @@ test.suite(function(env) { // PhantomJS does not support PAC file proxy configuration. // Safari does not support proxies. - test.ignore(env.browsers(Browser.IE, Browser.OPERA, Browser.SAFARI)). + test.ignore(env.browsers(Browser.IE, Browser.SAFARI)). describe('pac proxy settings', function() { it('can configure proxy through PAC file', async function() { await createDriver(proxy.pac(proxyServer.url('/proxy.pac'))); diff --git a/javascript/node/selenium-webdriver/test/upload_test.js b/javascript/node/selenium-webdriver/test/upload_test.js index 25ad06a856227..8b34d6f47c268 100644 --- a/javascript/node/selenium-webdriver/test/upload_test.js +++ b/javascript/node/selenium-webdriver/test/upload_test.js @@ -50,10 +50,7 @@ test.suite(function(env) { } }); - test.ignore(env.browsers( - Browser.IPAD, - Browser.IPHONE, - Browser.SAFARI)). + test.ignore(env.browsers(Browser.SAFARI)). it('can upload files', async function() { driver.setFileDetector(new remote.FileDetector);