<!DOCTYPE html>
<html>
<head>
  <%- include('/headers') %>
  <%- include('/macros/page/title', {
    reportName: 'Steps Overview'
  }) %>
</head>
<body>
  <%- include('/macros/page/navigation', {
    active_tab: 'steps'
  }) %>
  <%- include('/macros/page/reportInfo') %>
  <%- include('/macros/page/lead', {
    page_title: 'Steps Statistics',
    page_description: 'The following graph shows step statistics for this build. Below list is based on results, step does not provide information about result then is not listed below. Additionally @Before and @After are not counted because they are part of the scenarios, not steps.'
  }) %>
<div class="container-fluid" id="report">
  <div class="row">
    <div class="col-md-10 col-md-offset-1">
      <table id="tablesorter" class="stats-table table-hover">

        <thead>
          <tr class="header">
            <th>Implementation</th>
            <th>Occurrences</th>
            <th>Average duration</th>
            <th>Max duration</th>
            <th>Total durations</th>
            <th>Ratio</th>
          </tr>
        </thead>

        <tbody>
          <% all_steps.forEach(step => { %>
            <tr>
              <td class="location"><%= step.location %></td>
              <td><%= step.getTotalOccurrences() %></td>
              <td class="duration" data-value="<%= step.getAverageDuration() %>"><%= step.getFormattedAverageDuration() %></td>
              <td class="duration" data-value="<%= step.getAverageDuration() %>"><%= step.getFormattedMaxDuration() %></td>
              <td class="duration" data-value="<%= step.getDuration() %>"><%= step.getFormattedTotalDuration() %></td>
              <td class="<%= step.getStatus().rawName %>"><%= step.getPercentageResult() %></td>
            </tr>
          <% }); %>
        </tbody>

        <tfoot class="total">
          <tr>
            <td><%= all_steps.length %></td>
            <td><%= all_occurrences %></td>
            <td class="duration"><%= all_average_duration %></td>
            <td class="duration"><%= all_max_duration %></td>
            <td class="duration"><%= all_durations %></td>
            <td>Totals</td>
          </tr>
        </tfoot>

      </table>
    </div>
  </div>
</div>
<%- include('/footer') %>
</body>
</html>
