status-desktop/test/e2e/driver/squish_api.py

13 lines
316 B
Python
Raw Normal View History

import time
import configs.timeouts
def waitFor(condition, timeout_msec: int = configs.timeouts.UI_LOAD_TIMEOUT_MSEC) -> bool:
started_at = time.monotonic()
while not condition():
time.sleep(1)
if time.monotonic() - started_at > timeout_msec/1000:
return False
return True