TestCentric / testcentric-gui

TestCentric GUI Runner for NUnit
Other
66 stars 31 forks source link

Test result icon in tree is not applied for group nodes #1118

Open rowo360 opened 3 hours ago

rowo360 commented 3 hours ago

Describe the bug When I run a test, the test results are displayed in the TreeNode with a matching icon. This applies for all test nodes except group nodes.

Here are some screenshots:

  1. 'Fixture list' view and group by 'Category' => run all tests

=> All category nodes keep their 'initial' state.

  1. 'Fixture list' view and group by 'Category' => run only one single test case 'TestB'

=> State of test fixture 'Feature1Tests' is updated; but Category node not

  1. 'Test list' view and group by 'Outcome' => run tests of group 'Failed'

=> 'Failed' node is not getting updated

Expected behavior I expect that the test result state is applied to all kind of tree node. Even if only a subset of the tests is executed, its test results should be passed upwards. Just as I know it from the NUnitTreeDisplay format.

Environment (please complete the following information):

rowo360 commented 3 hours ago

I believe that the current system behavior can be explained by looking at the XML structure. Whenever the execution of a test case is completed, we receive an event and perform actions to update the icon.

That's fine, however group nodes (like categories) are not represented in this XML structure, so we'll receive no events for them. This means that we have to determine the correct test result for groups ourselves and then set the icon.

Good news: I think that exactly this behavior is already implemented in the code base. But unfortunately it's not invoked anymore. This code is located here: CategoryGrouping.OnTestFinished()

So my idea is to simply reactivate this code. If that works, then I can check why this is actually implemented in the CategoryGrouping class and how the two DuractionGrouping and OutcomeGrouping behave.

CharliePoole commented 2 hours ago

Cool! Of course, it may be disabled because it caused some problem or it may be unfinished work, but let's find out.