1 | This branch is for Jasmine 1.x.
|
2 | [Switch to the 2.x branch.](https://github.com/larrymyers/jasmine-reporters)
|
3 |
|
4 | # Jasmine Reporters
|
5 |
|
6 | Jasmine Reporters is a collection of javascript jasmine.Reporter classes that can be used with
|
7 | the [JasmineBDD testing framework](http://jasmine.github.io/).
|
8 |
|
9 | Included reporters:
|
10 |
|
11 | * ConsoleReporter - Report test results to the browser console.
|
12 | * JUnitXmlReporter - Report test results to a file in JUnit XML Report format.
|
13 | * NUnitXmlReporter - Report test results to a file in NUnit XML Report format.
|
14 | * TapReporter - Test Anything Protocol, report tests results to console.
|
15 | * TeamcityReporter - Basic reporter that outputs spec results to for the Teamcity build system.
|
16 | * TerminalReporter - Logs to a terminal (including colors) with variable verbosity.
|
17 |
|
18 | ## Usage
|
19 |
|
20 | Examples are included in the test directory that show how to use the reporters,
|
21 | as well a basic runner scripts for Rhino + envjs, and a basic runner for
|
22 | [PhantomJS](https://github.com/ariya/phantomjs). Either of these methods could
|
23 | be used in a Continuous Integration project for running headless tests and
|
24 | generating JUnit XML output.
|
25 |
|
26 | ### Rhino + EnvJS
|
27 |
|
28 | Everything needed to run the tests in Rhino + EnvJS is included in this
|
29 | repository inside the `ext` directory, specifically Rhino 1.7r2 and envjs 1.2
|
30 | for Rhino.
|
31 |
|
32 | ### PhantomJS
|
33 |
|
34 | Should work in most versions of PhantomJS > 1.4.1
|
35 | I have used PhantomJS 1.4.1 through 1.9.6 on Mac OS X with no problems.
|
36 |
|
37 | ### Node.js
|
38 |
|
39 | Most of these reporters also work in node.js by making use of the excellent
|
40 | [jasmine-node project](https://github.com/mhevery/jasmine-node).
|
41 |
|
42 | # Protractor
|
43 |
|
44 | Protractor 1.6.0 or above allows you to use either Jasmine 1 or Jasmine 2.
|
45 | If you are using Jasmine 1, make sure you install a 1.x-compatible version of jasmine-reporters:
|
46 |
|
47 | npm install --save-dev jasmine-reporters@^1.0.0
|
48 |
|
49 | Then set everything up inside your protractor.conf:
|
50 |
|
51 | onPrepare: function() {
|
52 | // The require statement must be down here, since jasmine-reporters@1.0
|
53 | // expects jasmine to be in the global and protractor does not guarantee
|
54 | // this until inside the onPrepare function.
|
55 | require('jasmine-reporters');
|
56 | jasmine.getEnv().addReporter(
|
57 | new jasmine.JUnitXmlReporter('xmloutput', true, true)
|
58 | );
|
59 | }
|