github.com/munnerz/test-infra@v0.0.0-20190108210205-ce3d181dc989/prow/spyglass/lenses/junit/template.html (about)

     1  {{define "header"}}
     2  <style>
     3      .hidden-tests {
     4          visibility: collapse;
     5      }
     6      .mdl-data-table__cell--non-numeric {
     7        font-family: monospace;
     8        background-color: #212121;
     9        color: #e8e8e8;
    10      }
    11      .noselect {
    12        user-select: none;
    13      }
    14      .expander {
    15        background-color: #333333;
    16        font-weight:bold;
    17        font-size:1.5em;
    18      }
    19      a {
    20        color: inherit;
    21        text-decoration: none;
    22      }
    23  </style>
    24  
    25  <script type="text/javascript" src="script_bundle.min.js"></script>
    26  {{end}}
    27  
    28  {{define "body"}}
    29  {{$numF := len .Failed}}
    30  {{$numP := len .Passed}}
    31  {{$numS := len .Skipped}}
    32  <div id="junit-container">
    33    <table id="junit-table" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp" style="white-space: pre-wrap;">
    34    {{if gt $numF 0}}
    35      <thead id="failed-theader" onclick="toggleExpansion('failed-tbody', 'failed-expander')">
    36      <tr>
    37        <td class="mdl-data-table__cell--non-numeric expander" style="color: #FF0000;" colspan="3"><h6>{{len .Failed}}/{{.NumTests}} Tests Failed.</h6></td>
    38        <td class="mdl-data-table__cell--non-numeric expander"><i id="failed-expander" class="icon-button material-icons arrow-icon noselect">expand_less</i></td>
    39      </tr>
    40      </thead>
    41      <tbody id="failed-tbody">
    42      {{range $ix, $test := .Failed}}
    43      <tr class="dark" onclick="toggleExpansion('failed-test-body-{{$ix}}', 'failed-test-expander-{{$ix}}')">
    44        <td class="mdl-data-table__cell--non-numeric"><a href="{{$test.Link}}">{{$test.Junit.Name}}</a></td>
    45        <td class="mdl-data-table__cell--non-numeric" style="color: #FF0000">{{$test.Junit.Status}}</td>
    46        <td class="mdl-data-table__cell--non-numeric">{{$test.Junit.Duration}}</td>
    47        <td class="mdl-data-table__cell--non-numeric">{{$test.Junit.Error.Message}}</td>
    48      </tr>
    49      {{end}}
    50      </tbody>
    51    {{end}}
    52    {{if gt $numP 0}}
    53      <thead id="passed-theader" onclick="toggleExpansion('passed-tbody', 'passed-expander')">
    54      <tr>
    55        <td class="mdl-data-table__cell--non-numeric expander" style="color: #00FF00" colspan="3"><h6>{{len .Passed}}/{{.NumTests}} Tests Passed!</h6></td>
    56        <td class="mdl-data-table__cell--non-numeric expander"><i id="passed-expander" class="icon-button material-icons arrow-icon noselect">expand_more</i></td>
    57      </tr>
    58      </thead>
    59      <tbody id="passed-tbody" class="hidden-tests">
    60      {{range .Passed}}
    61      <tr>
    62        <td class="mdl-data-table__cell--non-numeric"><a href="{{.Link}}">{{.Junit.Name}}</a></td>
    63        <td class="mdl-data-table__cell--non-numeric" style="color: #00FF00">{{.Junit.Status}}</td>
    64        <td class="mdl-data-table__cell--non-numeric">{{.Junit.Duration}}</td>
    65        <td class="mdl-data-table__cell--non-numeric"></td>
    66      </tr>
    67      {{end}}
    68      </tbody>
    69    {{end}}
    70    {{if gt $numS 0}}
    71      <thead id="skipped-theader" onclick="toggleExpansion('skipped-tbody', 'skipped-expander')">
    72      <tr>
    73        <td class="mdl-data-table__cell--non-numeric expander" style="color: rgba(255, 224, 0, 1.0);" colspan="3"><h6>{{len .Skipped}}/{{.NumTests}} Tests Skipped.</h6></td>
    74        <td class="mdl-data-table__cell--non-numeric expander"><i id="skipped-expander" class="icon-button material-icons arrow-icon noselect">expand_more</i></td>
    75      </tr>
    76      </thead>
    77      <tbody id="skipped-tbody" class="hidden-tests">
    78      {{range .Skipped}}
    79      <tr>
    80        <td class="mdl-data-table__cell--non-numeric"><a href="{{.Link}}">{{.Junit.Name}}</a></td>
    81        <td class="mdl-data-table__cell--non-numeric" style="color: rgba(255, 224, 0, 1.0);">{{.Junit.Status}}</td>
    82        <td class="mdl-data-table__cell--non-numeric">{{.Junit.Duration}}</td>
    83        <td class="mdl-data-table__cell--non-numeric"></td>
    84      </tr>
    85      {{end}}
    86      </tbody>
    87    {{end}}
    88    </table>
    89  </div>
    90  {{end}}