diff options
-rw-r--r-- | plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb | 9 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb | 61 |
2 files changed, 44 insertions, 26 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb index 47f5aac6a91..1daa013ee80 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/web/tests_viewer.html.erb @@ -89,7 +89,7 @@ <% test_cases.each_with_index do |test_case, index| %> - <tr class="<%= cycle("even", "odd") -%>" id="testdata_<%= index -%>" display="table-row"> + <tr class="<%= cycle("even", "odd") -%> testdata_<%= index -%>" display="table-row"> <% status = test_case[:status] case status @@ -104,14 +104,13 @@ else icon_url = ApplicationController.root_context + "/images/levels/" + status + ".png" end - %> <td class="thin" nowrap> - <img id="test_status_<%= index -%>_<%= status -%>" src="<%= icon_url -%>"/> + <img class="test_status_<%= index -%>_<%= status -%>" src="<%= icon_url -%>"/> </td> - <td id="test_time_<%= index -%>" class="thin right" nowrap><%= test_case[:time] -%> ms</td> + <td class="test_time_<%= index -%> thin right" nowrap><%= test_case[:time] -%> ms</td> <% if has_covered_lines %> - <td id="test_covered_lines_<%= index -%>" class="thin right" nowrap> + <td class="test_covered_lines_<%= index -%>" class="thin right" nowrap> <a class="test_covered_lines_link_<%= index -%>" href="<%= ApplicationController.root_context -%>/test/testcase/?sid=<%= @snapshot.id -%>&test=<%= test_case[:name] -%>" onclick="openAccordionItem(this.href, this); return false;"><%= number_with_precision(test_case[:covered_lines], :precision => 0) -%> </a> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb index 6ddf7d2bda4..e202cdd2093 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/test/_testable_working_view.erb @@ -5,27 +5,46 @@ <br/> <div class="accordion-body"> <% @test_case_by_test_plan.sort_by{|test_plan, test_cases| test_plan.component.longName}.each do |test_plan, test_cases| %> - <table class="data"> - <thead> - <tr> - <th> - <% resource_key = test_plan.component.key %> - <a href="<%= ApplicationController.root_context -%>/resource/index/<%= resource_key -%>?display_title=true&tab=source" - onclick="openAccordionItem(this.href, this); return false;"><%= test_plan.component.longName %> - </a> - </th> - </tr> - </thead> - <tbody> - <% test_cases.sort_by{|test_case| test_case.name}.each do |test_case| %> - <tr class="<%= cycle("even", "odd") -%>"> - <td> - <%= test_case.name -%> - </td> - </tr> - <% end %> - </tbody> - </table> + <% resource_key = test_plan.component.key %> + <table class="data"> + <thead> + <tr> + <th colspan="3"> + <a href="<%= ApplicationController.root_context -%>/resource/index/<%= resource_key -%>?display_title=true&tab=source" + onclick="openAccordionItem(this.href, this); return false;"><%= test_plan.component.longName %> + </a> + </th> + </tr> + </thead> + <tbody> + <% test_cases.sort_by{|test_case| test_case.name}.each do |test_case| %> + <tr class="<%= cycle("even", "odd") -%>"> + <% + status = test_case.status + case status + when 'ok' + icon_url = ApplicationController.root_context + "/images/levels/ok.png" + when 'failure' + icon_url = ApplicationController.root_context + "/images/warning.png" + when 'error' + icon_url = ApplicationController.root_context + "/images/levels/error.png" + when 'skipped' + icon_url = ApplicationController.root_context + "/images/levels/none.png" + else + icon_url = ApplicationController.root_context + "/images/levels/" + status + ".png" + end + %> + <td class="thin" nowrap> + <img src="<%= icon_url -%>"/> + </td> + <td class="thin right" nowrap><%= test_case.durationInMs -%> ms</td> + <td> + <%= test_case.name -%> + </td> + </tr> + <% end %> + </tbody> + </table> <br/> <% end %> </div> |