{"id":70,"date":"2011-08-22T23:09:54","date_gmt":"2011-08-23T03:09:54","guid":{"rendered":"http:\/\/www.jetmore.org\/john\/blog\/?p=70"},"modified":"2012-05-11T15:16:32","modified_gmt":"2012-05-11T19:16:32","slug":"alternating-test-step-row-colors-in-testlink","status":"publish","type":"post","link":"https:\/\/www.jetmore.org\/john\/blog\/2011\/08\/alternating-test-step-row-colors-in-testlink\/","title":{"rendered":"Alternating Test Step Row Colors in TestLink"},"content":{"rendered":"<p>Working on implementing TestLink at work for better testing process flow.  Very few complaints about the product as a whole &#8211; it can feel ponderous at times, but testing is a big problem, and TestLink is the best tool I&#8217;ve found for addressing them all.<\/p>\n<p>The only real negative feedback I&#8217;ve received so far is regarding the display of steps from individual test cases.  By default, the entire table is the same color, and it&#8217;s very difficult to visually track which row is which.  It seems like such an obvious problem that I assumed I had missed a knob to tweak, but I can&#8217;t find anything about it in the docs, the forums, or the bug tracker.<\/p>\n<p>I poked around a bit tonight and the solution turned out to be ridiculously (but pleasingly) simple.<\/p>\n<blockquote><p><strong>Update 2012-05-08<\/strong>: There is a usable-with-the-patch-command <a href=\"https:\/\/github.com\/jetmore\/TestLink-Misc\/blob\/master\/patches\/ui-tweaks.patch\">patch available<\/a> that incorporates all of these changes and more.  See the <a href=\"https:\/\/github.com\/jetmore\/TestLink-Misc\">README at the base of the github repo<\/a> for more details on what&#8217;s in that patch.\n<\/p><\/blockquote>\n<p>First, add the following to gui\/themes\/default\/css\/custom.css:<\/p>\n<pre class=\"brush: css; title: gui\/themes\/default\/css\/custom.css; notranslate\" title=\"gui\/themes\/default\/css\/custom.css\">\r\n.row_color_1 {\r\n    background-color:   #DDDDDD;\r\n}\r\n.row_color_2 {\r\n    background-color:   #CCCCCC;\r\n}\r\n<\/pre>\n<p>Then, patch the following two files in gui\/templates\/testcases\/ like so (original files were from 1.9.3):<\/p>\n<pre class=\"brush: diff; title: inc_steps.tpl; notranslate\" title=\"inc_steps.tpl\">\r\n--- inc_steps.tpl.dist  2011-08-22 21:08:21.000000000 -0500\r\n+++ inc_steps.tpl       2011-08-22 21:13:02.000000000 -0500\r\n@@ -45,7 +45,7 @@\r\n        &lt;\/tr&gt;\r\n        {* BUGID 3376 *}\r\n        {foreach from=$steps item=step_info}\r\n-       &lt;tr id=&quot;step_row_{$step_info.step_number}&quot;&gt;\r\n+       &lt;tr id=&quot;step_row_{$step_info.step_number}&quot; class=&quot;{cycle values=&quot;row_color_1,row_color_2&quot;}&quot;&gt;\r\n                &lt;td style=&quot;text-align:left;&quot;&gt;\r\n                        &lt;span class=&quot;order_info&quot; style='display:none'&gt;\r\n                        &lt;input type=&quot;text&quot; name=&quot;step_set[{$step_info.id}]&quot; id=&quot;step_set_{$step_info.id}&quot;\r\n<\/pre>\n<pre class=\"brush: diff; title: tcStepEdit.tpl; notranslate\" title=\"tcStepEdit.tpl\">\r\n--- tcStepEdit.tpl.dist 2011-09-22 10:27:23.000000000 -0500\r\n+++ tcStepEdit.tpl      2011-09-22 10:39:55.000000000 -0500\r\n@@ -197,7 +197,7 @@\r\n   {* this means we have steps to display *}\r\n   {if $gui-&gt;tcaseSteps != ''}\r\n        {foreach from=$gui-&gt;tcaseSteps item=step_info}\r\n-         &lt;tr id=&quot;step_row_{$step_info.step_number}&quot;&gt;\r\n+         &lt;tr id=&quot;step_row_{$step_info.step_number}&quot; class=&quot;{cycle values=&quot;row_color_1,row_color_2&quot;}&quot;&gt;\r\n       {if $step_info.step_number == $gui-&gt;step_number}\r\n                    &lt;td style=&quot;text-align:left;&quot;&gt;{$gui-&gt;step_number}&lt;\/td&gt;\r\n                  &lt;td&gt;{$steps}&lt;\/td&gt;\r\n<\/pre>\n<p>Blow away the cached .css files, and voila!  Alternating background colors for test steps in TestLink.<\/p>\n<table border=0>\n<tr>\n<td valign=top style=\"background-color: #FFFFFF\">Before:<\/td>\n<td valign=top width=50% style=\"background-color: #FFFFFF\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.jetmore.org\/john\/blog\/wp-content\/uploads\/2011\/08\/before.png\" alt=\"\" title=\"before\" width=\"69\" height=\"423\" class=\"alignnone size-full wp-image-77\" \/><\/td>\n<td valign=top style=\"background-color: #FFFFFF\">After:<\/td>\n<td valign=top width=50% style=\"background-color: #FFFFFF\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/www.jetmore.org\/john\/blog\/wp-content\/uploads\/2011\/08\/after.png\" alt=\"\" title=\"after\" width=\"67\" height=\"428\" class=\"alignnone size-full wp-image-78\" \/><\/td>\n<\/tr>\n<\/table>\n<p>I tried to post this as a hint in the TestLink forum but I honestly couldn&#8217;t figure out how to register a forum account.  I did post a comment on a related bug in their issue tracker, <a href=\"http:\/\/mantis.testlink.org\/view.php?id=3583\" target=\"_blank\">ticket 3583<\/a><\/p>\n<p><strong>EDIT 2011-09-22<\/strong>: The original version of this post only included a change to inc_steps.tpl.  Added the patch to tcStepsEdit.tpl to apply alternation to the rows in the test case step edit view also.<\/p>\n<p><strong>EDIT 2011-09-26<\/strong>: Updated to include the correct full path to custom.css<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Working on implementing TestLink at work for better testing process flow. Very few complaints about the product as a whole &#8211; it can feel ponderous at times, but testing is a big problem, and TestLink is the best tool I&#8217;ve &hellip; <a href=\"https:\/\/www.jetmore.org\/john\/blog\/2011\/08\/alternating-test-step-row-colors-in-testlink\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[8,9,14],"_links":{"self":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/70"}],"collection":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":5,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":691,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/70\/revisions\/691"}],"wp:attachment":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/media?parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/categories?post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/tags?post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}