Skip to content

Commit

Permalink
[js] Removed various browsers from the list of "standard" browser names
Browse files Browse the repository at this point in the history
supported by selenium-webdriver.

ANDROID: there hasn't been an AndroidDriver in a long time. Users should instead
use the chromedriver configured for Chrome on Android.

IPAD & IPHONE: there hasn't been meaningful support for either of these in a
a long time. Surfacing them in the API is misleading to users.

OPERA: The operadriver appears to be abandoned. Since the operadriver and Opera
are just forks of chromedriver and Chromium, respectively, users can get by
using Chrome.

PHANTOM_JS & HTMLUNIT: Users should be using Chrome or Firefox in headless mode
  • Loading branch information
jleyba committed Nov 3, 2017
1 parent e46eb57 commit 647420b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 70 deletions.
13 changes: 13 additions & 0 deletions javascript/node/selenium-webdriver/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
58 changes: 0 additions & 58 deletions javascript/node/selenium-webdriver/lib/capabilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
};


Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -290,58 +277,13 @@ 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.
*/
static safari() {
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<string, ?>} The JSON representation of this instance.
* Note, the returned object may contain nested promised values.
Expand Down
1 change: 0 additions & 1 deletion javascript/node/selenium-webdriver/test/cookie_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ suite(function(env) {
});

ignore(env.browsers(
Browser.ANDROID,
Browser.FIREFOX,
Browser.IE)).
it('should retain cookie expiry', async function() {
Expand Down
5 changes: 0 additions & 5 deletions javascript/node/selenium-webdriver/test/page_loading_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions javascript/node/selenium-webdriver/test/proxy_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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')));
Expand Down
5 changes: 1 addition & 4 deletions javascript/node/selenium-webdriver/test/upload_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 647420b

Please sign in to comment.