summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-04-21 12:55:06 +0200
committerXisco FaulĂ­ <xiscofauli@libreoffice.org>2020-04-21 15:07:00 +0200
commitb98eec284718e91d85cb0f4003e1fac7869e2185 (patch)
tree46a047dee1eda89db207aacc845c4dd4febcc340 /uitest
parenta83f77a11b36d5dcdebec08f37df889191143c84 (diff)
uitest: use while loop instead of time.sleep
Execution times goes from 3.807 to 2.718 for me Change-Id: I9c93417d2678c64a8d9a90b0a18b4d1210c8fdd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92624 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r--uitest/writer_tests8/customizeDialog.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/uitest/writer_tests8/customizeDialog.py b/uitest/writer_tests8/customizeDialog.py
index fa187c36ac35..92fddfdff3b4 100644
--- a/uitest/writer_tests8/customizeDialog.py
+++ b/uitest/writer_tests8/customizeDialog.py
@@ -10,7 +10,6 @@ from uitest.framework import UITestCase
from libreoffice.uno.propertyvalue import mkPropertyValues
from uitest.uihelper.common import get_state_as_dict
from uitest.uihelper.common import select_pos
-from uitest.debug import sleep
class ConfigureDialog(UITestCase):
@@ -39,17 +38,25 @@ class ConfigureDialog(UITestCase):
xSearch.executeAction("SET", mkPropertyValues({"TEXT":"format"}))
# Wait for the search/filter op to be completed
- time.sleep(1)
+ timeout = time.time() + 1
+ while time.time() < timeout:
+ filteredEntryCount = get_state_as_dict(xfunc)["Children"]
+ if filteredEntryCount != initialEntryCount:
+ break
+ time.sleep(0.1)
- filteredEntryCount = get_state_as_dict(xfunc)["Children"]
self.assertTrue(filteredEntryCount < initialEntryCount)
xSearch.executeAction("CLEAR", tuple())
# Wait for the search/filter op to be completed
- time.sleep(1)
+ timeout = time.time() + 1
+ while time.time() < timeout:
+ finalEntryCount = get_state_as_dict(xfunc)["Children"]
+ if finalEntryCount != filteredEntryCount:
+ break
+ time.sleep(0.1)
- finalEntryCount = get_state_as_dict(xfunc)["Children"]
self.assertEqual(initialEntryCount, finalEntryCount)