diff --git a/garage.nix b/garage.nix index 944c7f92..bd2c38ed 100644 --- a/garage.nix +++ b/garage.nix @@ -173,7 +173,7 @@ in { script = '' set -xeuo pipefail # give garage time to start up - sleep 60 + sleep 10 # XXX: this is very sensitive to being a single instance # (doing the bare minimum to get garage up and running) diff --git a/tests/pixelfed-garage.nix b/tests/pixelfed-garage.nix index d562390a..e3f72f2f 100644 --- a/tests/pixelfed-garage.nix +++ b/tests/pixelfed-garage.nix @@ -8,6 +8,7 @@ let } '' import sys import os + import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait @@ -42,14 +43,22 @@ let driver.find_element(By.ID, "password").send_keys(password) # FIXME: This is disgusting. Find instead the input type submit in the form # with action ending in "/login". + time.sleep(1) print("Click “Login” button...") driver.find_element(By.XPATH, "//button[normalize-space()='Login']").click() + time.sleep(3) + # Find the new post form, fill it in with our pictureand a caption. print("Click on “Create New Post”...") driver.find_element(By.LINK_TEXT, "Create New Post").click() print("Add file to input element...") - driver.find_element(By.XPATH, "//input[@type='file']").send_keys(green_path) + driver.find_element(By.XPATH, "//input[@type='file']").send_keys(media_path) + print("Add a caption") + driver.find_element(By.CSS_SELECTOR, ".media-body textarea").send_keys( + "Fediversity test of image upload to pixelfed with garage storage." + ) + time.sleep(3) print("Click on “Post” button...") driver.find_element(By.LINK_TEXT, "Post").click() @@ -64,6 +73,7 @@ let ), ) ) + time.sleep(3) print("Take screenshot...") if not driver.save_screenshot(screenshot_path): raise Exception("selenium could not save screenshot")