From e645f7cae14618bd8fc7d6b3eadf9307f5a1aeb7 Mon Sep 17 00:00:00 2001 From: Julie Date: Thu, 6 Feb 2014 11:29:24 -0800 Subject: refactor(testing): split travis end to end tests into separate jobs for jquery and jqlite Closes #6159 --- .travis.yml | 9 ++++++--- Gruntfile.js | 2 ++ protractor-conf.js | 5 +++-- protractor-jquery-conf.js | 32 ++++++++++++++++++++++++++++++++ scripts/travis/build.sh | 9 ++++++--- 5 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 protractor-jquery-conf.js diff --git a/.travis.yml b/.travis.yml index 6a24af3f..b94d3b58 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 123a0d72..89e461d6 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/protractor-conf.js b/protractor-conf.js index 9e7179db..c21ee68f 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 00000000..6b93994b --- /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 b07e2069..a415c35e 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 \ -- cgit v1.2.3