sc/qa/uitest/calc_tests9/tdf57841.py | 2 +- uitest/uitest/test.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
New commits: commit 39605d175bc0fe52c904d4b41a184d7e2691f2dc Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Jun 23 16:11:27 2021 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed Jun 23 23:16:11 2021 +0200 Introduce wait_for_top_focus_window to fix UITest_calc_tests9 ...which I had seen hang at least once, and after a manual `kill -9` of the hung soffice.bin process (still yielding in UI loop from within executing a dialog), it failed with > ====================================================================== > ERROR: test_tdf57841 (tdf57841.Tdf57841) > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "sc/qa/uitest/calc_tests9/tdf57841.py", line 27, in test_tdf57841 > self.assertEqual('true', get_state_as_dict(xDialog.getChild("tab"))['Selected']) > uno.com.sun.star.uno.RuntimeException: Could not find child with id: tab vcl/source/uitest/uiobject.cxx:467 (The subtle difference in naming is that wait_for_top_focus_window waits indefinitely, while its sister wait_until_* functions (like wait_until_child_is_available) can time out. There is no good reason here to allow for timing out.) Change-Id: I3e4dc68871f42d64160d8e411fe9a661bbaec192 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117739 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/sc/qa/uitest/calc_tests9/tdf57841.py b/sc/qa/uitest/calc_tests9/tdf57841.py index 0eb2d260b699..995fab2647de 100644 --- a/sc/qa/uitest/calc_tests9/tdf57841.py +++ b/sc/qa/uitest/calc_tests9/tdf57841.py @@ -23,7 +23,7 @@ class Tdf57841(UITestCase): xOpenBtn = xOpenDialog.getChild("open") xOpenBtn.executeAction("CLICK", tuple()) - xDialog = self.xUITest.getTopFocusWindow() + xDialog = self.ui_test.wait_for_top_focus_window('TextImportCsvDialog') self.assertEqual('true', get_state_as_dict(xDialog.getChild("tab"))['Selected']) self.assertEqual('true', get_state_as_dict(xDialog.getChild("comma"))['Selected']) self.assertEqual('true', get_state_as_dict(xDialog.getChild("semicolon"))['Selected']) diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py index 723878a34e3c..29af1e0899c2 100644 --- a/uitest/uitest/test.py +++ b/uitest/uitest/test.py @@ -49,6 +49,13 @@ class UITest(object): if component is not None: return component + def wait_for_top_focus_window(self, id): + while True: + win = self._xUITest.getTopFocusWindow() + if get_state_as_dict(win)['ID'] == id: + return win + time.sleep(DEFAULT_SLEEP) + def wait_until_child_is_available(self, childName): time_ = 0 xChild = None _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits