3 new revisions:

Revision: 76469243ef7f
Author:   Pekka Klärck
Date:     Mon Aug 20 04:31:31 2012
Log:      report.html: indentation and whitespace
http://code.google.com/p/robotframework/source/detail?r=76469243ef7f

Revision: a0faf2c0ca23
Author:   Pekka Klärck
Date:     Mon Aug 20 04:59:59 2012
Log: report.html: Add tests only to details table itself, not possible tabl...
http://code.google.com/p/robotframework/source/detail?r=a0faf2c0ca23

Revision: e5321a17ff92
Author:   Pekka Klärck
Date:     Tue Aug 21 04:45:12 2012
Log:      Sorting of statistics in log/report....
http://code.google.com/p/robotframework/source/detail?r=e5321a17ff92

==============================================================================
Revision: 76469243ef7f
Author:   Pekka Klärck
Date:     Mon Aug 20 04:31:31 2012
Log:      report.html: indentation and whitespace
http://code.google.com/p/robotframework/source/detail?r=76469243ef7f

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Mon Aug 20 02:04:43 2012
+++ /src/robot/htmldata/rebot/report.html       Mon Aug 20 04:31:31 2012
@@ -231,8 +231,7 @@
         return;
     var elements = popUpTo(window.elementsToRender, 10);
     $.tmpl('testDetailsTableRowTemplate', elements,
-           {logURL: window.settings.logURL}
-    ).appendTo('#test_details tbody');
+ {logURL: window.settings.logURL}).appendTo('#test_details tbody');
     if (window.elementsToRender.length)
         setTimeout(function () {renderTestDetails(sortedColumn);}, 0);
     else {
@@ -243,18 +242,17 @@

 function configureTableSorter() {
     $.tablesorter.addParser({
-            id: 'criticality',
-            is: function(s) {
-                // return false so this parser is not auto detected
-                return false;
-            },
-            format: function(s) {
-                return s.toLowerCase().replace(/no/,1).replace(/yes/,0);
-            },
-            type: 'numeric'
-        });
+        id: 'criticality',
+        type: 'numeric',
+        is: function(s) {
+            return false;  // do not auto-detect
+        },
+        format: function(s) {
+            return s.toLowerCase().replace(/no/, 1).replace(/yes/, 0);
+        }
+    });
     $("#test_details").tablesorter({
-        headers:{ 3:{ sorter:'criticality' }}
+        headers: {3: {sorter:'criticality'}}
     });
 }


==============================================================================
Revision: a0faf2c0ca23
Author:   Pekka Klärck
Date:     Mon Aug 20 04:59:59 2012
Log: report.html: Add tests only to details table itself, not possible tables inside it. This fixes a really strange bug.
http://code.google.com/p/robotframework/source/detail?r=a0faf2c0ca23

Modified:
 /src/robot/htmldata/rebot/report.html

=======================================
--- /src/robot/htmldata/rebot/report.html       Mon Aug 20 04:31:31 2012
+++ /src/robot/htmldata/rebot/report.html       Mon Aug 20 04:59:59 2012
@@ -231,7 +231,7 @@
         return;
     var elements = popUpTo(window.elementsToRender, 10);
     $.tmpl('testDetailsTableRowTemplate', elements,
- {logURL: window.settings.logURL}).appendTo('#test_details tbody'); + {logURL: window.settings.logURL}).appendTo('#test_details > tbody');
     if (window.elementsToRender.length)
         setTimeout(function () {renderTestDetails(sortedColumn);}, 0);
     else {

==============================================================================
Revision: e5321a17ff92
Author:   Pekka Klärck
Date:     Tue Aug 21 04:45:12 2012
Log:      Sorting of statistics in log/report.

Update issue 1199
Statistics are now sortable. There is currently no way to restore
original sorting of tags and suites other than refressing the page. I
try to fix that next.

As part of this issue I did some tuning for sorting indicators (those small
arrows) that we already used in report. They are now closer to the right side of the column and thus take less space. Also the default icon is gray so that
it doesn't distract text close to it too much.

To see how sorting looks like, and to try it out, you can install the latest
version from the version control system or see this example:
http://robotframework.googlecode.com/hg/src/robot/htmldata/rebot/log.html
http://code.google.com/p/robotframework/source/detail?r=e5321a17ff92

Modified:
 /src/robot/htmldata/rebot/common.css
 /src/robot/htmldata/rebot/log.html
 /src/robot/htmldata/rebot/report.css
 /src/robot/htmldata/rebot/view.js

=======================================
--- /src/robot/htmldata/rebot/common.css        Fri Aug 17 05:21:47 2012
+++ /src/robot/htmldata/rebot/common.css        Tue Aug 21 04:45:12 2012
@@ -103,14 +103,17 @@
     margin: 0;
 }
 table.statistics th {
-    background: #DCDCF0;
+    background-color: #DCDCDC;
 }
 .col_stat {
     width: 3em;
     text-align: center;
 }
+table.statistics th.col_stat, table.statistics th.col_elapsed {
+    padding-right: 1em;
+}
 .col_elapsed {
-    width: 4em;
+    width: 4.5em;
     text-align: center;
 }
 .col_graph {
@@ -151,3 +154,18 @@
     float: left;
     height: 100%;
 }
