Skip to content

Commit fdeaf91

Browse files
fzuellichyanne
authored andcommitted
Fixing bug #1529 "Using '(De)select all tests' option will expand all nodes" by simply remembering the state of the element when it is walked over and restore it in the end.
1 parent ff3be4e commit fdeaf91

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/robotide/ui/tree.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,14 +639,21 @@ def _for_all_tests(self, item, func):
639639
if not self.HasAGWFlag(customtreectrl.TR_HIDE_ROOT) or item != self.GetRootItem():
640640
if isinstance(item.GetData(), ResourceRootHandler or ResourceFileHandler):
641641
return
642-
self.Expand(item)
642+
643+
is_item_expanded = self.IsExpanded(item)
644+
if is_item_expanded is False:
645+
self.Expand(item)
643646
if self._is_test_node(item):
644647
func(item)
645648
if not self.IsExpanded(item):
646649
return
650+
647651
for child in item.GetChildren():
648652
self._for_all_tests(child, func)
649653

654+
if is_item_expanded is False:
655+
self.Collapse(item)
656+
650657
def _for_all_drawn_tests(self, item, func):
651658
if self._is_test_node(item):
652659
func(item)

0 commit comments

Comments
 (0)