Merged in feature/lesser-table-caching-refactor-hybrid (pull request #847)
Feature/lesser table caching refactor hybrid * chore: Remove unused duplicate main.py from shared pipeline * fix: Correct crosswalk paths in aarete_derived.py * chore: Remove unused documentation files from fieldExtraction * docs: Add documentation files to documentation folder * docs: Update README with uv setup, expanded project structure, and branching conventions * docs: Add uv installation steps with Ubuntu/WSL emphasis * Enable prompt caching for all remaining LLM calls - Add _INSTRUCTION() functions for: EXHIBIT_HEADER, EXHIBIT_LINKAGE, EXHIBIT_TITLE_MATCH, DATE_FIX, DERIVED_TERM_DATE, CHECK_PROVIDER_NAME_MATCH, SPECIAL_CASE_ASSIGNMENT - Update all invoke_claude() calls in saas and clover pipelines to use cache=True with corresponding _INSTRUCTION() functions - Add new instructions to get_cacheable_instructions() for cache warming - Update tests for new instruction functions Functions now using caching: - prompt_exhibit_level - prompt_exhibit_lesser (EXHIBIT_LEVEL_LESSER_OF) - prompt_fee_schedule_breakout - prompt_grouper_breakout - prompt_special_case_assignment - prompt_exhibit_linkage - prompt_exhibit_header - prompt_smart_chunked (ONE_TO_ONE templates) - prompt_date_fix - prompt_derived_term_date - prompt_exhibit_title_match - provider_name_match_check 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Reorder * feat: Add bcbs_promise client pipeline with OFFSET_TERM extraction - Add new bcbs_promise client with HSC-based OFFSET_TERM field extraction - Extract full paragraph text of offset/recoupment provisions from contracts - Derive OFFSET_INDICATOR (Y/N) from OFFSET_TERM presence - Fix reorder_columns to preserve extra columns not in COLUMN_ORDER - Update QC/QA output path to outputs/qc_qa/ * fix: Update dev deps and test assertions for QC/QA output path - Add pytest/pytest-mock to dev dependencies for mypy type checking - Update test assertions to expect outputs/qc_qa instead of qa_qc_output * style: Apply black formatting to prompt_templates.py * Merge main, move scripts * Archive some scripts * update py version * remove .py version file * Remove ASCII characters * Restore testbed code * restore tracking * Update testbed metrics * Enable prompt caching for CODE_LAST_CHECK, FILL_BILL_TYPE, DUAL_LOB_CHECK, and GROUPER_BREAKOUT - Add CODE_LAST_CHECK_INSTRUCTION() for service specificity classification - Add FILL_BILL_TYPE_INSTRUCTION() for bill type code determination - Add DUAL_LOB_CHECK_INSTRUCTION() for Medicare/Medicaid classification - Update code_funcs.py to use caching for CODE_LAST_CHECK, FILL_BILL_TYPE, GROUPER_BREAKOUT - Update postprocessing_funcs.py to use caching for DUAL_LOB_CHECK - Add new instructions to get_cacheable_instructions() for cache warming - Add unit tests for new instruction functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix postprocessing_funcs to remove invalid columns * Merge branch 'main' into feature/lesser-table-caching-refactor-hybrid * Revert prompt caching changes from aed1b73c * update formatting * Update imports Approved-by: Sha Brown Approved-by: Praneel Panchigar
This commit is contained in:
@@ -0,0 +1 @@
|
||||
.mypy_cache
|
||||
@@ -0,0 +1 @@
|
||||
3.11.10
|
||||
@@ -0,0 +1 @@
|
||||
# Doczy.AI Automation
|
||||
@@ -0,0 +1,34 @@
|
||||
import boto3
|
||||
from botocore.exceptions import ClientError
|
||||
import snowflake.connector
|
||||
|
||||
|
||||
def get_files(s3_client, path, client_bucket, batch_id):
|
||||
batch_objects = s3_client.list_objects_v2(
|
||||
Bucket=client_bucket, Prefix=path + "/" + batch_id, Delimiter="/"
|
||||
)
|
||||
file_list = []
|
||||
for prefix in batch_objects["CommonPrefixes"]:
|
||||
file_list.append(prefix["Prefix"][:-1].split("/")[-1])
|
||||
file_count = len(file_list)
|
||||
return file_count, file_list
|
||||
|
||||
|
||||
def get_s3_client():
|
||||
region_name = "us-east-2"
|
||||
s3_client = boto3.client("s3", region_name=region_name)
|
||||
return s3_client
|
||||
|
||||
|
||||
def get_snowflake_conn(schema):
|
||||
secret = "" # get_secret()
|
||||
secret_dict = eval(secret)
|
||||
conn = snowflake.connector.connect(
|
||||
user=secret_dict["user"],
|
||||
password=secret_dict["password"],
|
||||
account=secret_dict["account_alias"],
|
||||
warehouse=secret_dict["warehouse"],
|
||||
database=secret_dict["database"],
|
||||
schema=schema,
|
||||
)
|
||||
return conn
|
||||
@@ -0,0 +1,33 @@
|
||||
environment:
|
||||
DEV:
|
||||
platform: 'firefox'
|
||||
url_interface_0: "https://doczydev.aarete.com:8500/"
|
||||
url_interface_1: "https://doczydev.aarete.com:8501/"
|
||||
url_interface_2: "https://doczydev.aarete.com:8502/"
|
||||
username: "ahinge@aarete.com"
|
||||
password: ""
|
||||
timeout: 20
|
||||
contract_files_path: "C:\\Ankit\\test\\"
|
||||
data_file_path: 'C:\\Ankit\\Code\\doczy.ai\\Doczy.AI_Automation\\data\\data.xlsx'
|
||||
|
||||
UAT:
|
||||
platform: 'firefox'
|
||||
url_interface_0: "https://doczyuat.aarete.com:8500/"
|
||||
url_interface_1: "https://doczyuat.aarete.com:8501/"
|
||||
url_interface_2: "https://doczyuat.aarete.com:8502/"
|
||||
username: "ahinge@aarete.com"
|
||||
password: ""
|
||||
timeout: 20
|
||||
contract_files_path: "C:\\Ankit\\test\\"
|
||||
data_file_path: 'C:\\Ankit\\Code\\doczy.ai\\Doczy.AI_Automation\\data\\data.xlsx'
|
||||
|
||||
PROD:
|
||||
platform: 'firefox'
|
||||
url_interface_0: "https://doczy.aarete.com:8500/"
|
||||
url_interface_1: "https://doczy.aarete.com:8501/"
|
||||
url_interface_2: "https://doczy.aarete.com:8502/"
|
||||
username: "ahinge@aarete.com"
|
||||
password: ""
|
||||
timeout: 20
|
||||
contract_files_path: "C:\\Ankit\\test\\"
|
||||
data_file_path: 'C:\\Ankit\\Code\\doczy.ai\\Doczy.AI_Automation\\data\\data.xlsx'
|
||||
Binary file not shown.
@@ -0,0 +1,46 @@
|
||||
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)
|
||||
@@ -0,0 +1,58 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
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"
|
||||
batch_id_xpath = '(//div[@data-testid="stSelectbox"])[2]'
|
||||
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']]"
|
||||
)
|
||||
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
|
||||
)
|
||||
|
||||
def get_client_list(self, driver):
|
||||
return driver.find_elements(By.XPATH, self.client_list_xpath)
|
||||
|
||||
def get_batch_id(self, driver, config):
|
||||
return get_clickable_element(driver, config, By.XPATH, self.batch_id_xpath)
|
||||
|
||||
def get_batch_id_list(self, driver):
|
||||
return driver.find_elements(By.XPATH, self.batch_id_list_xpath)
|
||||
|
||||
def get_checkbox_list(self, driver):
|
||||
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
|
||||
)
|
||||
|
||||
def get_result_table(self, driver, config):
|
||||
return get_element(driver, config, By.XPATH, self.result_table_xpath)
|
||||
|
||||
def get_table_rows(self, result_table):
|
||||
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
|
||||
)
|
||||
|
||||
def get_error(self, driver, config):
|
||||
return get_element(driver, config, By.XPATH, self.error_xpath)
|
||||
@@ -0,0 +1,68 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
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"
|
||||
batch_id_xpath = '(//div[@data-testid="stSelectbox"])[2]'
|
||||
batch_id_list_xpath = "//li"
|
||||
contract_name_xpath = '(//div[@data-testid="stSelectbox"])[3]'
|
||||
contract_name_list_xpath = "//li"
|
||||
field_group_xpath = '(//div[@data-testid="stSelectbox"])[4]'
|
||||
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"
|
||||
kickoff_database_btn_xpath = "//button[.//p[text()='Kickoff Database Integration']]"
|
||||
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_batch_id(self, driver, config):
|
||||
return get_clickable_element(driver, config, By.XPATH, self.batch_id_xpath)
|
||||
|
||||
def get_batch_id_list(self, driver):
|
||||
return driver.find_elements(By.XPATH, self.batch_id_list_xpath)
|
||||
|
||||
def get_contract_name(self, driver, config):
|
||||
return get_clickable_element(driver, config, By.XPATH, self.contract_name_xpath)
|
||||
|
||||
def get_contract_name_list(self, driver):
|
||||
return driver.find_elements(By.XPATH, self.contract_name_list_xpath)
|
||||
|
||||
def get_field_group(self, driver, config):
|
||||
return get_clickable_element(driver, config, By.XPATH, self.field_group_xpath)
|
||||
|
||||
def get_field_group_list(self, driver):
|
||||
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
|
||||
)
|
||||
|
||||
def get_result_table(self, driver, config):
|
||||
return get_element(driver, config, By.XPATH, self.result_table_xpath)
|
||||
|
||||
def get_table_rows(self, result_table):
|
||||
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
|
||||
)
|
||||
|
||||
def get_error_toast(self, driver, config):
|
||||
return get_element(driver, config, By.XPATH, self.error_xpath)
|
||||
@@ -0,0 +1,20 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
from utils.element_related_methods import get_element, get_clickable_element
|
||||
|
||||
|
||||
class Email_sign_in_page:
|
||||
def __init__(self, driver):
|
||||
self.driver = driver
|
||||
self.email = get_element(self.driver, By.NAME, "loginfmt")
|
||||
self.next_btn = get_clickable_element(self.driver, By.ID, "idSIButton9")
|
||||
|
||||
def set_email(self, email):
|
||||
self.email.clear()
|
||||
self.email.send_keys(email)
|
||||
|
||||
def click_next_btn(self):
|
||||
self.next_btn.click()
|
||||
|
||||
def sign_in(self, config):
|
||||
self.set_email(config["username"])
|
||||
self.click_next_btn()
|
||||
@@ -0,0 +1,21 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
from utils.element_related_methods import get_clickable_element, get_element
|
||||
|
||||
|
||||
class Password_sign_in_page:
|
||||
def __init__(self, driver):
|
||||
self.driver = driver
|
||||
self.password = get_element(self.driver, By.NAME, "passwd")
|
||||
self.sign_in_btn = get_clickable_element(self.driver, By.ID, "idSIButton9")
|
||||
|
||||
def set_password(self, password):
|
||||
self.password.clear()
|
||||
self.password.send_keys(password)
|
||||
|
||||
def click_sign_in_btn(self):
|
||||
self.sign_in_btn.click()
|
||||
|
||||
def sign_in(self, config):
|
||||
self.set_password(config["password"])
|
||||
self.click_sign_in_btn()
|
||||
@@ -0,0 +1,14 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support.wait import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as ec
|
||||
|
||||
from utils.element_related_methods import get_clickable_element
|
||||
|
||||
|
||||
class Pre_sign_in_page:
|
||||
def __init__(self, driver):
|
||||
self.driver = driver
|
||||
self.sign_in = get_clickable_element(self.driver, By.TAG_NAME, "a")
|
||||
|
||||
def click_sign_in_link(self):
|
||||
self.sign_in.click()
|
||||
@@ -0,0 +1,13 @@
|
||||
from selenium.webdriver.common.by import By
|
||||
|
||||
from utils.element_related_methods import get_clickable_element
|
||||
|
||||
|
||||
class Remember_sign_in_page:
|
||||
def __init__(self, driver):
|
||||
self.driver = driver
|
||||
self.no_btn = get_clickable_element(self.driver, By.ID, "idBtn_Back")
|
||||
self.yes_btn = get_clickable_element(self.driver, By.ID, "idSIButton9")
|
||||
|
||||
def click_no_btn(self):
|
||||
self.no_btn.click()
|
||||
@@ -0,0 +1,76 @@
|
||||
import random
|
||||
import time
|
||||
|
||||
from selenium.common import InvalidArgumentException
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
|
||||
from elements.interface_0_elements import Interface_0_elements
|
||||
from utils.logger import get_logger
|
||||
from utils.reader import read_files
|
||||
|
||||
|
||||
class Interface_0(Interface_0_elements):
|
||||
logger = get_logger()
|
||||
p_element = None
|
||||
|
||||
def __init__(self, driver, config):
|
||||
self.driver = driver
|
||||
self.config = config
|
||||
|
||||
def select_client(self, client_name=""):
|
||||
client_name_dropdown = super().get_client_name_dropdown(
|
||||
self.driver, self.config
|
||||
)
|
||||
client_name_dropdown.click()
|
||||
client_list = super().get_client_list(self.driver)
|
||||
assert len(client_list) > 0
|
||||
if client_name == "":
|
||||
random_number = random.randint(0, len(client_list) - 1)
|
||||
time.sleep(1)
|
||||
self.logger.info(f"Selected Client Name: {client_list[random_number].text}")
|
||||
client_name = client_list[random_number].text
|
||||
client_list[random_number].click()
|
||||
else:
|
||||
for client in client_list:
|
||||
if client_name == client.text:
|
||||
client.click()
|
||||
self.logger.info(f"Selected Client Name: {client_name}")
|
||||
break
|
||||
time.sleep(20)
|
||||
return client_name
|
||||
|
||||
def upload_files(self, client_name):
|
||||
file_list = ""
|
||||
try:
|
||||
file_input = super().get_file_input(self.driver, self.config)
|
||||
file_list = read_files(
|
||||
self.config["contract_files_path"] + client_name + "\\"
|
||||
)
|
||||
files = "\n".join(file_list)
|
||||
print(files)
|
||||
file_input.send_keys(files)
|
||||
self.logger.info(f"Uploading files...")
|
||||
time.sleep(10)
|
||||
WebDriverWait(self.driver, timeout=50).until(
|
||||
lambda browser: len(super().get_file_input_progress(browser)) == 0
|
||||
)
|
||||
time.sleep(10)
|
||||
except InvalidArgumentException as e:
|
||||
print(e)
|
||||
self.logger.info(f"File not found in test folder {', '.join(file_list)}")
|
||||
except Exception as e1:
|
||||
print(e1)
|
||||
self.logger.info(f"Exception occur")
|
||||
|
||||
def create_batch(self):
|
||||
create_batch_btn = super().get_create_batch_btn(self.driver, self.config)
|
||||
create_batch_btn.click()
|
||||
# self.logger.info("Creating batch")
|
||||
time.sleep(3)
|
||||
|
||||
def verify_message(self, tc):
|
||||
time.sleep(3)
|
||||
if tc == "POS":
|
||||
return super().get_p_element(self.driver, self.config)
|
||||
else:
|
||||
return super().get_error_toast(self.driver, self.config)
|
||||
@@ -0,0 +1,126 @@
|
||||
import random
|
||||
import time
|
||||
|
||||
from selenium.common import InvalidArgumentException
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
|
||||
from elements.interface_1_elements import Interface_1_elements
|
||||
from utils.element_related_methods import (
|
||||
get_clickable_element,
|
||||
get_element,
|
||||
get_invisible_element,
|
||||
)
|
||||
from utils.logger import get_logger
|
||||
|
||||
|
||||
class Interface_1(Interface_1_elements):
|
||||
logger = get_logger()
|
||||
selected_batch = ""
|
||||
result_message = None
|
||||
p_element = None
|
||||
|
||||
def __init__(self, driver, config):
|
||||
self.driver = driver
|
||||
self.config = config
|
||||
|
||||
def select_client(self, client_name=""):
|
||||
client_name_dropdown = super().get_client_name_dropdown(
|
||||
self.driver, self.config
|
||||
)
|
||||
client_name_dropdown.click()
|
||||
client_list = super().get_client_list(self.driver)
|
||||
assert len(client_list) > 0
|
||||
if client_name == "":
|
||||
random_number = random.randint(0, len(client_list) - 1)
|
||||
time.sleep(1)
|
||||
self.logger.debug(
|
||||
f"Selected Client Name: {client_list[random_number].text}"
|
||||
)
|
||||
client_name = client_list[random_number].text
|
||||
client_list[random_number].click()
|
||||
else:
|
||||
for client in client_list:
|
||||
if client_name == client.text:
|
||||
client.click()
|
||||
self.logger.debug(f"Selected Client Name: {client_name}")
|
||||
break
|
||||
time.sleep(20)
|
||||
return client_name
|
||||
|
||||
def select_batch(self, batch_id_name=""):
|
||||
batch_id = super().get_batch_id(self.driver, self.config)
|
||||
batch_id.click()
|
||||
batch_id_list = super().get_batch_id_list(self.driver)
|
||||
assert len(batch_id_list) > 0
|
||||
if batch_id_name == "":
|
||||
random_number = random.randint(1, len(batch_id_list) - 1)
|
||||
self.selected_batch = batch_id_list[random_number].text
|
||||
time.sleep(1)
|
||||
self.logger.debug(f"Selected Batch: {batch_id_list[random_number].text}")
|
||||
batch_id_name = batch_id_list[random_number].text
|
||||
time.sleep(1)
|
||||
batch_id_list[random_number].click()
|
||||
else:
|
||||
for batch in batch_id_list:
|
||||
if batch.text == batch_id_name:
|
||||
batch.click()
|
||||
self.selected_batch = batch_id_name
|
||||
self.logger.debug(f"Selected Batch: {batch_id_name}")
|
||||
break
|
||||
time.sleep(5)
|
||||
return batch_id_name
|
||||
|
||||
def check_group_no(self, group_checkbox=None):
|
||||
if group_checkbox is None:
|
||||
group_checkbox = []
|
||||
checkbox_list = super().get_checkbox_list(self.driver)
|
||||
assert len(checkbox_list) > 0
|
||||
if len(group_checkbox) > 0:
|
||||
checked_groups = ""
|
||||
for checkbox in checkbox_list:
|
||||
if checkbox.text in group_checkbox:
|
||||
checkbox.click()
|
||||
checked_groups = f"{checked_groups}{checkbox.text}, "
|
||||
self.logger.debug(f"checked Group No.: {checked_groups[:-2]}")
|
||||
else:
|
||||
random_number = random.randint(0, len(checkbox_list) - 1)
|
||||
random_elements = random.sample(checkbox_list, random_number)
|
||||
checked_groups = ""
|
||||
for checkbox in random_elements:
|
||||
time.sleep(1)
|
||||
checkbox.click()
|
||||
time.sleep(1)
|
||||
checked_groups = f"{checked_groups}{checkbox.text}, "
|
||||
self.logger.debug(f"checked Group No.: {checked_groups[:-2]}")
|
||||
time.sleep(5)
|
||||
|
||||
def click_read_the_contracts_from_path(self):
|
||||
read_the_contracts_from_path_btn = super().get_read_the_contracts_from_path_btn(
|
||||
self.driver, self.config
|
||||
)
|
||||
read_the_contracts_from_path_btn.click()
|
||||
time.sleep(5)
|
||||
|
||||
def check_table_contain(self):
|
||||
result_table = super().get_result_table(self.driver, self.config)
|
||||
rows = super().get_table_rows(result_table)
|
||||
for row in rows:
|
||||
print(row)
|
||||
if len(rows) > 0:
|
||||
self.logger.debug(
|
||||
f"{len(rows)} contracts are read from batch: {self.selected_batch}"
|
||||
)
|
||||
assert True
|
||||
else:
|
||||
assert False
|
||||
time.sleep(5)
|
||||
|
||||
def click_run_doczy_ai_pipeline(self):
|
||||
run_doczy_ai_pipeline_btn = super().get_run_doczy_ai_pipeline_btn(
|
||||
self.driver, self.config
|
||||
)
|
||||
run_doczy_ai_pipeline_btn.click()
|
||||
time.sleep(3)
|
||||
self.result_message = super().get_error(self.driver, self.config)
|
||||
time.sleep(3)
|
||||
@@ -0,0 +1,134 @@
|
||||
import random
|
||||
import time
|
||||
|
||||
from selenium.common import InvalidArgumentException
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.support.ui import WebDriverWait
|
||||
|
||||
from elements.interface_2_elements import Interface_2_elements
|
||||
from utils.element_related_methods import (
|
||||
get_clickable_element,
|
||||
get_element,
|
||||
get_invisible_element,
|
||||
)
|
||||
from utils.logger import get_logger
|
||||
|
||||
|
||||
class Interface_2(Interface_2_elements):
|
||||
logger = get_logger()
|
||||
selected_batch = ""
|
||||
selected_contract = ""
|
||||
selected_field_group = ""
|
||||
result_message = None
|
||||
p_element = None
|
||||
|
||||
def __init__(self, driver, config):
|
||||
self.driver = driver
|
||||
self.config = config
|
||||
|
||||
def select_client(self, client_name=""):
|
||||
client_name_dropdown = super().get_client_name_dropdown(
|
||||
self.driver, self.config
|
||||
)
|
||||
client_name_dropdown.click()
|
||||
client_list = super().get_client_list(self.driver)
|
||||
assert len(client_list) > 0
|
||||
if client_name == "":
|
||||
random_number = random.randint(0, len(client_list) - 1)
|
||||
time.sleep(1)
|
||||
self.logger.info(f"Selected Client Name: {client_list[random_number].text}")
|
||||
client_name = client_list[random_number].text
|
||||
client_list[random_number].click()
|
||||
else:
|
||||
# assert client_name in client_list, "Selected Client not present"
|
||||
for client in client_list:
|
||||
print(client.text)
|
||||
if client_name == client.text:
|
||||
client.click()
|
||||
break
|
||||
time.sleep(20)
|
||||
return client_name
|
||||
|
||||
def select_batch(self, batch_id_name=""):
|
||||
batch_id = super().get_batch_id(
|
||||
self.driver, self.config
|
||||
) # get_clickable_element(self.driver, By.XPATH, '/html/body/div/div[1]/div[1]/div/div/div/section[2]/div[1]/div/div/div/div[5]/div[2]/div/div/div/div/div')
|
||||
batch_id.click()
|
||||
batch_id_list = super().get_batch_id_list(
|
||||
self.driver
|
||||
) # self.driver.find_elements(By.XPATH, "//li")
|
||||
assert len(batch_id_list) > 0
|
||||
if batch_id_name == "":
|
||||
random_number = random.randint(1, len(batch_id_list) - 1)
|
||||
self.selected_batch = batch_id_list[random_number].text
|
||||
time.sleep(1)
|
||||
self.logger.info(f"Selected Batch: {batch_id_list[random_number].text}")
|
||||
batch_id_name = batch_id_list[random_number].text
|
||||
time.sleep(1)
|
||||
batch_id_list[random_number].click()
|
||||
else:
|
||||
assert batch_id_name in batch_id_list, "Selected Batch Id not present"
|
||||
for batch in batch_id_list:
|
||||
if batch.text == batch_id_name:
|
||||
batch.click()
|
||||
break
|
||||
time.sleep(5)
|
||||
return batch_id_name
|
||||
|
||||
def select_contract(self):
|
||||
contract = super().get_contract_name(self.driver, self.config)
|
||||
contract.click()
|
||||
contract_list = super().get_contract_name_list(self.driver)
|
||||
assert len(contract_list) > 0
|
||||
random_number = random.randint(1, len(contract_list) - 1)
|
||||
time.sleep(1)
|
||||
self.selected_contract = contract_list[random_number].text
|
||||
time.sleep(1)
|
||||
self.logger.info(f"Selected contract: {contract_list[random_number].text}")
|
||||
time.sleep(1)
|
||||
contract_list[random_number].click()
|
||||
time.sleep(5)
|
||||
|
||||
def select_field_group(self):
|
||||
field_group = super().get_field_group(self.driver, self.config)
|
||||
field_group.click()
|
||||
field_group_list = super().get_field_group_list(self.driver)
|
||||
assert len(field_group_list) > 0
|
||||
random_number = random.randint(1, len(field_group_list) - 1)
|
||||
time.sleep(1)
|
||||
self.selected_field_group = field_group_list[random_number].text
|
||||
time.sleep(1)
|
||||
self.logger.info(
|
||||
f"Selected field froup: {field_group_list[random_number].text}"
|
||||
)
|
||||
time.sleep(1)
|
||||
field_group_list[random_number].click()
|
||||
time.sleep(5)
|
||||
|
||||
def click_show_results(self):
|
||||
show_result_btn = super().get_show_result_btn(self.driver, self.config)
|
||||
show_result_btn.click()
|
||||
time.sleep(15)
|
||||
|
||||
def check_table_contain(self):
|
||||
result_table = super().get_result_table(self.driver, self.config)
|
||||
rows = super().get_table_rows(result_table)
|
||||
if len(rows) > 0:
|
||||
self.logger.info(
|
||||
f"{len(rows)} fields are read from contract: {self.selected_contract}"
|
||||
)
|
||||
assert True
|
||||
else:
|
||||
assert False
|
||||
time.sleep(5)
|
||||
|
||||
def click_kickoff_database_integration_btn(self):
|
||||
kickoff_database_btn = super().get_kickoff_database_btn(
|
||||
self.driver, self.config
|
||||
)
|
||||
kickoff_database_btn.click()
|
||||
time.sleep(15)
|
||||
|
||||
def check_error_message(self):
|
||||
error_message = super().get_error_toast(self.driver, self.config)
|
||||
return error_message.text
|
||||
Generated
+1386
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
[tool.poetry]
|
||||
name = "doczyai-automation"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = ["Michael McGuinness <mmcguinness@aarete.com>"]
|
||||
readme = "README.md"
|
||||
package-mode = false
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "3.11.10"
|
||||
boto3 = "1.35.37"
|
||||
botocore = "1.35.37"
|
||||
loguru = "0.7.2"
|
||||
pandas = "2.2.3"
|
||||
pyyaml = "6.0.2"
|
||||
selenium = "4.25.0"
|
||||
snowflake = "0.13.0"
|
||||
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
black = "^24.10.0"
|
||||
mypy = "^1.12.0"
|
||||
|
||||
|
||||
|
||||
[tool.poetry.group.test.dependencies]
|
||||
pytest = "^8.3.3"
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.black]
|
||||
line-length = 88
|
||||
target-version = ['py311']
|
||||
|
||||
[tool.mypy]
|
||||
disable_error_code = ["import-not-found","import-untyped"]
|
||||
#install_types = true
|
||||
#non_interactive = true
|
||||
@@ -0,0 +1,2 @@
|
||||
[pytest]
|
||||
addopts = --html=reports/test_report.html --json=reports/test_report.json --alluredir=reports/allure-results
|
||||
@@ -0,0 +1,319 @@
|
||||
body {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
/* do not increase min-width as some may use split screens */
|
||||
min-width: 800px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
p {
|
||||
color: black;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
/******************************
|
||||
* SUMMARY INFORMATION
|
||||
******************************/
|
||||
#environment td {
|
||||
padding: 5px;
|
||||
border: 1px solid #e6e6e6;
|
||||
vertical-align: top;
|
||||
}
|
||||
#environment tr:nth-child(odd) {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
#environment ul {
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/******************************
|
||||
* TEST RESULT COLORS
|
||||
******************************/
|
||||
span.passed,
|
||||
.passed .col-result {
|
||||
color: green;
|
||||
}
|
||||
|
||||
span.skipped,
|
||||
span.xfailed,
|
||||
span.rerun,
|
||||
.skipped .col-result,
|
||||
.xfailed .col-result,
|
||||
.rerun .col-result {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
span.error,
|
||||
span.failed,
|
||||
span.xpassed,
|
||||
.error .col-result,
|
||||
.failed .col-result,
|
||||
.xpassed .col-result {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.col-links__extra {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/******************************
|
||||
* RESULTS TABLE
|
||||
*
|
||||
* 1. Table Layout
|
||||
* 2. Extra
|
||||
* 3. Sorting items
|
||||
*
|
||||
******************************/
|
||||
/*------------------
|
||||
* 1. Table Layout
|
||||
*------------------*/
|
||||
#results-table {
|
||||
border: 1px solid #e6e6e6;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
}
|
||||
#results-table th,
|
||||
#results-table td {
|
||||
padding: 5px;
|
||||
border: 1px solid #e6e6e6;
|
||||
text-align: left;
|
||||
}
|
||||
#results-table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/*------------------
|
||||
* 2. Extra
|
||||
*------------------*/
|
||||
.logwrapper {
|
||||
max-height: 230px;
|
||||
overflow-y: scroll;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
.logwrapper.expanded {
|
||||
max-height: none;
|
||||
}
|
||||
.logwrapper.expanded .logexpander:after {
|
||||
content: "collapse [-]";
|
||||
}
|
||||
.logwrapper .logexpander {
|
||||
z-index: 1;
|
||||
position: sticky;
|
||||
top: 10px;
|
||||
width: max-content;
|
||||
border: 1px solid;
|
||||
border-radius: 3px;
|
||||
padding: 5px 7px;
|
||||
margin: 10px 0 10px calc(100% - 80px);
|
||||
cursor: pointer;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
.logwrapper .logexpander:after {
|
||||
content: "expand [+]";
|
||||
}
|
||||
.logwrapper .logexpander:hover {
|
||||
color: #000;
|
||||
border-color: #000;
|
||||
}
|
||||
.logwrapper .log {
|
||||
min-height: 40px;
|
||||
position: relative;
|
||||
top: -50px;
|
||||
height: calc(100% + 50px);
|
||||
border: 1px solid #e6e6e6;
|
||||
color: black;
|
||||
display: block;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
padding: 5px;
|
||||
padding-right: 80px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
div.media {
|
||||
border: 1px solid #e6e6e6;
|
||||
float: right;
|
||||
height: 240px;
|
||||
margin: 0 5px;
|
||||
overflow: hidden;
|
||||
width: 320px;
|
||||
}
|
||||
|
||||
.media-container {
|
||||
display: grid;
|
||||
grid-template-columns: 25px auto 25px;
|
||||
align-items: center;
|
||||
flex: 1 1;
|
||||
overflow: hidden;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.media-container--fullscreen {
|
||||
grid-template-columns: 0px auto 0px;
|
||||
}
|
||||
|
||||
.media-container__nav--right,
|
||||
.media-container__nav--left {
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.media-container__viewport {
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
height: inherit;
|
||||
}
|
||||
.media-container__viewport img,
|
||||
.media-container__viewport video {
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.media__name,
|
||||
.media__counter {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
flex: 0 0 25px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.collapsible td:not(.col-links) {
|
||||
cursor: pointer;
|
||||
}
|
||||
.collapsible td:not(.col-links):hover::after {
|
||||
color: #bbb;
|
||||
font-style: italic;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.col-result {
|
||||
width: 130px;
|
||||
}
|
||||
.col-result:hover::after {
|
||||
content: " (hide details)";
|
||||
}
|
||||
|
||||
.col-result.collapsed:hover::after {
|
||||
content: " (show details)";
|
||||
}
|
||||
|
||||
#environment-header h2:hover::after {
|
||||
content: " (hide details)";
|
||||
color: #bbb;
|
||||
font-style: italic;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#environment-header.collapsed h2:hover::after {
|
||||
content: " (show details)";
|
||||
color: #bbb;
|
||||
font-style: italic;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/*------------------
|
||||
* 3. Sorting items
|
||||
*------------------*/
|
||||
.sortable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.sortable.desc:after {
|
||||
content: " ";
|
||||
position: relative;
|
||||
left: 5px;
|
||||
bottom: -12.5px;
|
||||
border: 10px solid #4caf50;
|
||||
border-bottom: 0;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
}
|
||||
.sortable.asc:after {
|
||||
content: " ";
|
||||
position: relative;
|
||||
left: 5px;
|
||||
bottom: 12.5px;
|
||||
border: 10px solid #4caf50;
|
||||
border-top: 0;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
}
|
||||
|
||||
.hidden, .summary__reload__button.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.summary__data {
|
||||
flex: 0 0 550px;
|
||||
}
|
||||
.summary__reload {
|
||||
flex: 1 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.summary__reload__button {
|
||||
flex: 0 0 300px;
|
||||
display: flex;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
background-color: #4caf50;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.summary__reload__button:hover {
|
||||
background-color: #46a049;
|
||||
}
|
||||
.summary__spacer {
|
||||
flex: 0 0 550px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.filters,
|
||||
.collapse {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.filters button,
|
||||
.collapse button {
|
||||
color: #999;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.filters button:hover,
|
||||
.collapse button:hover {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.filter__label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1,2 @@
|
||||
def test_always_passes():
|
||||
assert True
|
||||
@@ -0,0 +1,103 @@
|
||||
import datetime
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
from selenium import webdriver
|
||||
|
||||
from utils.reader import read_yaml, read_excel
|
||||
|
||||
|
||||
# def pytest_runtest_makereport(item, call):
|
||||
# # Your custom logic here
|
||||
# # This function will be called automatically by pytest
|
||||
# # with information about the test item and its outcome (call)
|
||||
# # outcome = yield
|
||||
# # rep = outcome.get_result()
|
||||
# pass
|
||||
|
||||
|
||||
# @pytest.hookimpl(tryfirst=True)
|
||||
def pytest_html_report_title(report):
|
||||
"""Set the title of the HTML report dynamically."""
|
||||
current_datetime = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||
report.title = f"Test Report {current_datetime}"
|
||||
|
||||
|
||||
def client_list():
|
||||
file_path = "C:\\Ankit\\Code\\doczy.ai\\Doczy.AI_Automation\\data\\data.xlsx"
|
||||
sheet_name = "client_data"
|
||||
return read_excel(file_path, sheet_name, ["client"])
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def client_list_fixture():
|
||||
return client_list()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def groups():
|
||||
file_path = "C:\\Ankit\\Code\\doczy.ai\\Doczy.AI_Automation\\data\\data.xlsx"
|
||||
sheet_name = "groups"
|
||||
return read_excel(file_path, sheet_name, ["groups"])
|
||||
|
||||
|
||||
def batch_list():
|
||||
file_path = "C:\\Ankit\\Code\\doczy.ai\\Doczy.AI_Automation\\data\\data.xlsx"
|
||||
sheet_name = "batch_data"
|
||||
return read_excel(file_path, sheet_name, ["client", "Batch"])
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@allure.title("Creating Web Driver")
|
||||
def driver(config, request):
|
||||
browser = request.config.getoption("--browser")
|
||||
if browser == "remote":
|
||||
driver = webdriver.Remote()
|
||||
yield driver
|
||||
elif browser == "firefox":
|
||||
driver = webdriver.Firefox()
|
||||
yield driver
|
||||
elif browser == "edge":
|
||||
driver = webdriver.Edge()
|
||||
yield driver
|
||||
else:
|
||||
driver = webdriver.Chrome()
|
||||
driver.maximize_window()
|
||||
yield driver
|
||||
# if config['platform'] == 'remote':
|
||||
# driver = webdriver.Remote()
|
||||
# yield driver
|
||||
# elif config['platform'] == 'firefox':
|
||||
# driver = webdriver.Firefox()
|
||||
# yield driver
|
||||
# elif config['platform'] == 'edge':
|
||||
# driver = webdriver.Edge()
|
||||
# yield driver
|
||||
# else:
|
||||
# driver = webdriver.Chrome()
|
||||
# yield driver
|
||||
|
||||
if driver is not None:
|
||||
driver.quit()
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def config(request):
|
||||
env = request.config.getoption("--env")
|
||||
return read_yaml_config(env)
|
||||
|
||||
|
||||
def read_yaml_config(env):
|
||||
yaml_file_path = "C:\\Ankit\\Code\\doczy.ai\\Doczy.AI_Automation\\config\\"
|
||||
yaml_file_name = "env.yaml"
|
||||
|
||||
return read_yaml(yaml_file_path, yaml_file_name)["environment"][env]
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--env", action="store", default="DEV", help="Environment to run tests against"
|
||||
)
|
||||
parser.addoption(
|
||||
"--browser", action="store", default="firefox", help="browser to run test on"
|
||||
)
|
||||
@@ -0,0 +1,319 @@
|
||||
body {
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
font-size: 12px;
|
||||
/* do not increase min-width as some may use split screens */
|
||||
min-width: 800px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 16px;
|
||||
color: black;
|
||||
}
|
||||
|
||||
p {
|
||||
color: black;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
/******************************
|
||||
* SUMMARY INFORMATION
|
||||
******************************/
|
||||
#environment td {
|
||||
padding: 5px;
|
||||
border: 1px solid #e6e6e6;
|
||||
vertical-align: top;
|
||||
}
|
||||
#environment tr:nth-child(odd) {
|
||||
background-color: #f6f6f6;
|
||||
}
|
||||
#environment ul {
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/******************************
|
||||
* TEST RESULT COLORS
|
||||
******************************/
|
||||
span.passed,
|
||||
.passed .col-result {
|
||||
color: green;
|
||||
}
|
||||
|
||||
span.skipped,
|
||||
span.xfailed,
|
||||
span.rerun,
|
||||
.skipped .col-result,
|
||||
.xfailed .col-result,
|
||||
.rerun .col-result {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
span.error,
|
||||
span.failed,
|
||||
span.xpassed,
|
||||
.error .col-result,
|
||||
.failed .col-result,
|
||||
.xpassed .col-result {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.col-links__extra {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
/******************************
|
||||
* RESULTS TABLE
|
||||
*
|
||||
* 1. Table Layout
|
||||
* 2. Extra
|
||||
* 3. Sorting items
|
||||
*
|
||||
******************************/
|
||||
/*------------------
|
||||
* 1. Table Layout
|
||||
*------------------*/
|
||||
#results-table {
|
||||
border: 1px solid #e6e6e6;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
}
|
||||
#results-table th,
|
||||
#results-table td {
|
||||
padding: 5px;
|
||||
border: 1px solid #e6e6e6;
|
||||
text-align: left;
|
||||
}
|
||||
#results-table th {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/*------------------
|
||||
* 2. Extra
|
||||
*------------------*/
|
||||
.logwrapper {
|
||||
max-height: 230px;
|
||||
overflow-y: scroll;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
.logwrapper.expanded {
|
||||
max-height: none;
|
||||
}
|
||||
.logwrapper.expanded .logexpander:after {
|
||||
content: "collapse [-]";
|
||||
}
|
||||
.logwrapper .logexpander {
|
||||
z-index: 1;
|
||||
position: sticky;
|
||||
top: 10px;
|
||||
width: max-content;
|
||||
border: 1px solid;
|
||||
border-radius: 3px;
|
||||
padding: 5px 7px;
|
||||
margin: 10px 0 10px calc(100% - 80px);
|
||||
cursor: pointer;
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
.logwrapper .logexpander:after {
|
||||
content: "expand [+]";
|
||||
}
|
||||
.logwrapper .logexpander:hover {
|
||||
color: #000;
|
||||
border-color: #000;
|
||||
}
|
||||
.logwrapper .log {
|
||||
min-height: 40px;
|
||||
position: relative;
|
||||
top: -50px;
|
||||
height: calc(100% + 50px);
|
||||
border: 1px solid #e6e6e6;
|
||||
color: black;
|
||||
display: block;
|
||||
font-family: "Courier New", Courier, monospace;
|
||||
padding: 5px;
|
||||
padding-right: 80px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
div.media {
|
||||
border: 1px solid #e6e6e6;
|
||||
float: right;
|
||||
height: 240px;
|
||||
margin: 0 5px;
|
||||
overflow: hidden;
|
||||
width: 320px;
|
||||
}
|
||||
|
||||
.media-container {
|
||||
display: grid;
|
||||
grid-template-columns: 25px auto 25px;
|
||||
align-items: center;
|
||||
flex: 1 1;
|
||||
overflow: hidden;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.media-container--fullscreen {
|
||||
grid-template-columns: 0px auto 0px;
|
||||
}
|
||||
|
||||
.media-container__nav--right,
|
||||
.media-container__nav--left {
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.media-container__viewport {
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
height: inherit;
|
||||
}
|
||||
.media-container__viewport img,
|
||||
.media-container__viewport video {
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
.media__name,
|
||||
.media__counter {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-around;
|
||||
flex: 0 0 25px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.collapsible td:not(.col-links) {
|
||||
cursor: pointer;
|
||||
}
|
||||
.collapsible td:not(.col-links):hover::after {
|
||||
color: #bbb;
|
||||
font-style: italic;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.col-result {
|
||||
width: 130px;
|
||||
}
|
||||
.col-result:hover::after {
|
||||
content: " (hide details)";
|
||||
}
|
||||
|
||||
.col-result.collapsed:hover::after {
|
||||
content: " (show details)";
|
||||
}
|
||||
|
||||
#environment-header h2:hover::after {
|
||||
content: " (hide details)";
|
||||
color: #bbb;
|
||||
font-style: italic;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#environment-header.collapsed h2:hover::after {
|
||||
content: " (show details)";
|
||||
color: #bbb;
|
||||
font-style: italic;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
/*------------------
|
||||
* 3. Sorting items
|
||||
*------------------*/
|
||||
.sortable {
|
||||
cursor: pointer;
|
||||
}
|
||||
.sortable.desc:after {
|
||||
content: " ";
|
||||
position: relative;
|
||||
left: 5px;
|
||||
bottom: -12.5px;
|
||||
border: 10px solid #4caf50;
|
||||
border-bottom: 0;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
}
|
||||
.sortable.asc:after {
|
||||
content: " ";
|
||||
position: relative;
|
||||
left: 5px;
|
||||
bottom: 12.5px;
|
||||
border: 10px solid #4caf50;
|
||||
border-top: 0;
|
||||
border-left-color: transparent;
|
||||
border-right-color: transparent;
|
||||
}
|
||||
|
||||
.hidden, .summary__reload__button.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.summary__data {
|
||||
flex: 0 0 550px;
|
||||
}
|
||||
.summary__reload {
|
||||
flex: 1 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.summary__reload__button {
|
||||
flex: 0 0 300px;
|
||||
display: flex;
|
||||
color: white;
|
||||
font-weight: bold;
|
||||
background-color: #4caf50;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.summary__reload__button:hover {
|
||||
background-color: #46a049;
|
||||
}
|
||||
.summary__spacer {
|
||||
flex: 0 0 550px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.filters,
|
||||
.collapse {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.filters button,
|
||||
.collapse button {
|
||||
color: #999;
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.filters button:hover,
|
||||
.collapse button:hover {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.filter__label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
@@ -0,0 +1,770 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title id="head-title">test_report.html</title>
|
||||
<link href="assets\style.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="title">test_report.html</h1>
|
||||
<p>Report generated on 17-May-2024 at 12:39:54 by <a href="https://pypi.python.org/pypi/pytest-html">pytest-html</a>
|
||||
v4.1.1</p>
|
||||
<div id="environment-header">
|
||||
<h2>Environment</h2>
|
||||
</div>
|
||||
<table id="environment"></table>
|
||||
<!-- TEMPLATES -->
|
||||
<template id="template_environment_row">
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="template_results-table__body--empty">
|
||||
<tbody class="results-table-row">
|
||||
<tr id="not-found-message">
|
||||
<td colspan="4">No results found. Check the filters.</th>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="template_results-table__tbody">
|
||||
<tbody class="results-table-row">
|
||||
<tr class="collapsible">
|
||||
</tr>
|
||||
<tr class="extras-row">
|
||||
<td class="extra" colspan="4">
|
||||
<div class="extraHTML"></div>
|
||||
<div class="media">
|
||||
<div class="media-container">
|
||||
<div class="media-container__nav--left"><</div>
|
||||
<div class="media-container__viewport">
|
||||
<img src="" />
|
||||
<video controls>
|
||||
<source src="" type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
<div class="media-container__nav--right">></div>
|
||||
</div>
|
||||
<div class="media__name"></div>
|
||||
<div class="media__counter"></div>
|
||||
</div>
|
||||
<div class="logwrapper">
|
||||
<div class="logexpander"></div>
|
||||
<div class="log"></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</template>
|
||||
<!-- END TEMPLATES -->
|
||||
<div class="summary">
|
||||
<div class="summary__data">
|
||||
<h2>Summary</h2>
|
||||
<div class="additional-summary prefix">
|
||||
</div>
|
||||
<p class="run-count">1 test took 00:00:09.</p>
|
||||
<p class="filter">(Un)check the boxes to filter the results.</p>
|
||||
<div class="summary__reload">
|
||||
<div class="summary__reload__button hidden" onclick="location.reload()">
|
||||
<div>There are still tests running. <br />Reload this page to get the latest results!</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="summary__spacer"></div>
|
||||
<div class="controls">
|
||||
<div class="filters">
|
||||
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="failed" disabled/>
|
||||
<span class="failed">0 Failed,</span>
|
||||
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="passed" />
|
||||
<span class="passed">1 Passed,</span>
|
||||
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="skipped" disabled/>
|
||||
<span class="skipped">0 Skipped,</span>
|
||||
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="xfailed" disabled/>
|
||||
<span class="xfailed">0 Expected failures,</span>
|
||||
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="xpassed" disabled/>
|
||||
<span class="xpassed">0 Unexpected passes,</span>
|
||||
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="error" disabled/>
|
||||
<span class="error">0 Errors,</span>
|
||||
<input checked="true" class="filter" name="filter_checkbox" type="checkbox" data-test-result="rerun" disabled/>
|
||||
<span class="rerun">0 Reruns</span>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<button id="show_all_details">Show all details</button> / <button id="hide_all_details">Hide all details</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="additional-summary summary">
|
||||
</div>
|
||||
<div class="additional-summary postfix">
|
||||
</div>
|
||||
</div>
|
||||
<table id="results-table">
|
||||
<thead id="results-table-head">
|
||||
<tr>
|
||||
<th class="sortable" data-column-type="result">Result</th>
|
||||
<th class="sortable" data-column-type="testId">Test</th>
|
||||
<th class="sortable" data-column-type="duration">Duration</th>
|
||||
<th>Links</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</body>
|
||||
<footer>
|
||||
<div id="data-container" data-jsonblob="{"environment": {"Python": "3.12.3", "Platform": "Windows-10-10.0.19045-SP0", "Packages": {"pytest": "8.2.0", "pluggy": "1.5.0"}, "Plugins": {"html": "4.1.1", "json": "0.4.0", "metadata": "3.1.1"}}, "tests": {"tests/test_interface_0.py::Test_interface_0::test_validate_navigation": [{"extras": [], "result": "Passed", "testId": "tests/test_interface_0.py::Test_interface_0::test_validate_navigation", "duration": "00:00:09", "resultsTableRow": ["<td class=\"col-result\">Passed</td>", "<td class=\"col-testId\">tests/test_interface_0.py::Test_interface_0::test_validate_navigation</td>", "<td class=\"col-duration\">00:00:09</td>", "<td class=\"col-links\"></td>"], "log": "----------------------------- Captured stderr call -----------------------------\n2024-05-17 12:39:42.555 | INFO | tests.test_interface_0:test_validate_navigation:17 - Verifying designated Interface 0 Page opens successfully\n2024-05-17 12:39:48.030 | INFO | tests.test_interface_0:test_validate_navigation:21 - Designated Interface 0 Page opened successfully\n"}]}, "renderCollapsed": ["passed"], "initialSort": "result", "title": "test_report.html"}"></div>
|
||||
<script>
|
||||
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||
const { getCollapsedCategory, setCollapsedIds } = require('./storage.js')
|
||||
|
||||
class DataManager {
|
||||
setManager(data) {
|
||||
const collapsedCategories = [...getCollapsedCategory(data.renderCollapsed)]
|
||||
const collapsedIds = []
|
||||
const tests = Object.values(data.tests).flat().map((test, index) => {
|
||||
const collapsed = collapsedCategories.includes(test.result.toLowerCase())
|
||||
const id = `test_${index}`
|
||||
if (collapsed) {
|
||||
collapsedIds.push(id)
|
||||
}
|
||||
return {
|
||||
...test,
|
||||
id,
|
||||
collapsed,
|
||||
}
|
||||
})
|
||||
const dataBlob = { ...data, tests }
|
||||
this.data = { ...dataBlob }
|
||||
this.renderData = { ...dataBlob }
|
||||
setCollapsedIds(collapsedIds)
|
||||
}
|
||||
|
||||
get allData() {
|
||||
return { ...this.data }
|
||||
}
|
||||
|
||||
resetRender() {
|
||||
this.renderData = { ...this.data }
|
||||
}
|
||||
|
||||
setRender(data) {
|
||||
this.renderData.tests = [...data]
|
||||
}
|
||||
|
||||
toggleCollapsedItem(id) {
|
||||
this.renderData.tests = this.renderData.tests.map((test) =>
|
||||
test.id === id ? { ...test, collapsed: !test.collapsed } : test,
|
||||
)
|
||||
}
|
||||
|
||||
set allCollapsed(collapsed) {
|
||||
this.renderData = { ...this.renderData, tests: [...this.renderData.tests.map((test) => (
|
||||
{ ...test, collapsed }
|
||||
))] }
|
||||
}
|
||||
|
||||
get testSubset() {
|
||||
return [...this.renderData.tests]
|
||||
}
|
||||
|
||||
get environment() {
|
||||
return this.renderData.environment
|
||||
}
|
||||
|
||||
get initialSort() {
|
||||
return this.data.initialSort
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
manager: new DataManager(),
|
||||
}
|
||||
|
||||
},{"./storage.js":8}],2:[function(require,module,exports){
|
||||
const mediaViewer = require('./mediaviewer.js')
|
||||
const templateEnvRow = document.getElementById('template_environment_row')
|
||||
const templateResult = document.getElementById('template_results-table__tbody')
|
||||
|
||||
function htmlToElements(html) {
|
||||
const temp = document.createElement('template')
|
||||
temp.innerHTML = html
|
||||
return temp.content.childNodes
|
||||
}
|
||||
|
||||
const find = (selector, elem) => {
|
||||
if (!elem) {
|
||||
elem = document
|
||||
}
|
||||
return elem.querySelector(selector)
|
||||
}
|
||||
|
||||
const findAll = (selector, elem) => {
|
||||
if (!elem) {
|
||||
elem = document
|
||||
}
|
||||
return [...elem.querySelectorAll(selector)]
|
||||
}
|
||||
|
||||
const dom = {
|
||||
getStaticRow: (key, value) => {
|
||||
const envRow = templateEnvRow.content.cloneNode(true)
|
||||
const isObj = typeof value === 'object' && value !== null
|
||||
const values = isObj ? Object.keys(value).map((k) => `${k}: ${value[k]}`) : null
|
||||
|
||||
const valuesElement = htmlToElements(
|
||||
values ? `<ul>${values.map((val) => `<li>${val}</li>`).join('')}<ul>` : `<div>${value}</div>`)[0]
|
||||
const td = findAll('td', envRow)
|
||||
td[0].textContent = key
|
||||
td[1].appendChild(valuesElement)
|
||||
|
||||
return envRow
|
||||
},
|
||||
getResultTBody: ({ testId, id, log, extras, resultsTableRow, tableHtml, result, collapsed }) => {
|
||||
const resultBody = templateResult.content.cloneNode(true)
|
||||
resultBody.querySelector('tbody').classList.add(result.toLowerCase())
|
||||
resultBody.querySelector('tbody').id = testId
|
||||
resultBody.querySelector('.collapsible').dataset.id = id
|
||||
|
||||
resultsTableRow.forEach((html) => {
|
||||
const t = document.createElement('template')
|
||||
t.innerHTML = html
|
||||
resultBody.querySelector('.collapsible').appendChild(t.content)
|
||||
})
|
||||
|
||||
if (log) {
|
||||
// Wrap lines starting with "E" with span.error to color those lines red
|
||||
const wrappedLog = log.replace(/^E.*$/gm, (match) => `<span class="error">${match}</span>`)
|
||||
resultBody.querySelector('.log').innerHTML = wrappedLog
|
||||
} else {
|
||||
resultBody.querySelector('.log').remove()
|
||||
}
|
||||
|
||||
if (collapsed) {
|
||||
resultBody.querySelector('.collapsible > td')?.classList.add('collapsed')
|
||||
resultBody.querySelector('.extras-row').classList.add('hidden')
|
||||
} else {
|
||||
resultBody.querySelector('.collapsible > td')?.classList.remove('collapsed')
|
||||
}
|
||||
|
||||
const media = []
|
||||
extras?.forEach(({ name, format_type, content }) => {
|
||||
if (['image', 'video'].includes(format_type)) {
|
||||
media.push({ path: content, name, format_type })
|
||||
}
|
||||
|
||||
if (format_type === 'html') {
|
||||
resultBody.querySelector('.extraHTML').insertAdjacentHTML('beforeend', `<div>${content}</div>`)
|
||||
}
|
||||
})
|
||||
mediaViewer.setup(resultBody, media)
|
||||
|
||||
// Add custom html from the pytest_html_results_table_html hook
|
||||
tableHtml?.forEach((item) => {
|
||||
resultBody.querySelector('td[class="extra"]').insertAdjacentHTML('beforeend', item)
|
||||
})
|
||||
|
||||
return resultBody
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
dom,
|
||||
htmlToElements,
|
||||
find,
|
||||
findAll,
|
||||
}
|
||||
|
||||
},{"./mediaviewer.js":6}],3:[function(require,module,exports){
|
||||
const { manager } = require('./datamanager.js')
|
||||
const { doSort } = require('./sort.js')
|
||||
const storageModule = require('./storage.js')
|
||||
|
||||
const getFilteredSubSet = (filter) =>
|
||||
manager.allData.tests.filter(({ result }) => filter.includes(result.toLowerCase()))
|
||||
|
||||
const doInitFilter = () => {
|
||||
const currentFilter = storageModule.getVisible()
|
||||
const filteredSubset = getFilteredSubSet(currentFilter)
|
||||
manager.setRender(filteredSubset)
|
||||
}
|
||||
|
||||
const doFilter = (type, show) => {
|
||||
if (show) {
|
||||
storageModule.showCategory(type)
|
||||
} else {
|
||||
storageModule.hideCategory(type)
|
||||
}
|
||||
|
||||
const currentFilter = storageModule.getVisible()
|
||||
const filteredSubset = getFilteredSubSet(currentFilter)
|
||||
manager.setRender(filteredSubset)
|
||||
|
||||
const sortColumn = storageModule.getSort()
|
||||
doSort(sortColumn, true)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
doFilter,
|
||||
doInitFilter,
|
||||
}
|
||||
|
||||
},{"./datamanager.js":1,"./sort.js":7,"./storage.js":8}],4:[function(require,module,exports){
|
||||
const { redraw, bindEvents, renderStatic } = require('./main.js')
|
||||
const { doInitFilter } = require('./filter.js')
|
||||
const { doInitSort } = require('./sort.js')
|
||||
const { manager } = require('./datamanager.js')
|
||||
const data = JSON.parse(document.getElementById('data-container').dataset.jsonblob)
|
||||
|
||||
function init() {
|
||||
manager.setManager(data)
|
||||
doInitFilter()
|
||||
doInitSort()
|
||||
renderStatic()
|
||||
redraw()
|
||||
bindEvents()
|
||||
}
|
||||
|
||||
init()
|
||||
|
||||
},{"./datamanager.js":1,"./filter.js":3,"./main.js":5,"./sort.js":7}],5:[function(require,module,exports){
|
||||
const { dom, find, findAll } = require('./dom.js')
|
||||
const { manager } = require('./datamanager.js')
|
||||
const { doSort } = require('./sort.js')
|
||||
const { doFilter } = require('./filter.js')
|
||||
const {
|
||||
getVisible,
|
||||
getCollapsedIds,
|
||||
setCollapsedIds,
|
||||
getSort,
|
||||
getSortDirection,
|
||||
possibleFilters,
|
||||
} = require('./storage.js')
|
||||
|
||||
const removeChildren = (node) => {
|
||||
while (node.firstChild) {
|
||||
node.removeChild(node.firstChild)
|
||||
}
|
||||
}
|
||||
|
||||
const renderStatic = () => {
|
||||
const renderEnvironmentTable = () => {
|
||||
const environment = manager.environment
|
||||
const rows = Object.keys(environment).map((key) => dom.getStaticRow(key, environment[key]))
|
||||
const table = document.getElementById('environment')
|
||||
removeChildren(table)
|
||||
rows.forEach((row) => table.appendChild(row))
|
||||
}
|
||||
renderEnvironmentTable()
|
||||
}
|
||||
|
||||
const addItemToggleListener = (elem) => {
|
||||
elem.addEventListener('click', ({ target }) => {
|
||||
const id = target.parentElement.dataset.id
|
||||
manager.toggleCollapsedItem(id)
|
||||
|
||||
const collapsedIds = getCollapsedIds()
|
||||
if (collapsedIds.includes(id)) {
|
||||
const updated = collapsedIds.filter((item) => item !== id)
|
||||
setCollapsedIds(updated)
|
||||
} else {
|
||||
collapsedIds.push(id)
|
||||
setCollapsedIds(collapsedIds)
|
||||
}
|
||||
redraw()
|
||||
})
|
||||
}
|
||||
|
||||
const renderContent = (tests) => {
|
||||
const sortAttr = getSort(manager.initialSort)
|
||||
const sortAsc = JSON.parse(getSortDirection())
|
||||
const rows = tests.map(dom.getResultTBody)
|
||||
const table = document.getElementById('results-table')
|
||||
const tableHeader = document.getElementById('results-table-head')
|
||||
|
||||
const newTable = document.createElement('table')
|
||||
newTable.id = 'results-table'
|
||||
|
||||
// remove all sorting classes and set the relevant
|
||||
findAll('.sortable', tableHeader).forEach((elem) => elem.classList.remove('asc', 'desc'))
|
||||
tableHeader.querySelector(`.sortable[data-column-type="${sortAttr}"]`)?.classList.add(sortAsc ? 'desc' : 'asc')
|
||||
newTable.appendChild(tableHeader)
|
||||
|
||||
if (!rows.length) {
|
||||
const emptyTable = document.getElementById('template_results-table__body--empty').content.cloneNode(true)
|
||||
newTable.appendChild(emptyTable)
|
||||
} else {
|
||||
rows.forEach((row) => {
|
||||
if (!!row) {
|
||||
findAll('.collapsible td:not(.col-links', row).forEach(addItemToggleListener)
|
||||
find('.logexpander', row).addEventListener('click',
|
||||
(evt) => evt.target.parentNode.classList.toggle('expanded'),
|
||||
)
|
||||
newTable.appendChild(row)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
table.replaceWith(newTable)
|
||||
}
|
||||
|
||||
const renderDerived = () => {
|
||||
const currentFilter = getVisible()
|
||||
possibleFilters.forEach((result) => {
|
||||
const input = document.querySelector(`input[data-test-result="${result}"]`)
|
||||
input.checked = currentFilter.includes(result)
|
||||
})
|
||||
}
|
||||
|
||||
const bindEvents = () => {
|
||||
const filterColumn = (evt) => {
|
||||
const { target: element } = evt
|
||||
const { testResult } = element.dataset
|
||||
|
||||
doFilter(testResult, element.checked)
|
||||
const collapsedIds = getCollapsedIds()
|
||||
const updated = manager.renderData.tests.map((test) => {
|
||||
return {
|
||||
...test,
|
||||
collapsed: collapsedIds.includes(test.id),
|
||||
}
|
||||
})
|
||||
manager.setRender(updated)
|
||||
redraw()
|
||||
}
|
||||
|
||||
const header = document.getElementById('environment-header')
|
||||
header.addEventListener('click', () => {
|
||||
const table = document.getElementById('environment')
|
||||
table.classList.toggle('hidden')
|
||||
header.classList.toggle('collapsed')
|
||||
})
|
||||
|
||||
findAll('input[name="filter_checkbox"]').forEach((elem) => {
|
||||
elem.addEventListener('click', filterColumn)
|
||||
})
|
||||
|
||||
findAll('.sortable').forEach((elem) => {
|
||||
elem.addEventListener('click', (evt) => {
|
||||
const { target: element } = evt
|
||||
const { columnType } = element.dataset
|
||||
doSort(columnType)
|
||||
redraw()
|
||||
})
|
||||
})
|
||||
|
||||
document.getElementById('show_all_details').addEventListener('click', () => {
|
||||
manager.allCollapsed = false
|
||||
setCollapsedIds([])
|
||||
redraw()
|
||||
})
|
||||
document.getElementById('hide_all_details').addEventListener('click', () => {
|
||||
manager.allCollapsed = true
|
||||
const allIds = manager.renderData.tests.map((test) => test.id)
|
||||
setCollapsedIds(allIds)
|
||||
redraw()
|
||||
})
|
||||
}
|
||||
|
||||
const redraw = () => {
|
||||
const { testSubset } = manager
|
||||
|
||||
renderContent(testSubset)
|
||||
renderDerived()
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
redraw,
|
||||
bindEvents,
|
||||
renderStatic,
|
||||
}
|
||||
|
||||
},{"./datamanager.js":1,"./dom.js":2,"./filter.js":3,"./sort.js":7,"./storage.js":8}],6:[function(require,module,exports){
|
||||
class MediaViewer {
|
||||
constructor(assets) {
|
||||
this.assets = assets
|
||||
this.index = 0
|
||||
}
|
||||
|
||||
nextActive() {
|
||||
this.index = this.index === this.assets.length - 1 ? 0 : this.index + 1
|
||||
return [this.activeFile, this.index]
|
||||
}
|
||||
|
||||
prevActive() {
|
||||
this.index = this.index === 0 ? this.assets.length - 1 : this.index -1
|
||||
return [this.activeFile, this.index]
|
||||
}
|
||||
|
||||
get currentIndex() {
|
||||
return this.index
|
||||
}
|
||||
|
||||
get activeFile() {
|
||||
return this.assets[this.index]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const setup = (resultBody, assets) => {
|
||||
if (!assets.length) {
|
||||
resultBody.querySelector('.media').classList.add('hidden')
|
||||
return
|
||||
}
|
||||
|
||||
const mediaViewer = new MediaViewer(assets)
|
||||
const container = resultBody.querySelector('.media-container')
|
||||
const leftArrow = resultBody.querySelector('.media-container__nav--left')
|
||||
const rightArrow = resultBody.querySelector('.media-container__nav--right')
|
||||
const mediaName = resultBody.querySelector('.media__name')
|
||||
const counter = resultBody.querySelector('.media__counter')
|
||||
const imageEl = resultBody.querySelector('img')
|
||||
const sourceEl = resultBody.querySelector('source')
|
||||
const videoEl = resultBody.querySelector('video')
|
||||
|
||||
const setImg = (media, index) => {
|
||||
if (media?.format_type === 'image') {
|
||||
imageEl.src = media.path
|
||||
|
||||
imageEl.classList.remove('hidden')
|
||||
videoEl.classList.add('hidden')
|
||||
} else if (media?.format_type === 'video') {
|
||||
sourceEl.src = media.path
|
||||
|
||||
videoEl.classList.remove('hidden')
|
||||
imageEl.classList.add('hidden')
|
||||
}
|
||||
|
||||
mediaName.innerText = media?.name
|
||||
counter.innerText = `${index + 1} / ${assets.length}`
|
||||
}
|
||||
setImg(mediaViewer.activeFile, mediaViewer.currentIndex)
|
||||
|
||||
const moveLeft = () => {
|
||||
const [media, index] = mediaViewer.prevActive()
|
||||
setImg(media, index)
|
||||
}
|
||||
const doRight = () => {
|
||||
const [media, index] = mediaViewer.nextActive()
|
||||
setImg(media, index)
|
||||
}
|
||||
const openImg = () => {
|
||||
window.open(mediaViewer.activeFile.path, '_blank')
|
||||
}
|
||||
if (assets.length === 1) {
|
||||
container.classList.add('media-container--fullscreen')
|
||||
} else {
|
||||
leftArrow.addEventListener('click', moveLeft)
|
||||
rightArrow.addEventListener('click', doRight)
|
||||
}
|
||||
imageEl.addEventListener('click', openImg)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
setup,
|
||||
}
|
||||
|
||||
},{}],7:[function(require,module,exports){
|
||||
const { manager } = require('./datamanager.js')
|
||||
const storageModule = require('./storage.js')
|
||||
|
||||
const genericSort = (list, key, ascending, customOrder) => {
|
||||
let sorted
|
||||
if (customOrder) {
|
||||
sorted = list.sort((a, b) => {
|
||||
const aValue = a.result.toLowerCase()
|
||||
const bValue = b.result.toLowerCase()
|
||||
|
||||
const aIndex = customOrder.findIndex((item) => item.toLowerCase() === aValue)
|
||||
const bIndex = customOrder.findIndex((item) => item.toLowerCase() === bValue)
|
||||
|
||||
// Compare the indices to determine the sort order
|
||||
return aIndex - bIndex
|
||||
})
|
||||
} else {
|
||||
sorted = list.sort((a, b) => a[key] === b[key] ? 0 : a[key] > b[key] ? 1 : -1)
|
||||
}
|
||||
|
||||
if (ascending) {
|
||||
sorted.reverse()
|
||||
}
|
||||
return sorted
|
||||
}
|
||||
|
||||
const durationSort = (list, ascending) => {
|
||||
const parseDuration = (duration) => {
|
||||
if (duration.includes(':')) {
|
||||
// If it's in the format "HH:mm:ss"
|
||||
const [hours, minutes, seconds] = duration.split(':').map(Number)
|
||||
return (hours * 3600 + minutes * 60 + seconds) * 1000
|
||||
} else {
|
||||
// If it's in the format "nnn ms"
|
||||
return parseInt(duration)
|
||||
}
|
||||
}
|
||||
const sorted = list.sort((a, b) => parseDuration(a['duration']) - parseDuration(b['duration']))
|
||||
if (ascending) {
|
||||
sorted.reverse()
|
||||
}
|
||||
return sorted
|
||||
}
|
||||
|
||||
const doInitSort = () => {
|
||||
const type = storageModule.getSort(manager.initialSort)
|
||||
const ascending = storageModule.getSortDirection()
|
||||
const list = manager.testSubset
|
||||
const initialOrder = ['Error', 'Failed', 'Rerun', 'XFailed', 'XPassed', 'Skipped', 'Passed']
|
||||
|
||||
storageModule.setSort(type)
|
||||
storageModule.setSortDirection(ascending)
|
||||
|
||||
if (type?.toLowerCase() === 'original') {
|
||||
manager.setRender(list)
|
||||
} else {
|
||||
let sortedList
|
||||
switch (type) {
|
||||
case 'duration':
|
||||
sortedList = durationSort(list, ascending)
|
||||
break
|
||||
case 'result':
|
||||
sortedList = genericSort(list, type, ascending, initialOrder)
|
||||
break
|
||||
default:
|
||||
sortedList = genericSort(list, type, ascending)
|
||||
break
|
||||
}
|
||||
manager.setRender(sortedList)
|
||||
}
|
||||
}
|
||||
|
||||
const doSort = (type, skipDirection) => {
|
||||
const newSortType = storageModule.getSort(manager.initialSort) !== type
|
||||
const currentAsc = storageModule.getSortDirection()
|
||||
let ascending
|
||||
if (skipDirection) {
|
||||
ascending = currentAsc
|
||||
} else {
|
||||
ascending = newSortType ? false : !currentAsc
|
||||
}
|
||||
storageModule.setSort(type)
|
||||
storageModule.setSortDirection(ascending)
|
||||
|
||||
const list = manager.testSubset
|
||||
const sortedList = type === 'duration' ? durationSort(list, ascending) : genericSort(list, type, ascending)
|
||||
manager.setRender(sortedList)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
doInitSort,
|
||||
doSort,
|
||||
}
|
||||
|
||||
},{"./datamanager.js":1,"./storage.js":8}],8:[function(require,module,exports){
|
||||
const possibleFilters = [
|
||||
'passed',
|
||||
'skipped',
|
||||
'failed',
|
||||
'error',
|
||||
'xfailed',
|
||||
'xpassed',
|
||||
'rerun',
|
||||
]
|
||||
|
||||
const getVisible = () => {
|
||||
const url = new URL(window.location.href)
|
||||
const settings = new URLSearchParams(url.search).get('visible')
|
||||
const lower = (item) => {
|
||||
const lowerItem = item.toLowerCase()
|
||||
if (possibleFilters.includes(lowerItem)) {
|
||||
return lowerItem
|
||||
}
|
||||
return null
|
||||
}
|
||||
return settings === null ?
|
||||
possibleFilters :
|
||||
[...new Set(settings?.split(',').map(lower).filter((item) => item))]
|
||||
}
|
||||
|
||||
const hideCategory = (categoryToHide) => {
|
||||
const url = new URL(window.location.href)
|
||||
const visibleParams = new URLSearchParams(url.search).get('visible')
|
||||
const currentVisible = visibleParams ? visibleParams.split(',') : [...possibleFilters]
|
||||
const settings = [...new Set(currentVisible)].filter((f) => f !== categoryToHide).join(',')
|
||||
|
||||
url.searchParams.set('visible', settings)
|
||||
window.history.pushState({}, null, unescape(url.href))
|
||||
}
|
||||
|
||||
const showCategory = (categoryToShow) => {
|
||||
if (typeof window === 'undefined') {
|
||||
return
|
||||
}
|
||||
const url = new URL(window.location.href)
|
||||
const currentVisible = new URLSearchParams(url.search).get('visible')?.split(',').filter(Boolean) ||
|
||||
[...possibleFilters]
|
||||
const settings = [...new Set([categoryToShow, ...currentVisible])]
|
||||
const noFilter = possibleFilters.length === settings.length || !settings.length
|
||||
|
||||
noFilter ? url.searchParams.delete('visible') : url.searchParams.set('visible', settings.join(','))
|
||||
window.history.pushState({}, null, unescape(url.href))
|
||||
}
|
||||
|
||||
const getSort = (initialSort) => {
|
||||
const url = new URL(window.location.href)
|
||||
let sort = new URLSearchParams(url.search).get('sort')
|
||||
if (!sort) {
|
||||
sort = initialSort || 'result'
|
||||
}
|
||||
return sort
|
||||
}
|
||||
|
||||
const setSort = (type) => {
|
||||
const url = new URL(window.location.href)
|
||||
url.searchParams.set('sort', type)
|
||||
window.history.pushState({}, null, unescape(url.href))
|
||||
}
|
||||
|
||||
const getCollapsedCategory = (renderCollapsed) => {
|
||||
let categories
|
||||
if (typeof window !== 'undefined') {
|
||||
const url = new URL(window.location.href)
|
||||
const collapsedItems = new URLSearchParams(url.search).get('collapsed')
|
||||
switch (true) {
|
||||
case !renderCollapsed && collapsedItems === null:
|
||||
categories = ['passed']
|
||||
break
|
||||
case collapsedItems?.length === 0 || /^["']{2}$/.test(collapsedItems):
|
||||
categories = []
|
||||
break
|
||||
case /^all$/.test(collapsedItems) || collapsedItems === null && /^all$/.test(renderCollapsed):
|
||||
categories = [...possibleFilters]
|
||||
break
|
||||
default:
|
||||
categories = collapsedItems?.split(',').map((item) => item.toLowerCase()) || renderCollapsed
|
||||
break
|
||||
}
|
||||
} else {
|
||||
categories = []
|
||||
}
|
||||
return categories
|
||||
}
|
||||
|
||||
const getSortDirection = () => JSON.parse(sessionStorage.getItem('sortAsc')) || false
|
||||
const setSortDirection = (ascending) => sessionStorage.setItem('sortAsc', ascending)
|
||||
|
||||
const getCollapsedIds = () => JSON.parse(sessionStorage.getItem('collapsedIds')) || []
|
||||
const setCollapsedIds = (list) => sessionStorage.setItem('collapsedIds', JSON.stringify(list))
|
||||
|
||||
module.exports = {
|
||||
getVisible,
|
||||
hideCategory,
|
||||
showCategory,
|
||||
getCollapsedIds,
|
||||
setCollapsedIds,
|
||||
getSort,
|
||||
setSort,
|
||||
getSortDirection,
|
||||
setSortDirection,
|
||||
getCollapsedCategory,
|
||||
possibleFilters,
|
||||
}
|
||||
|
||||
},{}]},{},[4]);
|
||||
</script>
|
||||
</footer>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
{"report": {"environment": {"Python": "3.12.3", "Platform": "Windows-10-10.0.19045-SP0"}, "tests": [{"name": "tests/test_interface_0.py::Test_interface_0::test_validate_navigation", "duration": 10.97751930000959, "run_index": 0, "setup": {"name": "setup", "duration": 1.6643610000028275, "outcome": "passed"}, "call": {"name": "call", "duration": 5.477519999985816, "outcome": "passed", "stderr": "2024-05-17 12:39:42.555 | INFO | tests.test_interface_0:test_validate_navigation:17 - Verifying designated Interface 0 Page opens successfully\n2024-05-17 12:39:48.030 | INFO | tests.test_interface_0:test_validate_navigation:21 - Designated Interface 0 Page opened successfully\n"}, "teardown": {"name": "teardown", "duration": 2.1712773000181187, "outcome": "passed"}, "outcome": "passed"}], "summary": {"passed": 1, "num_tests": 1, "duration": 13.407023668289185}, "created_at": "2024-05-17 12:39:54.266609"}}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,98 @@
|
||||
import random
|
||||
import time
|
||||
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
from pages.Pre_sign_in_page import Pre_sign_in_page
|
||||
from pages.interface_0_page_objects import Interface_0
|
||||
from pages.interface_1_page_objects import Interface_1
|
||||
from pages.interface_2_page_objects import Interface_2
|
||||
from tests.conftest import client_list
|
||||
from utils.common_methods import sign_in
|
||||
from utils.element_related_methods import get_title, get_invisible_element
|
||||
from utils.logger import get_logger
|
||||
|
||||
|
||||
class Test_end_to_end:
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
# @pytest.mark.skip("Due to broken functionality")
|
||||
@pytest.mark.parametrize("client", client_list())
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for End to end")
|
||||
@allure.sub_suite("Tests for End to end functionality")
|
||||
@allure.title("Verifying End to end functionality")
|
||||
@allure.feature("End to end")
|
||||
@allure.story("Verifying End to end functionality")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_end_to_end(self, client, driver, config, groups):
|
||||
self.logger.info("Verifying End to end functionality")
|
||||
driver.get(
|
||||
config["url_interface_0"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P90Kn8ixTenU_xRich4oROh6FiAIvqe9IcmtiRPSuy7Cl3U70LQWDBnyGZF1wF2US5pmZAl3cYSs3CXilUakzjFaRQS0hZDH-aAb1gwPAtMLD8kA5R0r8ZSuFDfE5TL30BocqNvItA96_6L9DmagcfQmtFhimBmT9zuiGWjDb13rNFI97_UyUojskrzjPLW_PSP_ynOqk9bKCGlsEU4mqnUfHW0HRarnk4nrv-H7mp4LXmHxlpNIUJjIT4lp1vhFz0TdsPXkTypHOhgjPQ6LA0S6NFcdd3pbejPGiRibqwOdS9HI2nYk4g6-FEO7-jRiEchFn_CeXILamMPkZuh4HXvvITZxkYfGHUXqap2mABFXvBknDT0QXqyonjknLCl8-HBmpRt8xe3D5cm95P_147j63uKS3CK9HM7aTAJ9aHAcBwkiF4axlYMoG9WRqC8RbPKaYmBKhcjScCNorqQRKbElXi0O4tkJwkS-CxLElQtQYhwdd1sAxLRSNg4WPz4RN8eH2osmh7RlZz3NrLe465U0PMIFYVRmJSEmiBilYY1LC-Ydg521gxePSpK882qOxJe4URjD2PziYAZ0mFVDvWpsLNtbV3B67mPBlyJD98gkcUsaY-34bmqRxfzbCJRxqBmBrLke-Y4vV16r4m4aAgNIH_sz9nC61hoB46UDpjiwYvMrCRDMrRthsUYD3FpA2CCxTmgNBXYZggLuHrJ_U7pHL71owHdv94yKVmNZOm4D8qs3-0y3zlYzlOC8f-RQQ1WRr7J20L1iN5VOesrv6xwVYS9EQRPOahkmOdwz1LrAcaDoxpr9CI&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
with allure.step("Signing in"):
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_0_page = Interface_0(driver, config)
|
||||
client = interface_0_page.select_client(client)
|
||||
with allure.step("Uploading files"):
|
||||
interface_0_page.upload_files(client)
|
||||
with allure.step("Creating Batch"):
|
||||
interface_0_page.create_batch()
|
||||
with allure.step("Asserting Batch Creating"):
|
||||
assert interface_0_page.verify_message("POS").startswith("batch_")
|
||||
batch = interface_0_page.verify_message("POS")
|
||||
self.logger.info(f"Created batch with Batch ID: {batch}")
|
||||
with allure.step("Navigating to interface 1"):
|
||||
driver.get(
|
||||
config["url_interface_1"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P90Kn8ixTenU_xRich4oROh6FiAIvqe9IcmtiRPSuy7Cl3U70LQWDBnyGZF1wF2US5pmZAl3cYSs3CXilUakzjFaRQS0hZDH-aAb1gwPAtMLD8kA5R0r8ZSuFDfE5TL30BocqNvItA96_6L9DmagcfQmtFhimBmT9zuiGWjDb13rNFI97_UyUojskrzjPLW_PSP_ynOqk9bKCGlsEU4mqnUfHW0HRarnk4nrv-H7mp4LXmHxlpNIUJjIT4lp1vhFz0TdsPXkTypHOhgjPQ6LA0S6NFcdd3pbejPGiRibqwOdS9HI2nYk4g6-FEO7-jRiEchFn_CeXILamMPkZuh4HXvvITZxkYfGHUXqap2mABFXvBknDT0QXqyonjknLCl8-HBmpRt8xe3D5cm95P_147j63uKS3CK9HM7aTAJ9aHAcBwkiF4axlYMoG9WRqC8RbPKaYmBKhcjScCNorqQRKbElXi0O4tkJwkS-CxLElQtQYhwdd1sAxLRSNg4WPz4RN8eH2osmh7RlZz3NrLe465U0PMIFYVRmJSEmiBilYY1LC-Ydg521gxePSpK882qOxJe4URjD2PziYAZ0mFVDvWpsLNtbV3B67mPBlyJD98gkcUsaY-34bmqRxfzbCJRxqBmBrLke-Y4vV16r4m4aAgNIH_sz9nC61hoB46UDpjiwYvMrCRDMrRthsUYD3FpA2CCxTmgNBXYZggLuHrJ_U7pHL71owHdv94yKVmNZOm4D8qs3-0y3zlYzlOC8f-RQQ1WRr7J20L1iN5VOesrv6xwVYS9EQRPOahkmOdwz1LrAcaDoxpr9CI&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# pre_sign_in_page = Pre_sign_in_page(driver)
|
||||
# pre_sign_in_page.click_sign_in_link()
|
||||
# self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_1 · Streamlit")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_1 = Interface_1(driver, config)
|
||||
interface_1.select_client(client)
|
||||
with allure.step("Selecting Batch"):
|
||||
interface_1.select_batch(batch)
|
||||
with allure.step("Selecting Groups"):
|
||||
interface_1.check_group_no(groups)
|
||||
with allure.step("Reading Contracts from S3 Bucket"):
|
||||
interface_1.click_read_the_contracts_from_path()
|
||||
interface_1.check_table_contain()
|
||||
with allure.step("Running Doczy.AI Pipeline"):
|
||||
interface_1.click_run_doczy_ai_pipeline()
|
||||
if interface_1.result_message.text == "Success":
|
||||
self.logger.info(f"Files are passed to Doczy.AI pipeline")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info(f"Files are unable to passed to Doczy.AI pipeline")
|
||||
assert False
|
||||
with allure.step("Signing in"):
|
||||
time.sleep(900)
|
||||
driver.get(
|
||||
config["url_interface_2"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P90Kn8ixTenU_xRich4oROh6FiAIvqe9IcmtiRPSuy7Cl3U70LQWDBnyGZF1wF2US5pmZAl3cYSs3CXilUakzjFaRQS0hZDH-aAb1gwPAtMLD8kA5R0r8ZSuFDfE5TL30BocqNvItA96_6L9DmagcfQmtFhimBmT9zuiGWjDb13rNFI97_UyUojskrzjPLW_PSP_ynOqk9bKCGlsEU4mqnUfHW0HRarnk4nrv-H7mp4LXmHxlpNIUJjIT4lp1vhFz0TdsPXkTypHOhgjPQ6LA0S6NFcdd3pbejPGiRibqwOdS9HI2nYk4g6-FEO7-jRiEchFn_CeXILamMPkZuh4HXvvITZxkYfGHUXqap2mABFXvBknDT0QXqyonjknLCl8-HBmpRt8xe3D5cm95P_147j63uKS3CK9HM7aTAJ9aHAcBwkiF4axlYMoG9WRqC8RbPKaYmBKhcjScCNorqQRKbElXi0O4tkJwkS-CxLElQtQYhwdd1sAxLRSNg4WPz4RN8eH2osmh7RlZz3NrLe465U0PMIFYVRmJSEmiBilYY1LC-Ydg521gxePSpK882qOxJe4URjD2PziYAZ0mFVDvWpsLNtbV3B67mPBlyJD98gkcUsaY-34bmqRxfzbCJRxqBmBrLke-Y4vV16r4m4aAgNIH_sz9nC61hoB46UDpjiwYvMrCRDMrRthsUYD3FpA2CCxTmgNBXYZggLuHrJ_U7pHL71owHdv94yKVmNZOm4D8qs3-0y3zlYzlOC8f-RQQ1WRr7J20L1iN5VOesrv6xwVYS9EQRPOahkmOdwz1LrAcaDoxpr9CI&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# pre_sign_in_page = Pre_sign_in_page(driver)
|
||||
# pre_sign_in_page.click_sign_in_link()
|
||||
# self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_2 · Streamlit")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_2 = Interface_2(driver, config)
|
||||
interface_2.select_client(client)
|
||||
with allure.step("Selecting Batch"):
|
||||
interface_2.select_batch(batch)
|
||||
with allure.step("Selecting Contract"):
|
||||
interface_2.select_contract()
|
||||
with allure.step("Selecting field Group"):
|
||||
interface_2.select_field_group()
|
||||
with allure.step("Click on 'Show Result' Button"):
|
||||
interface_2.click_show_results()
|
||||
interface_2.check_table_contain()
|
||||
@@ -0,0 +1,134 @@
|
||||
import allure
|
||||
|
||||
from config.aws_conn import get_s3_client
|
||||
from pages.Pre_sign_in_page import Pre_sign_in_page
|
||||
from pages.interface_0_page_objects import Interface_0
|
||||
from utils.element_related_methods import get_title
|
||||
from utils.common_methods import sign_in
|
||||
from utils.logger import get_logger
|
||||
import boto3
|
||||
|
||||
|
||||
class Test_interface_0:
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
# @allure.label("type", 'smoke')
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 0")
|
||||
@allure.sub_suite("Tests for Navigation")
|
||||
@allure.title("Verifying designated Interface 0 Page opens successfully")
|
||||
@allure.feature("Interface 0")
|
||||
@allure.story("Verifying designated Interface 0 Page opens successfully")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_validate_navigation(self, driver, config):
|
||||
self.logger.info("Verifying designated Interface 0 Page opens successfully")
|
||||
driver.get(config["url_interface_0"])
|
||||
get_title(driver, config, "interface_0 · Streamlit")
|
||||
if driver.title == "interface_0 · Streamlit":
|
||||
self.logger.info("Designated Interface 0 Page opened successfully")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info("Designated Interface 0 Page not opened successfully")
|
||||
assert False
|
||||
|
||||
# @allure.label('type', 'regression', 'smoke')
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 0")
|
||||
@allure.sub_suite("Tests for Authentication")
|
||||
@allure.title("Verifying Single Sign-On (SSO) Login for Interface 0")
|
||||
@allure.feature("Interface 0")
|
||||
@allure.story("Verifying Single Sign-On (SSO) Login for Interface 0")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_sign_in(self, driver, config):
|
||||
self.logger.info("Verifying Single Sign-On (SSO) Login for Interface 0")
|
||||
driver.get(
|
||||
config["url_interface_0"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P-Xu65_k1cptZUCoWDROksYjcCYq_DvUcJbXG9MczlC6LlsO80A1Y4mYcEajsGirxfVgaxYazfwYb5sXUbARKILzxaoqtvPuW3nJDMPcIjjOCG5bNQo2tu67oUGeIWJEQIMWH0jVXB4D8N1j3m3Rd1lPkV-d_Wr6LNfieAK1ralDynQXV8zd5y5TNJTkplLjazIKbhjMr9SrhfCs4m-_IrWIPcGIteLt4oly-XzxAxgX6mhs0WTgcXqUfuyTuYkPJrZs70exEdNQi48Ml_vZRXux7NXn_yuyRu51qZ34sG89Wj8nkIdmPyoOi-CTwl0QFSUzNKixWczhQssq0WyRfKgw4-afANx2mkHozy9gwL1JbGm6Je29H00ntHrQX0YvSWtEvTT4kdXRh2F6zaS12LZJ31-GUAOUNdZcz09FitSbdEVSF-Z9e4VPNEZVPoUhj3cbFAf02N5Wv3K4vapE24Aof18CHav9gvg5-BcZUzfPhq-zAva2WoC-DANUSPHOjCQlUBRt2WjnJ-9qqAWNV8A9MIf3-tF5kES48HpIVwnt05uCs0t6M6bDJIK6eml4lV9YfVtlmO9LOxhtoMO69Sj5RExcol8Yz_-5T1u0xlbdKlWetUXQTFNwfjcz1u_HYjXVy_fpLFG1M2MdhjtvQ85hxGBv32d8BDYuGeXpjoc-fYEOnm1tOlESrqbZBzFLRv1MmRlkxiAg3uW0Myb32wKjS2iTFp3pkQ-D8Yxv1h0_HRd9ZeCQE-JfLJ2HALswI9wxLFidsCvZ4xaOXpqLZX0o8U7SwHvLw9BRvPvPol5b7mHQ9_OS&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_0 · Streamlit")
|
||||
if driver.title == "interface_0 · Streamlit":
|
||||
self.logger.info("Interface 0 page opened successfully")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info("Interface 0 page not opened successfully")
|
||||
assert False
|
||||
|
||||
# @allure.label('type', 'regression', 'smoke')
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 0")
|
||||
@allure.sub_suite("Tests for Batch Creation")
|
||||
@allure.title("Verifying S3 bucket is created with batch ID")
|
||||
@allure.feature("Interface 0")
|
||||
@allure.story("Verifying S3 bucket is created with batch ID")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
@allure.testcase("TC-003")
|
||||
def test_verify_batch_creation(self, driver, config):
|
||||
self.logger.info("Verifying S3 bucket is created with batch ID")
|
||||
driver.get(
|
||||
config["url_interface_0"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P-Xu65_k1cptZUCoWDROksYjcCYq_DvUcJbXG9MczlC6LlsO80A1Y4mYcEajsGirxfVgaxYazfwYb5sXUbARKILzxaoqtvPuW3nJDMPcIjjOCG5bNQo2tu67oUGeIWJEQIMWH0jVXB4D8N1j3m3Rd1lPkV-d_Wr6LNfieAK1ralDynQXV8zd5y5TNJTkplLjazIKbhjMr9SrhfCs4m-_IrWIPcGIteLt4oly-XzxAxgX6mhs0WTgcXqUfuyTuYkPJrZs70exEdNQi48Ml_vZRXux7NXn_yuyRu51qZ34sG89Wj8nkIdmPyoOi-CTwl0QFSUzNKixWczhQssq0WyRfKgw4-afANx2mkHozy9gwL1JbGm6Je29H00ntHrQX0YvSWtEvTT4kdXRh2F6zaS12LZJ31-GUAOUNdZcz09FitSbdEVSF-Z9e4VPNEZVPoUhj3cbFAf02N5Wv3K4vapE24Aof18CHav9gvg5-BcZUzfPhq-zAva2WoC-DANUSPHOjCQlUBRt2WjnJ-9qqAWNV8A9MIf3-tF5kES48HpIVwnt05uCs0t6M6bDJIK6eml4lV9YfVtlmO9LOxhtoMO69Sj5RExcol8Yz_-5T1u0xlbdKlWetUXQTFNwfjcz1u_HYjXVy_fpLFG1M2MdhjtvQ85hxGBv32d8BDYuGeXpjoc-fYEOnm1tOlESrqbZBzFLRv1MmRlkxiAg3uW0Myb32wKjS2iTFp3pkQ-D8Yxv1h0_HRd9ZeCQE-JfLJ2HALswI9wxLFidsCvZ4xaOXpqLZX0o8U7SwHvLw9BRvPvPol5b7mHQ9_OS&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
with allure.step("Signing in"):
|
||||
self.logger.info("Signed in successful")
|
||||
interface_0_page = Interface_0(driver, config)
|
||||
|
||||
with allure.step("Selecting Client"):
|
||||
client_name = interface_0_page.select_client("Centene")
|
||||
with allure.step("Uploading files"):
|
||||
interface_0_page.upload_files(client_name)
|
||||
with allure.step("Creating Batch"):
|
||||
interface_0_page.create_batch()
|
||||
# self.logger.info(f"Created batch with Batch ID: {interface_0_page.p_element.text}")
|
||||
with allure.step("Asserting Batch Creating"):
|
||||
assert interface_0_page.verify_message("POS").startswith("batch_")
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 0")
|
||||
@allure.sub_suite("Tests for Batch Creation without client")
|
||||
@allure.title("Verifying S3 bucket is created without selecting client")
|
||||
@allure.feature("Interface 0")
|
||||
@allure.story("Verifying S3 bucket is created without selecting client")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_batch_creation_without_client(self, driver, config):
|
||||
self.logger.info("Verifying S3 bucket is created without selecting client")
|
||||
driver.get(
|
||||
config["url_interface_0"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P-Xu65_k1cptZUCoWDROksYjcCYq_DvUcJbXG9MczlC6LlsO80A1Y4mYcEajsGirxfVgaxYazfwYb5sXUbARKILzxaoqtvPuW3nJDMPcIjjOCG5bNQo2tu67oUGeIWJEQIMWH0jVXB4D8N1j3m3Rd1lPkV-d_Wr6LNfieAK1ralDynQXV8zd5y5TNJTkplLjazIKbhjMr9SrhfCs4m-_IrWIPcGIteLt4oly-XzxAxgX6mhs0WTgcXqUfuyTuYkPJrZs70exEdNQi48Ml_vZRXux7NXn_yuyRu51qZ34sG89Wj8nkIdmPyoOi-CTwl0QFSUzNKixWczhQssq0WyRfKgw4-afANx2mkHozy9gwL1JbGm6Je29H00ntHrQX0YvSWtEvTT4kdXRh2F6zaS12LZJ31-GUAOUNdZcz09FitSbdEVSF-Z9e4VPNEZVPoUhj3cbFAf02N5Wv3K4vapE24Aof18CHav9gvg5-BcZUzfPhq-zAva2WoC-DANUSPHOjCQlUBRt2WjnJ-9qqAWNV8A9MIf3-tF5kES48HpIVwnt05uCs0t6M6bDJIK6eml4lV9YfVtlmO9LOxhtoMO69Sj5RExcol8Yz_-5T1u0xlbdKlWetUXQTFNwfjcz1u_HYjXVy_fpLFG1M2MdhjtvQ85hxGBv32d8BDYuGeXpjoc-fYEOnm1tOlESrqbZBzFLRv1MmRlkxiAg3uW0Myb32wKjS2iTFp3pkQ-D8Yxv1h0_HRd9ZeCQE-JfLJ2HALswI9wxLFidsCvZ4xaOXpqLZX0o8U7SwHvLw9BRvPvPol5b7mHQ9_OS&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
interface_0_page = Interface_0(driver, config)
|
||||
interface_0_page.create_batch()
|
||||
assert (
|
||||
interface_0_page.verify_message("NEG") == "No Client Name Selected."
|
||||
), "Batch ID is created instead of message"
|
||||
|
||||
# @allure.label("type", 'regression')
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 0")
|
||||
@allure.sub_suite("Tests for Batch Creation without files")
|
||||
@allure.title("Verifying S3 bucket is created with no files are uploaded")
|
||||
@allure.feature("Interface 0")
|
||||
@allure.story("Verifying S3 bucket is created with no files are uploaded")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_no_files_uploaded(self, driver, config):
|
||||
self.logger.info("Verifying S3 bucket is created with no files are uploaded")
|
||||
driver.get(
|
||||
config["url_interface_0"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P9LX84t_sXygReogqiCvr7kFfaCaIcCEnNTGHigLFFW27KaCXXvBZ4b6UzF9L92ozdGa9JxHLXSNERV8wUc7DZRC5U_FC1U-hcSZjGFGA_rteC6-iOnqSqzp58hTnxJw5gBPxwqO0ZIBZy3zbjfe2piABPrTTvvftQ_ccdzbZoSoBfVbvpnWNpesYapFyc8zCnUdfKAS3sz65mtBouZqqgRQ6C31NhaoUMl5qFmqLs01vM50k3VrnRA_AqkzMTne0nNgt53FsdQ2WbubuIIZnwNFbDO8WwskHT2r_jVjnSXXs7pgufPMgV0DOlu2BRZKnabLSqiYa0OGsUepnB7dTV9QlduQw-_TYyXdiReapwXxkz9RtfgM8EUgt1ldTGB5Qd4GOtXDwACNcas53RxUoKJeI2vLVLSXKAtvhROs8NqvF222T1IWWDjjari6-M661OZd2kEmx9JeRilSlmIylonz8qhmL40dRWsDppiSeoPiCgIQsoIqZJiCD8TTMyUSo23qxDcQZamIR8LlteELMQdZHUpSfQG8vKCF02I7Bxc8zD8aksP-27O7g7JTCwWQ3OOFbTGH2hy9_JZFzWCj6W8vYbb9yjGJrAccevXg6T-FBa6LBqWZBmTP9q6Ic8XQOUFZaYMkceMuDg6-ARDxyLXWE60ajN3fQA0xkFrWXOyaCJY3fYnxpHwRk_jyC_yEAaZCciUHFyDPK_Uiudh4L4jbpy7wKM_GPR0faJE0OPJbTc32SId6-LC9e2ECaFYtyUNTkLw-DVhZ2MnFbUEj-Y0SAoRYchAroTF7EfByMFLqSXAKeGj&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
with allure.step("Sign In"):
|
||||
self.logger.info("Signed in successful")
|
||||
interface_0_page = Interface_0(driver, config)
|
||||
with allure.step("Selecting Client"):
|
||||
interface_0_page.select_client("Centene")
|
||||
with allure.step("Creating Batch"):
|
||||
interface_0_page.create_batch()
|
||||
assert (
|
||||
interface_0_page.verify_message("NEG") == "No Files Selected."
|
||||
), "Batch ID is created instead of message"
|
||||
@@ -0,0 +1,147 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
from pages.interface_1_page_objects import Interface_1
|
||||
from tests.conftest import groups
|
||||
from utils.element_related_methods import get_title
|
||||
from utils.common_methods import sign_in
|
||||
from utils.logger import get_logger
|
||||
|
||||
|
||||
class Test_interface_1:
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 1")
|
||||
@allure.sub_suite("Tests for Navigation")
|
||||
@allure.title("Verifying designated Interface 1 Page opens successfully")
|
||||
@allure.feature("Interface 1")
|
||||
@allure.story("Verifying designated Interface 1 Page opens successfully")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_validate_navigation(self, driver, config):
|
||||
self.logger.info("Verifying designated Interface 1 Page opens successfully")
|
||||
driver.get(config["url_interface_1"])
|
||||
self.logger.info(f"url_interface_1 {config['url_interface_1']} opened")
|
||||
get_title(driver, config, "interface_1 · Streamlit")
|
||||
if driver.title == "interface_1 · Streamlit":
|
||||
self.logger.info("Designated Interface 1 Page opened successfully")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info("Designated Interface 1 Page not opened successfully")
|
||||
assert False
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 1")
|
||||
@allure.sub_suite("Tests for Authentication")
|
||||
@allure.title("Verifying Single Sign-On (SSO) Login for Interface 1")
|
||||
@allure.feature("Interface 1")
|
||||
@allure.story("Verifying Single Sign-On (SSO) Login for Interface 1")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_sign_in(self, driver, config):
|
||||
self.logger.info("Verifying Single Sign-On (SSO) Login for Interface 1")
|
||||
driver.get(
|
||||
config["url_interface_1"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P-OZmUc_k67ay91q5x8iGq-FCMcsGOuN-RILqMWR3WzTHoAUItcREFppJowN22APhWP0_3aO-H-ByYLq_4toR4SkrJ83TIfavORbh2T-CllhzINKejOopV6Oj2TGqnANs2vp_vgpufdLpQiYcT5Cntcx6Zfz4TZCFrmFNjxoLox5FcXrNiwv_yTFyoiHaIUJG-cIaOn_oTqRGo7O-hUouN9JVxhmnU7ufPFdqEyvj566q9FddhHWKDUAh15f8nxWwRKqI65-vBXTiygJZboznnFjs4kQaXi7sRrmoT1uXt73lxr6FQe6bzlIWxHRWXci50qp4J_MU5gfZ1vSzJS5zFzFy7W2spTG7hByAH9LVv3us5Q_dAvr2_J3rn6zLJaZBnp_xRJ6cJM9e_zgcxL5zD6vVPtFkuqxWpV_Axtm2xrqTS7q03WRoDDwhRlHC02whsP8HVovurA-knXTrIRHM4p1eRSfK99EuKkev0eOGL5cNSKT-JNLQoe23R-JstAqhlyTSTis2wNK8I5Y2kd5esJGnBoe1jHeyTD5a-yppMfmBd6nW90_nvOc0eipFxMuWnhvYs56ex5Mv7PM6iWvnrP2ewVPbRI7oFa8WM_YhJ84Je4JRVw-HGi8Ftfv3pZfn8kxfxAp2lvncXw9GmCjm3eig-NdJqB1gpNGXN-lPZgMzjOwX5REWe3Wvqn2wK9sNd9gSzGTUCtHCN9NCkuSqkUAlAxECMy7FVuUl8i3CqNCkfrd7EI-LwczhRaOnKT9VJF0E544fAK1W5GWKMBGcrcrp8fJwOdAHqf8R7Mcsl3XzrafYzJo1SO&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_1 · Streamlit")
|
||||
if driver.title == "interface_1 · Streamlit":
|
||||
self.logger.info("Interface 1 page opened successfully")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info("Interface 1 page not opened successfully")
|
||||
assert False
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 1")
|
||||
@allure.sub_suite("Tests for Read the contracts from Path")
|
||||
@allure.title('Verify the "Read the contracts from Path" button functionality')
|
||||
@allure.feature("Interface 1")
|
||||
@allure.story('Verify the "Read the contracts from Path" button functionality')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_read_contract_from_path(self, driver, config, groups):
|
||||
self.logger.info(
|
||||
'Verify the "Read the contracts from Path" button functionality'
|
||||
)
|
||||
driver.get(
|
||||
config["url_interface_1"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P-OZmUc_k67ay91q5x8iGq-FCMcsGOuN-RILqMWR3WzTHoAUItcREFppJowN22APhWP0_3aO-H-ByYLq_4toR4SkrJ83TIfavORbh2T-CllhzINKejOopV6Oj2TGqnANs2vp_vgpufdLpQiYcT5Cntcx6Zfz4TZCFrmFNjxoLox5FcXrNiwv_yTFyoiHaIUJG-cIaOn_oTqRGo7O-hUouN9JVxhmnU7ufPFdqEyvj566q9FddhHWKDUAh15f8nxWwRKqI65-vBXTiygJZboznnFjs4kQaXi7sRrmoT1uXt73lxr6FQe6bzlIWxHRWXci50qp4J_MU5gfZ1vSzJS5zFzFy7W2spTG7hByAH9LVv3us5Q_dAvr2_J3rn6zLJaZBnp_xRJ6cJM9e_zgcxL5zD6vVPtFkuqxWpV_Axtm2xrqTS7q03WRoDDwhRlHC02whsP8HVovurA-knXTrIRHM4p1eRSfK99EuKkev0eOGL5cNSKT-JNLQoe23R-JstAqhlyTSTis2wNK8I5Y2kd5esJGnBoe1jHeyTD5a-yppMfmBd6nW90_nvOc0eipFxMuWnhvYs56ex5Mv7PM6iWvnrP2ewVPbRI7oFa8WM_YhJ84Je4JRVw-HGi8Ftfv3pZfn8kxfxAp2lvncXw9GmCjm3eig-NdJqB1gpNGXN-lPZgMzjOwX5REWe3Wvqn2wK9sNd9gSzGTUCtHCN9NCkuSqkUAlAxECMy7FVuUl8i3CqNCkfrd7EI-LwczhRaOnKT9VJF0E544fAK1W5GWKMBGcrcrp8fJwOdAHqf8R7Mcsl3XzrafYzJo1SO&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
with allure.step("Signing in"):
|
||||
# sign_in(driver, config)
|
||||
self.logger.debug("Signed in successful")
|
||||
get_title(driver, config, "interface_1 · Streamlit")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_1 = Interface_1(driver, config)
|
||||
interface_1.select_client("Centene")
|
||||
with allure.step("Selecting Batch"):
|
||||
interface_1.select_batch("batch_190624022330")
|
||||
with allure.step("Selecting Groups"):
|
||||
interface_1.check_group_no(groups)
|
||||
with allure.step("Reading Contracts from S3 Bucket"):
|
||||
interface_1.click_read_the_contracts_from_path()
|
||||
interface_1.check_table_contain()
|
||||
|
||||
# @pytest.mark.skip("Due to broken functionality")
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 1")
|
||||
@allure.sub_suite("Tests for Run Doczy.AI Pipeline")
|
||||
@allure.title('Verify "Run Doczy.AI Pipeline" button functionality')
|
||||
@allure.feature("Interface 1")
|
||||
@allure.story('Verify "Run Doczy.AI Pipeline" button functionality')
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_run_doczy_ai_pipeline(self, driver, config, groups):
|
||||
self.logger.info('Verify "Run Doczy.AI Pipeline" button functionality')
|
||||
driver.get(
|
||||
config["url_interface_1"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P9xUVp2PJ6-Ymm_h4pBRlXjhIYg3cEOpiosJGKkG8EF0WMNT10RyUeKXqrs3UDMkLlTCZy3qMPFePktnSIkLU7AmdUv_QXjPc221BMScHwImuvMxH5YhN8s8jeJuS9GWMnllIbKInqHn_DNzL5uBSMVCd3lx1YEtHTr2Bn_MY4Vp9TS7Z3byW3upWK77c6SE6Fsv4nBTTab_4ebD_cLAanFoY2BPZdKXPngveBjjxDPUcAXD3JvRwUGHPUR8Iv3sRip6lqa02SsXt0_UzhypRYRmP67P52D_xhGjfQ--FuVF_M87UTnFK4FeNVHSeU6SRKJA9VWG9QDnizP-xiRB_8cnfmaaBw2UWnpbXC1o_EnsWPbjyomHylkPTc69gygghWBOGwR8agZA3B8sWjz-pMJO8E7hWpOIBlsEeRLJieXgBZxdRG77JZ4iUtJZZ0Dd-1VFxQCh8bSUl9TBdHA8wzui-dqNd15xKDHtS7FA3BHGZOICrYcKeiaShjC2OhQl71oUOtF8o31zsyUvq9jeTCL64X1l_xL8ePDqzinfJeaN--mPea3QZHkd3P6jOGdT4cTD9u-RBTD-Qbu6dj5egQDgUSPCcfL7kVeSz0QSi8jpqUoxJi4RTOXZEFLX77n88kUJczMsUsSQSdzTaKBDXY5HQwFK79jE5uJ7hwdBcEtKBHv0zoE0pn8RogLwzKk6SG-6R94UAuvuYw-ivkW8HyCWbGHQq_QSj5YdMEyBO2C-woCH5qwFbN4qoTc-OabOvW4lHTfFyeoJB7ryUdHilMd1kdAPe6WNNRKCmLb0Ofn_Jv5eqFID6L7DtmEJCc&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_1 · Streamlit")
|
||||
interface_1 = Interface_1(driver, config)
|
||||
interface_1.select_client()
|
||||
interface_1.select_batch()
|
||||
interface_1.check_group_no(groups)
|
||||
interface_1.click_read_the_contracts_from_path()
|
||||
interface_1.check_table_contain()
|
||||
interface_1.click_run_doczy_ai_pipeline()
|
||||
if interface_1.result_message.text == "Success":
|
||||
self.logger.info(f"Files are passed to Doczy.AI pipeline")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info(f"Files are passed to Doczy.AI pipeline")
|
||||
assert True
|
||||
|
||||
@pytest.mark.skip("Due to broken functionality")
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 1")
|
||||
@allure.sub_suite("Tests for Run Doczy.AI Pipeline with no Groups")
|
||||
@allure.title(
|
||||
'Verify if none Group No is selected from Group No Checkbox or from table then "Run Doczy.AI Pipeline"should not be functional'
|
||||
)
|
||||
@allure.feature("Interface 1")
|
||||
@allure.story(
|
||||
'Verify if none Group No is selected from Group No Checkbox or from table then "Run Doczy.AI Pipeline"should not be functional'
|
||||
)
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_run_doczy_ai_pipeline_without_selecting_group_no(self, driver, config):
|
||||
self.logger.info(
|
||||
'Verify if none Group No is selected from Group No Checkbox or from table then "Run Doczy.AI Pipeline"should not be functional'
|
||||
)
|
||||
driver.get(
|
||||
config["url_interface_1"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P-OZmUc_k67ay91q5x8iGq-FCMcsGOuN-RILqMWR3WzTHoAUItcREFppJowN22APhWP0_3aO-H-ByYLq_4toR4SkrJ83TIfavORbh2T-CllhzINKejOopV6Oj2TGqnANs2vp_vgpufdLpQiYcT5Cntcx6Zfz4TZCFrmFNjxoLox5FcXrNiwv_yTFyoiHaIUJG-cIaOn_oTqRGo7O-hUouN9JVxhmnU7ufPFdqEyvj566q9FddhHWKDUAh15f8nxWwRKqI65-vBXTiygJZboznnFjs4kQaXi7sRrmoT1uXt73lxr6FQe6bzlIWxHRWXci50qp4J_MU5gfZ1vSzJS5zFzFy7W2spTG7hByAH9LVv3us5Q_dAvr2_J3rn6zLJaZBnp_xRJ6cJM9e_zgcxL5zD6vVPtFkuqxWpV_Axtm2xrqTS7q03WRoDDwhRlHC02whsP8HVovurA-knXTrIRHM4p1eRSfK99EuKkev0eOGL5cNSKT-JNLQoe23R-JstAqhlyTSTis2wNK8I5Y2kd5esJGnBoe1jHeyTD5a-yppMfmBd6nW90_nvOc0eipFxMuWnhvYs56ex5Mv7PM6iWvnrP2ewVPbRI7oFa8WM_YhJ84Je4JRVw-HGi8Ftfv3pZfn8kxfxAp2lvncXw9GmCjm3eig-NdJqB1gpNGXN-lPZgMzjOwX5REWe3Wvqn2wK9sNd9gSzGTUCtHCN9NCkuSqkUAlAxECMy7FVuUl8i3CqNCkfrd7EI-LwczhRaOnKT9VJF0E544fAK1W5GWKMBGcrcrp8fJwOdAHqf8R7Mcsl3XzrafYzJo1SO&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_1 · Streamlit")
|
||||
interface_1 = Interface_1(driver, config)
|
||||
interface_1.select_client()
|
||||
interface_1.select_batch()
|
||||
interface_1.click_read_the_contracts_from_path()
|
||||
interface_1.check_table_contain()
|
||||
interface_1.click_run_doczy_ai_pipeline()
|
||||
assert interface_1.result_message.text is "Please select at least one Group No."
|
||||
@@ -0,0 +1,186 @@
|
||||
import allure
|
||||
import pytest
|
||||
|
||||
from pages.interface_2_page_objects import Interface_2
|
||||
from utils.common_methods import sign_in
|
||||
from utils.element_related_methods import get_title
|
||||
from utils.logger import get_logger
|
||||
|
||||
|
||||
class Test_interface_2:
|
||||
logger = get_logger()
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 2")
|
||||
@allure.sub_suite("Tests for Navigation")
|
||||
@allure.title("Verifying designated Interface 2 Page opens successfully")
|
||||
@allure.feature("Interface 2")
|
||||
@allure.story("Verifying designated Interface 2 Page opens successfully")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_validate_navigation(self, driver, config):
|
||||
self.logger.info("Verifying designated Interface 2 Page opens successfully")
|
||||
driver.get(config["url_interface_2"])
|
||||
get_title(driver, config, "interface_2 · Streamlit")
|
||||
if driver.title == "interface_2 · Streamlit":
|
||||
self.logger.info("Designated Interface 2 Page opened successfully")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info("Designated Interface 2 Page not opened successfully")
|
||||
assert False
|
||||
|
||||
# @pytest.mark.skip("Due to bug ")
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 2")
|
||||
@allure.sub_suite("Tests for Authentication")
|
||||
@allure.title("Verifying Single Sign-On (SSO) Login for Interface 2")
|
||||
@allure.feature("Interface 2")
|
||||
@allure.story("Verifying Single Sign-On (SSO) Login for Interface 2")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_sign_in(self, driver, config):
|
||||
self.logger.info("Verifying Single Sign-On (SSO) Login for Interface 2")
|
||||
driver.get(
|
||||
config["url_interface_2"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P91FtoYFvR20dqHG0dEKQhDe1BftWl3mQWsfh9s8UJttZdIVkp4cYIkmKKhTtdGruEzTbeZjcCH6mii-K8QH5QDmQ9chVv-P5lGlTOPig_9AZ_6ZZEty4XWPFPJzseHk4JsvCk36kgebUZvfT2X2MfMEsRi-TnOC2CWhhlurm0a8mCR7WzDWHLzPHpFAwcd-GS7V3N8NUri6LDskw8E1HiOtMSs0SwwZCGw2A7GZV59MrYvNxi8YyousqNRLhdOg56PrzlhLk5l-hgm9ZX9NrKYmlNmb3LYFrxd8zgWQ5fdulyColwquQHTGZ4kRwM49xCdTEsCDprDYqopmMoPXcwvjFz69f_a9S-qT8jNhFGN_WmdoUlq02J0BSLnD-IfKNAQe5w2D6SKCYH4LLZnSSKpQrJUFosqYmxOsk34Z80enm-f4kiJhzqYt9Qwa6n70J3bF-6vXCjZdu3l5iI5CLc7QcaicPmfiOQBGu_EyFploqsW7fmqfNhJ92_W0jL_yQvgZaBtMeZH23BmVpYQGdNeBhRauBj4qaHpTkPHSUPBw26atNtq5yWOs0j6gIL_hhHljLqqvMmI3vw0B3deVxqy2MvgU40wkYYfETwaBaIVTH5OtO60EBULwN7PBCYDVOT2ZskBZnQCp29IZqam1GwZHDBHEVbw9djRXl9ZwKOUHa9mv_dKHJAB_cMtpAzOF0H6fnyzLr1kZEd-hfHUY-ZF1mrEPgUBKC5swYTfgYpBpgWjnlxMKva9tC1iHAwKSyRcsRc7BnSzBJv9ZU8UhzrhIlJ1ILGjjJQcUwicfVIokN9X79fxllkkqQ&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_2 · Streamlit")
|
||||
if driver.title == "interface_2 · Streamlit":
|
||||
self.logger.info("Interface 2 page opened successfully")
|
||||
assert True
|
||||
else:
|
||||
self.logger.info("Interface 2 page not opened successfully")
|
||||
assert False
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 2")
|
||||
@allure.sub_suite("Tests for Show Result button")
|
||||
@allure.title("Verify the 'show result' button functionality")
|
||||
@allure.feature("Interface 2")
|
||||
@allure.story("Verify the 'show result' button functionality")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
@allure.testcase("TC-008")
|
||||
def test_verify_show_results_button(self, driver, config):
|
||||
self.logger.info("Verify the 'show result' button functionality")
|
||||
driver.get(
|
||||
config["url_interface_2"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P91FtoYFvR20dqHG0dEKQhDe1BftWl3mQWsfh9s8UJttZdIVkp4cYIkmKKhTtdGruEzTbeZjcCH6mii-K8QH5QDmQ9chVv-P5lGlTOPig_9AZ_6ZZEty4XWPFPJzseHk4JsvCk36kgebUZvfT2X2MfMEsRi-TnOC2CWhhlurm0a8mCR7WzDWHLzPHpFAwcd-GS7V3N8NUri6LDskw8E1HiOtMSs0SwwZCGw2A7GZV59MrYvNxi8YyousqNRLhdOg56PrzlhLk5l-hgm9ZX9NrKYmlNmb3LYFrxd8zgWQ5fdulyColwquQHTGZ4kRwM49xCdTEsCDprDYqopmMoPXcwvjFz69f_a9S-qT8jNhFGN_WmdoUlq02J0BSLnD-IfKNAQe5w2D6SKCYH4LLZnSSKpQrJUFosqYmxOsk34Z80enm-f4kiJhzqYt9Qwa6n70J3bF-6vXCjZdu3l5iI5CLc7QcaicPmfiOQBGu_EyFploqsW7fmqfNhJ92_W0jL_yQvgZaBtMeZH23BmVpYQGdNeBhRauBj4qaHpTkPHSUPBw26atNtq5yWOs0j6gIL_hhHljLqqvMmI3vw0B3deVxqy2MvgU40wkYYfETwaBaIVTH5OtO60EBULwN7PBCYDVOT2ZskBZnQCp29IZqam1GwZHDBHEVbw9djRXl9ZwKOUHa9mv_dKHJAB_cMtpAzOF0H6fnyzLr1kZEd-hfHUY-ZF1mrEPgUBKC5swYTfgYpBpgWjnlxMKva9tC1iHAwKSyRcsRc7BnSzBJv9ZU8UhzrhIlJ1ILGjjJQcUwicfVIokN9X79fxllkkqQ&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
with allure.step("Signing in"):
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_2 · Streamlit")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_2 = Interface_2(driver, config)
|
||||
interface_2.select_client("Centene")
|
||||
with allure.step("Selecting Batch"):
|
||||
interface_2.select_batch()
|
||||
with allure.step("Selecting Contract"):
|
||||
interface_2.select_contract()
|
||||
with allure.step("Selecting field Group"):
|
||||
interface_2.select_field_group()
|
||||
with allure.step("Click on 'Show Result' Button"):
|
||||
interface_2.click_show_results()
|
||||
interface_2.check_table_contain()
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 2")
|
||||
@allure.sub_suite("Tests for Show Result button without Contract")
|
||||
@allure.title(
|
||||
"Verify the 'show result' button functionality without selecting contracts"
|
||||
)
|
||||
@allure.feature("Interface 2")
|
||||
@allure.story(
|
||||
"Verify the 'show result' button functionality without selecting contracts"
|
||||
)
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_show_results_button_without_contract(self, driver, config):
|
||||
self.logger.info(
|
||||
"Verify the 'show result' button functionality without selecting contracts"
|
||||
)
|
||||
driver.get(
|
||||
config["url_interface_2"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P91FtoYFvR20dqHG0dEKQhDe1BftWl3mQWsfh9s8UJttZdIVkp4cYIkmKKhTtdGruEzTbeZjcCH6mii-K8QH5QDmQ9chVv-P5lGlTOPig_9AZ_6ZZEty4XWPFPJzseHk4JsvCk36kgebUZvfT2X2MfMEsRi-TnOC2CWhhlurm0a8mCR7WzDWHLzPHpFAwcd-GS7V3N8NUri6LDskw8E1HiOtMSs0SwwZCGw2A7GZV59MrYvNxi8YyousqNRLhdOg56PrzlhLk5l-hgm9ZX9NrKYmlNmb3LYFrxd8zgWQ5fdulyColwquQHTGZ4kRwM49xCdTEsCDprDYqopmMoPXcwvjFz69f_a9S-qT8jNhFGN_WmdoUlq02J0BSLnD-IfKNAQe5w2D6SKCYH4LLZnSSKpQrJUFosqYmxOsk34Z80enm-f4kiJhzqYt9Qwa6n70J3bF-6vXCjZdu3l5iI5CLc7QcaicPmfiOQBGu_EyFploqsW7fmqfNhJ92_W0jL_yQvgZaBtMeZH23BmVpYQGdNeBhRauBj4qaHpTkPHSUPBw26atNtq5yWOs0j6gIL_hhHljLqqvMmI3vw0B3deVxqy2MvgU40wkYYfETwaBaIVTH5OtO60EBULwN7PBCYDVOT2ZskBZnQCp29IZqam1GwZHDBHEVbw9djRXl9ZwKOUHa9mv_dKHJAB_cMtpAzOF0H6fnyzLr1kZEd-hfHUY-ZF1mrEPgUBKC5swYTfgYpBpgWjnlxMKva9tC1iHAwKSyRcsRc7BnSzBJv9ZU8UhzrhIlJ1ILGjjJQcUwicfVIokN9X79fxllkkqQ&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
with allure.step("Signing in"):
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_2 · Streamlit")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_2 = Interface_2(driver, config)
|
||||
interface_2.select_client("Centene")
|
||||
with allure.step("Selecting Batch"):
|
||||
interface_2.select_batch()
|
||||
with allure.step("Selecting field Group"):
|
||||
interface_2.select_field_group()
|
||||
with allure.step("Click on 'Show Result' Button"):
|
||||
interface_2.click_show_results()
|
||||
assert interface_2.check_error_message() == "Please select Contract"
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 2")
|
||||
@allure.sub_suite("Tests for Show Result button without Field Groups")
|
||||
@allure.title(
|
||||
"Verify the 'show result' button functionality without selecting field groups"
|
||||
)
|
||||
@allure.feature("Interface 2")
|
||||
@allure.story(
|
||||
"Verify the 'show result' button functionality without selecting field groups"
|
||||
)
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_show_results_button_without_field_group(self, driver, config):
|
||||
self.logger.info(
|
||||
"Verify the 'show result' button functionality without selecting field groups"
|
||||
)
|
||||
driver.get(
|
||||
config["url_interface_2"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P91FtoYFvR20dqHG0dEKQhDe1BftWl3mQWsfh9s8UJttZdIVkp4cYIkmKKhTtdGruEzTbeZjcCH6mii-K8QH5QDmQ9chVv-P5lGlTOPig_9AZ_6ZZEty4XWPFPJzseHk4JsvCk36kgebUZvfT2X2MfMEsRi-TnOC2CWhhlurm0a8mCR7WzDWHLzPHpFAwcd-GS7V3N8NUri6LDskw8E1HiOtMSs0SwwZCGw2A7GZV59MrYvNxi8YyousqNRLhdOg56PrzlhLk5l-hgm9ZX9NrKYmlNmb3LYFrxd8zgWQ5fdulyColwquQHTGZ4kRwM49xCdTEsCDprDYqopmMoPXcwvjFz69f_a9S-qT8jNhFGN_WmdoUlq02J0BSLnD-IfKNAQe5w2D6SKCYH4LLZnSSKpQrJUFosqYmxOsk34Z80enm-f4kiJhzqYt9Qwa6n70J3bF-6vXCjZdu3l5iI5CLc7QcaicPmfiOQBGu_EyFploqsW7fmqfNhJ92_W0jL_yQvgZaBtMeZH23BmVpYQGdNeBhRauBj4qaHpTkPHSUPBw26atNtq5yWOs0j6gIL_hhHljLqqvMmI3vw0B3deVxqy2MvgU40wkYYfETwaBaIVTH5OtO60EBULwN7PBCYDVOT2ZskBZnQCp29IZqam1GwZHDBHEVbw9djRXl9ZwKOUHa9mv_dKHJAB_cMtpAzOF0H6fnyzLr1kZEd-hfHUY-ZF1mrEPgUBKC5swYTfgYpBpgWjnlxMKva9tC1iHAwKSyRcsRc7BnSzBJv9ZU8UhzrhIlJ1ILGjjJQcUwicfVIokN9X79fxllkkqQ&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
with allure.step("Signing in"):
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_2 · Streamlit")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_2 = Interface_2(driver, config)
|
||||
interface_2.select_client("Centene")
|
||||
with allure.step("Selecting Batch"):
|
||||
interface_2.select_batch()
|
||||
with allure.step("Selecting Contract"):
|
||||
interface_2.select_contract()
|
||||
with allure.step("Click on 'Show Result' Button"):
|
||||
interface_2.click_show_results()
|
||||
assert interface_2.check_error_message() == "Please select a Field Group"
|
||||
|
||||
@allure.parent_suite("Tests for web interface")
|
||||
@allure.suite("Tests for Interface 2")
|
||||
@allure.sub_suite("Tests for Kickoff Database Integration")
|
||||
@allure.title("Verifying Kickoff Database Integration Functionality")
|
||||
@allure.feature("Interface 2")
|
||||
@allure.story("Verifying Kickoff Database Integration Functionality")
|
||||
@allure.severity(allure.severity_level.CRITICAL)
|
||||
def test_verify_Kickoff_Database_Integration(self, driver, config):
|
||||
self.logger.info("Verifying Kickoff Database Integration Functionality")
|
||||
driver.get(
|
||||
config["url_interface_2"]
|
||||
+ "?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAAApTwJmzXqdR4BN2miheQMYAgDs_wUA9P91FtoYFvR20dqHG0dEKQhDe1BftWl3mQWsfh9s8UJttZdIVkp4cYIkmKKhTtdGruEzTbeZjcCH6mii-K8QH5QDmQ9chVv-P5lGlTOPig_9AZ_6ZZEty4XWPFPJzseHk4JsvCk36kgebUZvfT2X2MfMEsRi-TnOC2CWhhlurm0a8mCR7WzDWHLzPHpFAwcd-GS7V3N8NUri6LDskw8E1HiOtMSs0SwwZCGw2A7GZV59MrYvNxi8YyousqNRLhdOg56PrzlhLk5l-hgm9ZX9NrKYmlNmb3LYFrxd8zgWQ5fdulyColwquQHTGZ4kRwM49xCdTEsCDprDYqopmMoPXcwvjFz69f_a9S-qT8jNhFGN_WmdoUlq02J0BSLnD-IfKNAQe5w2D6SKCYH4LLZnSSKpQrJUFosqYmxOsk34Z80enm-f4kiJhzqYt9Qwa6n70J3bF-6vXCjZdu3l5iI5CLc7QcaicPmfiOQBGu_EyFploqsW7fmqfNhJ92_W0jL_yQvgZaBtMeZH23BmVpYQGdNeBhRauBj4qaHpTkPHSUPBw26atNtq5yWOs0j6gIL_hhHljLqqvMmI3vw0B3deVxqy2MvgU40wkYYfETwaBaIVTH5OtO60EBULwN7PBCYDVOT2ZskBZnQCp29IZqam1GwZHDBHEVbw9djRXl9ZwKOUHa9mv_dKHJAB_cMtpAzOF0H6fnyzLr1kZEd-hfHUY-ZF1mrEPgUBKC5swYTfgYpBpgWjnlxMKva9tC1iHAwKSyRcsRc7BnSzBJv9ZU8UhzrhIlJ1ILGjjJQcUwicfVIokN9X79fxllkkqQ&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#"
|
||||
)
|
||||
with allure.step("Selecting Client"):
|
||||
# sign_in(driver, config)
|
||||
self.logger.info("Signed in successful")
|
||||
get_title(driver, config, "interface_2 · Streamlit")
|
||||
with allure.step("Selecting Client"):
|
||||
interface_2 = Interface_2(driver, config)
|
||||
interface_2.select_client("Centene")
|
||||
with allure.step("Selecting Batch"):
|
||||
interface_2.select_batch()
|
||||
with allure.step("Selecting Contract"):
|
||||
interface_2.select_contract()
|
||||
with allure.step("Selecting field Group"):
|
||||
interface_2.select_field_group()
|
||||
with allure.step("Click on 'Show Result' Button"):
|
||||
interface_2.click_show_results()
|
||||
interface_2.check_table_contain()
|
||||
with allure.step("Click on 'Kickoff Database Integration' Button"):
|
||||
# interface_2.click_kickoff_database_integration_btn()
|
||||
pass
|
||||
###Verify with database###
|
||||
@@ -0,0 +1,52 @@
|
||||
from selenium.common import TimeoutException
|
||||
|
||||
|
||||
class CustomError(Exception):
|
||||
"""Base class for custom exceptions"""
|
||||
|
||||
def __init__(self, message):
|
||||
super().__init__(message)
|
||||
self.message = message
|
||||
|
||||
|
||||
class InvalidInputError(CustomError):
|
||||
"""Exception raised for invalid inputs"""
|
||||
|
||||
def __init__(self, value):
|
||||
super().__init__(f"Invalid input: {value}")
|
||||
self.value = value
|
||||
|
||||
|
||||
class DatabaseConnectionError(CustomError):
|
||||
"""Exception raised for database connection errors"""
|
||||
|
||||
def __init__(self, db_url):
|
||||
super().__init__(f"Database connection failed: {db_url}")
|
||||
self.db_url = db_url
|
||||
|
||||
|
||||
class NoYamlFile(FileNotFoundError):
|
||||
def __init__(self, yaml_file_path, yaml_file_name):
|
||||
super().__init__(
|
||||
f"Please create YAML file at location={yaml_file_path} with filename={yaml_file_name}"
|
||||
)
|
||||
self.yaml_file_path = yaml_file_path
|
||||
self.yaml_file_name = yaml_file_name
|
||||
|
||||
|
||||
class NoElementFound(Exception):
|
||||
def __init__(self, xpath, timeout):
|
||||
super().__init__(
|
||||
f'Element with "{xpath}" XPATH is not located in {timeout} second. Try re-run the testcase'
|
||||
)
|
||||
self.xpath = xpath
|
||||
self.timeout = timeout
|
||||
|
||||
|
||||
class TitleNotFound(Exception):
|
||||
def __init__(self, title, timeout):
|
||||
super().__init__(
|
||||
f'Web Page with "{title}" title is not loaded in {timeout} second.'
|
||||
)
|
||||
self.title = title
|
||||
self.timeout = timeout
|
||||
@@ -0,0 +1,15 @@
|
||||
from pages.Email_sign_in_page import Email_sign_in_page
|
||||
from pages.Password_sign_in_page import Password_sign_in_page
|
||||
from pages.Pre_sign_in_page import Pre_sign_in_page
|
||||
from pages.Remember_sign_in_page import Remember_sign_in_page
|
||||
|
||||
|
||||
def sign_in(driver, config):
|
||||
pre_sign_in_page = Pre_sign_in_page(driver)
|
||||
pre_sign_in_page.click_sign_in_link()
|
||||
email_sign_in_page = Email_sign_in_page(driver)
|
||||
email_sign_in_page.sign_in(config)
|
||||
password_sign_in_page = Password_sign_in_page(driver)
|
||||
password_sign_in_page.sign_in(config)
|
||||
remember_sign_in_page = Remember_sign_in_page(driver)
|
||||
remember_sign_in_page.click_no_btn()
|
||||
@@ -0,0 +1,48 @@
|
||||
from selenium.common import TimeoutException
|
||||
from selenium.webdriver.support.wait import WebDriverWait
|
||||
from selenium.webdriver.support import expected_conditions as ec
|
||||
|
||||
from tests.conftest import config
|
||||
from utils.CustomException import NoElementFound, TitleNotFound
|
||||
|
||||
|
||||
def get_clickable_element(driver, config, By, element_id):
|
||||
|
||||
try:
|
||||
element = WebDriverWait(driver, timeout=config["timeout"]).until(
|
||||
ec.element_to_be_clickable((By, element_id))
|
||||
)
|
||||
except TimeoutException:
|
||||
# print("NoElement")
|
||||
raise NoElementFound(element_id, config["timeout"])
|
||||
return element
|
||||
|
||||
|
||||
def get_element(driver, config, By, element_id):
|
||||
try:
|
||||
return WebDriverWait(driver, timeout=config["timeout"]).until(
|
||||
ec.visibility_of_element_located((By, element_id))
|
||||
)
|
||||
except TimeoutException:
|
||||
# print("NoElement")
|
||||
raise NoElementFound(element_id, config["timeout"])
|
||||
|
||||
|
||||
def get_invisible_element(driver, config, By, element_id):
|
||||
try:
|
||||
return WebDriverWait(driver, timeout=config["timeout"]).until(
|
||||
ec.presence_of_element_located((By, element_id))
|
||||
)
|
||||
except TimeoutException:
|
||||
# print("NoElement")
|
||||
raise NoElementFound(element_id, config["timeout"])
|
||||
|
||||
|
||||
def get_title(driver, config, title):
|
||||
try:
|
||||
return WebDriverWait(driver, timeout=config["timeout"]).until(
|
||||
ec.title_contains(title)
|
||||
)
|
||||
except TimeoutException:
|
||||
# print("NoElement")
|
||||
raise TitleNotFound(title, config["timeout"])
|
||||
@@ -0,0 +1,9 @@
|
||||
from loguru import logger
|
||||
|
||||
|
||||
def setup_logger(logfile):
|
||||
logger.add(logfile)
|
||||
|
||||
|
||||
def get_logger():
|
||||
return logger
|
||||
@@ -0,0 +1,30 @@
|
||||
import yaml
|
||||
import pandas as pd
|
||||
import os
|
||||
|
||||
from utils.CustomException import NoYamlFile
|
||||
|
||||
|
||||
def read_yaml(file_path, file_name):
|
||||
try:
|
||||
with open(file_path + file_name, "r") as file:
|
||||
return yaml.safe_load(file)
|
||||
except Exception as e:
|
||||
raise NoYamlFile(file_path, file_name)
|
||||
|
||||
|
||||
def read_excel(file_path, sheet_name, col_name):
|
||||
df = pd.read_excel(file_path, usecols=col_name, sheet_name=sheet_name)
|
||||
if len(col_name) == 1:
|
||||
data = [val[0] for val in df.values]
|
||||
else:
|
||||
data = [tuple(row) for row in df.values]
|
||||
return data
|
||||
|
||||
|
||||
def read_files(folder_path):
|
||||
file_paths = []
|
||||
for root, dirs, files in os.walk(folder_path):
|
||||
for file in files:
|
||||
file_paths.append(os.path.join(root, file))
|
||||
return file_paths
|
||||
@@ -0,0 +1,18 @@
|
||||
import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
|
||||
def pytest_runtest_makereport(item, call):
|
||||
outcome = yield
|
||||
rep = outcome.get_result()
|
||||
|
||||
# if rep.when == "call":
|
||||
|
||||
|
||||
# @pytest.hookimpl(tryfirst=True)
|
||||
# def pytest_html_report_title(report):
|
||||
# """Set the title of the HTML report dynamically."""
|
||||
# current_datetime = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
|
||||
# report.title = f"Test Report {current_datetime}"
|
||||
Reference in New Issue
Block a user