diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-05-25 23:56:43 +0200 |
---|---|---|
committer | Xisco Faulí <xiscofauli@libreoffice.org> | 2020-05-26 15:06:55 +0200 |
commit | a38a97ff07a4d088bad18a08012973a3344301be (patch) | |
tree | d58d1384379391a2798a1312f91467d8c61a5d94 | |
parent | 751d543d5a5f08b6870a9730448c013d0baac92d (diff) |
uitest: replace sleep with processEventsToIdle
Change-Id: I48798e98718cae11b9ef7902cb48fe2d8ab9c2b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94812
Tested-by: Jenkins
Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/uitest/writer_tests4/tdf113284.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sw/qa/uitest/writer_tests4/tdf113284.py b/sw/qa/uitest/writer_tests4/tdf113284.py index 83494b2a79b1..4a4750b00349 100644 --- a/sw/qa/uitest/writer_tests4/tdf113284.py +++ b/sw/qa/uitest/writer_tests4/tdf113284.py @@ -8,8 +8,6 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.common import get_state_as_dict import org.libreoffice.unotest import pathlib -import time -from uitest.debug import sleep def get_url_for_data_file(file_name): return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() @@ -22,7 +20,9 @@ class tdf113284(UITestCase): xWriterDoc = self.xUITest.getTopFocusWindow() xWriterEdit = xWriterDoc.getChild("writer_edit") - sleep(2) #we need this sleep,because without this is pagecount counted without index. Load index takes time probably. + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + xToolkit.processEventsToIdle() + xPageCount = document.CurrentController.PageCount self.ui_test.execute_dialog_through_command(".uno:GotoPage") xDialog = self.xUITest.getTopFocusWindow() @@ -30,7 +30,7 @@ class tdf113284(UITestCase): xPageText.executeAction("TYPE", mkPropertyValues({"TEXT":str(xPageCount)})) # goto last page xOkBtn = xDialog.getChild("ok") self.ui_test.close_dialog_through_button(xOkBtn) - xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + xToolkit.processEventsToIdle() self.assertEqual(get_state_as_dict(xWriterEdit)["CurrentPage"], str(xPageCount)) |