Skip to content

Commit 84467d8

Browse files
juliemrIgorMinar
authored andcommitted
refactor(testing): run end to end tests on separate browsers in parallel
1 parent 0e85ca9 commit 84467d8

File tree

6 files changed

+15
-14
lines changed

6 files changed

+15
-14
lines changed

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ node_js:
55
env:
66
matrix:
77
- JOB=unit
8-
- JOB=e2e
8+
- JOB=e2e-chrome
9+
- JOB=e2e-firefox
10+
- JOB=e2e-safari
911
global:
1012
- SAUCE_USERNAME=angular-ci
1113
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987

Gruntfile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ module.exports = function(grunt) {
9090
},
9191

9292

93-
runprotractor: {
93+
protractor: {
9494
normal: 'protractor-conf.js',
9595
jenkins: 'protractor-jenkins-conf.js'
9696
},
@@ -291,8 +291,8 @@ module.exports = function(grunt) {
291291
grunt.registerTask('test:modules', 'Run the Karma module tests with Karma', ['tests:modules']);
292292
grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']);
293293
grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']);
294-
grunt.registerTask('test:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'runprotractor:normal']);
295-
grunt.registerTask('test:ci-protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'runprotractor:jenkins']);
294+
grunt.registerTask('test:protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'protractor:normal']);
295+
grunt.registerTask('test:ci-protractor', 'Run the end to end tests with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'protractor:jenkins']);
296296
grunt.registerTask('test:e2e', 'Alias for test:protractor', ['test:protractor']);
297297
grunt.registerTask('test:docgen', ['jasmine_node']);
298298
grunt.registerTask('test:promises-aplus',['build:promises-aplus-adapter','shell:promises-aplus-tests']);

docs/content/misc/contribute.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ made available a local web server based on Node.js.
135135

136136
## Running the Unit Test Suite
137137

138-
We write unit tests with Jasmine and execute them with Karma. To run all of the
138+
We write unit and integration tests with Jasmine and execute them with Karma. To run all of the
139139
tests once on Chrome run:
140140

141141
```shell

lib/grunt/plugins.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = function(grunt) {
6565
util.updateWebdriver.call(util, this.async());
6666
});
6767

68-
grunt.registerMultiTask('runprotractor', 'Run Protractor integration tests', function() {
68+
grunt.registerMultiTask('protractor', 'Run Protractor integration tests', function() {
6969
util.startProtractor.call(util, this.data, this.async());
7070
});
7171

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"karma-sauce-launcher": "0.2.0",
3737
"karma-script-launcher": "0.1.0",
3838
"karma-browserstack-launcher": "0.0.7",
39-
"protractor": "~0.17.0",
39+
"protractor": "~0.18.0",
4040
"yaml-js": "~0.0.8",
4141
"marked": "0.2.9",
4242
"rewire": "1.1.3",

scripts/travis/build.sh

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@
33
set -e
44

55
export SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
6+
export BROWSER=${JOB#*-}
67

78
if [ $JOB = "unit" ]; then
89
grunt ci-checks
910
grunt test:docgen
1011
grunt test:promises-aplus
1112
grunt test:unit --browsers SL_Chrome,SL_Safari,SL_Firefox,SL_IE_8,SL_IE_9,SL_IE_10,SL_IE_11 --reporters dots
12-
elif [ $JOB = "e2e" ]; then
13-
export SAUCE_OPTIONS="--sauceUser $SAUCE_USERNAME \
13+
elif [[ $JOB == e2e* ]]; then
14+
grunt test:protractor --sauceUser $SAUCE_USERNAME \
1415
--sauceKey $SAUCE_ACCESS_KEY \
1516
--capabilities.tunnel-identifier=$TRAVIS_JOB_NUMBER \
16-
--capabilities.build=$TRAVIS_BUILD_NUMBER"
17-
grunt test:protractor $SAUCE_OPTIONS
18-
grunt test:protractor $SAUCE_OPTIONS --browser=firefox
19-
grunt test:protractor $SAUCE_OPTIONS --browser=safari
17+
--capabilities.build=$TRAVIS_BUILD_NUMBER \
18+
--browser=$BROWSER
2019
else
21-
echo "Unknown job type. Please set JOB=unit or JOB=e2e."
20+
echo "Unknown job type. Please set JOB=unit or JOB=e2e-*."
2221
fi

0 commit comments

Comments
 (0)