send-test.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>Test Report</title>
  6. <style>body {
  7. font-family: Helvetica, Arial, sans-serif;
  8. font-size: 12px;
  9. min-width: 1200px;
  10. color: #999;
  11. }
  12. h1 {
  13. font-size: 24px;
  14. color: black;
  15. }
  16. h2 {
  17. font-size: 16px;
  18. color: black;
  19. }
  20. p {
  21. color: black;
  22. }
  23. a {
  24. color: #999;
  25. }
  26. table {
  27. border-collapse: collapse;
  28. }
  29. /******************************
  30. * SUMMARY INFORMATION
  31. ******************************/
  32. #environment td {
  33. padding: 5px;
  34. border: 1px solid #E6E6E6;
  35. }
  36. #environment tr:nth-child(odd) {
  37. background-color: #f6f6f6;
  38. }
  39. /******************************
  40. * TEST RESULT COLORS
  41. ******************************/
  42. span.passed, .passed .col-result {
  43. color: green;
  44. }
  45. span.skipped, span.xfailed, span.rerun, .skipped .col-result, .xfailed .col-result, .rerun .col-result {
  46. color: orange;
  47. }
  48. span.error, span.failed, span.xpassed, .error .col-result, .failed .col-result, .xpassed .col-result {
  49. color: red;
  50. }
  51. /******************************
  52. * RESULTS TABLE
  53. *
  54. * 1. Table Layout
  55. * 2. Extra
  56. * 3. Sorting items
  57. *
  58. ******************************/
  59. /*------------------
  60. * 1. Table Layout
  61. *------------------*/
  62. #results-table {
  63. border: 1px solid #e6e6e6;
  64. color: #999;
  65. font-size: 12px;
  66. width: 100%
  67. }
  68. #results-table th, #results-table td {
  69. padding: 5px;
  70. border: 1px solid #E6E6E6;
  71. text-align: left
  72. }
  73. #results-table th {
  74. font-weight: bold
  75. }
  76. /*------------------
  77. * 2. Extra
  78. *------------------*/
  79. .log:only-child {
  80. height: inherit
  81. }
  82. .log {
  83. background-color: #e6e6e6;
  84. border: 1px solid #e6e6e6;
  85. color: black;
  86. display: block;
  87. font-family: "Courier New", Courier, monospace;
  88. height: 230px;
  89. overflow-y: scroll;
  90. padding: 5px;
  91. white-space: pre-wrap
  92. }
  93. div.image {
  94. border: 1px solid #e6e6e6;
  95. float: right;
  96. height: 240px;
  97. margin-left: 5px;
  98. overflow: hidden;
  99. width: 320px
  100. }
  101. div.image img {
  102. width: 320px
  103. }
  104. .collapsed {
  105. display: none;
  106. }
  107. .expander::after {
  108. content: " (show details)";
  109. color: #BBB;
  110. font-style: italic;
  111. cursor: pointer;
  112. }
  113. .collapser::after {
  114. content: " (hide details)";
  115. color: #BBB;
  116. font-style: italic;
  117. cursor: pointer;
  118. }
  119. /*------------------
  120. * 3. Sorting items
  121. *------------------*/
  122. .sortable {
  123. cursor: pointer;
  124. }
  125. .sort-icon {
  126. font-size: 0px;
  127. float: left;
  128. margin-right: 5px;
  129. margin-top: 5px;
  130. /*triangle*/
  131. width: 0;
  132. height: 0;
  133. border-left: 8px solid transparent;
  134. border-right: 8px solid transparent;
  135. }
  136. .inactive .sort-icon {
  137. /*finish triangle*/
  138. border-top: 8px solid #E6E6E6;
  139. }
  140. .asc.active .sort-icon {
  141. /*finish triangle*/
  142. border-bottom: 8px solid #999;
  143. }
  144. .desc.active .sort-icon {
  145. /*finish triangle*/
  146. border-top: 8px solid #999;
  147. }
  148. </style></head>
  149. <body onLoad="init()">
  150. <script>/* This Source Code Form is subject to the terms of the Mozilla Public
  151. * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  152. * You can obtain one at http://mozilla.org/MPL/2.0/. */
  153. function toArray(iter) {
  154. if (iter === null) {
  155. return null;
  156. }
  157. return Array.prototype.slice.call(iter);
  158. }
  159. function find(selector, elem) {
  160. if (!elem) {
  161. elem = document;
  162. }
  163. return elem.querySelector(selector);
  164. }
  165. function find_all(selector, elem) {
  166. if (!elem) {
  167. elem = document;
  168. }
  169. return toArray(elem.querySelectorAll(selector));
  170. }
  171. function sort_column(elem) {
  172. toggle_sort_states(elem);
  173. var colIndex = toArray(elem.parentNode.childNodes).indexOf(elem);
  174. var key;
  175. if (elem.classList.contains('numeric')) {
  176. key = key_num;
  177. } else if (elem.classList.contains('result')) {
  178. key = key_result;
  179. } else {
  180. key = key_alpha;
  181. }
  182. sort_table(elem, key(colIndex));
  183. }
  184. function show_all_extras() {
  185. find_all('.col-result').forEach(show_extras);
  186. }
  187. function hide_all_extras() {
  188. find_all('.col-result').forEach(hide_extras);
  189. }
  190. function show_extras(colresult_elem) {
  191. var extras = colresult_elem.parentNode.nextElementSibling;
  192. var expandcollapse = colresult_elem.firstElementChild;
  193. extras.classList.remove("collapsed");
  194. expandcollapse.classList.remove("expander");
  195. expandcollapse.classList.add("collapser");
  196. }
  197. function hide_extras(colresult_elem) {
  198. var extras = colresult_elem.parentNode.nextElementSibling;
  199. var expandcollapse = colresult_elem.firstElementChild;
  200. extras.classList.add("collapsed");
  201. expandcollapse.classList.remove("collapser");
  202. expandcollapse.classList.add("expander");
  203. }
  204. function show_filters() {
  205. var filter_items = document.getElementsByClassName('filter');
  206. for (var i = 0; i < filter_items.length; i++)
  207. filter_items[i].hidden = false;
  208. }
  209. function add_collapse() {
  210. // Add links for show/hide all
  211. var resulttable = find('table#results-table');
  212. var showhideall = document.createElement("p");
  213. showhideall.innerHTML = '<a href="javascript:show_all_extras()">Show all details</a> / ' +
  214. '<a href="javascript:hide_all_extras()">Hide all details</a>';
  215. resulttable.parentElement.insertBefore(showhideall, resulttable);
  216. // Add show/hide link to each result
  217. find_all('.col-result').forEach(function(elem) {
  218. var collapsed = get_query_parameter('collapsed') || 'Passed';
  219. var extras = elem.parentNode.nextElementSibling;
  220. var expandcollapse = document.createElement("span");
  221. if (collapsed.includes(elem.innerHTML)) {
  222. extras.classList.add("collapsed");
  223. expandcollapse.classList.add("expander");
  224. } else {
  225. expandcollapse.classList.add("collapser");
  226. }
  227. elem.appendChild(expandcollapse);
  228. elem.addEventListener("click", function(event) {
  229. if (event.currentTarget.parentNode.nextElementSibling.classList.contains("collapsed")) {
  230. show_extras(event.currentTarget);
  231. } else {
  232. hide_extras(event.currentTarget);
  233. }
  234. });
  235. })
  236. }
  237. function get_query_parameter(name) {
  238. var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
  239. return match && decodeURIComponent(match[1].replace(/\+/g, ' '));
  240. }
  241. function init () {
  242. reset_sort_headers();
  243. add_collapse();
  244. show_filters();
  245. toggle_sort_states(find('.initial-sort'));
  246. find_all('.sortable').forEach(function(elem) {
  247. elem.addEventListener("click",
  248. function(event) {
  249. sort_column(elem);
  250. }, false)
  251. });
  252. };
  253. function sort_table(clicked, key_func) {
  254. var rows = find_all('.results-table-row');
  255. var reversed = !clicked.classList.contains('asc');
  256. var sorted_rows = sort(rows, key_func, reversed);
  257. /* Whole table is removed here because browsers acts much slower
  258. * when appending existing elements.
  259. */
  260. var thead = document.getElementById("results-table-head");
  261. document.getElementById('results-table').remove();
  262. var parent = document.createElement("table");
  263. parent.id = "results-table";
  264. parent.appendChild(thead);
  265. sorted_rows.forEach(function(elem) {
  266. parent.appendChild(elem);
  267. });
  268. document.getElementsByTagName("BODY")[0].appendChild(parent);
  269. }
  270. function sort(items, key_func, reversed) {
  271. var sort_array = items.map(function(item, i) {
  272. return [key_func(item), i];
  273. });
  274. var multiplier = reversed ? -1 : 1;
  275. sort_array.sort(function(a, b) {
  276. var key_a = a[0];
  277. var key_b = b[0];
  278. return multiplier * (key_a >= key_b ? 1 : -1);
  279. });
  280. return sort_array.map(function(item) {
  281. var index = item[1];
  282. return items[index];
  283. });
  284. }
  285. function key_alpha(col_index) {
  286. return function(elem) {
  287. return elem.childNodes[1].childNodes[col_index].firstChild.data.toLowerCase();
  288. };
  289. }
  290. function key_num(col_index) {
  291. return function(elem) {
  292. return parseFloat(elem.childNodes[1].childNodes[col_index].firstChild.data);
  293. };
  294. }
  295. function key_result(col_index) {
  296. return function(elem) {
  297. var strings = ['Error', 'Failed', 'Rerun', 'XFailed', 'XPassed',
  298. 'Skipped', 'Passed'];
  299. return strings.indexOf(elem.childNodes[1].childNodes[col_index].firstChild.data);
  300. };
  301. }
  302. function reset_sort_headers() {
  303. find_all('.sort-icon').forEach(function(elem) {
  304. elem.parentNode.removeChild(elem);
  305. });
  306. find_all('.sortable').forEach(function(elem) {
  307. var icon = document.createElement("div");
  308. icon.className = "sort-icon";
  309. icon.textContent = "vvv";
  310. elem.insertBefore(icon, elem.firstChild);
  311. elem.classList.remove("desc", "active");
  312. elem.classList.add("asc", "inactive");
  313. });
  314. }
  315. function toggle_sort_states(elem) {
  316. //if active, toggle between asc and desc
  317. if (elem.classList.contains('active')) {
  318. elem.classList.toggle('asc');
  319. elem.classList.toggle('desc');
  320. }
  321. //if inactive, reset all other functions and add ascending active
  322. if (elem.classList.contains('inactive')) {
  323. reset_sort_headers();
  324. elem.classList.remove('inactive');
  325. elem.classList.add('active');
  326. }
  327. }
  328. function is_all_rows_hidden(value) {
  329. return value.hidden == false;
  330. }
  331. function filter_table(elem) {
  332. var outcome_att = "data-test-result";
  333. var outcome = elem.getAttribute(outcome_att);
  334. class_outcome = outcome + " results-table-row";
  335. var outcome_rows = document.getElementsByClassName(class_outcome);
  336. for(var i = 0; i < outcome_rows.length; i++){
  337. outcome_rows[i].hidden = !elem.checked;
  338. }
  339. var rows = find_all('.results-table-row').filter(is_all_rows_hidden);
  340. var all_rows_hidden = rows.length == 0 ? true : false;
  341. var not_found_message = document.getElementById("not-found-message");
  342. not_found_message.hidden = !all_rows_hidden;
  343. }
  344. </script>
  345. <h1>send-test.html</h1>
  346. <p>Report generated on 14-Jun-2018 at 14:20:27 by<a href="https://pypi.python.org/pypi/pytest-html"> pytest-html</a> v1.19.0</p>
  347. <h2>Environment</h2>
  348. <table id="environment">
  349. <tr>
  350. <td>Base URL</td>
  351. <td><a href="http://localhost:1443" target="_blank">http://localhost:1443</a></td></tr>
  352. <tr>
  353. <td>Driver</td>
  354. <td>Firefox</td></tr>
  355. <tr>
  356. <td>JAVA_HOME</td>
  357. <td>/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home</td></tr>
  358. <tr>
  359. <td>Packages</td>
  360. <td>{&apos;pytest&apos;: &apos;3.6.1&apos;, &apos;py&apos;: &apos;1.5.3&apos;, &apos;pluggy&apos;: &apos;0.6.0&apos;}</td></tr>
  361. <tr>
  362. <td>Platform</td>
  363. <td>Darwin-17.5.0-x86_64-i386-64bit</td></tr>
  364. <tr>
  365. <td>Plugins</td>
  366. <td>{&apos;xdist&apos;: &apos;1.22.2&apos;, &apos;variables&apos;: &apos;1.7.1&apos;, &apos;selenium&apos;: &apos;1.13.0&apos;, &apos;metadata&apos;: &apos;1.7.0&apos;, &apos;html&apos;: &apos;1.19.0&apos;, &apos;forked&apos;: &apos;0.2&apos;, &apos;base-url&apos;: &apos;1.4.1&apos;}</td></tr>
  367. <tr>
  368. <td>Python</td>
  369. <td>3.6.5</td></tr></table>
  370. <h2>Summary</h2>
  371. <p>3 tests ran in 20.54 seconds. </p>
  372. <p class="filter" hidden="true">(Un)check the boxes to filter the results.</p><input checked="true" class="filter" data-test-result="passed" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="passed">3 passed</span>, <input checked="true" class="filter" data-test-result="skipped" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="skipped">0 skipped</span>, <input checked="true" class="filter" data-test-result="failed" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="failed">0 failed</span>, <input checked="true" class="filter" data-test-result="error" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="error">0 errors</span>, <input checked="true" class="filter" data-test-result="xfailed" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="xfailed">0 expected failures</span>, <input checked="true" class="filter" data-test-result="xpassed" disabled="true" hidden="true" name="filter_checkbox" onChange="filter_table(this)" type="checkbox"/><span class="xpassed">0 unexpected passes</span>
  373. <h2>Results</h2>
  374. <table id="results-table">
  375. <thead id="results-table-head">
  376. <tr>
  377. <th class="sortable result initial-sort" col="result">Result</th>
  378. <th class="sortable" col="name">Test</th>
  379. <th class="sortable numeric" col="duration">Duration</th>
  380. <th>Links</th></tr>
  381. <tr hidden="true" id="not-found-message">
  382. <th colspan="4">No results found. Try to check the filters</th></tr></thead>
  383. <tbody class="passed results-table-row">
  384. <tr>
  385. <td class="col-result">Passed</td>
  386. <td class="col-name">test_download.py::test_download</td>
  387. <td class="col-duration">0.00</td>
  388. <td class="col-links"></td></tr>
  389. <tr>
  390. <td class="extra" colspan="4">
  391. <div class="empty log">No log output captured.</div></td></tr></tbody>
  392. <tbody class="passed results-table-row">
  393. <tr>
  394. <td class="col-result">Passed</td>
  395. <td class="col-name">test_progress.py::test_progress</td>
  396. <td class="col-duration">0.00</td>
  397. <td class="col-links"></td></tr>
  398. <tr>
  399. <td class="extra" colspan="4">
  400. <div class="empty log">No log output captured.</div></td></tr></tbody>
  401. <tbody class="passed results-table-row">
  402. <tr>
  403. <td class="col-result">Passed</td>
  404. <td class="col-name">test_upload.py::test_upload</td>
  405. <td class="col-duration">0.01</td>
  406. <td class="col-links"></td></tr>
  407. <tr>
  408. <td class="extra" colspan="4">
  409. <div class="empty log">No log output captured.</div></td></tr></tbody></table></body></html>