Files
doczyai-pipelines/archive/Doczy.AI_Automation/tests/test_end_to_end.py
T
Katon Minhas afb6d5185d 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
2026-01-26 16:52:55 +00:00

99 lines
6.9 KiB
Python

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