+/* Tablesorter - adapted from Blue Skin available at http://tablesorter.com */
+.header {
+ background-image: url(data:image/gif;base64,R0lGODlhCwAJAIAAAH9/fwAAACH5BAEAAAEALAAAAAALAAkAAAIRjAOnBr3cnIr0WUjTrC9e9BQAOw==);
+    background-repeat: no-repeat;
+    background-position: center right;
+    cursor: pointer;
+}
+.headerSortUp {
+ background-image: url(data:image/gif;base64,R0lGODlhCwAEAIAAAAAAAAAAACH5BAEAAAEALAAAAAALAAQAAAIKDI4Qu6nMEJwPFgA7);
+    background-color: #ADBDD8 !important;
+}
+.headerSortDown {
+ background-image: url(data:image/gif;base64,R0lGODlhCwAEAIAAAAAAAAAAACH5BAEAAAEALAAAAAALAAQAAAIKjAOnBr3cnIr0FAA7);
+    background-color: #ADBDD8 !important;
+}
=======================================
--- /src/robot/htmldata/rebot/log.html  Wed Jun 27 04:58:19 2012
+++ /src/robot/htmldata/rebot/log.html  Tue Aug 21 04:45:12 2012
@@ -15,6 +15,7 @@
 <script type="text/javascript" src="log.js"></script>
 <script type="text/javascript" src="../lib/jquery.min.js"></script>
 <script type="text/javascript" src="../lib/jquery.tmpl.min.js"></script>
+<script type="text/javascript" src="../lib/jquery.tablesorter.min.js"></script>
 <script type="text/javascript" src="../lib/jsxcompressor.js"></script>
 <script type="text/javascript" src="fileloading.js"></script>
 <script type="text/javascript" src="model.js"></script>
=======================================
--- /src/robot/htmldata/rebot/report.css        Thu May 31 05:05:46 2012
+++ /src/robot/htmldata/rebot/report.css        Tue Aug 21 04:45:12 2012
@@ -81,9 +81,10 @@
 }
 table#test_details th {
     white-space: nowrap;
+    padding: 0.2em;
 }
 table#test_details th.col_crit, table#test_details th.col_status {
-    padding-right: 1.5em;
+    padding-right: 1em;
 }
 table#test_details .col_name {
     min-width: 13em;
@@ -113,18 +114,3 @@
 table#test_details td.col_times {
     text-align: right;
 }
-/* Tablesorter - adapted from Blue Skin available at http://tablesorter.com */
-table#test_details thead tr .header {
- background-image: url(data:imge/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
-    background-repeat: no-repeat;
-    background-position: center right;
-    cursor: pointer;
-}
-table#test_details thead tr .headerSortUp {
- background-image: url(data:imge/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
-    background-color: #8DBDD8;
-}
-table#test_details thead tr .headerSortDown {
- background-image: url(data:imge/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
-    background-color: #8DBDD8;
-}
=======================================
--- /src/robot/htmldata/rebot/view.js   Mon Aug 20 01:59:17 2012
+++ /src/robot/htmldata/rebot/view.js   Tue Aug 21 04:45:12 2012
@@ -76,18 +76,19 @@
         '<th class="col_graph">Pass / Fail</th>';
     var statTable =
         '<h2>Test Statistics</h2>' +
-        '<table class="statistics" id="total_stats">' +
- '<tr><th class="col_stat_name">Total Statistics</th>' + statHeaders + '</tr>' +
-        '</table>' +
-        '<table class="statistics" id="tag_stats">' +
- '<tr><th class="col_stat_name">Statistics by Tag</th>' + statHeaders + '</tr>' +
-        '</table>' +
-        '<table class="statistics" id="suite_stats">' +
- '<tr><th class="col_stat_name">Statistics by Suite</th>' + statHeaders + '</tr>' +
-        '</table>';
+        '<table class="statistics" id="total_stats"><thead><tr>' +
+        '<th class="col_stat_name">Total Statistics</th>' + statHeaders +
+        '</tr></thead><tbody></tbody></table>' +
+        '<table class="statistics" id="tag_stats"><thead><tr>' +
+        '<th class="col_stat_name">Statistics by Tag</th>' + statHeaders +
+        '</tr></thead><tbody></tbody></table>' +
+        '<table class="statistics" id="suite_stats"><thead><tr>' +
+ '<th class="col_stat_name">Statistics by Suite</th>' + statHeaders +
+        '</tr></thead><tbody></tbody></table>';
     $(statTable).appendTo('#statistics_container');
     $.map(['total', 'tag', 'suite'], addStatTable);
     addTooltipsToElapsedTimes();
+    enableStatisticsSorter();
 }

 function addTooltipsToElapsedTimes() {
@@ -97,6 +98,10 @@
     $('#suite_stats .col_elapsed').attr('title',
         'Total execution time of this test suite.');
 }
+
+function enableStatisticsSorter() {
+    $(".statistics").tablesorter({headers: {5: {sorter: false}}});
+}

 function addStatTable(tableName) {
     var stats = window.testdata.statistics()[tableName];
@@ -116,7 +121,7 @@
     var tableId = "#" + tableName + "_stats";
// Need explicit for loop because $.tmpl() does not handle very large lists
     for (var i = 0; stats !== undefined && i < stats.length; i++) {
-        $.tmpl(templateName , stats[i]).appendTo($(tableId));
+        $.tmpl(templateName , stats[i]).appendTo($(tableId + '> tbody'));
     }
 }

Reply via email to