<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ name }} | Xmind2TestCase Preview</title>
    <link rel="shortcut icon" href="{{ url_for('static',filename='favicon.ico') }}" type="image/x-icon"/>
    <link rel="stylesheet" type="text/css" media="all" href="{{ url_for('static',filename='css/pure-min.css') }}">
    <link rel="stylesheet" type="text/css" media="all" href="{{ url_for('static',filename='css/custom.css') }}">
</head>
<body>
<div class="header">
    <h1>{{ name }} - Preview</h1>
    <h2>TestSuites: {{ suite_count }} / TestCases: {{ suite | length }}
        / <a href="{{ url_for("download_zentao_file",filename= name) }}">Get Zentao CSV</a>
        / <a href="{{ url_for("download_testlink_file",filename= name) }}">Get TestLink XML</a>
        / <a href="{{ url_for("index") }}">Go Back</a></h2>
</div>
<table class="pure-table tests-table">
    <thead>
    <tr>
        <th width="5%">#</th>
        <th width="5%">Suite</th>
        <th width="10%">Category</th>
        <th width="10%">Title</th>
        <th width="10%">PreConditions</th>
        <th width=10%">Attributes</th>
        <th width="40%">Steps</th>
    </tr>
    </thead>
    <tbody>
    {% for test in suite %}
        <tr>
            <td>{{ loop.index }}</td>
            <td>{{ test.suite }}</td>
            <td>{{ test.category | replace('\n','<br>') |safe }}</td>

            <td {% if test.name|length>100 %}class="long-name" {% endif %}>{{ test.name }}
                {% if test.name|length>100 %}
                    <span class="long-name-info">Warn: test name might be too long: {{ test.name|length }}!</span>
                {% endif %}
            </td>
            <td>{{ test.preconditions | replace('\n','<br>') |safe }}</td>
            <td>
                <div class="tag-success tooltip">
                    Priority {{ test.importance }}
                    <span class="tooltiptext">Priority {{ test.importance }} </span>
                </div>
                {% if test.preconditions %}
                    <div class="pure-button tag-info tooltip">PreCond.
                        <p class="tooltiptext">
                            <b>Preconditions:</b> <br>
                            {{ test.preconditions | replace('\n','<br>') |safe }}
                        </p></div>
                {% endif %}
                {% if test.summary %}
                    <div class="pure-button tag-warn tooltip">Summary
                        <p class="tooltiptext">
                            <b>Summary:</b> <br>
                            {{ test.summary | replace('\n','<br>') |safe }}
                        </p></div>
                {% endif %}
            <td>
                {% if test.steps %}
                    <ol>
                        {% for step in test.steps %}
                            <li>{{ step.actions }}
                                {% if step.expectedresults %}
                                    {% for expected_result in step.expectedresults %}
                                        <ul>
                                            <li>{{ expected_result }}</li>
                                        </ul>
                                    {% endfor %}
                                {% endif %}
                            </li>
                        {% endfor %}
                    </ol>
                {% endif %}
            </td>
        </tr>
    {% endfor %}
    </tbody>
</table>
<div class="footer">
    <a href="{{ url_for('static', filename='guide/index.html') }}" target="_blank">User Guide</a> |
    <a href="https://github.com/zhuifengshen/xmind2testcase/issues/new" target="_blank">Report Issue</a> |
    Powered by <a href="https://github.com/zhuifengshen/xmind2testcase" target="_blank">XMind2TestCase</a>
</div>
</body>
</html>