Skip to content

Commit

Permalink
test dashboard nav updates for api timeout error
Browse files Browse the repository at this point in the history
  • Loading branch information
RRosio committed Oct 13, 2022
1 parent 468bc7d commit 252b432
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nbclassic/tests/end_to_end/test_dashboard_nav.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def get_list_items(nb):
'link': a.get_attribute('href'),
'label': a.get_inner_text(),
'element': a,
} for a in link_items if a.get_inner_text() != '..']
} for a in link_items if a.get_inner_text() != '..' and 'ipynb' not in a.get_inner_text()]


def test_navigation(notebook_frontend):

link_elements = get_list_items(notebook_frontend)

def check_links(nb, list_of_link_elements):
if len(list_of_link_elements) < 1:
if not list_of_link_elements or len(list_of_link_elements) < 1:
return False

for item in list_of_link_elements:
Expand Down
12 changes: 11 additions & 1 deletion nbclassic/tests/end_to_end/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import time

from playwright.sync_api import ElementHandle, JSHandle
from playwright.sync_api import sync_playwright, TimeoutError as PlaywrightTimeoutError


# Key constants for browser_data
Expand Down Expand Up @@ -96,8 +97,17 @@ def __bool__(self):
def click(self):
return self._element.click()

# DEBUG: Playwright Timeout Error when calling inner_text
def get_inner_text(self):
return self._element.inner_text()
count = 0
while count < 2:
try:
count += 1
innerText = self._element.inner_text()
return innerText
except PlaywrightTimeoutError:
print('Timeout grabbing the inner text of an element')
return None

def get_inner_html(self):
return self._element.inner_html()
Expand Down

0 comments on commit 252b432

Please sign in to comment.