Skip to content

Commit

Permalink
Try different ways to wait on the table to load properly
Browse files Browse the repository at this point in the history
  • Loading branch information
sambible committed Sep 9, 2024
1 parent 91bee73 commit 291fcc4
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions airgun/views/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from time import sleep
from widgetastic.widget import (
Checkbox,
ConditionalSwitchableView,
Expand Down Expand Up @@ -439,7 +438,7 @@ def select_status(self, value):
def search(self, value):
"""Search for specific available resource and return the results"""
self.searchbox.search(value)
return self.table.read()
return self.read()

def add(self, value):
"""Associate specific resource"""
Expand All @@ -465,8 +464,12 @@ def remove(self, value):

def read(self):
"""Read all table values from both resource tables"""
self.browser.wait_for_element(self.table, exception=False, visible=True)
sleep(3)
self.browser.wait_for_element(locator='//h4[text()="Loading"]', exception=False)
self.browser.wait_for_element(
self.table, exception=False, ensure_page_safe=True, timeout=10
)
self.browser.plugin.ensure_page_safe(timeout='60s')
self.table.wait_displayed()
self.select_status("All")
return self.table.read()

Expand Down

0 comments on commit 291fcc4

Please sign in to comment.