Show latest steps execution results

LATEST Official version.
Questions and discussions - NO ISSUES
FOR ISSUES => http://mantis.testlink.org

Moderators: Amaradana, TurboPT, TL Developers

Show latest steps execution results

Postby tjosephine » Fri Jan 13, 2017 4:42 pm

In TestLink 1.9.15 it is now possible to see the latest steps execution notes by providing the following entry in the custom_config.inc.php

// When textarea is displayed to allow user to write execution notes
// at step level, choose what to display:
// 'empty'
// 'latest' => latest execution notes.
$tlCfg->exec_cfg->steps_exec_notes_default = 'latest';

This is something very useful but as a user I would like to see the latest steps execution results as well.

Is it possible to have this option implemented in a future release of TestLink? (already requested in http://forum.testlink.org/viewtopic.php?f=11&t=8010)
In this case I would like to share the modifications I've done to make the steps results visible when steps_exec_notes_default = 'latest'.
Feel free to use/update the code below so that all TestLink community can benefit.

- First, update /testlink/lib/functions/testcase.class.php at line 3626

Code: Select all
if(!is_null($step_set))
{
 $key_set = array_keys($step_set);
 foreach($key_set as $kyx)
{
 $step_set[$kyx]['execution_notes'] = ;
 $step_set[$kyx]['execution_status'] = ; // Add this line
 if( isset($xx[$step_set[$kyx]['id']]) )
 {
  $step_set[$kyx]['execution_notes'] = $xx[$step_set[$kyx]['id']]['notes'];
  $step_set[$kyx]['execution_status'] = $xx[$step_set[$kyx]['id']]['status']; // Add this line
 }
}


- Second, update /testlink/gui/templates/testcases/steps_horizontal.inc.tpl at line 46 and 105

Code: Select all
    {if $inExec}
      <th>{if $tlCfg->exec_cfg->steps_exec_notes_default == 'latest'}{$inc_steps_labels.latest_exec_notes}
          {else}{$inc_steps_labels.step_exec_notes}{/if}
          <img class="clickable" src="{$tlImages.clear_notes}"
          onclick="javascript:clearTextAreaByClassName('step_note_textarea');" title="{$inc_steps_labels.clear_all_notes}"></th>
      <th>{$inc_steps_labels.exec_result}
        <img class="clickable" src="{$tlImages.clear_notes}"
          onclick="javascript:clearTextAreaByClassName('step_status');" title="Clear all status"></th> {* /// modifications *}
    {/if}


Code: Select all
    {if $inExec}
      <td class="exec_tcstep_note">
        <textarea class="step_note_textarea" name="step_notes[{$step_info.id}]" id="step_notes_{$step_info.id}"
                  cols="40" rows="5">{$step_info.execution_notes|escape}</textarea>
      </td>

      <td>
        <select class="step_status" name="step_status[{$step_info.id}]" id="step_status_{$step_info.id}">
          {html_options options=$gui->execStatusValues selected=$step_info.execution_status} {* /// modifications *}
        </select> <br>
       
        {if $gui->tlCanCreateIssue}
          {include file="execute/add_issue_on_step.inc.tpl"
                   args_labels=$labels
                   args_step_id=$step_info.id}
        {/if}
      </td>


I applied the changes in my local installation and everything is working fine.
As you can see above, I hardcoded the "Clear all status" but of course a label can be defined as well.
It would be great to include this new option in a future release of TestLink.
Thanks

Image
tjosephine
Advanced user
 
Posts: 23
Joined: Sat Sep 12, 2015 2:01 pm

Re: Show latest steps execution results

Postby fman » Fri Jan 13, 2017 6:49 pm

Thanks a lot.
next time please open an issue on mantis, the create repository on github to share your code

thanks again
fman
Member of TestLink Community
 
Posts: 3021
Joined: Tue Nov 15, 2005 7:19 am

Re: Show latest steps execution results

Postby fman » Sat Jan 14, 2017 6:00 pm

fman
Member of TestLink Community
 
Posts: 3021
Joined: Tue Nov 15, 2005 7:19 am

Re: Show latest steps execution results

Postby tjosephine » Mon Jan 16, 2017 2:03 pm

Thanks a lot. Very appreciated
tjosephine
Advanced user
 
Posts: 23
Joined: Sat Sep 12, 2015 2:01 pm


Return to TestLink 1.9



Who is online

Users browsing this forum: No registered users and 6 guests