[%# 1.0@bugzilla.org %]
[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Testopia System
  #
  # The Initial Developer of the Original Code is Greg Hendricks.
  # Portions created by Greg Hendricks are Copyright (C) 2006 Novell.
  # All Rights Reserved.
  #
  # Contributor(s): Greg Hendricks <ghendricks@novell.com>
  #%]
  
<html>
  <head>
    <title>Test Plan [% plan.id FILTER html %] - [% plan.name FILTER html %]</title>
    <link href="extensions/testopia/css/print.css" rel="stylesheet" type="text/css"/>
  </head>
</html>
<h1>Test Plan [% plan.id FILTER html %] - [% plan.name FILTER html %]</h1>
<table>
  <tr>
    <td class="print_table_bold">Author:</td>
    <td class="print_table_body">[% plan.author.identity FILTER html %]</td>
    <td class="print_table_bold">Created:</td>
    <td class="print_table_body">[% plan.creation_date FILTER time %]</td>
  </tr>
  <tr>
    <td class="print_table_bold">Product:</td>
    <td class="print_table_body">[% plan.product.name FILTER html %]</td>
    <td class="print_table_bold">Product Version:</td>
    <td class="print_table_body">[% plan.default_product_version FILTER html %]</td>
  </tr>
  <tr>
    <td class="print_table_bold">Plan Type:</td>
    <td class="print_table_body">[% plan.type FILTER html %]</td>
    <td class="print_table_bold">Plan Text Version:</td>
    <td class="print_table_body">[% plan.version FILTER html %]</td>
  </tr>
  <tr>
    <td class="print_table_bold">Total Test Cases:</td>
    <td class="print_table_body">[% case_table.list_count FILTER html %]</td>
    <td class="print_table_bold">Total Test Runs:</td>
    <td class="print_table_body">[% run_table.list_count FILTER html %]</td>
  </tr>
</table>

<table>
  <tr>
    <th>Tags</th>
  </tr>
  <tr>
    <td>
    [% FOREACH tag = plan.tags %]
      [% tag.tag_name FILTER html %]</br>
    [% END %]
    </td>
  </tr>
</table>
<hr>
<h3>Pass/Fail Rundown By Build</h3>
<table>
  <TR>
    <td>&nbsp;</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_header">[% status.name FILTER html %]</TD>
  [% END %]
  </TR>
[% FOREACH build = plan.builds_seen %]
  <tr>
    <td class="print_table_row_header">[% build.name FILTER html %]</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_data">[% percentage(build.case_run_count,build.case_run_count(status.id)) %]%</TD>
  [% END %]
  </tr>
[% END %]
</table>

<hr>
<h3>Pass/Fail Rundown By Environment</h3>
<table>
  <TR>
    <td>&nbsp;</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_header">[% status.name FILTER html %]</TD>
  [% END %]
  </TR>
[% FOREACH environment = plan.environments_seen %]
  <tr>
    <td class="print_table_row_header">[% environment.name FILTER html %]</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_data">[% percentage(environment.case_run_count,environment.case_run_count(status.id)) %]%</TD>
  [% END %]
  </tr>
[% END %]
</table>

<hr>
<h3>Pass/Fail Rundown By Run</h3>
<table>
  <TR>
    <td>&nbsp;</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_header">[% status.name FILTER html %]</TD>
  [% END %]
  </TR>
[% FOREACH run = plan.test_runs %]
  <tr>
    <td class="print_table_row_header">[% run.summary FILTER html %]</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_data">[% percentage(run.case_run_count,run.case_run_count(status.id)) %]%</TD>
  [% END %]
  </tr>
[% END %]
</table>
<hr>
<h3>Pass/Fail Totals</h3>
<table>
  <TR>
    <td>&nbsp;</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_header">[% status.name FILTER html %]</TD>
  [% END %]
  </TR>
  <tr>
    <td class="print_table_row_header">Total</td>
  [% FOREACH status = plan.test_runs.0.caseruns.0.get_status_list %]
    <TD class="print_table_data">[% percentage(plan.test_case_run_count,plan.test_case_run_count(status.id)) %]%</TD>
  [% END %]
  </tr>
</table>


<hr>
<h3>Plan Document</h3>
[% plan.text.plan_text FILTER html_light %]
<h3>Test Cases</h3><hr/>
    [% FOREACH case = plan.test_cases %]
    <table cellpadding="5" width="100%">
        <tr>
            <th colspan="2">Case [% case.id FILTER html %]: [% case.summary FILTER html %]</th>
        </tr>
        <tr>
            <th>Status: [% case.status FILTER html %]</th><th>Priority: [% case.priority FILTER html %]</th>
        </tr>
        <tr>
            <th>Setup</th><th>Breakdown</th>
        </tr>
        <tr>
            <td>[% case.text.setup FILTER none %]</td><td>[% case.text.breakdown FILTER none %]</td>
        </tr>
        <tr>
            <th>Action</th><th>Expected Result</th>
        </tr>
        <tr>
            <td>[% case.text.action FILTER none %]</td><td>[% case.text.effect FILTER none %]</td>
        </tr>
    </table>
    <hr/>
    [% END %]
