diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-25 15:04:59 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-25 15:27:39 +0200 |
commit | 5de168c51c20ef298d1257cc91517eeca9db7d9c (patch) | |
tree | 85d9bc08bee201e24a01c95c047ba13687bcc55e /server | |
parent | 4e21ed56063352cf19d5709b28545112dffe3a9d (diff) | |
download | sonarqube-5de168c51c20ef298d1257cc91517eeca9db7d9c.tar.gz sonarqube-5de168c51c20ef298d1257cc91517eeca9db7d9c.zip |
Add task to run single spec with casper, make casper less verbose on CI
Diffstat (limited to 'server')
-rw-r--r-- | server/sonar-web/Gruntfile.coffee | 10 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/tests/e2e/lib.js | 4 |
2 files changed, 13 insertions, 1 deletions
diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index 9007008bd7d..e222dcb4112 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -269,6 +269,7 @@ module.exports = (grunt) -> options: test: true 'no-colors': true + concise: true src: ['<%= pkg.sources %>js/tests/e2e/tests/**/*.js'] cw: options: @@ -276,6 +277,12 @@ module.exports = (grunt) -> parallel: true, concurrency: 5 src: ['<%= pkg.sources %>js/tests/e2e/tests/component-viewer-spec.js'] + single: + options: + test: true + parallel: true, + concurrency: 5 + src: ['<%= pkg.sources %>js/tests/e2e/tests/<%= grunt.option("spec") %>-spec.js'] watch: @@ -333,3 +340,6 @@ module.exports = (grunt) -> grunt.registerTask 'cw', ['clean:js', 'coffee:build', 'handlebars:build', 'copy:js', 'concat:dev', 'express:test', 'casper:cw'] + + grunt.registerTask 'single', ['clean:js', 'coffee:build', 'handlebars:build', 'copy:js', 'concat:dev', + 'express:test', 'casper:single'] diff --git a/server/sonar-web/src/main/js/tests/e2e/lib.js b/server/sonar-web/src/main/js/tests/e2e/lib.js index 3cf5968d3ed..6650aa509de 100644 --- a/server/sonar-web/src/main/js/tests/e2e/lib.js +++ b/server/sonar-web/src/main/js/tests/e2e/lib.js @@ -22,8 +22,10 @@ exports.initMessages = function () { exports.changeWorkingDirectory = function (dir) { + var commandLineArgs = require('system').args; // Since Casper has control, the invoked script is deep in the argument stack - var currentFile = require('system').args[4]; + // commandLineArgs = casper/bin/bootstrap.js,--casper-path=.../casperjs,--cli,--test,[file(s) under test],[options] + var currentFile = commandLineArgs[4]; var curFilePath = fs.absolute(currentFile).split(fs.separator); if (curFilePath.length > 1) { curFilePath.pop(); // PhantomJS does not have an equivalent path.baseName()-like method |