From af1338aa3c99e8d692c893b18d8aab914351c189 Mon Sep 17 00:00:00 2001 From: Pawel Szkamruk Date: Wed, 29 Nov 2023 16:45:30 +0100 Subject: [PATCH] changes after review part - 4 --- ui_tests/pages/groups_page.py | 3 ++- ui_tests/pages/header_page.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ui_tests/pages/groups_page.py b/ui_tests/pages/groups_page.py index 91a727698..334bba80e 100644 --- a/ui_tests/pages/groups_page.py +++ b/ui_tests/pages/groups_page.py @@ -42,7 +42,8 @@ def click_submit_button_for_add_group(self): ) add_grp_btn = driver.find_element(By.XPATH, add_group_button_xpath) add_grp_btn.click() - time.sleep(5) # wait for group to be shown on the list + # wait for group to be shown on the list + time.sleep(5) def click_submit_button_for_add_device(self): self.click_submit_button_for_add_group() diff --git a/ui_tests/pages/header_page.py b/ui_tests/pages/header_page.py index 428d29e5f..352d998e3 100644 --- a/ui_tests/pages/header_page.py +++ b/ui_tests/pages/header_page.py @@ -1,5 +1,7 @@ import re import time +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC from logger.logger import Logger from selenium.webdriver.common.by import By @@ -29,7 +31,12 @@ def _switch_to_page(self, page_name): xpath_button = page_button_xpath[page_name] tab = driver.find_element(By.XPATH, xpath_button) tab.click() - time.sleep(3) + page_table_xpath = { + "profiles": "//div[@data-test='sc4snmp:profiles-table']", + "groups": "//div[@data-test='sc4snmp:group-table']", + "inventory": "//div[@data-test='sc4snmp:inventory-table']" + } + WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, page_table_xpath[page_name]))) def apply_changes(self): logger.info("Apply changes")