Page 1 of 2

How to set custom status for a test case in 1.9.16?

PostPosted: Sat Mar 11, 2017 3:43 pm
by AnaYoshikawa
Hi, all.

First of all, congrats on the great job of evolving the tool. (First contact I had with TestLink, was way back on version 1.7.3...)

I'm planning on proposing the adoption of TestLink on my next project so I've just downloaded version 1.9.16 and installed it on Windows with MySQL DB, to adapt it to our process and to test integration with Jira.

I've added a custom status (cancelled), following the instructions in the manual and the tips on custom_config.inc.php.example. (This is part of our process and this customization had been successfully done in TL 1.9.8.)

Here's how it looks like.

$tlCfg->results['status_code'] = array (
'failed' => 'f',
'blocked' => 'b',
'passed' => 'p',
'not_run' => 'n',
'cancelled' => 'c'
);

//// For localization example see /locale/<your_language>/custom_strings.txt.example
$tlCfg->results['status_label'] = array(
'not_run' => 'test_status_not_run',
'passed' => 'test_status_passed',
'failed' => 'test_status_failed',
'blocked' => 'test_status_blocked',
'cancelled' => 'test_status_cancelled'
);

$tlCfg->results['status_label_for_exec_ui'] = array(
'not_run' => 'test_status_not_run',
'passed' => 'test_status_passed',
'failed' => 'test_status_failed',
'blocked' => 'test_status_blocked',
'cancelled' => 'test_status_cancelled'
);

$tlCfg->results['default_status'] = 'not_run';

$tlCfg->results['charts']['status_colour'] = array(
'not_run' => '000000',
'passed' => '006400',
'failed' => 'B22222',
'blocked' => '00008B',
'cancelled' => 'FF8C11'
);

I can see my new status on the list box for each step. However, I would like to cancel the whole test case, not just the individual steps.
With the new icons, how is it possible to set the status of the test case to a customized status. Have I forgotten something in the customization? Is it possible, through configuration, to go back to the radio buttons instead of the icons for setting the test case status? Should I open a ticket in Mantis?

Thanks in advance.

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Mon Mar 13, 2017 7:16 pm
by fman
Customization has changed a little bit but all the info you need is inside cfg\const.inc.php

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Wed Mar 15, 2017 2:25 pm
by LouKingga
Hi all,
I'm also interested in this topic and, thanks to fman, I was finally able to add my custome status to the result box!
My only remaining issue is that the respective icons are not displayed:
Image

I created the respective icons and uploaded to the same folder as the default ones.
However, as you can see on the right, it's like the path is not being recognized.

This is wat I added to the custom.config.inc.php (lines related to the new status in bold):

// This Example shows how to add the status 'my_status'

$tlCfg->results['status_code'] = array (
'failed' => 'f',
'blocked' => 'b',
'passed' => 'p',
'not_run' => 'n',
'part_passed' => 'a'
);
//
//// For localization example see /locale/<your_language>/custom_strings.txt.example
$tlCfg->results['status_label'] = array(
'not_run' => 'test_status_not_run',
'passed' => 'test_status_passed',
'failed' => 'test_status_failed',
'blocked' => 'test_status_blocked',
'part_passed' => 'test_status_part_passed'
);

$tlCfg->results['status_label_for_exec_ui'] = array(
'not_run' => 'test_status_not_run',
'passed' => 'test_status_passed',
'failed' => 'test_status_failed',
'blocked' => 'test_status_blocked',
'part_passed' => 'test_status_part_passed'
);

$tlCfg->results['charts']['status_colour'] = array(
'not_run' => '000000',
'passed' => '006400',
'failed' => 'B22222',
'blocked' => '00008B',
'part_passed' => 'FF8C11'
);

$tlCfg->results['status_icons_for_exec_ui'] =
array('passed' => array('img' => 'test_status_passed',
'title' => 'click_passed'),
'part_passed' => array('img' => 'test_status_part_passed',
'title' => 'click_part_passed'),

'failed' => array('img' => 'test_status_failed',
'title' => 'click_failed'),
'blocked' => array('img' => 'test_status_blocked',
'title' => 'click_blocked'));

