Skip to content

Commit a26212e

Browse files
committed
Update test instructions, add reporter to karma and remove not used
dependencies.
1 parent 30da7e3 commit a26212e

File tree

4 files changed

+38
-22
lines changed

4 files changed

+38
-22
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
bower_components
3-
dist
3+
dist
4+
test_out

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,38 @@ The easiest way to run the unit tests is to use the npm script:
154154

155155
npm test
156156

157-
This will start the [Karma](http://karma-runner.github.io/0.12/index.html) test runner and execute the tests.
157+
This will start the [Karma](http://karma-runner.github.io/0.12/index.html) test runner and execute the tests. By default the browser is Chrome.
158158

159-
####End to end testing
160-
These tests are run with the [Protractor](https://github.com/angular/protractor) test runner, it simulates interaction.
161-
So first the web server should be brought up:
159+
To run the tests for a single run you can use:
162160

163-
npm start
161+
npm run test-single
164162

165-
So that Protractor can execute the tests against it. Starting the tests is done with:
163+
To run the tests on Firefox you can use:
166164

167-
npm run protractor
165+
npm run test-single-firefox
166+
167+
###End to end testing
168+
These tests are run with the [Protractor](https://github.com/angular/protractor) test runner, it simulates interaction.
169+
170+
####Setup
168171

169-
**Note**: Protractor is built upon WebDriver and this should be installed:
172+
Before proceeding you need to download and install the latest version of the stand-alone WebDriver tool:
170173

171174
npm run update-webdriver
175+
176+
After that make sure you have [Java Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html) installed on your machine. It is required for the Standalone Selenium Server.
177+
178+
####Running tests
179+
180+
So first the web server should be brought up so that Protractor can execute the tests against it:
181+
182+
npm start
183+
184+
Running the tests is done with:
185+
186+
npm run protractor
172187

173-
This will download and install the latest version of the stand-alone WebDriver tool.
188+
**Note:** You will need to run the protractor on a separate bash
174189

175190
---------------------------------------
176191

package.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,18 @@
44
"devDependencies": {
55
"grunt": "",
66
"grunt-contrib-jshint": "",
7-
"grunt-contrib-concat": "",
87
"grunt-contrib-uglify": "",
98
"grunt-contrib-watch": "",
10-
"grunt-contrib-requirejs": "",
119
"jshint-stylish": "",
12-
"karma": "",
1310
"protractor": "",
1411
"http-server": "",
1512
"bower": "",
1613
"shelljs": "",
17-
"karma": "",
18-
"karma-jasmine": "",
19-
"karma-chrome-launcher": "",
20-
"karma-firefox-launcher": "",
21-
"karma-junit-reporter": ""
14+
"karma": "",
15+
"karma-jasmine": "",
16+
"karma-chrome-launcher": "",
17+
"karma-firefox-launcher": "",
18+
"karma-junit-reporter": ""
2219
},
2320
"scripts": {
2421
"postinstall": "bower install",
@@ -28,8 +25,8 @@
2825

2926
"pretest": "npm install",
3027
"test": "karma start test/karma.conf.js",
31-
"test-chrome-single": "karma start test/karma.conf.js --browsers Chrome --single-run",
32-
"test-firefox-single": "karma start test/karma.conf.js --browsers Firefox --single-run",
28+
"test-single": "karma start test/karma.conf.js --single-run --reporters junit,dots",
29+
"test-single-firefox": "karma start test/karma.conf.js --browsers Firefox --single-run --reporters junit,dots",
3330

3431
"preupdate-webdriver": "npm install",
3532
"update-webdriver": "webdriver-manager update",

test/karma.conf.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ module.exports = function(config){
2424
browsers : ['Chrome'],
2525

2626
plugins : [ 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-jasmine', 'karma-junit-reporter' ],
27-
27+
28+
reporters: ['junit'],
29+
2830
junitReporter : {
29-
outputFile: 'test_out/unit.xml',
31+
outputDir: './test_out',
32+
outputFile: 'unit.xml',
3033
suite: 'unit'
3134
}
3235

0 commit comments

Comments
 (0)