How to set default values for new TC

The release related discussions, plans and questions.

How to set default values for new TC

Postby kmielke » Mon Nov 05, 2007 9:27 am

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
kmielke
Advanced user
 
Posts: 20
Joined: Mon Jan 29, 2007 9:37 am

Postby fman » Mon Nov 05, 2007 9:29 am

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
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am

Postby kmielke » Mon Nov 05, 2007 9:32 am

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?
kmielke
Advanced user
 
Posts: 20
Joined: Mon Jan 29, 2007 9:37 am

Postby fman » Mon Nov 05, 2007 10:36 am

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
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am

Postby kmielke » Mon Nov 05, 2007 12:10 pm

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
kmielke
Advanced user
 
Posts: 20
Joined: Mon Jan 29, 2007 9:37 am

Postby fman » Tue Nov 06, 2007 10:47 am

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
fman
Member of TestLink Community
 
Posts: 3010
Joined: Tue Nov 15, 2005 7:19 am

Postby mspaul » Wed Nov 07, 2007 9:59 pm

How can I go ahead adding default value to the Test_Suite_Details section?
mspaul
TestLink user
 
Posts: 10
Joined: Fri May 18, 2007 6:05 pm

Postby Zerstoiber » Thu Jun 18, 2009 8:16 am

works it also with testlink 1.8?

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

Thanks
Zerstoiber
TestLink user
 
Posts: 9
Joined: Thu Feb 05, 2009 7:00 am


Return to TestLink 1.7 (Closed)



Who is online

Users browsing this forum: No registered users and 2 guests