Files
doczyai-pipelines/Doczy.AI_Automation/tests/test_interface_0.py
T
2024-05-10 12:02:56 +05:30

86 lines
4.4 KiB
Python

import random
import time
from pages.interface_0_page_objects import Interface_0
from utils.common_methods import get_title
from utils.common_methods2 import sign_in
from utils.logger import get_logger
class Test_interface_0:
logger = get_logger()
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, "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
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'])
sign_in(driver, config)
self.logger.info("Signed in successful")
get_title(driver, "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
# def test_verify_client_name_dropdown(self, driver, config):
# self.logger.info(f"Opening URL {config['url_interface_0']}")
# driver.get(config['url_interface_0'])
# self.logger.info(f"URL {config['url_interface_0']} opened")
# sign_in(driver, config)
# interface_0_page = Interface_0(driver)
# interface_0_page.click_client_name_dropdown()
# # get_title(driver, "interface_0 · Streamlit")
# if driver.title == 'interface_0 · Streamlit':
# assert True
# else:
# assert False
def test_verify_batch_creation(self, driver, config):
self.logger.info("Verifying S3 bucket is created with batch ID")
driver.get("https://doczy.aarete.com:8500/?code=0.AVsA57e_zrnCv0-sKQYbnoaPz5D--u_XfqNDqwMZoL4vF1hbAN8.AgABBAIAAADnfolhJpSnRYB1SVj-Hgd8AgDs_wUA9P_RZqy1FCzyPP5scMnkTe8faDovl-TipWlCQv5NMzUDPBxfg3EZU5RLyv3xgJnUHQxcuO1FNR_WCmKJKB8FhTu5_5sas33OydEDE6Jdi9xRo_N_80v4ZmA4LzNQThwVak0kyMKWIAQYILSs7SpPVfsUvcfj0c9Gk75dbJSqKCbaWZ8yfut4eMypIMVbjIUSd3mZp_mwr1fwCDUYOt2gmJ38i1FE_hRitH41rEP1yjIkMLgKn9BVpP7cpwbpo2LpPUZnejhWeE6mhKmnsD1yIp_a7ymsdzVM6lca3C2Ufr3TQAqcO2TxzqKUxmQQ89n6VIkIewc-LPZM6PmW-AhIYdJG1bTI2qvWHgDliKSvm_FfW4x_FYqCNwVTiXrNlhr1LBbGqQvMq51Im8aFebngRM9M-LJHpaYM2lK5VmhxxnBK_oy4ajGfndjhWY2R0vFZUHDIXwdc1A5ZfXZLvmrv2T55oUACm5uOyoZzRXgQW2ZeRwiuGP_G6DMGvjVZy4ktPsKBWMlnYXd8PcSsNF4d6nLzxDyPoL5tzIm6qvR-K3Xs8xDTG1ONV4mQaIc-GP2Y2_aNqRpf0oYgtHdP-VGe3VDWGjgTfbkL351Wz3AvZJkT7oN85poJrhDLO_rIB_7neM7jIevdLslq8sto01KcwGFShdqcaWeMNKIja6Pta3Q48lYjIDAy5LCXSoQNrJDZl_dQewUi3QH1jB9pqaXl57_xqP5CvEy_NdBe8FOmUg&session_state=7515cdc9-6fd7-4e93-b526-f0a3c23401fd#")
#(config['url_interface_0'])
# sign_in(driver, config)
self.logger.info("Signed in successful")
interface_0_page = Interface_0(driver)
interface_0_page.select_client()
interface_0_page.upload_files(config)
interface_0_page.create_batch()
def test_verify_no_files_uploaded(self, driver, config):
self.logger.info("Verifying S3 bucket is created with batch ID")
driver.get(config['url_interface_0'])
sign_in(driver, config)
self.logger.info("Signed in successful")
interface_0_page = Interface_0(driver)
interface_0_page.select_client()
interface_0_page.create_batch()
# def test_multiple_files(self, driver, config):
# contract_files = config["contract_files"]
# # random.seed(5)
# random_count = random.randint(1, len(contract_files)) # Choose a random count between 1 and the length of the array
#
# # Get a random selection of elements from the array
# random_elements = random.sample(contract_files, random_count)
#
# # Print the random count and the selected elements
# print("Random count:", random_count)
# print("Random elements:", random_elements)
# contracts = '\nC:\\Ankit\\Marked Up PDFs\\test\\'.join(random_elements)
# print(contracts)
# # for file in contract_files:
# # print(file)
# # print(contract_files)