Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008297TestLinkReports - Test report matrixpublic2018-06-13 14:182018-06-29 20:42
Reportertjosephine 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformPCOSWindows OS Version7
Product Version1.9.17 (2018 Q1) 
Fixed in Version1.9.18 (2018 Q3) 
Summary0008297: Test Result Matrix report - latest execution notes - when more that one tc exists notes are always the same for all tc
DescriptionAfter implementing changes from mantis 0008202 and 0008276 on resultsTC.php in order to display latest Notes for latest created build and latest Notes for last execution, the last column added in the Test Result Matrix report "Notes (latest exec)" always returns the notes of the first test case.

Part 1:
------
I execute TC1, TC2 and TC3 against build1, build2 and build3 and make sure to add a note for latest created build3. The report is fine and displays the notes for latest build created.

I re-execute TC1 against build1 with note = N1
I re-execute TC2 against build1 with note = N2
I re-execute TC3 against build1 with note = N3

When running the Test Result Matrix report, the last column "Notes (latest exec)" displays N1 for the 3 test cases TC1, TC2 and TC3. This is not correct. If I understand the changes, we should see N1 for TC1, N2 for TC2 and N3 for TC3.

When looking at resultsTC.php, the code to display the latest exec Notes at line 771 is:

$dfx = current($latestExecution[0]);
if( $fo == FORMAT_XLS) {
   $rows[] = $dfx['execution_notes'];
}
if( $fo == FORMAT_HTML) {
  $rows[] = ['text' => $dfx['execution_notes']];
}

I am surprised to not see the test case ID when looping on the different results.
It sounds like $dfx always returns the same value.

I updated the code with
$dfx = $latestExecution[0][$tcaseID];
Better! when running the report I was able to see N1 for TC1, N2 for TC2 and N3 for TC3.


Part 2:
-------
I continue my testing and decide to use platforms and create P1 and P2 assigned to my test plan.
I add latest build4 and re-execute TC1, TC2 and TC3 for P1 and P2 with notes.
I re-execute the test cases for P1 and P2 against the first build build1 with new notes (New N1, New N2 and New N3)
I run the report again and last column "Notes (latest exec)" shows 'null' for the 3 test cases. Humm..


He took me some times to realize that the ID=0 in $latestExecution[0] corresponds to the platform ID.

I updated the code with
$dfx = $latestExecution[$platformID][$tcaseID];

MAGIC!! it is working fine using platforms or not. The report displays the correct notes for latest created build and for last execution. I can see now New N1 for TC1, New N2 for TC2 and New N3 for TC3.

Please could you confirm if this is the correct implementation?
$dfx = $latestExecution[$platformID][$tcaseID];

Thanks


Steps To Reproduce1-Implement changes fron mantis 0008202 and 0008276
2-Execute TC1, TC2, TC3 against build1, build2, build3 with notes
3-Reexecute TC1, TC2, TC2 against first build build1 with new notes
4-Run Test Result Matrix and check

Add 2 platforms P1 and P2 and repeat steps 2, 3 and 4
Run again Test Result Matrix and check

TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
BrowserChrome v.58
PHP Version5.6.14
TestCaseID
QA Team - Task Workflow StatusTBD
Attached Filespng file icon latest_exec.png [^] (12,860 bytes) 2018-06-18 19:51

- Relationships

-  Notes
(0027587)
fman (administrator)
2018-06-16 16:49
edited on: 2018-06-16 18:26

Thanks for your analysis and patience.
my fault has been doing a refactoring without good test.
also my fault no test with platforms.

I'm going to try to find time to review your code, but at first, glance seems ok.

(0027599)
fman (administrator)
2018-06-16 18:29

please check if this solved the issue

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/a4048256463f932d643c527e4159f8719c7eeef9 [^]
(0027605)
tjosephine (reporter)
2018-06-18 20:08

Yes it is working but one last issue (see attachment).
When there is nothing to display (test cases NOT RUN), the report displays 'null'.

I updated the code like:
If execution_notes exists, then $rows[] = execution_notes or empty string

====
$dfx = $latestExecution[$platformID][$tcaseID];
if( $fo == FORMAT_XLS) {
    if ($dfx['execution_notes']) {
        $rows[] = $dfx['execution_notes'];
    }
    else {
        $rows[] = '';
    }
}
if( $fo == FORMAT_HTML) {
    if ($dfx['execution_notes']) {
        $rows[] = ['text' => $dfx['execution_notes']];
    }
    else {
        $rows[] = ['text' => ''];
    }
}
====

With this change, 'null' disappears and the report looks nice!
Let me know if there is another alternative.
(0027632)
fman (administrator)
2018-06-23 16:42

please try this (your approach refactored)
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/de277670a66b648fa365d9d6dbf3818cb44d868d [^]

thanks a lot!
(0027648)
tjosephine (reporter)
2018-06-28 13:48

Working great! Thank you for the refactoring

- Issue History
Date Modified Username Field Change
2018-06-13 14:18 tjosephine New Issue
2018-06-16 16:49 fman Note Added: 0027587
2018-06-16 16:50 fman Note Edited: 0027587 View Revisions
2018-06-16 18:26 fman Note Edited: 0027587 View Revisions
2018-06-16 18:26 fman QA Team - Task Workflow Status => TBD
2018-06-16 18:26 fman Summary Test Result Matrix report doesn't display the correct notes from last execution => Test Result Matrix report doesn't display the correct notes from latest execution
2018-06-16 18:28 fman Summary Test Result Matrix report doesn't display the correct notes from latest execution => Test Result Matrix report - latest execution notes - when more that one tc exists notes are always the same for all tc
2018-06-16 18:29 fman Note Added: 0027599
2018-06-18 19:51 tjosephine File Added: latest_exec.png
2018-06-18 20:08 tjosephine Note Added: 0027605
2018-06-23 16:42 fman Note Added: 0027632
2018-06-23 16:42 fman Assigned To => fman
2018-06-23 16:42 fman Status new => feedback
2018-06-28 13:48 tjosephine Note Added: 0027648
2018-06-28 13:48 tjosephine Status feedback => assigned
2018-06-29 20:42 fman Status assigned => resolved
2018-06-29 20:42 fman Fixed in Version => 1.9.18 (2018 Q3)
2018-06-29 20:42 fman Resolution open => fixed



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker