From 116889dd4e3813651a92b82986a4c1c9495e1c95 Mon Sep 17 00:00:00 2001 From: Gitead Date: Thu, 20 Aug 2026 00:37:14 -0400 Subject: [PATCH] perf: reduce fixed sleeps in MassHealth click_plus_button Cuts unconditional delay when adding a service line from ~7s to ~3s as a first pass at speeding up MassHealth claim submission. --- apps/SeleniumService/selenium_claimSubmitWorker.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/SeleniumService/selenium_claimSubmitWorker.py b/apps/SeleniumService/selenium_claimSubmitWorker.py index 40bef341..77739826 100755 --- a/apps/SeleniumService/selenium_claimSubmitWorker.py +++ b/apps/SeleniumService/selenium_claimSubmitWorker.py @@ -694,7 +694,7 @@ class AutomationMassHealthClaimsLogin: print("DEBUG: Clicking plus button to add new service line") # Step 1: Wait a moment to ensure the previous service line is fully processed - time.sleep(3) + time.sleep(1) # Step 2: Try multiple approaches to find the plus button plus_button = None @@ -768,11 +768,11 @@ class AutomationMassHealthClaimsLogin: print(f"DEBUG: JavaScript approach failed: {e}") raise Exception("Could not find plus button with any method") - time.sleep(1) - + time.sleep(0.5) + # Step 3: Scroll into view self.driver.execute_script("arguments[0].scrollIntoView(true);", plus_button) - time.sleep(1) + time.sleep(0.5) # Step 4: Check if button is enabled is_disabled = plus_button.get_attribute("disabled") @@ -804,8 +804,8 @@ class AutomationMassHealthClaimsLogin: actions = ActionChains(self.driver) actions.move_to_element(plus_button).click().perform() - time.sleep(2) # Wait for new row to be created - + time.sleep(1) # Wait for new row to be created + print("DEBUG: Successfully clicked plus button") return "Success" except Exception as e: