{"id":148,"date":"2011-09-22T13:07:47","date_gmt":"2011-09-22T17:07:47","guid":{"rendered":"http:\/\/www.jetmore.org\/john\/blog\/?p=148"},"modified":"2012-05-11T15:14:24","modified_gmt":"2012-05-11T19:14:24","slug":"better-copypaste-when-editing-test-steps-in-testlink","status":"publish","type":"post","link":"https:\/\/www.jetmore.org\/john\/blog\/2011\/09\/better-copypaste-when-editing-test-steps-in-testlink\/","title":{"rendered":"Better Copy\/Paste When Editing Test Steps in TestLink"},"content":{"rendered":"<p>My current biggest peeve with TestLink is how hard TestLink makes it to copy text out of test steps when editing a test case. Both when viewing a case and when editing test case steps via the Test Specification interface, clicking on the text of a test step causes you to start editing the text in that step.<\/p>\n<p>I find this behavior very off-putting. I constantly find myself trying to copy in these views, either to copy repetitive actions from a previous step, or to do a dry-run executing a test case. I finally got mad enough today to spend the time figuring out how to change this behavior.<\/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>There are two Smarty templates that control the layout of these views, both of which live in gui\/templates\/testcases\/. inc_steps.tpl controls the layout when viewing a test case (but <strong>not<\/strong> editing steps), and tcStepEdit.tpl controls the layout when editing steps.<\/p>\n<p>After applying these patches, you can copy text out of the Step Action and Expected Results columns. To edit the row as before the patch, click on the row counter (the first cell in the row).<\/p>\n<p>These patches are against TestLink 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-09-22 10:08:55.000000000 -0500\r\n@@ -53,10 +53,10 @@\r\n                                size=&quot;{#STEP_NUMBER_SIZE#}&quot;\r\n                                maxlength=&quot;{#STEP_NUMBER_MAXLEN#}&quot;&gt;\r\n                        {include file=&quot;error_icon.tpl&quot; field=&quot;step_number&quot;}\r\n-                       &lt;\/span&gt;{$step_info.step_number}\r\n+                       &lt;\/span&gt;&lt;div {if $edit_enabled} style=&quot;cursor:pointer;&quot; onclick=&quot;launchEditStep({$step_info.id})&quot; {\/if}&gt;{$step_info.step_number}&lt;\/div&gt;\r\n                &lt;\/td&gt;\r\n-               &lt;td {if $edit_enabled} style=&quot;cursor:pointer;&quot; onclick=&quot;launchEditStep({$step_info.id})&quot; {\/if}&gt;{$step_info.actions}&lt;\/td&gt;\r\n-               &lt;td {if $edit_enabled} style=&quot;cursor:pointer;&quot; onclick=&quot;launchEditStep({$step_info.id})&quot; {\/if}&gt;{$step_info.expected_results}&lt;\/td&gt;\r\n+               &lt;td&gt;{$step_info.actions}&lt;\/td&gt;\r\n+               &lt;td&gt;{$step_info.expected_results}&lt;\/td&gt;\r\n                {if $session['testprojectOptions']-&gt;automationEnabled}\r\n                &lt;td {if $edit_enabled} style=&quot;cursor:pointer;&quot; onclick=&quot;launchEditStep({$step_info.id})&quot; {\/if}&gt;{$gui-&gt;execution_types[$step_info.execution_type]}&lt;\/td&gt;\r\n                {\/if}\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@@ -211,8 +211,8 @@\r\n        {\/if}\r\n       {else}\r\n         &lt;td style=&quot;text-align:left;&quot;&gt;&lt;a href=&quot;{$hrefEditStep}{$step_info.id}&quot;&gt;{$step_info.step_number}&lt;\/a&gt;&lt;\/td&gt;\r\n-               &lt;td &gt;&lt;a href=&quot;{$hrefEditStep}{$step_info.id}&quot;&gt;{$step_info.actions}&lt;\/a&gt;&lt;\/td&gt;\r\n-               &lt;td &gt;&lt;a href=&quot;{$hrefEditStep}{$step_info.id}&quot;&gt;{$step_info.expected_results}&lt;\/a&gt;&lt;\/td&gt;\r\n+               &lt;td &gt;{$step_info.actions}&lt;\/td&gt;\r\n+               &lt;td &gt;{$step_info.expected_results}&lt;\/td&gt;\r\n         {if $session['testprojectOptions']-&gt;automationEnabled}\r\n                  &lt;td&gt;&lt;a href=&quot;{$hrefEditStep}{$step_info.id}&quot;&gt;{$gui-&gt;execution_types[$step_info.execution_type]}&lt;\/a&gt;&lt;\/td&gt;\r\n                {\/if}\r\n<\/pre>\n<p>I&#8217;ve been writing test cases with this change in place all morning and it is much, much nicer than the default behavior<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My current biggest peeve with TestLink is how hard TestLink makes it to copy text out of test steps when editing a test case. Both when viewing a case and when editing test case steps via the Test Specification interface, &hellip; <a href=\"https:\/\/www.jetmore.org\/john\/blog\/2011\/09\/better-copypaste-when-editing-test-steps-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\/148"}],"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=148"}],"version-history":[{"count":5,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"predecessor-version":[{"id":685,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/posts\/148\/revisions\/685"}],"wp:attachment":[{"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jetmore.org\/john\/blog\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}