Skip to content

Commit

Permalink
More test runner updates
Browse files Browse the repository at this point in the history
  • Loading branch information
stijn-uva committed Apr 19, 2024
1 parent e4f37b7 commit 96b36fd
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@
# profile
shutil.copytree(profile_dir, profile_file, ignore=lambda x, y: ["storage", "extensions", "signedInUser.json"])

with open(args.tests) as infile:
tests = json.load(infile)

selected_tests = [f for f in args.sources.split(",") if f.strip()]
print("Tests found for platforms: {}".format(", ".join(tests.keys())))
if selected_tests:
print(f"Tests to run: {', '.join(selected_tests)}")
else:
print("Running all tests.")

# set up selenium with zeeschuimer loaded
print("Launching Firefox")
options = Options()
Expand Down Expand Up @@ -119,15 +129,6 @@
handles = driver.window_handles

print("Running tests")
with open(args.tests) as infile:
tests = json.load(infile)

selected_tests = args.sources.split(",")
print("Tests found for platforms: {}".format(", ".join(tests.keys())))
if selected_tests:
print(f"Tests to run: {', '.join(selected_tests)}")
else:
print("Running all tests.")

if args.login:
input("Press Enter after you have logged in to the platforms you want to test")
Expand Down Expand Up @@ -180,7 +181,7 @@
try:
captcha_element = driver.find_element(By.CSS_SELECTOR, settings.get("captcha-selector"))
if captcha_element.is_displayed():
print(colored(f"{indent} :: [⚠️] Captcha detected... Press Enter after you have solved the captcha", yellow))
print(colored(f"{indent} :: [⚠️] Captcha detected... Press Enter after you have solved the captcha", "yellow"))
except selenium_exceptions.NoSuchElementException:
pass

Expand Down

0 comments on commit 96b36fd

Please sign in to comment.