fix: remove vm.hasResults wait in accumulator step, print page as-is
Member info is always present on the accumulator page regardless of whether dollar amounts exist. Removing the button wait eliminates the 15s freeze for patients with no financial data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user