format codebase

This commit is contained in:
Michael McGuinness
2024-09-30 12:21:29 +01:00
parent 788503595d
commit 037909db74
110 changed files with 7959 additions and 4631 deletions
@@ -1,19 +1,29 @@
from selenium.webdriver.common.by import By
from utils.element_related_methods import get_clickable_element, get_invisible_element, get_element
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'
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']"
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)
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)
@@ -25,7 +35,9 @@ class Interface_0_elements:
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)
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)
@@ -1,22 +1,30 @@
from selenium.webdriver.common.by import By
from utils.element_related_methods import get_clickable_element, get_invisible_element, get_element
from utils.element_related_methods import (
get_clickable_element,
get_invisible_element,
get_element,
)
class Interface_1_elements:
client_name_dropdown_xpath = '//div[@data-testid="stSelectbox"]'
client_list_xpath = '//li'
client_list_xpath = "//li"
batch_id_xpath = '(//div[@data-testid="stSelectbox"])[2]'
batch_id_list_xpath = '//li'
batch_id_list_xpath = "//li"
checkbox_list_xpath = "//div[@data-testid='stCheckbox']"
read_the_contracts_from_path_btn_xpath = "//button[.//p[text()='Read the contracts from Path']]"
read_the_contracts_from_path_btn_xpath = (
"//button[.//p[text()='Read the contracts from Path']]"
)
result_table_xpath = "//table[@aria-colcount='9']"
table_rows_xpath = ".//tbody/tr"
run_doczy_ai_pipeline_btn_xpath = "//button[.//p[text()='Run Doczy.AI Pipeline']]"
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)
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)
@@ -31,7 +39,9 @@ class Interface_1_elements:
return driver.find_elements(By.XPATH, self.checkbox_list_xpath)
def get_read_the_contracts_from_path_btn(self, driver, config):
return get_clickable_element(driver, config, By.XPATH, self.read_the_contracts_from_path_btn_xpath)
return get_clickable_element(
driver, config, By.XPATH, self.read_the_contracts_from_path_btn_xpath
)
def get_result_table(self, driver, config):
return get_element(driver, config, By.XPATH, self.result_table_xpath)
@@ -40,7 +50,9 @@ class Interface_1_elements:
return result_table.find_elements(By.XPATH, self.table_rows_xpath)
def get_run_doczy_ai_pipeline_btn(self, driver, config):
return get_clickable_element(driver, config, By.XPATH, self.run_doczy_ai_pipeline_btn_xpath)
return get_clickable_element(
driver, config, By.XPATH, self.run_doczy_ai_pipeline_btn_xpath
)
def get_error(self, driver, config):
return get_element(driver, config, By.XPATH, self.error_xpath)
@@ -1,17 +1,21 @@
from selenium.webdriver.common.by import By
from utils.element_related_methods import get_clickable_element, get_invisible_element, get_element
from utils.element_related_methods import (
get_clickable_element,
get_invisible_element,
get_element,
)
class Interface_2_elements:
client_name_dropdown_xpath = '//div[@data-testid="stSelectbox"]'
client_list_xpath = '//li'
client_list_xpath = "//li"
batch_id_xpath = '(//div[@data-testid="stSelectbox"])[2]'
batch_id_list_xpath = '//li'
batch_id_list_xpath = "//li"
contract_name_xpath = '(//div[@data-testid="stSelectbox"])[3]'
contract_name_list_xpath = '//li'
contract_name_list_xpath = "//li"
field_group_xpath = '(//div[@data-testid="stSelectbox"])[4]'
field_group_list_xpath = '//li'
field_group_list_xpath = "//li"
show_result_btn_xpath = "//button[.//p[text()='Show Results']]"
result_table_xpath = "//table[@aria-colcount='9']"
table_rows_xpath = ".//tbody/tr"
@@ -19,7 +23,9 @@ class Interface_2_elements:
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)
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)
@@ -43,7 +49,9 @@ class Interface_2_elements:
return driver.find_elements(By.XPATH, self.field_group_list_xpath)
def get_show_result_btn(self, driver, config):
return get_clickable_element(driver, config, By.XPATH, self.show_result_btn_xpath)
return get_clickable_element(
driver, config, By.XPATH, self.show_result_btn_xpath
)
def get_result_table(self, driver, config):
return get_element(driver, config, By.XPATH, self.result_table_xpath)
@@ -52,7 +60,9 @@ class Interface_2_elements:
return result_table.find_elements(By.XPATH, self.table_rows_xpath)
def get_kickoff_database_btn(self, driver, config):
return get_clickable_element(driver, config, By.XPATH, self.kickoff_database_btn_xpath)
return get_clickable_element(
driver, config, By.XPATH, self.kickoff_database_btn_xpath
)
def get_error_toast(self, driver, config):
return get_element(driver, config, By.XPATH, self.error_xpath)