access_denied unless has_role?(:user, @resource)
@snapshot=@resource.last_snapshot
+ @popup_mode = params[:popup] == 'true'
if @snapshot
load_extensions()
else
render_resource_deleted()
end
+ # popup mode
else
+ # Always display title in popup mode
+ @params_opts = '&popup=true&display_title=true'
params[:layout] = 'false'
render :action => 'index'
end
@test = params[:test].to_s
@test_plan = java_facade.testPlan(snapshot_id)
@test_case = @test_plan.testCasesByName(@test).first
- render :partial => 'test/testcase_working_view'
+ render :partial => 'test/testcase'
end
def testable
test_cases << test_case
@test_case_by_test_plan[test_plan] = test_cases
end
- render :partial => 'test/testable_working_view'
+ render :partial => 'test/testable'
end
end
\ No newline at end of file
</li>
<% first=false
end %>
+ <% unless @popup_mode %>
<li class="<%= 'first' if first -%>">
<a href="<%= ApplicationController.root_context -%>/resource/index/<%= @resource.key -%>?display_title=true" onclick="window.open(this.href,'resource','height=800,width=900,scrollbars=1,resizable=1');return false;"><%= message('new_window') -%></a>
</li>
+ <% end %>
</ul>
<ul class="tabs2">
<% @extensions.each do |extension| %>
<div id="accordion-panel"/>
<script type="text/javascript">
- openAccordionItem('<%= request.request_uri -%>', this);
+ openAccordionItem('<%= request.request_uri + @params_opts.to_s -%>', this);
</script>
\ No newline at end of file
--- /dev/null
+<div class="accordion-item">
+ <div class="accordion-item-header">
+ <div class="source_title">
+ <div class="subtitle">Tests covering <%= @testable.component.longName %> on line <%= @line %></div>
+ </div>
+ </div>
+ <div class="accordion-item-body">
+ <% @test_case_by_test_plan.sort_by { |test_plan, test_cases| test_plan.component.longName }.each do |test_plan, test_cases| %>
+ <% 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>
+ <table class="data marginbottom10">
+ <tbody>
+ <% reset_cycle %>
+ <% test_cases.sort_by { |test_case| test_case.name }.each do |test_case|
+ reset_cycle
+ %>
+ <tr class="<%= cycle('even', 'odd') -%>">
+ <td class="thin" nowrap>
+ <img src="<%= ApplicationController.root_context + "/images/test/" + test_case.status.name + ".png" -%>"/>
+ </td>
+ <td class="thin right" nowrap><%= test_case.durationInMs -%> ms</td>
+ <td>
+ <%= test_case.name -%>
+ </td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ <% end %>
+ </div>
+</div>
+++ /dev/null
-<div class="accordion-item">
- <div class="accordion-item-header">
- <div class="source_title">
- <div class="subtitle">Tests covering <%= @testable.component.longName %> on line <%= @line %></div>
- </div>
- </div>
- <div class="accordion-item-body">
- <% @test_case_by_test_plan.sort_by { |test_plan, test_cases| test_plan.component.longName }.each do |test_plan, test_cases| %>
- <% 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>
- <table class="data marginbottom10">
- <tbody>
- <% reset_cycle %>
- <% test_cases.sort_by { |test_case| test_case.name }.each do |test_case|
- reset_cycle
- %>
- <tr class="<%= cycle('even', 'odd') -%>">
- <td class="thin" nowrap>
- <img src="<%= ApplicationController.root_context + "/images/test/" + test_case.status.name + ".png" -%>"/>
- </td>
- <td class="thin right" nowrap><%= test_case.durationInMs -%> ms</td>
- <td>
- <%= test_case.name -%>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- <% end %>
- </div>
-</div>
--- /dev/null
+<div class="accordion-item">
+ <div class="accordion-item-header">
+ <h3>Files covered by <%= @test %> (<%= @test_plan.component.longName %>)</h3>
+ </div>
+ <br/>
+ <div class="accordion-item-body">
+ <table class="data">
+ <thead>
+ <tr>
+ <th>File</th>
+ <th>Covered Lines</th>
+ </tr>
+ </thead>
+ <tbody>
+ <% @test_case.coverageBlocks.sort_by{|cover| cover.testable.component.name}.each do |cover|
+ reset_cycle
+ %>
+ <tr class="<%= cycle("even", "odd") -%>">
+ <td>
+ <a href="<%= ApplicationController.root_context -%>/resource/index/<%= cover.testable.component.key -%>?display_title=true&tab=coverage&coverage_filter=lines_covered_per_test&test_case_filter=<%= @test -%>"
+ onclick="openAccordionItem(this.href, this); return false;"><%= cover.testable.component.longName -%>
+ </a>
+ </td>
+ <td><%= cover.lines.size -%></td>
+ </tr>
+ <% end %>
+ </tbody>
+ </table>
+ </div>
+</div>
\ No newline at end of file
+++ /dev/null
-<div class="accordion-item">
- <div class="accordion-item-header">
- <h3>Files covered by <%= @test %> (<%= @test_plan.component.longName %>)</h3>
- </div>
- <br/>
- <div class="accordion-item-body">
- <table class="data">
- <thead>
- <tr>
- <th>File</th>
- <th>Covered Lines</th>
- </tr>
- </thead>
- <tbody>
- <% @test_case.coverageBlocks.sort_by{|cover| cover.testable.component.name}.each do |cover|
- reset_cycle
- %>
- <tr class="<%= cycle("even", "odd") -%>">
- <td>
- <a href="<%= ApplicationController.root_context -%>/resource/index/<%= cover.testable.component.key -%>?display_title=true&tab=coverage&coverage_filter=lines_covered_per_test&test_case_filter=<%= @test -%>"
- onclick="openAccordionItem(this.href, this); return false;"><%= cover.testable.component.longName -%>
- </a>
- </td>
- <td><%= cover.lines.size -%></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
-</div>
\ No newline at end of file
Functions used in tests viewer
*/
function expandTests(index, elt){
+ expandAccordionItem(elt);
var parent = $j(elt).closest('.test_name_'+index);
parent.find(".test_expandLink_"+ index).hide();
parent.find(".test_collapseLink_"+ index).show();
}
function collapseTests(index, elt){
+ expandAccordionItem(elt);
var parent = $j(elt).closest('.test_name_'+index);
parent.find(".test_collapseLink_"+ index).hide();
parent.find(".test_expandLink_"+ index).show();