This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(exitCodes): adding exit code for direct connect errors
- Loading branch information
Showing
3 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
var path = require('path'); | ||
var fs = require('fs'); | ||
var BrowserError = require('../../../built/exitCodes').BrowserError; | ||
|
||
describe('direct connect', function() { | ||
describe('without the selenium driver', function() { | ||
beforeEach(function() { | ||
try { | ||
var directory = path.resolve('selenium'); | ||
var files = fs.readdirSync(directory); | ||
for (var pos = 0; pos < files.length; pos++) { | ||
fs.unlinkSync(path.resolve(directory, files[pos])); | ||
} | ||
fs.rmdirSync(directory); | ||
} catch(e) { } | ||
}); | ||
|
||
it('should do something', function() { | ||
var config = { | ||
directConnect: true, | ||
capabilities: { browserName: 'chrome' } | ||
}; | ||
var errorFound = false; | ||
try { | ||
webdriver = require('../../../built/driverProviders/direct')(config); | ||
webdriver.getNewDriver(); | ||
} catch(e) { | ||
errorFound = true; | ||
expect(e.code).toBe(BrowserError.CODE); | ||
} | ||
expect(errorFound).toBe(true); | ||
}); | ||
|
||
// it('should throw an error', function() { | ||
// ; | ||
// }); | ||
}); | ||
}); |