Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001668TestLinkNew Featurepublic2008-08-13 10:432010-08-31 20:29
Reporterdrakossi 
Assigned Tofman 
PrioritynormalSeverityfeature requestReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version1.7.4 
Fixed in Version1.9 Beta 5 
Summary0001668: Step test cases (Using tables in the Steps function and not using the expected results field)
DescriptionI saw a few posts about being able to do this on the forums and I needed to do this on almost all of my test cases. I work in an IT shop and we rollout hundreds of updates and applications a year, each has to have a test case and most of them are multi step. I saw fmans idea about just using the steps section and pasting (or creating a 2 row table) in there and decided to take it a step further.

You could get this in your code with a minimal amount of changes, and it doesn't require any schema changes. Just the modification of a couple of templates and the addition of a g_variable that allows for different template folders.

Steps are outlined in the next section, if you can get the variable to work in custom_config.inc.php that would be great, then you can allow for custom templates as well as custom themes.
Additional InformationMulti step test case workaround (no DB Schema Changes required).

Requires editing of 3 core files, but allows for recovery if you screw something up ;)

Note: making this change will keep you from editing your existing templates (result column will be missing), either do this on a new installation with no test cases created, or modify your existing ones before applying this mod.


----- step 1 -----

First, since test link doesnt have a direct way to using a different set of smarty templates I decided to modify the way the tlsmarty.inc.php file defines the templates directory. Nothing complex here, you just create a variable and set it to the template directory you wish to use:



Locate tlsmarty.inc.php in the following directory \lib\general\

open the file with a text editor and make the following modifications:

At the very top of the file you will see a bunch of global definitions, underneath these, add the following line:

    /* added to allow for custom template directories 08/12/2008 jdk
        default directory is templates */
        $g_templates_path='templates2';

I put these here becuase I couldnt figure out how to get them to read correctly in the custom_config.inc.php file.

scroll down a little bit and modify the 2 lines that look like this:

$this->template_dir = TL_ABS_PATH . 'gui/templates/';
    to
$this->template_dir = TL_ABS_PATH . 'gui/'.$g_templates_path.'/';

    and

$this->config_dir = TL_ABS_PATH . 'gui/templates/';
    to
$this->config_dir = TL_ABS_PATH . 'gui/'.$g_templates_path.'/';


----- step 2 -----

create a folder in your \gui\ directory called templates2 (or whatever you used in the g_templates_path variable above.

copy the contents of \gui\templates to this directory (EVERYTHING)

----- step 3 -----

For the Editor Screen:

edit tc_Edit_New_viewer.tpl in a text editor (it is inside the templates2 directory you just copied)


locate the line that begins with {$layout1}

delete everything from {$layout1} to {$layout3} and everything in between


replace them with this: (watch for line wraps)

            {*JDK 08/11/2008
                ALLOWS FOR MULTI STEPS BY IMPORTING OR CREATING A TABLE
                (EVERYTHING GOES IN THE STEPS FIELD)
                THE RESULTS FIELD IS NOT DISPLAYED (IN EDIT OR VIEW)
                @NOTE: This requires any templates that were done with the results field in tact
                to be modified since this template doesn't show the results field anymore*}
            {$layout1}
            <div class="labelHolder">------------------------------|{lang_get s='steps'}|------------------------------------------------------------|{lang_get s='expected_results'}|------------------------------</div>
            <div>{$steps}</div>
            {*{$layout2}
            <div class="labelHolder">{lang_get s='expected_results'}</div>
            <div>{$expected_results}</div>*}
            {$layout3}
            {* END STEPS MOD *}

----- Step 4 -----


Open tcView_viewer.tpl (in the same directory) in a text editor

locate the following text:

    <tr>
            <td class="bold" width="50%">{lang_get s='steps'}</td>
            <td class="bold" width="50%">{lang_get s='expected_results'}</td>
    </tr>
    <tr>
            <td>{$args_testcase.steps}</td>
            <td>{$args_testcase.expected_results}</td>
    </tr>

and replace it with this:


    <tr>
            {*JDK STEP ALLOWS FOR MULTI STEPS BY IMPORTING OR CREATING A TABLE
             (EVERYTHING GOES IN THE STEPS FIELD)
             THE RESULTS FIELD IS NOT DISPLAYED (IN EDIT OR VIEW) JDK 08/11/2008 *}
            <td class="bold" width="100%">-------------------------|{lang_get s='steps'}|-------------------------------------------------------|{lang_get s='expected_results'}|-------------------------</td>
            {*JDK STEP <td class="bold" width="50%">{lang_get s='expected_results'}</td>*}
    </tr>
    <tr>
            <td>{$args_testcase.steps}</td>
            {*JDK STEP <td>{$args_testcase.expected_results}</td>*}
            {*JDK END STEP MOD *}
    </tr>


This modification will allow you to enter a table (either pasted from excel or created with the editor) as a full steps - results test case and does not modify the existing schema or make any major core changes to the Testlink source.

If you screw it up, just change the variable in tlsmarty.inc.php back to its default value.
TagsNo tags attached.
Database (MySQL,Postgres,etc)
Browserie and FF3
PHP Versioncurrent
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
(0011177)
fman (administrator)
2010-08-31 20:29

Release BETA 6 - 20100831

- Issue History
Date Modified Username Field Change
2008-08-13 10:43 drakossi New Issue
2008-08-13 10:43 drakossi Browser => ie and FF3
2008-08-13 10:43 drakossi PHP Version => current
2010-06-05 08:05 fman Status new => resolved
2010-06-05 08:05 fman Fixed in Version => 1.9 Beta 5
2010-06-05 08:05 fman Resolution open => fixed
2010-06-05 08:05 fman Assigned To => fman
2010-08-31 20:29 fman Note Added: 0011177
2010-08-31 20:29 fman Status resolved => closed



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker