Files
doczyai-pipelines/Doczy.AI_Automation/elements/interface_0_elements.py
T
Michael McGuinness 037909db74 format codebase
2024-09-30 12:21:29 +01:00

47 lines
1.6 KiB
Python

from selenium.webdriver.common.by import By
from utils.element_related_methods import (
get_clickable_element,
get_invisible_element,
get_element,
)
class Interface_0_elements:
client_name_dropdown_xpath = '//div[@data-testid="stSelectbox"]'
client_list_xpath = "//li"
file_input_xpath = "//input[@type='file']"
file_input_progress_xpath = (
'//div[@role="progressbar"]' #'//div[@class="stFileUploaderFileName"]'
)
create_batch_btn_xpath = (
"//div[@data-testid='stButton']/button[@data-testid='baseButton-secondary']"
)
p_element_xpath = "//div[@data-testid='stCodeBlock']/pre/div/code/span"
error_xpath = "//div[@data-testid='stNotificationContentError']/div/div/p"
def get_client_name_dropdown(self, driver, config):
return get_clickable_element(
driver, config, By.XPATH, self.client_name_dropdown_xpath
)
def get_client_list(self, driver):
return driver.find_elements(By.XPATH, self.client_list_xpath)
def get_file_input(self, driver, config):
return get_invisible_element(driver, config, By.XPATH, self.file_input_xpath)
def get_file_input_progress(self, driver):
return driver.find_elements(By.XPATH, self.file_input_progress_xpath)
def get_create_batch_btn(self, driver, config):
return get_clickable_element(
driver, config, By.XPATH, self.create_batch_btn_xpath
)
def get_p_element(self, driver, config):
return get_element(driver, config, By.XPATH, self.p_element_xpath)
def get_error_toast(self, driver, config):
return get_element(driver, config, By.XPATH, self.error_xpath)