diff --git a/apps/SeleniumService/selenium_CMSP_eligibilityHistoryRemainingCheckWorker.py b/apps/SeleniumService/selenium_CMSP_eligibilityHistoryRemainingCheckWorker.py index db8e60ed..fa0d2bc3 100644 --- a/apps/SeleniumService/selenium_CMSP_eligibilityHistoryRemainingCheckWorker.py +++ b/apps/SeleniumService/selenium_CMSP_eligibilityHistoryRemainingCheckWorker.py @@ -374,21 +374,10 @@ class AutomationCMSPEligibilityHistoryRemainingCheck: self.driver.execute_script("arguments[0].click();", accumulator_link) time.sleep(2) - # Wait for accumulator page shell + # Wait for accumulator page to load then print whatever is on screen — + # member info is always present even when there are no dollar amounts wait.until(lambda d: d.execute_script("return document.readyState") == "complete") - - # Wait up to 15 s for vm.hasResults — captures data or "no results" state - try: - WebDriverWait(self.driver, 15).until( - EC.visibility_of_element_located( - (By.CSS_SELECTOR, "button.btn.btn-primary[ng-click='vm.printResults()']") - ) - ) - print("[step6] accumulator data loaded (vm.hasResults true)") - except TimeoutException: - print("[step6] no accumulator data for this patient — printing empty state") - - time.sleep(3) + time.sleep(4) safe_member = "".join(c for c in str(self.memberId) if c.isalnum() or c in "-_.") pdf_filename = f"cmsp_accumulator_{safe_member}.pdf"