{% extends "layout.html" %}
{% block nav %}
    <nav class="navbar navbar-expand-lg navbar-light bg-light sticky-top">
        <div class="container-fluid">
          <a class="navbar-brand" href="#">Flat HTML Test Report</a>
            <div class="collapse navbar-collapse">
              <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
                <li class="nav-item active">
                  <a class="nav-link" href="index.html" title="go to all report">Index</a>
                </li>
              </ul>
            </div>
        </div>
    </nav>
{% endblock %}
{% block content %}
    <table class="table table-hover datatable">
        <thead>
            <tr class="align-text-top">
                <th class="text-center">Start at</th>
                <th>Features<br/>{{ grand_totals['features'] | int }}</th>
                <th>Scenarios<br/>{{ grand_totals['scenarios'] | int }}</th>
                <th class="text-center">Steps<br/>{{ grand_totals['steps'] | int }}</th>
                <th class="text-center">Status</th>
                <th class="text-center">Duration<br/>{{ grand_totals['duration'] | int }}s</th>
            </tr>
        </thead>
        {% for feature in features %}
            {% for scenario in feature["scenarios"] %}
                <!--- ignore Backgrounds for the time being -->
                {% if scenario['keyword'] != 'Background' %}
                <tr>
                    <td class="text-center">{{ scenario['start_at'] }}</td>
                    <td><a href="{{ urlencode(escape(feature['name'])) }}.html"><span>{{ escape(feature['name']) }}</span></a><br>{{ feature['tags'] }}</td>
                    <td><a href="{{ urlencode(escape(feature['folder_name'])) }}/{{ urlencode(escape(scenario['folder_name'])) }}/index.html"><span>{{ escape(scenario['name']) }}</span></a><br>{{ scenario['tags'] }}</td>
                    <td class="text-center">{{ scenario['total_steps'] }}</td>
                    <td class="text-center"><span class="status-{{ scenario['status'] }}">{{ scenario['status'] }}</span></td>
                    <td class="text-center">{{ '{:.1f}'.format(scenario['duration'] | float) }}</td>
                </tr>
                {%  endif %}
            {% endfor %}
        {% endfor %}
    </table>

    <script>
    setupReportTables([[2, 'asc']], [{type: 'timestamp', searchable: false}, {type: 'string'}, {type: 'string'}, {type: 'num', searchable: false}, {type: 'html'} , {type: 'timestamp', searchable: false} ])
    </script>
{% endblock %}
