Skip to content

Commit

Permalink
feat: add timeout for start of SUT
Browse files Browse the repository at this point in the history
Add possibility to define timeout for SUT in ini file.
  • Loading branch information
Joona Oikarinen committed Jan 4, 2022
1 parent 2c7106f commit c296d90
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions change_analyzer/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import configparser
import uuid
from configparser import ConfigParser
from datetime import datetime
import argparse

Expand All @@ -14,7 +14,7 @@
from change_analyzer.wrappers.sequence_recorder import SequenceRecorder


CONFIG = ConfigParser()
CONFIG = configparser.ConfigParser()


def reset() -> WebDriver:
Expand All @@ -26,6 +26,12 @@ def reset() -> WebDriver:
"deviceName": "WindowsPC",
}
driver = webdriver.Remote(CONFIG["driver"]["command_executor"], capabilities)
try:
timeout = CONFIG.get("driver", "timeout")
print(f"{timeout} second timeout defined.")
driver.implicitly_wait(timeout)
except configparser.NoOptionError:
print("No timeout defined.")

if CONFIG["driver"]["platform"] == "web":
web_options = webdriver.ChromeOptions()
Expand Down

0 comments on commit c296d90

Please sign in to comment.