5 new revisions:

Revision: 43d1af826d47
Author:   Pekka Klärck
Date:     Fri Aug 17 04:53:04 2012
Log:      Added elapsed time to statistics in log/report....
http://code.google.com/p/robotframework/source/detail?r=43d1af826d47

Revision: e556dbbadf6a
Author:   Pekka Klärck
Date:     Fri Aug 17 04:54:11 2012
Log: times2csv.py: 1) Test including keywords inside suite setup/teardown. ...
http://code.google.com/p/robotframework/source/detail?r=e556dbbadf6a

Revision: da6b2ee43d6a
Author:   Pekka Klärck
Date:     Fri Aug 17 05:20:35 2012
Log: Added tooltips to newly added elapsed times in log/report statistics....
http://code.google.com/p/robotframework/source/detail?r=da6b2ee43d6a

Revision: 9ebb5f4ea1d3
Author:   Pekka Klärck
Date:     Fri Aug 17 05:21:47 2012
Log: log/report: slightly smaller graph in stats now that we have elapsed t...
http://code.google.com/p/robotframework/source/detail?r=9ebb5f4ea1d3

Revision: bbe845be1bb9
Author:   Pekka Klärck
Date:     Fri Aug 17 05:55:43 2012
Log: Show elapsed time in log/report statistics as '0.mil' when elapsed < 1...
http://code.google.com/p/robotframework/source/detail?r=bbe845be1bb9

==============================================================================
Revision: 43d1af826d47
Author:   Pekka Klärck
Date:     Fri Aug 17 04:53:04 2012
Log:      Added elapsed time to statistics in log/report.

Update issue 1194
Now elapsed times are shown in statistics. I try to add tooltips explaining
the times next.
http://code.google.com/p/robotframework/source/detail?r=43d1af826d47

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

=======================================
--- /src/robot/htmldata/rebot/common.css        Thu Aug 16 01:03:44 2012
+++ /src/robot/htmldata/rebot/common.css        Fri Aug 17 04:53:04 2012
@@ -109,8 +109,12 @@
     width: 3em;
     text-align: center;
 }
+.col_elapsed {
+    width: 4em;
+    text-align: center;
+}
 .col_graph {
-   width: 11em;
+    width: 11em;
 }
 .stat_name {
     float: left;
=======================================
--- /src/robot/htmldata/rebot/view.js   Wed Jun 27 04:58:19 2012
+++ /src/robot/htmldata/rebot/view.js   Fri Aug 17 04:53:04 2012
@@ -72,6 +72,7 @@
         '<th class="col_stat">Total</th>' +
         '<th class="col_stat">Pass</th>' +
         '<th class="col_stat">Fail</th>' +
+        '<th class="col_elapsed">Elapsed</th>' +
         '<th class="col_graph">Graph</th>';
     var statTable =
         '<h2>Test Statistics</h2>' +
@@ -114,6 +115,7 @@
     '<td class="col_stat">${total}</td>' +
     '<td class="col_stat">${pass}</td>' +
     '<td class="col_stat">${fail}</td>' +
+    '<td class="col_elapsed">${elapsed}</td>' +
     '<td class="col_graph">' +
       '{{if total}}' +
       '<div class="graph">' +

==============================================================================
Revision: e556dbbadf6a
Author:   Pekka Klärck
Date:     Fri Aug 17 04:54:11 2012
Log: times2csv.py: 1) Test including keywords inside suite setup/teardown. 2) Enhance test runner a little. 3) Tiny clean-up.
http://code.google.com/p/robotframework/source/detail?r=e556dbbadf6a

Modified:
 /tools/times2csv/test/run.sh
 /tools/times2csv/test/test.txt
 /tools/times2csv/times2csv.py

=======================================
--- /tools/times2csv/test/run.sh        Mon Aug  6 03:52:05 2012
+++ /tools/times2csv/test/run.sh        Fri Aug 17 04:54:11 2012
@@ -1,7 +1,8 @@
 #!/bin/sh
 testdir=`dirname $0`
 rm -f $testdir/output.*
-pybot --log none --report none --outputdir $testdir $testdir/test.txt
+export PYTHONPATH=$testdir/../../../src
+python -m robot.run -l none -r none -d $testdir $testdir/test.txt
 python $testdir/../times2csv.py $testdir/output.xml
echo "------------------------------ results ------------------------------"
 cat $testdir/output.csv
=======================================
--- /tools/times2csv/test/test.txt      Mon Aug  6 03:52:05 2012
+++ /tools/times2csv/test/test.txt      Fri Aug 17 04:54:11 2012
@@ -1,3 +1,7 @@
+*** Settings ***
+Suite Setup      Parempi keywörd
+Suite Teardown   Parempi keywörd
+
 *** Test Cases ***
 Hyvä testi
     Parempi keywörd
=======================================
--- /tools/times2csv/times2csv.py       Mon Aug  6 03:52:05 2012
+++ /tools/times2csv/times2csv.py       Fri Aug 17 04:54:11 2012
@@ -73,8 +73,7 @@
 def process_keyword(kw, writer, level):
     if kw is None:
         return
