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()