Skip to content
This repository was archived by the owner on Aug 13, 2024. It is now read-only.

Commit 07acade

Browse files
committed
chore: isFrozen verification added to method click
1 parent 49d6d75 commit 07acade

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

driver/squish_api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import time
22

33
import configs.timeouts
4+
import driver
45

56

67
def waitFor(condition, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC) -> bool:
78
started_at = time.monotonic()
89
while not condition():
910
time.sleep(1)
10-
if time.monotonic() - started_at > timeout_msec/1000:
11+
if time.monotonic() - started_at > timeout_msec / 1000:
1112
return False
1213
return True
14+
15+
16+
def isFrozen(timeout_msec):
17+
return driver.currentApplicationContext().isFrozen(timeout_msec)

gui/elements/object.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import configs
88
import driver
9-
from gui.objects_map import names
9+
from driver import isFrozen
1010
from scripts.tools.image import Image
1111

1212
LOG = logging.getLogger(__name__)
@@ -92,8 +92,12 @@ def click(
9292
self,
9393
x: int = None,
9494
y: int = None,
95-
button=None
95+
button=None,
9696
):
97+
if isFrozen(500) is False:
98+
pass
99+
else:
100+
time.sleep(2000)
97101
driver.mouseClick(
98102
self.object,
99103
x or int(self.object.width * 0.1),

0 commit comments

Comments
 (0)