Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
chore(test): interaction tests
Browse files Browse the repository at this point in the history
- webdriver.quit throws a no session error
- define "quit" at runner.ts similar to restart where the driverprovider
  calls quit instead of the webdriver
  • Loading branch information
cnishina committed Nov 17, 2016
1 parent 1adc0e1 commit 57f9f5c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 4 additions & 0 deletions lib/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ export class Runner extends EventEmitter {
this.setupGlobals_(browser_);
};

browser_.quit = () => {
this.driverprovider_.quitDriver(browser_.driver);
}

return browser_;
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/attachSession.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var sessionId = '';

// 1. Create a new selenium session.
var postData = JSON.stringify(
{'desiredCapabilities': {'browserName': 'chrome'}});
{'desiredCapabilities': {'browserName': 'firefox'}});
var createOptions = {
hostname: 'localhost',
port: 4444,
Expand Down
5 changes: 2 additions & 3 deletions spec/interaction/interaction_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ describe('Browser', function() {
// throughout all of your tests). However, I'm forking browsers in my tests
// and don't want to pile up my browser count.
if (newBrowser) {
newBrowser.quit().then(function() {
done();
});
newBrowser.quit();
done();
} else {
done();
}
Expand Down

0 comments on commit 57f9f5c

Please sign in to comment.