From 4178822ee2206133c0ce69685c8adacc70662e98 Mon Sep 17 00:00:00 2001 From: Taeer Bar-Yam Date: Mon, 9 Sep 2024 10:13:13 -0400 Subject: [PATCH] nicer timing for video --- garage.nix | 2 +- tests/pixelfed-garage.nix | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/garage.nix b/garage.nix index 944c7f9..bd2c38e 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 d562390..e3f72f2 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")