From 1d491782c8ff50874102a6d23aa30f0c51b1d2f6 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 1 Dec 2014 12:11:53 +0100 Subject: [PATCH] Fix execution of web medium tests. Fix minification of the js files --- server/sonar-web/Gruntfile.coffee | 31 +++++++++++++++++-- .../main/js/tests/e2e/tests/issues-spec.js | 1 - 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/server/sonar-web/Gruntfile.coffee b/server/sonar-web/Gruntfile.coffee index 398c742840a..f694891b755 100644 --- a/server/sonar-web/Gruntfile.coffee +++ b/server/sonar-web/Gruntfile.coffee @@ -309,7 +309,7 @@ module.exports = (grunt) -> test: true 'no-colors': true concise: true - src: ['<%= pkg.sources %>js/tests/e2e/tests/**/*.js'] + src: ['<%= pkg.sources %>js/tests/e2e/tests/**/issues-spec.js'] single: options: test: true @@ -318,6 +318,17 @@ module.exports = (grunt) -> src: ['<%= pkg.sources %>js/tests/e2e/tests/<%= grunt.option("spec") %>-spec.js'] + uglify: + build: + files: [ + expand: true + cwd: '<%= pkg.assets %>js' + src: ['**/*.js'] + dest: '<%= pkg.assets %>js' + ext: '.js' + ] + + jshint: dev: src: [ @@ -376,11 +387,25 @@ module.exports = (grunt) -> 'concat:dev'] - grunt.registerTask 'default', ['clean:css', 'clean:js', + grunt.registerTask 'default', [ + # testing first + 'clean:js', 'coffee:build', 'handlebars:build', 'copy:js', 'concat:dev', + 'express:test', 'casper:test' + + # then build + 'clean:css', 'clean:js', 'less:build', 'cssUrlRewrite:build' 'coffee:build', 'handlebars:build', 'copy:js', 'concat:build', - 'requirejs', 'clean:js', 'copy:build', 'copy:requirejs', 'clean:build'] + 'requirejs', 'clean:js', 'copy:build', 'copy:requirejs', 'uglify:build', + 'clean:build'] + + grunt.registerTask 'build', ['clean:css', 'clean:js', + 'less:build', 'cssUrlRewrite:build' + 'coffee:build', 'handlebars:build', 'copy:js', + 'concat:build', + 'requirejs', 'clean:js', 'copy:build', 'copy:requirejs', 'uglify:build', + 'clean:build'] grunt.registerTask 'test', ['clean:js', 'coffee:build', 'handlebars:build', 'copy:js', 'concat:dev', 'express:test', 'casper:test'] diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js index 03282f3bbd8..771279d4781 100644 --- a/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js +++ b/server/sonar-web/src/main/js/tests/e2e/tests/issues-spec.js @@ -90,7 +90,6 @@ casper.test.begin(testName('Issue Box', 'Check Elements'), function (test) { test.assertSelectorContains('.issue.selected .js-issue-plan', 'unplanned'); test.assertSelectorContains('.issue.selected', '20min'); test.assertExists('.issue.selected .js-issue-comment'); - test.assertExists('.issue.selected .js-issue-more'); test.assertExists('.issue.selected .js-issue-show-changelog'); }) -- 2.39.5