Skip to content

Commit 1d49fa6

Browse files
mojwangjleyba
authored andcommitted
Add JS bindings for Microsoft's Edge browser
Add a base set of capabilities for Microsoft's Edge browser Add 'EDGE' property to webdriver.Browser object. Add 'edge' method to webdriver.Capabilities object. Add edge.js to javascript/node/selenium-webdriver directory Add Edge-specific Options class Add Edge-specific ServiceBuilder class Add an Edge-specific ServiceBuilder class that manages the Edge WebDriver server in a child process. Add a WebDriver client for Microsoft's Edge browser Add license header to edge.js Add Edge-specific properties and methods to the Builder class * Create WebDriver client when the Edge browser is specified. * Add edgeOptions property and setEdgeOptions method. Update README.md & CHANGES.md Signed-off-by: Jason Leyba <[email protected]>
1 parent 1070ace commit 1d49fa6

File tree

5 files changed

+418
-3
lines changed

5 files changed

+418
-3
lines changed

javascript/node/selenium-webdriver/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ the selenium-webdriver package README.
99

1010
### Change Summary
1111

12+
* Add support for Microsoft's Edge web browser
1213
* Bumped the minimum supported version of Node to v4.2.x
1314
* Added `promise.Promise#catch()` for API compatibility with native Promises.
1415
`promise.Promise#thenCatch()` is not yet deprecated, but it simply

javascript/node/selenium-webdriver/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ Selenium may be installed via npm with
1212

1313
Out of the box, Selenium includes everything you need to work with Firefox. You
1414
will need to download additional components to work with the other major
15-
browsers. The drivers for Chrome, IE, PhantomJS, and Opera are all standalone
16-
executables that should be placed on your
15+
browsers. The drivers for Chrome, PhantomJS, Opera, and Microsoft's IE and Edge
16+
web browsers are all standalone executables that should be available on your
1717
[PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29). The SafariDriver
1818
browser extension should be installed in your browser before using Selenium; we
1919
recommend disabling the extension when using the browser without Selenium or
@@ -23,6 +23,7 @@ installing the extension in a profile only used for testing.
2323
| ----------------- | ---------------------------------- |
2424
| Chrome | [chromedriver(.exe)][chrome] |
2525
| Internet Explorer | [IEDriverServer.exe][release] |
26+
| Edge | [MicrosoftWebDriver.msi][edge] |
2627
| PhantomJS | [phantomjs(.exe)][phantomjs] |
2728
| Opera | [operadriver(.exe)][opera] |
2829
| Safari | [SafariDriver.safariextz][release] |
@@ -219,6 +220,7 @@ under the License.
219220
[issues]: https://github.com/SeleniumHQ/selenium/issues
220221
[opera]: https://github.com/operasoftware/operachromiumdriver/releases
221222
[phantomjs]: http://phantomjs.org/
223+
[edge]: http://go.microsoft.com/fwlink/?LinkId=619687
222224
[reduction]: http://www.webkit.org/quality/reduction.html
223225
[release]: http://selenium-release.storage.googleapis.com/index.html
224226
[users]: https://groups.google.com/forum/#!forum/selenium-users

javascript/node/selenium-webdriver/builder.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ var Builder = function() {
113113
/** @private {ie.Options} */
114114
this.ieOptions_ = null;
115115

116+
/** @private {edge.Options} */
117+
this.edgeOptions_ = null;
118+
116119
/** @private {safari.Options} */
117120
this.safariOptions_ = null;
118121

@@ -338,7 +341,7 @@ Builder.prototype.setOperaOptions = function(options) {
338341

339342

340343
/**
341-
* Sets Internet Explorer specific
344+
* Sets Microsoft's Internet Explorer specific
342345
* {@linkplain selenium-webdriver/ie.Options options} for drivers created by
343346
* this builder. Any proxy settings defined on the given options will take
344347
* precedence over those set through {@link #setProxy}.
@@ -351,6 +354,19 @@ Builder.prototype.setIeOptions = function(options) {
351354
return this;
352355
};
353356

357+
/**
358+
* Sets Microsoft's Edge specific
359+
* {@linkplain selenium-webdriver/edge.Options options} for drivers created by
360+
* this builder. Any proxy settings defined on the given options will take
361+
* precedence over those set through {@link #setProxy}.
362+
*
363+
* @param {!edge.Options} options The MicrosoftEdgeDriver options to use.
364+
* @return {!Builder} A self reference.
365+
*/
366+
Builder.prototype.setEdgeOptions = function(options) {
367+
this.edgeOptions_ = options;
368+
return this;
369+
};
354370

355371
/**
356372
* Sets Safari specific {@linkplain selenium-webdriver/safari.Options options}
@@ -428,6 +444,9 @@ Builder.prototype.build = function() {
428444

429445
} else if (browser === Browser.SAFARI && this.safariOptions_) {
430446
capabilities.merge(this.safariOptions_.toCapabilities());
447+
448+
} else if (browser === Browser.EDGE && this.edgeOptions_) {
449+
capabilities.merge(this.edgeOptions_.toCapabilities());
431450
}
432451

433452
// Check for a remote browser.
@@ -465,6 +484,12 @@ Builder.prototype.build = function() {
465484
var ie = require('./ie');
466485
return new ie.Driver(capabilities, this.flow_);
467486

487+
case Browser.EDGE:
488+
// Requiring 'edge' above would create a cycle:
489+
// index -> builder -> edge -> index
490+
var edge = require('./edge');
491+
return new edge.Driver(capabilities, null, this.flow_);
492+
468493
case Browser.OPERA:
469494
// Requiring 'opera' would create a cycle:
470495
// index -> builder -> opera -> index

0 commit comments

Comments
 (0)