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 browser connect errors (#3133)
* add exit code for browser connect errors * add exit code for browserstack error * add browser error for debug with multiple capabilities * use thrown stack traces for errors (instead of creating new ones) with captureStackTrace * allow for errors to suppress exit code for config parser thrown error
- Loading branch information
Showing
13 changed files
with
408 additions
and
66 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
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,46 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
var spawn = require('child_process').spawnSync; | ||
var exitCodes = require('../built/exitCodes'); | ||
|
||
var runProtractor, output, messages; | ||
var checkLogs = function(output, messages) { | ||
for (var pos in messages) { | ||
var message = messages[pos]; | ||
if (output.indexOf(message) === -1) { | ||
throw new Error('does not exist in logs: ' + message); | ||
} | ||
} | ||
}; | ||
|
||
/****************************** | ||
*Below are exit failure tests* | ||
******************************/ | ||
|
||
// assert authentication error for sauce labs | ||
runProtractor = spawn('node', | ||
['bin/protractor', 'spec/errorTest/sauceLabsAuthentication.js']); | ||
output = runProtractor.stdout.toString(); | ||
messages = ['WebDriverError: Sauce Labs Authentication Error.', | ||
'Process exited with error code ' + exitCodes.BrowserError.CODE]; | ||
checkLogs(output, messages); | ||
|
||
// assert authentication error for browser stack | ||
runProtractor = spawn('node', | ||
['bin/protractor', 'spec/errorTest/browserStackAuthentication.js']); | ||
output = runProtractor.stdout.toString(); | ||
messages = ['WebDriverError: Invalid username or password', | ||
'Process exited with error code ' + exitCodes.BrowserError.CODE]; | ||
checkLogs(output, messages); | ||
|
||
|
||
// assert there is no capabilities in the config | ||
runProtractor = spawn('node', | ||
['bin/protractor', 'spec/errorTest/debugMultiCapabilities.js']); | ||
output = runProtractor.stdout.toString(); | ||
messages = [ | ||
'Cannot run in debug mode with multiCapabilities, count > 1, or sharding', | ||
'Process exited with error code ' + exitCodes.ConfigError.CODE]; | ||
checkLogs(output, messages); |
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
Oops, something went wrong.