scenarios.html.dist 6.78 KB
<html>
 <head>
	<title>Test results</title>
	<meta charset='utf-8'>
	<link href='https://fonts.googleapis.com/css?family=Varela+Round&v2' rel='stylesheet' type='text/css'>
     <meta name="viewport" content="width=device-width, initial-scale=1">
	 <style>
		 .layout {
		 margin: 0 auto;
		 max-width: 1000px;

		 }
		 body { font-family: arial, serif; margin: 0; padding: 0; background: #ecf0f1; font-size: 20px; }
		 h1,h2,h3 { font-family: arial, serif; color: #7f8c8d; }
		 h1 { font-size: 2.5em; }
		 h2 { font-size: 1.3em; }
         h3 { font-size: 1em; color: #84BBDD; margin: 0.5em 0; }

		 table { border: none; margin: 0; padding: 0; font-size: 0.9em;}
		 .scenarioStepsTable .stepName { padding: 5px; }

		 .scenarioStepsTable td {
            background: #fff;
		 }

         .quiet {
             color: #333;
             font-size: 0.8em;
         }

         .screenshot {
             max-height: 400px;
             overflow-y: scroll;
             display: block;
         }
         .screenshot img {
             zoom: 0.5;
         }

         @media (max-width: 1200px) {
           #toolbar-filter {
             display: none !important;
           }
         }

         .scenarioStepsTable .nostyle {
             background: none;
             border: none;
         }

		 p {
		    cursor: pointer;
		 }

         .scenarioRow>td>p {
             padding: 5px;
         }

         .scenarioStepsTable .failedStep {
             padding: 10px;
             background: #ecf0f1;
             border: 2px solid #e74c3c;
             border-radius: 0px;
             color:  #e74c3c;
         }

         .scenarioStepsTable .error {
             background:  #999;
             padding: 10px;
             color: #fff;
             border-radius: 0px;
         }

         .scenarioStepsTable .error a {
             color: #eef;
         }

         .scenarioStepsTable.substeps td {
             background: #bdc3c7;
         }

		 .header { font-size: large; font-weight: bold; }
		 p.scenarioSuccess {
    		 background: rgb(157,213,58); /* Old browsers */
		 }


		 .scenario { color: black; }
		 p.scenarioFailed, p.scenarioError { color: black;
		   background: #e74c3c
		 }

		 table.scenarioFailed tr:last-child { font-weight: bold; }

		 td.scenarioSuccess { color: green }
		 td.scenarioFailed { color: red }
		 .scenarioSkipped { color: teal; }
		 .scenarioIncomplete { color: gray; }
		 .scenarioStepsTable { margin-left: 10px; display: none; color: #333; }

		 #stepContainerSummary {
		 background: white;
		 -webkit-border-radius: 5px;
		 -moz-border-radius: 5px;
		 border-radius: 5px;
		 padding: 20px;
		 }

         .toggle {
             background: rgba(255,255,255,0.5);
             border-radius: 10px;
             display: inline-block;
             width: 20px;
             height: 20px;
             text-align: center;
             margin: auto;
             color: #666
         }

		 ul#toolbar-filter {
            display: block;
            position: fixed;
            top: 20px;
            left: 0px;
            padding: 0px;
		 }
		 ul#toolbar-filter li {
		    list-style: none;
		    text-align: center;
			padding: 20px;
			background-color: #3498db;
		 }
		 ul#toolbar-filter li a, ul#toolbar-filter li a:hover, ul#toolbar-filter li a:visited {
		    color: #34495e;
		    text-decoration: none;
		 }
		 ul#toolbar-filter li.disabled {
			background-color: #bdc3c7;
		 }
	 </style>

  <script type="text/javascript">
  var showAll = true;
  function showHide(nodeId, linkObj)
  {
    var subObj = document.getElementById('stepContainer' + nodeId);
    var toggle = linkObj.childNodes[0];
    if (toggle.innerHTML != '-') {
      toggle.innerHTML = '-';
      subObj.style.display='block';
      subObj.style.width = '100%';
    } else {
      toggle.innerHTML = '+';
      subObj.style.display='none';
    }
  }

  function showAllScenarios() {
    var toolbar = document.getElementById('toolbar-filter');
    for (var i = 0; i < toolbar.children.length; i++) {
      toolbar.children[i].className = '';
    }

    var trs = document.getElementsByTagName('tr');
    for(var z = 0; z < trs.length; z++) {
      trs[z].style.display = '';
    }
    showAll = true;
  }

  function toggleScenarios(name, linkObj) {
    var links = document.getElementById('toolbar-filter').children;
    var rows = document.getElementsByClassName('scenarioRow');
    if (showAll) {
        for (var i = 0; i < links.length; i++) {
            links[i].className = 'disabled';
        }

        for (var i = 0; i < rows.length; i++) {
            rows[i].style.display = 'none';
        }

    }
    showAll = false;

    if (linkObj.className == '') {
        linkObj.className = 'disabled';
        for (var i = 0; i < rows.length; i++) {
          if (rows[i].classList.contains(name)) {
                rows[i].style.display = 'none';
          }
        }
        return;
    }
    if (linkObj.className == 'disabled') {
        linkObj.className = '';
        for (var i = 0; i < rows.length; i++) {
          if (rows[i].classList.contains(name)) {
                rows[i].style.display = 'table-row';
          }
        }
        return;
    }

  }
  </script>
 </head>

 <body>
   <ul id="toolbar-filter">
     <li> <a href="#" title="Show all" onClick="showAllScenarios()"></a></li>
     <li> <a href="#" title="Successful" onClick="toggleScenarios('scenarioSuccess', this.parentElement)"><strong></strong> {successfulScenarios}</a></li>
     <li> <a href="#" title="Failed" onClick="toggleScenarios('scenarioFailed', this.parentElement)"><strong></strong> {failedScenarios}</a></li>
     <li> <a href="#" title="Skipped" onClick="toggleScenarios('scenarioSkipped', this.parentElement)"><strong>S</strong> {skippedScenarios}</a></li>
     <li> <a href="#" title="Incomplete" onClick="toggleScenarios('scenarioIncomplete', this.parentElement)"><strong>I</strong> {incompleteScenarios}</a></li>
   </ul>
 <div class="layout">
 {header}

	 <table border="0" style="width: 100%;">
		{scenarios}
   <tr>
    <td>
	    <h2>Summary</h2>
     <div id="stepContainerSummary">
      <table border="0">
       <tr>
        <td width="250" class="scenarioSuccess">Successful scenarios:</td>
        <td class="scenarioSuccessValue"><strong>{successfulScenarios}</strong></td>
       </tr>
       <tr>
        <td class="scenarioFailed">Failed scenarios:</td>
        <td class="scenarioFailedValue"><strong>{failedScenarios}</strong></td>
       </tr>
       <tr>
        <td class="scenarioSkipped">Skipped scenarios:</td>
        <td class="scenarioSkippedValue"><strong>{skippedScenarios}</strong></td>
       </tr>
       <tr>
        <td class="scenarioIncomplete">Incomplete scenarios:</td>
        <td class="scenarioIncompleteValue"><strong>{incompleteScenarios}</strong></td>
       </tr>
      </table>
     </div>
    </td>
   </tr>
  </table>
 </div>
 </body>
</html>