Skip to content

Commit

Permalink
Fix transiently failing selenium test?
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Sep 18, 2024
1 parent 5acc518 commit a97c84b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions lib/galaxy/selenium/navigates_galaxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2056,10 +2056,25 @@ def tour_wait_for_element_present(self, selector):
)
return element

def _clear_tooltip(self, tooltip_component):
last_timeout: Optional[SeleniumTimeoutException] = None
for _ in range(2):
if not tooltip_component.is_absent:
move_away_chain = self.action_chains()
move_away_chain.move_by_offset(100, 100)
move_away_chain.perform()
try:
tooltip_component.wait_for_absent()
return
except SeleniumTimeoutException as e:
last_timeout = e

message = "Failed to force current tool tip off screen, cannot test next tooltip."
raise self.prepend_timeout_message(e, message)

def get_tooltip_text(self, element, sleep=0, click_away=True):
tooltip_balloon = self.components._.tooltip_balloon
tooltip_balloon.wait_for_absent()

self._clear_tooltip(tooltip_balloon)
action_chains = self.action_chains()
action_chains.move_to_element(element)
action_chains.perform()
Expand Down

0 comments on commit a97c84b

Please sign in to comment.