Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e120f88

Browse files
committed
WIP: add protractor grunt task + configs for running E2E specs
1 parent 2d8a442 commit e120f88

File tree

6 files changed

+106
-2
lines changed

6 files changed

+106
-2
lines changed

Gruntfile.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ module.exports = function(grunt) {
111111
},
112112

113113

114+
protractor: {
115+
normal: 'protractor-e2e.conf.js',
116+
travis: 'protractor-e2e-travis.conf.js',
117+
jenkins: 'protractor-e2e-jenkins.conf.js'
118+
},
119+
120+
114121
clean: {
115122
build: ['build'],
116123
tmp: ['tmp']

lib/grunt/plugins.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ module.exports = function(grunt) {
5757
util.updateWebdriver.call(util, this.async());
5858
});
5959

60-
grunt.registerMultiTask('protractor-docs', 'Run Protractor integration tests', function() {
60+
grunt.registerMultiTask('protractor-docs', 'Run Protractor Docs integration tests', function() {
61+
util.startProtractor.call(util, this.data, this.async());
62+
});
63+
64+
grunt.registerMultiTask('protractor', 'Run Protractor E2E tests', function() {
6165
util.startProtractor.call(util, this.data, this.async());
6266
});
6367

protractor-e2e-jenkins.conf.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
exports.config = {
4+
allScriptsTimeout: 11000,
5+
6+
specs: [
7+
'test/e2e/tests/**/*.js'
8+
],
9+
10+
capabilities: {
11+
'browserName': 'chrome'
12+
},
13+
14+
baseUrl: 'http://localhost:8000/e2e/',
15+
16+
framework: 'jasmine',
17+
18+
onPrepare: function() {
19+
/* global angular: false, browser: false, jasmine: false */
20+
21+
// Disable animations so e2e tests run more quickly
22+
var disableNgAnimate = function() {
23+
angular.module('disableNgAnimate', []).run(['$animate', function($animate) {
24+
$animate.enabled(false);
25+
}]);
26+
};
27+
28+
browser.addMockModule('disableNgAnimate', disableNgAnimate);
29+
30+
require('jasmine-reporters');
31+
jasmine.getEnv().addReporter(
32+
new jasmine.JUnitXmlReporter('test_out/e2e-' + exports.config.capabilities.browserName + '-', true, true));
33+
},
34+
35+
jasmineNodeOpts: {
36+
defaultTimeoutInterval: 30000,
37+
showColors: false
38+
}
39+
};

protractor-e2e-travis.conf.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
var config = require('./protractor-shared-conf').config;
4+
5+
config.sauceUser = process.env.SAUCE_USERNAME;
6+
config.sauceKey = process.env.SAUCE_ACCESS_KEY;
7+
8+
config.multiCapabilities = [{
9+
'browserName': 'chrome',
10+
'platform': 'OS X 10.9',
11+
'name': 'Angular E2E',
12+
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
13+
'build': process.env.TRAVIS_BUILD_NUMBER,
14+
'version': '34'
15+
}, {
16+
'browserName': 'firefox',
17+
'name': 'Angular E2E',
18+
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
19+
'build': process.env.TRAVIS_BUILD_NUMBER,
20+
'version': '28'
21+
}, {
22+
browserName: 'safari',
23+
'platform': 'OS X 10.9',
24+
'version': '7',
25+
'name': 'Angular E2E',
26+
'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
27+
'build': process.env.TRAVIS_BUILD_NUMBER
28+
}];
29+
30+
config.specs = [
31+
'test/e2e/tests/**/*.js'
32+
];
33+
34+
config.baseUrl = 'http://localhost:8000/e2e/';
35+
36+
config.allScriptsTimeout = 30000;
37+
config.getPageTimeout = 30000;
38+
39+
exports.config = config;

protractor-e2e.conf.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
var config = require('./protractor-shared-conf').config;
4+
5+
config.specs = [
6+
'test/e2e/tests/**/*.js'
7+
];
8+
9+
config.baseUrl = 'http://localhost:8000/e2e/';
10+
11+
config.capabilities = {
12+
browserName: 'chrome',
13+
};
14+
15+
exports.config = config;

protractor-jenkins-conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ exports.config = {
3030

3131
require('jasmine-reporters');
3232
jasmine.getEnv().addReporter(
33-
new jasmine.JUnitXmlReporter('test_out/e2e-' + exports.config.capabilities.browserName + '-', true, true));
33+
new jasmine.JUnitXmlReporter('test_out/docs-e2e-' + exports.config.capabilities.browserName + '-', true, true));
3434
},
3535

3636
jasmineNodeOpts: {

0 commit comments

Comments
 (0)