$tlCfg->results['status_icons_for_exec_next_ui'] =
array('passed' => array('img' => 'test_status_passed_next',
'title' => 'click_passed_next'),
'part_passed' => array('img' => 'test_status_part_passed_next',
'title' => 'click_part_passed_next'),

'failed' => array('img' => 'test_status_failed_next',
'title' => 'click_failed_next'),
'blocked' => array('img' => 'test_status_blocked_next',
'title' => 'click_blocked_next'));


What am I doing wrong???

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Wed Mar 15, 2017 7:55 pm
by m1ch13l
Have you tried adding the image file name to the image array in lib\functions\tlsmarty.inc.php?

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Thu Mar 16, 2017 1:41 pm
by LouKingga
That's exactly what I forgot to do.

It's working PERFECTLY now, THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Thu Mar 16, 2017 4:04 pm
by fman
Thanks to all you.
I'm going to add some doc to explain this, apologize ;(

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Tue Jun 27, 2017 6:44 pm
by fortcwb
Is there any way to keep using words instead of "emoticons"?

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Wed Jul 19, 2017 2:00 pm
by tjosephine
We would like as well a possibility to use a list box with all the status instead of the "emoticons". Thanks

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Fri Nov 17, 2017 10:09 am
by Kveldus
We upgraded from 1.9.14 to 1.9.16 and found the same issue. Unfortunately custom statuses we had became unavailable after upgrade in execution. As far as I understand need to add icons + updates in custom config files for those to get back.
Is there any possibility to switch to the previous style of drop-down menu for TC's execution and status?

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Fri Nov 17, 2017 2:48 pm
by Kveldus
I have also found that custom test execution statuses should be also defined for quick execution in getQuickExecCfg function in /lib/testcases/tcAssignedToUser.php (used in, for example, Test Case Assignment Overview report)
It's not really critical, just a nice-to-adjust, but anyway.

One of bad points of Icons as status for result in execution implementation is that after upgrade all custom statuses are no longer visible in results for test execution until user defines those manually in $tlCfg->results['status_icons_for_exec_ui'] array, uploads icons and adds the appropriate entries $TLS_click_<status> in custom strings files. Imho in this case some more detailed documentation (at least description in const.inc.php) on custom statuses upgrade or some handling of custom statuses during upgrade would be the benefit. It was not obvious from const.inc.php that also lib\functions\tlsmarty.inc.php should be updated - user can definitely research and find this step by step, but it would be nice to add this info into const.inc.php.

Thanks to that post, I didn't need to spend more time to find all items needed to be updated to restore custom statuses!

But I re-designed the default icons a bit too as imho emoticons are not the best solution for the icons. So here is how it looks like now in our TestLink:
Image
Statuses: Passed, Failed, Blocked, In Progress, Deferred, To Review, Cancelled

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Sun Nov 19, 2017 10:13 am
by fman
@Kveldus
What about contributing with the missing documentation?

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Mon Nov 20, 2017 7:31 am
by Kveldus
fman wrote:@Kveldus
What about contributing with the missing documentation?

Good idea! I can do that.
I only think that it would be better to make it in docs, not in const.inc.php. In addition to this statuses item I also have some more customization tips we used.

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Mon Nov 20, 2017 12:34 pm
by fman

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Tue Mar 06, 2018 4:39 pm
by fortcwb
Hey guys, I followed Kveldus idea and created my own icons. I'm posting here if you want to use them.

Image

Image Image Image Image Image

I use them as "passed", "partially passed", "failed", "blocked" and "not applicable"

Re: How to set custom status for a test case in 1.9.16?

PostPosted: Mon Oct 08, 2018 3:20 pm
by nukemrex
Hi guys,

I'm new in Testlink, and I wanted to add 2 new test cases status when in my project want to run a test plan, I followed the different steps described in this topic, but I couldn't get the images in place, I'm using 1.9.17 version, replace the images using the ones that "fortcwb" shared but actually 2 of the new status are not been recognized, and if we use Firefox the new status are not displayed, and as a workaround we use Chrome, that display the icons as missed images.

https://ibb.co/mB72R9

Could you please help me with this problem? I tried every different changes described in other posts but without good results.

Thanks in advance to anyone that could help.

Regards.