-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add unit test for jasmine-spec-reporter, and associated accoutre…
…ments
- Loading branch information
1 parent
ea80f2c
commit 9d446b7
Showing
4 changed files
with
95 additions
and
1 deletion.
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
51 changes: 51 additions & 0 deletions
51
test/integration/support/protractor-config/jasmine-spec-reporter.conf.js
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,51 @@ | ||
'use strict'; | ||
|
||
var JOB_NUMBER = (process.env.TRAVIS_JOB_NUMBER || '') | ||
var JOB_NAME = 'Flake' + JOB_NUMBER | ||
|
||
exports.config = { | ||
specs: [ | ||
'../flakey-test.js', | ||
'../passing-test.js' | ||
], | ||
|
||
capabilities: { | ||
browserName: 'chrome', | ||
name: JOB_NAME, | ||
shardTestFiles: false, | ||
maxInstances: 2, | ||
'tunnel-identifier': JOB_NUMBER | ||
}, | ||
|
||
sauceUser: process.env.SAUCE_USERNAME, | ||
sauceKey: process.env.SAUCE_ACCESS_KEY, | ||
|
||
baseUrl: 'http://localhost:3000/', | ||
|
||
framework: 'jasmine2', | ||
|
||
allScriptsTimeout: 10000, | ||
|
||
getPageTimeout: 3000, | ||
|
||
jasmineNodeOpts: { | ||
defaultTimeoutInterval: 5000, | ||
print: function() {} // remove dot reporter | ||
}, | ||
|
||
onPrepare: function () { | ||
// let protractor know it doesn't need to look for angular on the page | ||
browser.ignoreSynchronization = true; | ||
|
||
// make reports mo' pretty | ||
var SpecReporter = require('jasmine-spec-reporter').SpecReporter; | ||
jasmine.getEnv().addReporter( | ||
new SpecReporter({ | ||
spec: { | ||
displayStacktrace: true | ||
} | ||
}) | ||
); | ||
} | ||
}; | ||
|
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
32 changes: 32 additions & 0 deletions
32
test/unit/support/fixtures/failed-jasmine-spec-reporter-test-output.txt
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,32 @@ | ||
[08:04:24] I/launcher - Running 1 instances of WebDriver | ||
[08:04:24] I/direct - Using ChromeDriver directly... | ||
Jasmine started | ||
|
||
a flakey integration test | ||
✗ fails, in a horribly consistent manner | ||
- Expected false to be truthy. | ||
at UserContext.<anonymous> (/tests/flakey.test.js:7:39) | ||
at node_modules/jasminewd2/index.js:112:25 | ||
at new ManagedPromise (node_modules/selenium-webdriver/lib/promise.js:1067:7) | ||
at ControlFlow.promise (node_modules/selenium-webdriver/lib/promise.js:2396:12) | ||
at schedulerExecute (node_modules/jasminewd2/index.js:95:18) | ||
at TaskQueue.execute_ (node_modules/selenium-webdriver/lib/promise.js:2970:14) | ||
at TaskQueue.executeNext_ (node_modules/selenium-webdriver/lib/promise.js:2953:27) | ||
at asyncRun (node_modules/selenium-webdriver/lib/promise.js:2813:27) | ||
at node_modules/selenium-webdriver/lib/promise.js:676:7 | ||
|
||
A test that passes | ||
✓ passes | ||
|
||
************************************************** | ||
* Failures * | ||
************************************************** | ||
|
||
1) a flakey integration test fails, in a horribly consistent manner | ||
- Expected false to be truthy. | ||
|
||
Executed 2 of 2 specs (1 FAILED) in 0.742 sec. | ||
[08:04:26] I/launcher - 0 instance(s) of WebDriver still running | ||
[08:04:26] I/launcher - chrome #01 failed 1 test(s) | ||
[08:04:26] I/launcher - overall: 1 failed spec(s) | ||
[08:04:26] E/launcher - Process exited with error code 1 |