diff --git a/.travis.yml b/.travis.yml index 6a24af3fd41b..b94d3b58f2a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,12 @@ node_js: env: matrix: - JOB=unit - - JOB=e2e-chrome - - JOB=e2e-firefox - - JOB=e2e-safari + - JOB=e2e BROWSER=chrome JQVERSION=jqlite + - JOB=e2e BROWSER=firefox JQVERSION=jqlite + - JOB=e2e BROWSER=safari JQVERSION=jqlite + - JOB=e2e BROWSER=chrome JQVERSION=jquery + - JOB=e2e BROWSER=firefox JQVERSION=jquery + - JOB=e2e BROWSER=safari JQVERSION=jquery global: - SAUCE_USERNAME=angular-ci - SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987 diff --git a/Gruntfile.js b/Gruntfile.js index 123a0d72a574..89e461d61190 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -92,6 +92,7 @@ module.exports = function(grunt) { protractor: { normal: 'protractor-conf.js', + jquery: 'protractor-jquery-conf.js', jenkins: 'protractor-jenkins-conf.js' }, @@ -292,6 +293,7 @@ module.exports = function(grunt) { grunt.registerTask('test:docs', 'Run the doc-page tests with Karma', ['package', 'tests:docs']); grunt.registerTask('test:unit', 'Run unit, jQuery and Karma module tests with Karma', ['tests:jqlite', 'tests:jquery', 'tests:modules']); 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']); + grunt.registerTask('test:jq-protractor', 'Run the end to end tests against jquery with Protractor and keep a test server running in the background', ['webdriver', 'connect:testserver', 'protractor:jquery']); 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']); grunt.registerTask('test:e2e', 'Alias for test:protractor', ['test:protractor']); grunt.registerTask('test:docgen', ['jasmine_node']); diff --git a/docs/src/gen-docs.js b/docs/src/gen-docs.js index 9fc5f8db4c90..ff8d8311868a 100755 --- a/docs/src/gen-docs.js +++ b/docs/src/gen-docs.js @@ -57,7 +57,10 @@ writer.makeDir('build/docs/', true).then(function() { fileFutures.push(writer.output('partials/' + doc.section + '/' + id + '.html', doc.html())); // If it has a sample Protractor test, output that as well. if (doc.protractorTests.length) { - fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '_test.js', ngdoc.writeProtractorTest(doc))); + fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '.jquery_test.js', + ngdoc.writeProtractorTest(doc, 'index-jq-nocache.html#!/'))); + fileFutures.push(writer.output('ptore2e/' + doc.section + '/' + id + '.jqlite_test.js', + ngdoc.writeProtractorTest(doc, 'index-nocache.html#!/'))); } }); diff --git a/docs/src/ngdoc.js b/docs/src/ngdoc.js index 1e8896d06459..78f968d99793 100644 --- a/docs/src/ngdoc.js +++ b/docs/src/ngdoc.js @@ -1110,28 +1110,17 @@ function scenarios(docs){ } } -function writeProtractorTest(doc){ +function writeProtractorTest(doc, pathPrefix){ var lines = []; lines.push('describe("' + doc.section + '/' + doc.id + '", function() {'); - lines.push(' describe("angular+jqLite", function() {') - lines.push(' beforeEach(function() {'); - lines.push(' browser.get("index-nocache.html#!/' + doc.section + '/' + doc.id + '");'); - lines.push(' });'); - lines.push(''); - doc.protractorTests.forEach(function(test){ - lines.push(indentCode(trim(test), 4)); - lines.push(''); - }); + lines.push(' beforeEach(function() {'); + lines.push(' browser.get("' + pathPrefix + doc.section + '/' + doc.id + '");'); lines.push(' });'); - lines.push(' describe("angular+jQuery", function() {') - lines.push(' beforeEach(function() {'); - lines.push(' browser.get("index-jq-nocache.html#!/' + doc.section + '/' + doc.id + '");'); - lines.push(' });'); + lines.push(''); doc.protractorTests.forEach(function(test){ - lines.push(indentCode(trim(test), 4)); + lines.push(indentCode(trim(test), 0)); lines.push(''); }); - lines.push(' });'); lines.push('});'); lines.push(''); return lines.join('\n'); diff --git a/protractor-conf.js b/protractor-conf.js index 9e7179db0521..c21ee68f36eb 100644 --- a/protractor-conf.js +++ b/protractor-conf.js @@ -2,12 +2,13 @@ exports.config = { allScriptsTimeout: 11000, specs: [ - 'build/docs/ptore2e/**/*.js', + 'build/docs/ptore2e/**/*jqlite_test.js', 'test/e2e/docsAppE2E.js' ], capabilities: { - 'browserName': 'chrome' + 'browserName': 'chrome', + 'name': 'Angular E2E: jqlite' }, baseUrl: 'http://localhost:8000/build/docs/', diff --git a/protractor-jquery-conf.js b/protractor-jquery-conf.js new file mode 100644 index 000000000000..6b93994b7206 --- /dev/null +++ b/protractor-jquery-conf.js @@ -0,0 +1,32 @@ +exports.config = { + allScriptsTimeout: 11000, + + specs: [ + 'build/docs/ptore2e/**/*jquery_test.js', + 'test/e2e/docsAppE2E.js' + ], + + capabilities: { + 'browserName': 'chrome', + 'name': 'Angular E2E: jquery' + }, + + baseUrl: 'http://localhost:8000/build/docs/', + + framework: 'jasmine', + + onPrepare: function() { + // Disable animations so e2e tests run more quickly + var disableNgAnimate = function() { + angular.module('disableNgAnimate', []).run(function($animate) { + $animate.enabled(false); + }); + }; + + browser.addMockModule('disableNgAnimate', disableNgAnimate); + }, + + jasmineNodeOpts: { + defaultTimeoutInterval: 30000 + } +}; diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh index b07e2069e8c5..a415c35e48b4 100755 --- a/scripts/travis/build.sh +++ b/scripts/travis/build.sh @@ -3,15 +3,18 @@ set -e export SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev` -export BROWSER=${JOB#*-} if [ $JOB = "unit" ]; then grunt ci-checks grunt test:docgen grunt test:promises-aplus grunt test:unit --browsers SL_Chrome,SL_Safari,SL_Firefox,SL_IE_8,SL_IE_9,SL_IE_10,SL_IE_11 --reporters dots -elif [[ $JOB == e2e* ]]; then - grunt test:protractor --sauceUser $SAUCE_USERNAME \ +elif [ $JOB = "e2e" ]; then + export GRUNT_TARGET="test:protractor" + if [ $JQVERSION = "jquery" ]; then + GRUNT_TARGET="test:jq-protractor" + fi + grunt $GRUNT_TARGET --sauceUser $SAUCE_USERNAME \ --sauceKey $SAUCE_ACCESS_KEY \ --capabilities.tunnel-identifier=$TRAVIS_JOB_NUMBER \ --capabilities.build=$TRAVIS_BUILD_NUMBER \