Skip to content

Commit

Permalink
Enhance flexibility of modal and app timeouts
Browse files Browse the repository at this point in the history
Refactored two methods to allow custom timeout values
  • Loading branch information
leboff committed May 20, 2024
1 parent 1803ad2 commit afff62f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cumulusci/robotframework/Salesforce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("../../..")
Expand All @@ -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",
)

Expand Down

0 comments on commit afff62f

Please sign in to comment.