summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-05-08 01:07:34 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-06-18 17:02:12 +0200
commit7a8b2e211cf1e0c8facc1458b92bddf52758e17e (patch)
treed16ad538b6333639b6e89a17c821830a62f44441
parent6d1693edfa9bd9ec154b8faf5463511d618d0df4 (diff)
uitest: use a constant instead of repeating the value
Change-Id: I636f3750a6326c7293d5cdeac89b7f9507be2001
-rw-r--r--uitest/uitest_helper.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/uitest/uitest_helper.py b/uitest/uitest_helper.py
index 3c816c08af23..5d5f158566b9 100644
--- a/uitest/uitest_helper.py
+++ b/uitest/uitest_helper.py
@@ -11,6 +11,8 @@ from helper import EventListener
class UITest(object):
+ DEFAULT_SLEEP = 0.1
+
def __init__(self, xUITest, xContext):
self._xUITest = xUITest
self._xContext = xContext
@@ -21,10 +23,10 @@ class UITest(object):
time_ = 0
while time_ < 30:
if event.executed:
- time.sleep(0.1)
+ time.sleep(self.DEFAULT_SLEEP)
return
- time_ += 0.1
- time.sleep(0.1)
+ time_ += self.DEFAULT_SLEEP
+ time.sleep(self.DEFAULT_SLEEP)
# report a failure here
print("failure execute modal dialog")
@@ -35,10 +37,10 @@ class UITest(object):
time_ = 0
while time_ < 30:
if event.executed:
- time.sleep(0.1)
+ time.sleep(self.DEFAULT_SLEEP)
return
- time_ += 0.1
- time.sleep(0.11)
+ time_ += self.DEFAULT_SLEEP
+ time.sleep(self.DEFAULT_SLEEP)
# report a failure here
print("failure execute modeless dialog")
@@ -52,8 +54,8 @@ class UITest(object):
while time_ < 30:
if event.executed:
return
- time_ += 0.1
- time.sleep(0.1)
+ time_ += self.DEFAULT_SLEEP
+ time.sleep(self.DEFAULT_SLEEP)
print("failure doc in start center")
@@ -72,7 +74,7 @@ class UITest(object):
elif event.hasExecuted("OnViewClosed"):
return
- time_ += 0.1
- time.sleep(0.1)
+ time_ += self.DEFAULT_SLEEP
+ time.sleep(self.DEFAULT_SLEEP)
# vim:set shiftwidth=4 softtabstop=4 expandtab: */