fix: BCBS MA — wait for ccProgressBar spinner cycle before clicking buttons

Use appear-then-disappear pattern: briefly wait for spinner to show up
(so we don't pass through before it starts), then wait for it to clear.
Prevents element click interception on Find Provider button in step2.
Also restores element_to_be_clickable for New Eligibility Request (step1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ff
2026-06-02 23:53:46 -04:00
parent 4a1fd27870
commit 57c18b404f

View File

@@ -285,7 +285,7 @@ class AutomationBCBSMAEligibilityCheck:
)
try:
new_elig = self._wait(8).until(
EC.presence_of_element_located((By.XPATH, NEW_ELIG_XPATH))
EC.element_to_be_clickable((By.XPATH, NEW_ELIG_XPATH))
)
except TimeoutException:
# Dropdown may have closed — re-open Verification and try again
@@ -293,7 +293,7 @@ class AutomationBCBSMAEligibilityCheck:
verification.click()
time.sleep(2)
new_elig = self._wait(8).until(
EC.presence_of_element_located((By.XPATH, NEW_ELIG_XPATH))
EC.element_to_be_clickable((By.XPATH, NEW_ELIG_XPATH))
)
try:
new_elig.click()
@@ -342,13 +342,25 @@ class AutomationBCBSMAEligibilityCheck:
provider_id_input.send_keys(self.provider_npi)
print(f"[BCBS MA step2] Provider NPI entered: {self.provider_npi}")
# Click Find Provider
# Wait for spinner cycle to complete, then click Find Provider
try:
self._wait(2).until(
EC.visibility_of_element_located((By.CSS_SELECTOR, "div.ccProgressBar"))
)
except TimeoutException:
pass # spinner never appeared — page loaded instantly
self._wait(10).until(
EC.invisibility_of_element_located((By.CSS_SELECTOR, "div.ccProgressBar"))
)
find_provider = self._wait(10).until(
EC.element_to_be_clickable((By.XPATH,
"//button[@ng-click='searchProviders()']"
))
)
try:
find_provider.click()
except Exception:
self.driver.execute_script("arguments[0].click();", find_provider)
print("[BCBS MA step2] Find Provider clicked, waiting...")
time.sleep(3)