Skip to content

Commit

Permalink
test: Retry dropdown menu in storage tests
Browse files Browse the repository at this point in the history
It gets spuriously closed sometimes.
  • Loading branch information
mvollmer committed Oct 17, 2023
1 parent 6c4755b commit 14ebe9a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions test/common/storagelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,19 @@ def content_dropdown_action(self, index, title, isExpandable=True):
dropdown = self.content_row_tbody(index) + " tr td:last-child .pf-v5-c-dropdown"
else:
dropdown = "#detail-content > .pf-v5-c-card > div > table > :nth-child(%d)" % index + " td:last-child .pf-v5-c-dropdown"
self.browser.click(dropdown + " button.pf-v5-c-dropdown__toggle")
self.browser.click(dropdown + f" a:contains('{title}')")
btn = dropdown + f" a:contains('{title}')"

def step():
try:
if not self.browser.is_present(btn):
self.browser.click(dropdown + " button.pf-v5-c-dropdown__toggle")
self.browser.wait_visible(btn)
self.browser.click(btn)
return True
except Error:
return False

self.browser.wait(step)

def content_tab_expand(self, row_index, tab_index):
tab_btn = self.content_row_tbody(row_index) + " .pf-v5-c-tabs ul li:nth-child(%d) button" % tab_index
Expand Down

0 comments on commit 14ebe9a

Please sign in to comment.