[%# 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 Test Runner System.
  #
  # The Initial Developer of the Original Code is Maciej Maczynski.
  # Portions created by Maciej Maczynski are Copyright (C) 2001
  # Maciej Maczynski. All Rights Reserved.
  #
  # Contributor(s): David Koenig <dkoenig@novell.com>
  #%]

[%# Testopia Test Case XML export template #%]

[% PROCESS global/variables.none.tmpl %]

    <testcase author="[% case.author.email FILTER xml %]" priority="[% case.priority FILTER xml %]" automated="[% case.isautomated ? "Automatic" : "Manual" FILTER xml %]" status="[% case.status FILTER xml %]">
[% IF case.text.action %]
        <action>[% case.text.action FILTER replace('<','&testopia_lt;') FILTER replace('>','&testopia_gt;') %]</action>
[% END %]
[% IF case.alias %]
        <alias>[% case.alias FILTER xml %]</alias>
[% END %]
[% IF case.arguments %]
        <arguments>[% case.arguments FILTER xml %]</arguments>
[% END %]
[% FOREACH blocked_test_case = case.blocked %]
        <blocks type="Xml_description">[% blocked_test_case.summary FILTER xml %]</blocks>
[% END %]
[% IF case.text.breakdown %]
        <breakdown>[% case.text.breakdown FILTER replace('<','&testopia_lt;') FILTER replace('>','&testopia_gt;') %]</breakdown>
[% END %]
[% IF case.category.name %]
        <categoryname>[% case.category.name FILTER xml %]</categoryname>
[% END %]
[% FOREACH component = case.components %]
        <component product="[% component.product_name %]">[% component.name FILTER xml %]</component>
[% END %]
[% IF case.default_tester.email %]
        <defaulttester>[% case.default_tester.email FILTER xml %]</defaulttester>
[% END %]

[% FOREACH dependson_test_case = case.dependson %]
        <dependson type="Xml_description">[% dependson_test_case.summary FILTER xml %]</dependson>
[% END %]

[% IF case.text.effect %]
        <expectedresults>[% case.text.effect FILTER replace('<','&testopia_lt;') FILTER replace('>','&testopia_gt;') %]</expectedresults>
[% END %]
[% IF case.requirement %]
        <requirement>[% case.requirement FILTER xml %]</requirement>
[% END %]
[% IF case.script %]
        <script>[% case.script FILTER xml %]</script>
[% END %]
[% IF case.text.setup %]
        <setup>[% case.text.setup FILTER replace('<','&testopia_lt;') FILTER replace('>','&testopia_gt;') %]</setup>
[% END %]
[% IF case.summary %]
        <summary>[% case.summary FILTER xml %]</summary>
[% END %]
[% FOREACH tag = case.tags %]
        <tag>[% tag.name FILTER xml %]</tag>
[% END %]
[% FOREACH test_plan = case.plans %]
        <testplan_reference type="Xml_description">[% test_plan.name FILTER xml %]</testplan_reference>
[% END %]
    </testcase>
    