From afff62f6e9f28df58e3aca98cf239e4c1634889b Mon Sep 17 00:00:00 2001 From: Bryan Leboff Date: Mon, 20 May 2024 11:57:39 -0400 Subject: [PATCH] Enhance flexibility of modal and app timeouts Refactored two methods to allow custom timeout values --- cumulusci/robotframework/Salesforce.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cumulusci/robotframework/Salesforce.py b/cumulusci/robotframework/Salesforce.py index 8f6fc7e184..99eebdb0d0 100644 --- a/cumulusci/robotframework/Salesforce.py +++ b/cumulusci/robotframework/Salesforce.py @@ -600,11 +600,11 @@ def select_record_type(self, label): self.selenium.click_button("Next") @capture_screenshot_on_error - def select_app_launcher_app(self, app_name): + def select_app_launcher_app(self, app_name, timeout=30): """Navigates to a Salesforce App via the App Launcher""" locator = lex_locators["app_launcher"]["app_link"].format(app_name) self.open_app_launcher() - self.selenium.wait_until_page_contains_element(locator, timeout=30) + self.selenium.wait_until_page_contains_element(locator, timeout) self.selenium.set_focus_to_element(locator) elem = self.selenium.get_webelement(locator) link = elem.find_element_by_xpath("../../..") @@ -623,11 +623,11 @@ def select_app_launcher_tab(self, tab_name): self.wait_until_modal_is_closed() @capture_screenshot_on_error - def wait_until_modal_is_open(self): + def wait_until_modal_is_open(self, timeout=15): """Wait for modal to open""" self.selenium.wait_until_page_contains_element( lex_locators["modal"]["is_open"], - timeout=15, + timeout, error="Expected to see a modal window, but didn't", )