Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close and quit #94

Merged
merged 2 commits into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ osx_image: xcode7.3

node_js:
- '6'
- '7'
- '8'
env:
global:
- COVERALLS_PARALLEL=true
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"homepage": "https://github.com/GoogleChrome/selenium-assistant#readme",
"devDependencies": {
"chai": "^4.0.2",
"chromedriver": "^2.26.1",
"chromedriver": "^2.30.1",
"coveralls": "^2.11.12",
"eslint": "^3.12.1",
"eslint-config-google": "^0.8.0",
Expand Down
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