Skip to content

Commit

Permalink
Call close and quit to make FF nightly a bit happier
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Gaunt committed Jun 27, 2017
1 parent e7e3e13 commit 134b52b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ class SeleniumAssistant {
return new Promise((resolve) => {
quitTimeout = setTimeout(resolve, 2000);

driver.quit()
driver.close()
.then(() => driver.quit())
.then(resolve, resolve);
})
.then(() => {
Expand Down
17 changes: 11 additions & 6 deletions test/selenium-assistant.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ describe('SeleniumAssistant', function() {
this.timeout(3000);

const killPromise = seleniumAssistant.killWebDriver({
close: () => {
return Promise.resolve();
},
quit: () => {
return new Promise((resolve, reject) => {
resolve();
});
return Promise.resolve();
},
});
(killPromise instanceof Promise).should.equal(true);
Expand All @@ -177,10 +178,11 @@ describe('SeleniumAssistant', function() {
this.timeout(3000);

const killPromise = seleniumAssistant.killWebDriver({
close: () => {
return Promise.resolve();
},
quit: () => {
return new Promise((resolve, reject) => {
reject();
});
return Promise.reject();
},
});
(killPromise instanceof Promise).should.equal(true);
Expand All @@ -192,6 +194,9 @@ describe('SeleniumAssistant', function() {
this.timeout(5000);

const killPromise = seleniumAssistant.killWebDriver({
close: () => {
return Promise.resolve();
},
quit: () => {
return new Promise((resolve, reject) => {});
},
Expand Down

0 comments on commit 134b52b

Please sign in to comment.