-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for timeouts for attach applications
Fixes #149
- Loading branch information
Jani Mikkonen
committed
Aug 12, 2019
1 parent
0a66dc6
commit 7cb9c49
Showing
7 changed files
with
88 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
pushd %~dp0 | ||
ping 127.0.0.1 -n 6 | ||
start /B bin\Debug\UIAutomationTest.exe | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import time | ||
from robot.utils import timestr_to_secs | ||
|
||
|
||
class Wait: | ||
@staticmethod | ||
def until_true(condition, timeout, error_msg): | ||
"""Helper to wait until given condition is met.""" | ||
timeout = timestr_to_secs(timeout) | ||
max_wait = time.time() + timeout | ||
while True: | ||
if condition(): | ||
break | ||
if time.time() > max_wait: | ||
raise AssertionError(error_msg) | ||
time.sleep(0.1) |