chore: add isFrozen function and make the timeout for click a param
This commit is contained in:
parent
c71d11e990
commit
289d3561bd
|
@ -13,5 +13,5 @@ def waitFor(condition, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def isFrozen(timeout_msec):
|
def isFrozen(timeout_sec):
|
||||||
return driver.currentApplicationContext().isFrozen(timeout_msec)
|
return driver.currentApplicationContext().isFrozen(timeout_sec)
|
||||||
|
|
|
@ -100,6 +100,7 @@ class QObject:
|
||||||
x: int = None,
|
x: int = None,
|
||||||
y: int = None,
|
y: int = None,
|
||||||
button=None,
|
button=None,
|
||||||
|
timeout=1,
|
||||||
):
|
):
|
||||||
driver.mouseClick(
|
driver.mouseClick(
|
||||||
self.object,
|
self.object,
|
||||||
|
@ -108,6 +109,13 @@ class QObject:
|
||||||
button or driver.Qt.LeftButton
|
button or driver.Qt.LeftButton
|
||||||
)
|
)
|
||||||
LOG.info('%s: is clicked with Qt.LeftButton', self)
|
LOG.info('%s: is clicked with Qt.LeftButton', self)
|
||||||
|
LOG.info("Checking if application context is frozen")
|
||||||
|
|
||||||
|
if not isFrozen(timeout):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
LOG.info("Application context did not respond after click")
|
||||||
|
raise Exception(f'Application UI is not responding within {timeout} second(s)')
|
||||||
|
|
||||||
@allure.step('Native click {0}')
|
@allure.step('Native click {0}')
|
||||||
def native_mouse_click(
|
def native_mouse_click(
|
||||||
|
|
Loading…
Reference in New Issue