summaryrefslogtreecommitdiff
path: root/uitest
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-06-13 05:17:12 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-06-13 10:04:28 +0200
commit144edb88d29d397604010734f2d6c2e9d7626d1c (patch)
tree1132d2d085d388898e2fe4b7cb98dd7a11b71411 /uitest
parentbbfe78c4bfb8e7d0e53c171ed9616a8f32240358 (diff)
uitest: extract the wait time for the dialogs
Change-Id: Ieb82b643de58523cef30f88363276874b6169021
Diffstat (limited to 'uitest')
-rw-r--r--uitest/uitest/config.py2
-rw-r--r--uitest/uitest/test.py17
2 files changed, 11 insertions, 8 deletions
diff --git a/uitest/uitest/config.py b/uitest/uitest/config.py
index 890d88475b94..4ba4146a15a8 100644
--- a/uitest/uitest/config.py
+++ b/uitest/uitest/config.py
@@ -9,4 +9,6 @@ use_sleep = False
DEFAULT_SLEEP = 0.1
+MAX_WAIT = 30
+
# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/uitest/uitest/test.py b/uitest/uitest/test.py
index e17149251c03..04168c48ae2a 100644
--- a/uitest/uitest/test.py
+++ b/uitest/uitest/test.py
@@ -8,6 +8,7 @@
import time
import threading
from uitest.config import DEFAULT_SLEEP
+from uitest.config import MAX_WAIT
from uitest.uihelper.common import get_state_as_dict
from com.sun.star.uno import RuntimeException
@@ -57,7 +58,7 @@ class UITest(object):
with EventListener(self._xContext, "OnLoad") as event:
component = desktop.loadComponentFromURL(url, "_default", 0, tuple())
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.executed:
frames = self.get_frames()
if len(frames) == 1:
@@ -71,7 +72,7 @@ class UITest(object):
with EventListener(self._xContext, "DialogExecute") as event:
self._xUITest.executeDialog(command)
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.executed:
time.sleep(DEFAULT_SLEEP)
return
@@ -84,7 +85,7 @@ class UITest(object):
with EventListener(self._xContext, "ModelessDialogVisible") as event:
self._xUITest.executeCommand(command)
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.executed:
time.sleep(DEFAULT_SLEEP)
return
@@ -100,7 +101,7 @@ class UITest(object):
with EventListener(self._xContext, event_name) as event:
ui_object.executeAction(action, parameters)
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.executed:
time.sleep(DEFAULT_SLEEP)
return
@@ -132,7 +133,7 @@ class UITest(object):
with EventListener(self._xContext, "OnNew") as event:
xBtn.executeAction("CLICK", tuple())
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.executed:
frames = self.get_frames()
self.get_desktop().setActiveFrame(frames[0])
@@ -149,7 +150,7 @@ class UITest(object):
with EventListener(self._xContext, "DialogClosed" ) as event:
button.executeAction("CLICK", tuple())
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.executed:
time.sleep(DEFAULT_SLEEP)
return
@@ -161,7 +162,7 @@ class UITest(object):
with EventListener(self._xContext, ["DialogExecute", "OnViewClosed"] ) as event:
self._xUITest.executeDialog(".uno:CloseDoc")
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.hasExecuted("DialogExecute"):
xCloseDlg = self._xUITest.getTopFocusWindow()
xNoBtn = xCloseDlg.getChild("discard")
@@ -178,7 +179,7 @@ class UITest(object):
with EventListener(self._xContext, ["DialogExecute", "ModelessDialogExecute"]) as event:
thread.start()
time_ = 0
- while time_ < 30:
+ while time_ < MAX_WAIT:
if event.executed:
xDlg = self._xUITest.getTopFocusWindow()
xUIElement = xDlg.getChild(dialog_element)