From 53b65629d71f6f42133702d2971854735902fcaf Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Wed, 16 Oct 2024 13:17:52 +0200 Subject: [PATCH] Syntactic fixes --- energy-tests/helpers/helper_functions.py | 6 ++++-- energy-tests/nextcloud_install.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/energy-tests/helpers/helper_functions.py b/energy-tests/helpers/helper_functions.py index 13607e87..0bcdc64e 100644 --- a/energy-tests/helpers/helper_functions.py +++ b/energy-tests/helpers/helper_functions.py @@ -1,9 +1,11 @@ +import contextlib import random +import string from time import time_ns, sleep from playwright.sync_api import TimeoutError -def login(page, username='Crash', password='Override'): +def login_nextcloud(page, username='Crash', password='Override'): page.goto("http://nc/login") page.locator('#user').fill(username) page.locator('#password').fill(password) @@ -23,7 +25,7 @@ def log_note(message: str) -> None: def close_modal(page) -> None: with contextlib.suppress(TimeoutError): sleep(5) # Sleep to make sure the modal has time to appear before continuing navigation - page.locator('#firstrunwizard .modal-container__content button[aria-label=Close]', timeout=15_000).click() + page.locator('#firstrunwizard .modal-container__content button[aria-label=Close]').click(timeout=15_000) def timeout_handler(signum, frame): diff --git a/energy-tests/nextcloud_install.py b/energy-tests/nextcloud_install.py index d8eece9e..08792802 100644 --- a/energy-tests/nextcloud_install.py +++ b/energy-tests/nextcloud_install.py @@ -34,7 +34,7 @@ def main(browser_name: str = "chromium"): page.locator(install_selector).click() # 3. Dashboard - page.locator('.app-dashboard', timeout=240_000) + page.locator('.app-dashboard').wait_for(timeout=240_000) log_note("Installation complete") browser.close()