Page 1 of 2

How to summate a custom field?

Posted: Wed Feb 18, 2009 3:56 pm
by franny2006
Hi,

I have defined a custom field "working time", to record the time spent for each testcase. Now I want to know, how many time has to be spent on a testplan. So is there a way to cumulate the content of custom field "working time" for all testcases of a testplan?

Thank you for advice...

Posted: Wed Feb 18, 2009 5:20 pm
by fman
right now only a couple of well known CF are summed

see:
third_party/user_contribution/cfields_for_computing_time.sql

think is what you need

Posted: Thu Feb 19, 2009 7:26 am
by fman
/**
* TestLink Open Source Project - http://testlink.sourceforge.net/
* This script is distributed under the GNU General Public License 2 or later.
*
* Filename $RCSfile: customfields_for_computing_times.txt,v $
*
* @version $Revision: 1.1 $
* @modified $Date: 2009/02/19 07:08:40 $ by $Author: franciscom $
* @author Martin Havlat
*
*/

Quick Help - Computing Times using Custom Fields

Two custom fields with special name are managed by TestLink to compute times:


CF_ESTIMATED_EXEC_TIME
used by TEST PLAN designers, during Test Case Assignment to test plan, to give testers
an indication about time (IN MINUTES) needed to execute test case.

CF_EXEC_TIME
used by testers while executing test cases, to indicate time (IN MINUTES) used to run test case.

Test Link will do sum() on values present on these custom fields while creating reports



Using following SQL you can configure these Custom Fields

/*Data for the table `custom_fields` */
insert into custom_fields
(name,label,type,possible_values,default_value,valid_regexp,length_min,length_max,
show_on_design,enable_on_design,show_on_execution,enable_on_execution,
show_on_testplan_design,enable_on_testplan_design)
values ('CF_ESTIMATED_EXEC_TIME','Estimated Exec time (minutes)',2,'','','',0,0,1,1,1,0,0,0);

insert into custom_fields
(name,label,type,possible_values,default_value,valid_regexp,length_min,length_max,
show_on_design,enable_on_design,show_on_execution,enable_on_execution,
show_on_testplan_design,enable_on_testplan_design)
values ('CF_EXEC_TIME','Time used to execute test (min)',2,'','','',0,0,0,0,1,1,0,0);

/*Data for the table `cfield_node_types` */
insert into cfield_node_types (field_id,node_type_id)
values ( (SELECT id FROM custom_fields WHERE name='CF_ESTIMATED_EXEC_TIME') ,3);

insert into cfield_node_types (field_id,node_type_id)
values ( (SELECT id FROM custom_fields WHERE name='CF_EXEC_TIME') ,3);

Posted: Mon Feb 23, 2009 10:50 am
by franny2006
Thank you very much, this works great!

Posted: Wed Feb 25, 2009 8:12 am
by Ilissan
fman Are this custom_fields are built in in 1.8 RC4 ? Or by this query you add them ??



I understand that this specific custom fields id's ( CF_ESTIMATED_EXEC_TIME
and CF_EXEC_TIME) are hardcoded and therefore only their values will be summed? right?

Posted: Thu Mar 05, 2009 1:51 pm
by Ilissan
I mean, are these fields already there (in the custom fields) by default or i should create them by my self???

Thanks in Advance!!!!

:!:

Posted: Thu Mar 19, 2009 12:11 am
by milton
It is my doubt!

Posted: Thu Mar 19, 2009 7:58 pm
by Merch
Ilissan wrote:I mean, are these fields already there (in the custom fields) by default or i should create them by my self???

Thanks in Advance!!!!

:!:
They are not there by default, when you run the script they will be added. After running the script you have to go into the custom field management and activate them.

Posted: Fri Apr 03, 2009 2:06 pm
by Amaradana
Hi I am sorry to bother, but can you please teel in which reports does this caliculate and show the results, since i ran the reports, but i was unable to get that, where do i need to find these fields in the reports.

Posted: Fri Apr 03, 2009 2:19 pm
by Amaradana
Found it. Solved. Thanks, I was able to see in test plan reports

Posted: Mon Apr 06, 2009 8:27 am
by Amaradana
Amaradana wrote:Found it. Solved. Thanks, I was able to see in test plan reports
The above is vible in 1.8Rc4, when i generate the test plan, i was able to see in the test plan(summation of both the field). but in 1.8.1 i was unable to see in the test plan, Can you please let me know where to see in the results. Where does summation of results are availble in reports.

Can also provide some more information in which file does this both fields are hard coded.

Posted: Mon Apr 06, 2009 11:11 am
by Ilissan
The same is here...

Posted: Tue Apr 07, 2009 5:30 am
by Amaradana
Ok I got it, here is the solution those were moved to test report you can find the checkbox "METRICS", upon seletcing that you can get the values in the report.
NOTE: HELLO FMAN/MHAVALT, a small suggestion if any such changes taken place i feel that they should be documented, since these type of question will not come, at least in help file or say this is related to summate fields so in the user contribution in the file it can be updated saying that this fields are visinble in so and so place..
If this is possible, please do changes from the next release. This would be helpful.

Please let me know if anything else is required.

Posted: Tue Apr 07, 2009 11:23 am
by fman
dear users we need LOT of help with help/documentation then please whyt do not you volunteer for this taks ?

Posted: Tue Apr 07, 2009 11:25 am
by Amaradana
Hi Fman, I am happy to do that, can you please tell me the procedure, so that If at all any such updations i am really happy to update.