How to set default values for new TC

The release related discussions, plans and questions.
Locked
kmielke
Advanced user
Posts: 20
Joined: Mon Jan 29, 2007 9:37 am

How to set default values for new TC

Post by kmielke »

Hi,

i would like to place some text into tc summary and tc steps in case of a new tc. where can i do that?

thx
regards
Kester
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

this feature (what we could call templates) does not exist yet.

do you want to help us to develop it ?
No matter your answer:
1. please add an issue on Mantis


2. have you already add your company to the forum?
is your answer is not, please take 5 min to do it.

regards

francisco
kmielke
Advanced user
Posts: 20
Joined: Mon Jan 29, 2007 9:37 am

Post by kmielke »

ah. ok. thx.

well, i can try it. ;-)

but for a quick hack here where do i have to place the text if i want to do it hardcoded?
fman
Member of TestLink Community
Posts: 3123
Joined: Tue Nov 15, 2005 7:19 am

Post by fman »

Implementation is simple => is better do it well from start.

Then my suggestions

define new config parameter

$g_testcase_template->summary="Your text here";
$g_testcase_template->steps="Your text here";
$g_testcase_template->expected_results="Your text here";


Then try look debug code (I've no time now) to understand what page is called when you choose new testcase.
Then change page to get config:

$my_template=config_get('testcase_template');

then init FCK editor objetcs with

$my_template->summary
$my_template->steps
$my_template->expected_results

Please send the code back to me (or attach on mantis issue)

enjoy developing
kmielke
Advanced user
Posts: 20
Joined: Mon Jan 29, 2007 9:37 am

Post by kmielke »

thx. done. ;-) that was eays.

what i did so far.

1) custom_config.inc.php
/* Defaultvalues */
$g_testcase_template->summary="My summary";
$g_testcase_template->steps="My steps";
$g_testcase_template->expected_results="My Results";

2) tcEdit.php
at the end of the file where we have this:

if ($show_newTC_form)
{
...
$my_template = config_get('testcase_template');
foreach ($a_ofck as $key)
{
// Warning:
// the data assignment will work while the keys in $the_data are identical
// to the keys used on $oFCK.
$of = &$oFCK[$key];
/* $of->Value = ""; old version */
$of->Value = $my_template->$key;
$smarty->assign($key, $of->CreateHTML());
}
}

;-). this is fine for me.

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

Post by fman »

Yes, this is a solution.
I've a better one :
multiple sources for defaults:

1. string
2. string_id -> got value from strings.txt
3. file -> read file contens

I will send you asap
mspaul
TestLink user
Posts: 10
Joined: Fri May 18, 2007 6:05 pm

Post by mspaul »

How can I go ahead adding default value to the Test_Suite_Details section?
Zerstoiber
TestLink user
Posts: 9
Joined: Thu Feb 05, 2009 7:00 am

Post by Zerstoiber »

works it also with testlink 1.8?

I think the tcedit.php File is a littel different.

Thanks
Locked