-    kw_type = kw.type.capitalize()
-    process_item(kw, writer, level, kw_type)
+    process_item(kw, writer, level, kw.type.capitalize())
     for subkw in kw.keywords:
         process_keyword(subkw, writer, level+1)


==============================================================================
Revision: da6b2ee43d6a
Author:   Pekka Klärck
Date:     Fri Aug 17 05:20:35 2012
Log: Added tooltips to newly added elapsed times in log/report statistics.

Update issue 1194
Added tooltips to explain the times a bit.
http://code.google.com/p/robotframework/source/detail?r=da6b2ee43d6a

Modified:
 /src/robot/htmldata/rebot/view.js

=======================================
--- /src/robot/htmldata/rebot/view.js   Fri Aug 17 04:53:04 2012
+++ /src/robot/htmldata/rebot/view.js   Fri Aug 17 05:20:35 2012
@@ -87,6 +87,15 @@
         '</table>';
     $(statTable).appendTo('#statistics_container');
     $.map(['total', 'tag', 'suite'], addStatTable);
+    addTooltipsToElapsedTimes();
+}
+
+function addTooltipsToElapsedTimes() {
+    $('#total_stats .col_elapsed, #tag_stats .col_elapsed').attr('title',
+        'Total execution time of these tests. ' +
+        'Excludes suite setups and teardowns.');
+    $('#suite_stats .col_elapsed').attr('title',
+        'Total execution time of this suite.');
 }

 function addStatTable(tableName) {

==============================================================================
Revision: 9ebb5f4ea1d3
Author:   Pekka Klärck
Date:     Fri Aug 17 05:21:47 2012
Log: log/report: slightly smaller graph in stats now that we have elapsed times there as well
http://code.google.com/p/robotframework/source/detail?r=9ebb5f4ea1d3

Modified:
 /src/robot/htmldata/rebot/common.css

=======================================
--- /src/robot/htmldata/rebot/common.css        Fri Aug 17 04:53:04 2012
+++ /src/robot/htmldata/rebot/common.css        Fri Aug 17 05:21:47 2012
@@ -114,7 +114,7 @@
     text-align: center;
 }
 .col_graph {
-    width: 11em;
+    width: 9em;
 }
 .stat_name {
     float: left;
@@ -139,7 +139,7 @@
 .graph, .empty_graph {
     border: 1px solid black;
     width: 100%;
-    height: 0.75em;
+    height: 0.7em;
     padding: 0;
     background: red;
 }

==============================================================================
Revision: bbe845be1bb9
Author:   Pekka Klärck
Date:     Fri Aug 17 05:55:43 2012
Log: Show elapsed time in log/report statistics as '0.mil' when elapsed < 1s.

Update issue 1194
Changed showing times below one second to use format '0.mil'. Better than
using '00:00:00' when elapsed < 0.5s and '00:00:01' when 0.5s < elapsed < 1s.
http://code.google.com/p/robotframework/source/detail?r=bbe845be1bb9

Modified:
 /src/robot/model/stats.py
 /utest/model/test_statistics.py

=======================================
--- /src/robot/model/stats.py   Thu Aug 16 06:47:28 2012
+++ /src/robot/model/stats.py   Fri Aug 17 05:55:43 2012
@@ -33,8 +33,7 @@
         if include_label:
             attrs['label'] = self.name
         if include_elapsed:
-            attrs['elapsed'] = elapsed_time_to_string(self.elapsed,
-                                                      include_millis=False)
+            attrs['elapsed'] = self._elapsed_time_to_string(self.elapsed)
         if exclude_empty:
             attrs = dict((k, v) for k, v in attrs.items() if v != '')
         if values_as_strings:
@@ -45,6 +44,11 @@

     def _get_custom_attrs(self):
         return {}
+
+    def _elapsed_time_to_string(self, elapsed):
+        if elapsed < 1000:
+            return '0.%03d' % elapsed
+        return elapsed_time_to_string(elapsed, include_millis=False)

     def _html_escape(self, item):
         return html_escape(item) if isinstance(item, basestring) else item
=======================================
--- /utest/model/test_statistics.py     Thu Aug 16 06:47:28 2012
+++ /utest/model/test_statistics.py     Fri Aug 17 05:55:43 2012
@@ -199,6 +199,23 @@
                         TestSuite()]
         assert_equals(Statistics(suite).suite.stat.elapsed, 11001)

+    def test_elapsed_from_get_attributes(self):
+        for time, expected in [('00:00:00.000', '0.000'),
+                               ('00:00:00.001', '0.001'),
+                               ('00:00:00.500', '0.500'),
+                               ('00:00:00.999', '0.999'),
+                               ('00:00:01.000', '00:00:01'),
+                               ('00:00:01.001', '00:00:01'),
+                               ('00:00:01.499', '00:00:01'),
+                               ('00:00:01.500', '00:00:02'),
+                               ('01:59:59:499', '01:59:59'),
+                               ('01:59:59:500', '02:00:00')]:
+            suite = TestSuite(starttime='20120817 00:00:00.000',
+                              endtime='20120817 ' + time)
+            stat = Statistics(suite).suite.stat
+            elapsed = stat.get_attributes(include_elapsed=True)['elapsed']
+            assert_equals(elapsed, expected)
+

 if __name__ == "__main__":
     unittest.main()

Reply via email to