From: Robert Konigsberg Date: Sun, 2 Jun 2013 23:09:48 +0000 (-0400) Subject: Make a table view out of the test results for easier reading. X-Git-Tag: v1.0.0~27^2~5^2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=7cf85dd5eb42cfd0f1ce80197fdbadfbb90ce7e7;p=dygraphs.git Make a table view out of the test results for easier reading. --- diff --git a/auto_tests/misc/local.js b/auto_tests/misc/local.js index f53ce38..e8414ae 100644 --- a/auto_tests/misc/local.js +++ b/auto_tests/misc/local.js @@ -139,16 +139,27 @@ DygraphsLocalTester.prototype.createResultsDiv = function() { } DygraphsLocalTester.prototype.postResults = function() { + var table = document.createElement("table"); + this.resultsDiv.appendChild(table); for (var idx = 0; idx < this.results.length; idx++) { var result = this.results[idx]; - var elem = document.createElement("div"); - elem.setAttribute("class", result.result ? 'pass' : 'fail'); - - elem.innerHTML = result.name + ': ' + - (result.result ? 'pass' : 'fail') + - '' + - ' (' + result.duration + ' ms)'; - this.resultsDiv.appendChild(elem); + var tr = document.createElement("tr"); + tr.setAttribute("class", result.result ? 'pass' : 'fail'); + + var tdResult = document.createElement("td"); + tdResult.setAttribute("class", "outcome"); + tdResult.innerText = result.result ? 'pass' : 'fail'; + tr.appendChild(tdResult); + + var tdName = document.createElement("td"); + tdName.innerText = result.name; + tr.appendChild(tdName); + + var tdDuration = document.createElement("td"); + tdDuration.innerText = result.duration; + tr.appendChild(tdDuration); + + table.appendChild(tr); } }