sw/qa/uitest/writer_tests3/customizeDialog.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
New commits: commit 8e13914e3dd37ea3a6996596cc323cddd5fa151e Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Jul 14 10:45:58 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jul 14 16:11:11 2025 +0200 sw: fix UItest * get_state_as_dict returns a string. cast it to int where needed * drop timeout and use while True. Timeout can be reached with slower machines * use self.ui_test.get_default_sleep() Change-Id: I7ef46ec09461ce6918bd869a697240ca2812c9e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187850 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/qa/uitest/writer_tests3/customizeDialog.py b/sw/qa/uitest/writer_tests3/customizeDialog.py index c7b1a68e8123..85896bfe5340 100644 --- a/sw/qa/uitest/writer_tests3/customizeDialog.py +++ b/sw/qa/uitest/writer_tests3/customizeDialog.py @@ -23,30 +23,28 @@ class ConfigureDialog(UITestCase): xfunc = xDialog.getChild("functions") xSearch = xDialog.getChild("searchEntry") - initialEntryCount = get_state_as_dict(xfunc)["Children"] + initialEntryCount = int(get_state_as_dict(xfunc)["Children"]) self.assertTrue(initialEntryCount != 0) xSearch.executeAction("TYPE", mkPropertyValues({"TEXT":"format"})) # Wait for the search/filter op to be completed - timeout = time.time() + 1 - while time.time() < timeout: - filteredEntryCount = get_state_as_dict(xfunc)["Children"] + while True: + filteredEntryCount = int(get_state_as_dict(xfunc)["Children"]) if filteredEntryCount != initialEntryCount: break - time.sleep(0.1) + time.sleep(self.ui_test.get_default_sleep()) self.assertTrue(filteredEntryCount < initialEntryCount) xSearch.executeAction("CLEAR", tuple()) # Wait for the search/filter op to be completed - timeout = time.time() + 1 - while time.time() < timeout: - finalEntryCount = get_state_as_dict(xfunc)["Children"] + while True: + finalEntryCount = int(get_state_as_dict(xfunc)["Children"]) if finalEntryCount != filteredEntryCount: break - time.sleep(0.1) + time.sleep(self.ui_test.get_default_sleep()) self.assertEqual(initialEntryCount, finalEntryCount) @@ -57,15 +55,15 @@ class ConfigureDialog(UITestCase): xFunc = xDialog.getChild("functions") xCategory = xDialog.getChild("commandcategorylist") - initialEntryCount = get_state_as_dict(xFunc)["Children"] + initialEntryCount = int(get_state_as_dict(xFunc)["Children"]) self.assertTrue(initialEntryCount != 0) select_pos(xCategory, "1") - filteredEntryCount = get_state_as_dict(xFunc)["Children"] + filteredEntryCount = int(get_state_as_dict(xFunc)["Children"]) self.assertTrue(filteredEntryCount < initialEntryCount) select_pos(xCategory, "0") - finalEntryCount = get_state_as_dict(xFunc)["Children"] + finalEntryCount = int(get_state_as_dict(xFunc)["Children"]) self.assertEqual(initialEntryCount, finalEntryCount) def test_tdf133862(self):