Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR closes #1165 which reports a flicking in the Treeview when executing tests.
As mentioned in the issue description this bug is caused by the 'Show duration' implementation. This implementation updates a tree node name by adding the test duration as a suffix right away whenever a test finished.
I propose to solve this issue by doing one step back: instead of updating the tree node names on TestFinished event, we'll update them on the TestRunFinished event. That means that the TreeView update is triggered only once - which will solve the flickering.
Obviously this is one step back for the user as he cannot observe the test duration anymore during a test run, but needs to wait until the test run finish. Especially for long running test runs (for which test duration is most helpful), that's not the best solution.
However I didn't find any simple solution, which takes care about all use cases. And unfortunately WindowsForms TreeView triggers a TreeView refresh whenever a TreeNode name is changed.
So overall I want to fix this flickering effect first, which is annoying and hits all users regardless if 'Show duration' is activated or not.
Additional note:
If test run was executed previously and afterwards show test duration is activated, the test duration will be shown immediately - this is kept unchanged.
Some further ideas:
We can introduce additional columns next to the tree view. One of these columns will show the 'Test duration'. So instead of updating the tree node names, we need to update the column cells. I hope that updating cells won't cause a flickering effect as well. But overall, it must be evaluated first, if such columns are beneficial at all and for which other information they can be used (for example categories)?
And it's worth to mention that WindowsForms doesn't support a 'TreeView with additional columns' out-of-the-box. But there are several examples in the web which might be helpful.