人人商城

testify.report.html.php 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <?php
  2. require 'helpers.php';
  3. ?><!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="utf-8" />
  7. <title>(<?php echo $suiteResults['pass'], '|', $suiteResults['fail']?>) <?php echo $title?> · Testify Suite</title>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. }
  13. html {
  14. background-color: #fafafa;
  15. overflow-x: hidden;
  16. height: 100%;
  17. }
  18. body {
  19. font: 13px/1.5 Tahoma, Arial, sans-serif;
  20. text-align: center;
  21. color: #5a5a5a;
  22. height: 100%;
  23. }
  24. #wrapper {
  25. min-height: 100%;
  26. }
  27. h1, h2 {
  28. font-family: 'PT Sans Narrow', sans-serif;
  29. font-weight: normal;
  30. }
  31. h1:before,
  32. h2:before {
  33. display: inline-block;
  34. font: normal 0.6em/1.1 sans-serif;
  35. text-align: center;
  36. color: #fff;
  37. content: '\2714';
  38. position: relative;
  39. top: -0.2em;
  40. width: 1em;
  41. height: 1em;
  42. padding: 0.32em;
  43. margin-right: 1.2em;
  44. background-color: #a8d474;
  45. border-radius: 50%;
  46. }
  47. h1.fail:before,
  48. h2.fail:before {
  49. background-color: #ee3c4f;
  50. content: '\2718';
  51. line-height: 1.05;
  52. }
  53. h1 {
  54. font-size: 46px;
  55. padding: 50px 40px;
  56. position: relative;
  57. border-bottom: 1px solid #ddd;
  58. background-color: #fff;
  59. box-shadow: 0 0 3px #ddd;
  60. margin-bottom: 40px;
  61. color: #777;
  62. }
  63. h2 {
  64. font-size: 28px;
  65. }
  66. span.result {
  67. color: #DCDCDC;
  68. display: block;
  69. padding: 0.6em;
  70. }
  71. .green { color: #94c25d; }
  72. .red { color: #fb4357; }
  73. ul {
  74. list-style: none;
  75. font-size: 19px;
  76. width: 800px;
  77. margin: 10px auto 80px;
  78. }
  79. li span.pass {color: #94c25d;}
  80. li span.fail {color: #fb4357;}
  81. li span.file,
  82. li span.line {
  83. float: right;
  84. font-size: 14px;
  85. padding-left: 10px;
  86. line-height: 19px;
  87. position: relative;
  88. bottom: -4px;
  89. }
  90. li span.file {
  91. color: #b0b0b0;
  92. }
  93. li{
  94. text-align: left;
  95. border-bottom: 1px dotted #d4d4d4;
  96. padding: 3px 0;
  97. overflow: hidden;
  98. }
  99. li span.type {
  100. display: inline-block;
  101. width: 600px;
  102. }
  103. div.message {
  104. font-size: 22px;
  105. font-family: 'PT Sans Narrow', sans-serif;
  106. padding: 0 40px 50px;
  107. }
  108. div.message.pass .red,
  109. div.message.fail .green {
  110. display: none;
  111. }
  112. footer {
  113. background-color: #fff;
  114. border-top: 1px solid #ddd;
  115. box-shadow: 0 0 3px #ddd;
  116. color: #888;
  117. font-size: 10px;
  118. padding: 15px;
  119. display: block;
  120. height: 15px;
  121. position: relative;
  122. }
  123. a, a:visited {
  124. color: #3ba2cd;
  125. text-decoration: none;
  126. }
  127. a:hover {
  128. text-decoration: underline;
  129. }
  130. div.source {
  131. font-size: 11px;
  132. color: #ccc;
  133. -moz-transition: 0.25s;
  134. -webkit-transition: 0.25s;
  135. transition: 0.25s;
  136. }
  137. li:hover div.source {
  138. color: #444;
  139. }
  140. </style>
  141. <!--[if lt IE 9]>
  142. <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Narrow" />
  143. <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  144. <![endif]-->
  145. </head>
  146. <body>
  147. <div id="wrapper">
  148. <div id="content">
  149. <h1 class="<?php echo $result = ($suiteResults['fail'] == 0 ? 'pass' : 'fail') ?>">
  150. <?php echo $title?>
  151. </h1>
  152. <div class="message <?php echo $result?>">
  153. <span class="green">Far out! Everything passed!</span>
  154. <span class="red">Bummer! You have failing tests! [pass <?php echo percent($suiteResults)?>%]</span>
  155. </div>
  156. <?php
  157. foreach($cases as $caseTitle => $case) { ?>
  158. <h2 class="<?php echo $case['fail'] == 0 ? 'pass' : 'fail' ?>">
  159. <?php echo $caseTitle?>
  160. <span class="result">
  161. <span class="green"><?php echo $case['pass']?></span>/<span class="red"><?php echo $case['fail']?></span>
  162. </span>
  163. </h2>
  164. <ul class="tests">
  165. <?php
  166. foreach($case['tests'] as $test) { ?>
  167. <li>
  168. <span class="type <?php echo $test['result']?>">
  169. <?php
  170. echo $test['name'] === '' ? $test['type'].'()' : $test['name'];
  171. ?>
  172. </span>
  173. <span class="line">line <?php echo $test['line']?></span>
  174. <span class="file"><?php echo $test['file']?></span>
  175. <div class="source"><?php echo htmlspecialchars($test['source'])?></div>
  176. </li>
  177. <?php } ?>
  178. </ul>
  179. <?php } ?>
  180. </div>
  181. </div>
  182. <footer> Powered by <a href="http://tutorialzine.com/projects/testify/" target="_blank">Testify</a> framework</footer>
  183. </body>
  184. </html>