2 new revisions:

Revision: d90b7aa091b5
Branch:   default
Author:   Pekka Klärck
Date:     Fri Jan 31 09:51:12 2014 UTC
Log:      Report: Tag search functionality....
http://code.google.com/p/robotframework/source/detail?r=d90b7aa091b5

Revision: 12115f844335
Branch:   default
Author:   Pekka Klärck
Date:     Fri Jan 31 10:11:19 2014 UTC
Log: report: don't draw test details table if there are no tests and rm unn...
http://code.google.com/p/robotframework/source/detail?r=12115f844335

==============================================================================
Revision: d90b7aa091b5
Branch:   default
Author:   Pekka Klärck
Date:     Fri Jan 31 09:51:12 2014 UTC
Log:      Report: Tag search functionality.

Update issue 1634
Tag search implementation done based on Janne's work in revision f0fb2475dd41. Main changes compared to that commit:

- No suite search functionality (will take a look at implementing it separately). - Don't show critical statistics. The implementation broke e.g. showing Critical Tests and All Tests, and this would be a topic for a separate issue anyway.
- Added Clear button.
- Fixed print styles.

The new code looks pretty good and, more importantly, the funcitonality seams to work fine too. Only thing related to tag search I'd like to add is a way to get help about the pattern syntax.
http://code.google.com/p/robotframework/source/detail?r=d90b7aa091b5

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

=======================================
--- /src/robot/htmldata/rebot/print.css Thu Feb 14 09:20:27 2013 UTC
+++ /src/robot/htmldata/rebot/print.css Fri Jan 31 09:51:12 2014 UTC
@@ -12,7 +12,7 @@
 .details, .statistics {
     width: 100%;
 }
-#generated-ago, #top-right-header, #normal-selector,
+#generated-ago, #top-right-header, #normal-selector, #search,
 .folding-button, .expand, .hidden, .details-col-toggle {
     display: none;
 }
=======================================
--- /src/robot/htmldata/rebot/report.html       Sat Oct 12 17:33:44 2013 UTC
+++ /src/robot/htmldata/rebot/report.html       Fri Jan 31 09:51:12 2014 UTC
@@ -169,13 +169,20 @@
 function tagDetailSelected(name) {
     if (!name) return;
     renderTagSelector(name);
- var tag = util.filter(window.testdata.statistics().tag, function (tag) {
-        return tag.label == name;
-    })[0];
+    var tag = findTag(name);
     renderTagDetails(tag);
     updatePrintSelector(name, tag.info);
     scrollToSelector('tag_'+name);
 }
+
+function findTag(name) {
+    var tags = window.testdata.statistics().tag;
+    for (var i = 0, len = tags.length; i < len; i++) {
+        if (tags[i].label == name)
+            return tags[i];
+    }
+    return {combined: name, label: name, info: 'search'};
+}

 function renderTagSelector(name) {
     var args = {linkTarget: (name) ? 'tag_'+name : 'tags',
@@ -186,8 +193,14 @@

 function renderTagDetails(tag) {
     var tests = getTestsHavingTag(tag);
-    if (tag)
-        tag.totalTime = calculateTotalTime(tests);
+    tag.totalTime = calculateTotalTime(tests);
+    if (tag.info == 'search') {
+        tag.total = tests.length;
+        tag.pass = util.filter(tests, function (test) {
+            return test.status == 'PASS';
+        }).length;
+        tag.fail = tag.total - tag.pass;
+    }
     $.tmpl('tagOrTotalDetailsTemplate', tag).appendTo('#details-header');
     drawTestDetailsTable(tests, true);
 }
@@ -473,6 +486,16 @@
       </td>
       <td id="print-selector"></td>
     </tr>
+    <tr id="search">
+      <th>Search:</th>
+      <td>
+        <form>
+          <input id="search-field" type="text" value="${selected}">
+ <input type="submit" value="Search" onclick="tagDetailSelected($('#search-field').val())"> + <input type="button" value="Clear" onclick="$('#search-field').val('')">
+        </form>
+      </td>
+    </tr>
   </table>
 </script>


==============================================================================
Revision: 12115f844335
Branch:   default
Author:   Pekka Klärck
Date:     Fri Jan 31 10:11:19 2014 UTC
Log: report: don't draw test details table if there are no tests and rm unnecessary check
http://code.google.com/p/robotframework/source/detail?r=12115f844335

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

=======================================
--- /src/robot/htmldata/rebot/report.html       Fri Jan 31 09:51:12 2014 UTC
+++ /src/robot/htmldata/rebot/report.html       Fri Jan 31 10:11:19 2014 UTC
@@ -245,6 +245,8 @@
 }

 function drawTestDetailsTable(tests, sortByStatus) {
+    if (!tests.length)
+        return;
     renderTestDetailsHeader();
     window.elementsToRender = tests;
     var target = $('#test-details').find('tbody');
@@ -266,8 +268,6 @@
 }

 function getTestsHavingTag(tag) {
-    if (!tag)
-        return [];
return window.testdata.suite().searchTestsByTag(tag).sort(sortByStatus);
 }

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to