chore: isFrozen verification added to method click
This commit is contained in:
parent
aba501f025
commit
7482a8f8d9
|
@ -1,12 +1,17 @@
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import configs.timeouts
|
import configs.timeouts
|
||||||
|
import driver
|
||||||
|
|
||||||
|
|
||||||
def waitFor(condition, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC) -> bool:
|
def waitFor(condition, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC) -> bool:
|
||||||
started_at = time.monotonic()
|
started_at = time.monotonic()
|
||||||
while not condition():
|
while not condition():
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if time.monotonic() - started_at > timeout_msec/1000:
|
if time.monotonic() - started_at > timeout_msec / 1000:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def isFrozen(timeout_msec):
|
||||||
|
return driver.currentApplicationContext().isFrozen(timeout_msec)
|
||||||
|
|
|
@ -6,7 +6,7 @@ import allure
|
||||||
|
|
||||||
import configs
|
import configs
|
||||||
import driver
|
import driver
|
||||||
from gui.objects_map import names
|
from driver import isFrozen
|
||||||
from scripts.tools.image import Image
|
from scripts.tools.image import Image
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -92,8 +92,12 @@ class QObject:
|
||||||
self,
|
self,
|
||||||
x: int = None,
|
x: int = None,
|
||||||
y: int = None,
|
y: int = None,
|
||||||
button=None
|
button=None,
|
||||||
):
|
):
|
||||||
|
if isFrozen(500) is False:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
time.sleep(2000)
|
||||||
driver.mouseClick(
|
driver.mouseClick(
|
||||||
self.object,
|
self.object,
|
||||||
x or int(self.object.width * 0.1),
|
x or int(self.object.width * 0.1),
|
||||||
|
|
Loading…
Reference in New Issue