From 5449c5bbdcc2dce5fa92c3afffe41081381f5550 Mon Sep 17 00:00:00 2001 From: Drew Thomasson <126999465+DrewThomasson@users.noreply.github.com> Date: Sun, 16 Feb 2025 08:40:23 -0500 Subject: [PATCH] Create start_conversion_button_test.py --- tools/testing/start_conversion_button_test.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tools/testing/start_conversion_button_test.py diff --git a/tools/testing/start_conversion_button_test.py b/tools/testing/start_conversion_button_test.py new file mode 100644 index 00000000..f9e025fe --- /dev/null +++ b/tools/testing/start_conversion_button_test.py @@ -0,0 +1,26 @@ +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC + +# Start WebDriver +driver = webdriver.Chrome() +driver.get("http://localhost:7860") # Adjust if needed + +try: + # Wait for the button inside #component-31 to be clickable + button = WebDriverWait(driver, 5).until( + EC.element_to_be_clickable((By.CSS_SELECTOR, "#component-31 button[aria-label*='Click to upload']")) + ) + print("✅ Button found and clickable.") + + # Click the button + button.click() + print("✅ Button clicked successfully.") + +except Exception as e: + print(f"❌ Error occurred: {e}") + +finally: + driver.quit() + print("✅ Browser closed.")