Skip to content

Commit

Permalink
Catch driver start-up failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyba committed Aug 13, 2014
1 parent 7720e2a commit ecaa920
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions javascript/node/selenium-webdriver/lib/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,9 @@ function TestEnvironment(browserName, server) {

this.dispose = function() {
if (driver) {
driver.quit();
var d = driver;
driver = null;
return d.quit();
}
};

Expand Down Expand Up @@ -221,12 +222,12 @@ function suite(fn, opt_options) {

testing.beforeEach(function() {
if (env.autoCreateDriver) {
env.createDriver();
return env.createDriver().getSession(); // Catch start-up failures.
}
});

testing.after(function() {
env.dispose();
return env.dispose();
});

fn(env);
Expand Down

0 comments on commit ecaa920

Please sign in to comment.