From a5a4a49e0c8ded4740a0de91a31cf2c689a2f94c Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 1 Sep 2016 18:02:07 +0200 Subject: [PATCH] SONAR-7846 do not display both message and stacktrace --- .../it/projectAdministration/BackgroundTasksTest.java | 3 +-- .../src/test/java/pageobjects/BackgroundTaskItem.java | 7 +------ .../js/apps/background-tasks/views/StacktraceView.hbs | 8 ++++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java b/it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java index 46ad5307f85..0d66bab19a2 100644 --- a/it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java +++ b/it/it-tests/src/test/java/it/projectAdministration/BackgroundTasksTest.java @@ -71,7 +71,7 @@ public class BackgroundTasksTest { } @Test - public void display_error_message_and_stacktrace() { + public void display_error_stacktrace() { executeBuild("test-project", "Test Project", "2010-01-01"); nav.logIn().submitCredentials("admin", "admin"); @@ -81,7 +81,6 @@ public class BackgroundTasksTest { BackgroundTaskItem task = page.getTasksAsItems().get(0); task.openActions() .openErrorStacktrace() - .assertErrorMessageContains("Date of analysis cannot be older than the date of the last known analysis") .assertErrorStacktraceContains("Date of analysis cannot be older than the date of the last known analysis"); } diff --git a/it/it-tests/src/test/java/pageobjects/BackgroundTaskItem.java b/it/it-tests/src/test/java/pageobjects/BackgroundTaskItem.java index 75ea6965468..cd4bf7f16c0 100644 --- a/it/it-tests/src/test/java/pageobjects/BackgroundTaskItem.java +++ b/it/it-tests/src/test/java/pageobjects/BackgroundTaskItem.java @@ -56,12 +56,7 @@ public class BackgroundTaskItem { public BackgroundTaskItem openErrorStacktrace () { elt.$(".js-task-show-stacktrace").click(); - $(".js-task-error-message").shouldBe(visible); - return this; - } - - public BackgroundTaskItem assertErrorMessageContains(String text) { - $(".js-task-error-message").should(hasText(text)); + $(".js-task-stacktrace").shouldBe(visible); return this; } diff --git a/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.hbs b/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.hbs index 1a4d2eb4753..21ce604acb2 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.hbs +++ b/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.hbs @@ -6,12 +6,12 @@
{{#if loaded}} -

{{t 'background_tasks.error_message'}}

-
{{task.errorMessage}}
- {{#if stacktrace}} -

{{t 'background_tasks.error_stacktrace'}}

+

{{t 'background_tasks.error_stacktrace'}}

{{stacktrace}}
+ {{else}} +

{{t 'background_tasks.error_message'}}

+
{{task.errorMessage}}
{{/if}} {{else}} -- 2.39.5