fix: restore Continue button as page indicator in claim step3 to prevent browser close

Using paymentGroupId label as the page-load wait caused TimeoutException when
the claim flow's page structure differed, returning ERROR and triggering
_minimize_browser (about:blank + minimize). Now waits for the btn-primary
Continue button (original safe indicator) and wraps both dropdown selections
in try/except so the step never fails due to a missed dropdown.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-05-29 22:26:21 -04:00
parent 72b204f33f
commit cda00f5f8a

View File

@@ -640,9 +640,11 @@ class AutomationUnitedDHClaimSubmit:
try:
print("[UnitedDH Claim] step3: waiting for Practitioner & Location page")
# Wait for the Billing Entity label to be visible — confirms page has fully rendered
WebDriverWait(self.driver, 20).until(
EC.visibility_of_element_located((By.XPATH, "//label[@for='paymentGroupId']"))
# Wait for the Continue button — primary indicator that the page has loaded
continue_btn = WebDriverWait(self.driver, 20).until(
EC.element_to_be_clickable((By.XPATH,
"//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Continue')]"
))
)
# --- Treatment Location ---
@@ -701,7 +703,7 @@ class AutomationUnitedDHClaimSubmit:
if not billing_selected:
print("[UnitedDH Claim] step3: WARNING: Could not select Billing Entity — continuing anyway")
# Re-find Continue button after selections to avoid stale element reference
# Re-find Continue button after dropdown interactions to avoid stale element reference
continue_btn = WebDriverWait(self.driver, 10).until(
EC.element_to_be_clickable((By.XPATH,
"//button[contains(@class,'btn-primary') and contains(normalize-space(text()),'Continue')]"