Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005036TestLinkReportspublic2012-05-30 18:332012-05-30 20:55
Reportercasper 
Assigned To 
PrioritynoneSeverityfeature requestReproducibilityN/A
StatusnewResolutionopen 
PlatformOSOS Version
Product Version1.9.3 (2011 Q3 - bug fixing) 
Fixed in Version 
Summary0005036: Contribution - Color test result in test report based on result
DescriptionOk, I am aware of the shortcomings of the code. I have not yet localized and have hard coded this feature. Please bare with me I am a tester and not a programmer. I need a little help with that.

What the code does is basically check the value the $testStatus and based on this set a variable to color the result word. The colors are identical to the colors that you can see in testlink at the test result page. I have added In progress as a status but this is not in the default installation.
Steps To ReproduceIn the file print.inc.php I have added the following around line 1493.

    //switch to determine color variable for styling $testStatus below, default is black.
    $resultcolor='black';
    switch ($testStatus) {
    case "Passed":
        $resultcolor='0006400';
        break;
    case "Failed":
        $resultcolor='#B22222';
        break;
    case "Blocked":
        $resultcolor='#00008B';
        break;
    case "In Progress":
        $resultcolor='orange';
        break;
    }

And to use the value $resultcolor I have changed this line a couple of lines further down:

'<td ' .$td_colspan . '><div style="color:' . $resultcolor . ';">' . $testStatus . "</div></td></tr>\n" .
Additional InformationOk, as for localization. Is there someway I can state case "passed for x language file"? I found these puzzle blocks:

$labels['build']

$TLS_test_status_passed = "Passed";

---

As for any other code conventions, I might be missing can anyone please point them out.
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
BrowserFirefox 12
PHP Version
TestCaseID
QA Team - Task Workflow Status
Attached Filespng file icon color-test-result.png [^] (103,677 bytes) 2012-05-30 18:33

- Relationships

-  Notes
(0016806)
fman (administrator)
2012-05-30 20:54

thaks for contribution
please give a look to our way to develop, is not hard to follow it and produce code that do not need rework

- Issue History
Date Modified Username Field Change
2012-05-30 18:33 casper New Issue
2012-05-30 18:33 casper File Added: color-test-result.png
2012-05-30 20:54 fman Note Added: 0016806



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker