From 669998aaae7622734c6dc36d506fdc84378c64cd Mon Sep 17 00:00:00 2001 From: nuwang <2070605+nuwang@users.noreply.github.com> Date: Wed, 25 Sep 2024 10:13:01 +0530 Subject: [PATCH] More tweaks to waiting --- Dockerfile | 2 +- page_perf_timer.py | 23 +++++------------------ 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 404d17c..996adfc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y \ xvfb \ && rm -rf /var/lib/apt/lists/* -RUN pip3 install --no-cache-dir selenium +RUN pip3 install --no-cache-dir selenium requests FROM selenium diff --git a/page_perf_timer.py b/page_perf_timer.py index 4d48bb1..262e0c3 100644 --- a/page_perf_timer.py +++ b/page_perf_timer.py @@ -325,7 +325,7 @@ def import_published_history(self): @clock_action("workflow_list_page_load") def load_workflow_list(self): # Request workflows list page - self.driver.get(f"{self.server}workflows/list_shared_with_me") + self.driver.get(f"{self.server}workflows/list_published") # Wait for workflow page to load and import button to appear self.wait.until( expected_conditions.presence_of_element_located( @@ -413,25 +413,12 @@ def run_workflow(self): self.driver.find_element(By.ID, "run-workflow").click() # wait for the running message to appear - self.wait.until( - expected_conditions.presence_of_element_located( - ( - By.XPATH, - f"//div[@id='center']//div[@role='tabpanel']//div[@role='alert']//span[@data-description='loading message' and contains(., 'Waiting to complete invocation')]", - ) - ) - ) + loading_xpath = "//div[@id='center']//div[@role='tabpanel']//div[@role='alert']//span[@data-description='loading message' and contains(., 'Waiting to complete invocation')]" + self.wait.until(expected_conditions.presence_of_element_located((By.XPATH, loading_xpath))) # Wait for running message to disappear - with SeleniumCustomWait(self.driver, workflow_wait): - self.wait.until( - expected_conditions.invisibility_of_element_located( - ( - By.XPATH, - f"//div[@id='center']//div[@role='tabpanel']//div[@role='alert']//span[@data-description='loading message' and contains(., 'Waiting to complete invocation')]", - ) - ) - ) + custom_wait = WebDriverWait(self.driver, workflow_wait) + custom_wait.until(expected_conditions.invisibility_of_element_located((By.XPATH, loading_xpath))) def run_test_sequence(self): self.load_galaxy_login()