fix: update DDMA eligibility check worker for new deltadentalma.com sign-in and search flow

Delta Dental MA moved their provider login from providers.deltadentalma.com/onboarding
to www.deltadentalma.com/sign-in with new form field selectors, and moved eligibility
search behind a "Group/Health Connector" search page keyed by subscriber ID + birthdate
instead of the old member-search form. Updates login, OTP/MFA handling, and member
search/selection across the eligibility and claim DDMA workers and their session helpers.
This commit is contained in:
2026-07-04 22:57:59 -04:00
parent 79bae13f35
commit 877feb32fa
5 changed files with 194 additions and 276 deletions

View File

@@ -13,7 +13,7 @@ from datetime import date
from ddma_browser_manager import get_browser_manager
MEMBERS_URL = "https://providers.deltadentalma.com/members"
MEMBERS_URL = "https://www.deltadentalma.com/private/provider/dashboard"
# Absolute path to the Backend app root (two levels up from this file's SeleniumService dir)
_SERVICE_DIR = os.path.dirname(os.path.abspath(__file__))
@@ -61,7 +61,7 @@ class AutomationDDMAClaimSubmit:
print("[DDMA Claim login] Forcing logout due to credential change...")
browser_manager = get_browser_manager()
try:
self.driver.get("https://providers.deltadentalma.com/")
self.driver.get("https://www.deltadentalma.com/")
time.sleep(2)
for selector in [
"//button[contains(text(), 'Log out') or contains(text(), 'Logout') or contains(text(), 'Sign out')]",
@@ -100,10 +100,10 @@ class AutomationDDMAClaimSubmit:
try:
current_url = self.driver.current_url
print(f"[DDMA Claim login] Current URL: {current_url}")
logged_in_patterns = ["member", "dashboard", "eligibility", "search", "patients"]
logged_in_patterns = ["member", "dashboard", "eligibility", "search", "patients", "private/provider"]
is_logged_in_url = any(p in current_url.lower() for p in logged_in_patterns)
if is_logged_in_url and "onboarding" not in current_url.lower():
if is_logged_in_url and "sign-in" not in current_url.lower():
# Navigate to members page to confirm
if "member" not in current_url.lower():
try:
@@ -132,7 +132,7 @@ class AutomationDDMAClaimSubmit:
# Check if session redirected us straight to member search
try:
current_url = self.driver.current_url
if "onboarding" not in current_url.lower():
if "sign-in" not in current_url.lower():
member_search = WebDriverWait(self.driver, 3).until(
EC.presence_of_element_located((By.XPATH, '//input[@placeholder="Search by member ID"]'))
)
@@ -165,8 +165,7 @@ class AutomationDDMAClaimSubmit:
try:
otp_candidate = WebDriverWait(self.driver, 10).until(
EC.presence_of_element_located((By.XPATH,
"//input[contains(@aria-label,'Verification code') or "
"contains(@placeholder,'Enter your verification code')]"
"//input[@data-test-id='MfaCode']"
))
)
if otp_candidate:
@@ -191,7 +190,7 @@ class AutomationDDMAClaimSubmit:
# Fill login form
try:
email_field = WebDriverWait(self.driver, 10).until(
EC.element_to_be_clickable((By.XPATH, "//input[@name='username' and @type='text']"))
EC.element_to_be_clickable((By.XPATH, "//input[@data-test-id='Username']"))
)
except TimeoutException:
return "ERROR: Login form not found"
@@ -200,21 +199,13 @@ class AutomationDDMAClaimSubmit:
email_field.send_keys(self.massddma_username)
password_field = wait.until(
EC.presence_of_element_located((By.XPATH, "//input[@name='password' and @type='password']"))
EC.presence_of_element_located((By.XPATH, "//input[@data-test-id='Password']"))
)
password_field.clear()
password_field.send_keys(self.massddma_password)
try:
remember_me = wait.until(EC.element_to_be_clickable(
(By.XPATH, "//label[.//span[contains(text(),'Remember me')]]")
))
remember_me.click()
except Exception:
print("[DDMA Claim login] Remember me checkbox not found (continuing)")
login_button = wait.until(EC.element_to_be_clickable(
(By.XPATH, "//button[@type='submit' and @aria-label='Sign in']")
(By.XPATH, "//button[@data-test-id='SigninSubmitButton']")
))
login_button.click()
@@ -225,8 +216,7 @@ class AutomationDDMAClaimSubmit:
try:
otp_candidate = WebDriverWait(self.driver, 30).until(
EC.presence_of_element_located((By.XPATH,
"//input[contains(@aria-lable,'Verification code') or "
"contains(@placeholder,'Enter your verification code')]"
"//input[@data-test-id='MfaCode']"
))
)
if otp_candidate:
@@ -240,8 +230,8 @@ class AutomationDDMAClaimSubmit:
return "SUCCESS"
except Exception:
pass
if "onboarding" in self.driver.current_url.lower() or "login" in self.driver.current_url.lower():
return "ERROR: LOGIN FAILED: Still on login/onboarding page"
if "sign-in" in self.driver.current_url.lower():
return "ERROR: LOGIN FAILED: Still on login page"
print("[DDMA Claim login] Assuming login succeeded")
return "SUCCESS"