aiidalab / aiidalab-widgets-base

Reusable widgets for AiiDAlab applications
MIT License
7 stars 17 forks source link

More robust downstream CI test using selenium #398

Closed unkcpz closed 1 year ago

unkcpz commented 1 year ago

Currently, in selenium test we wait 5 seconds and expect that the page will loaded, but not always the case. The selenium provide the check that the web element appear or disappear. We can using the gear logo to show that the page is still loading.

As indicated by: https://stackoverflow.com/questions/68949169/python-selenium-how-to-wait-until-element-is-gone-becomes-stale

try:
    element_present = EC.presence_of_element_located((By.ID, 'element_id'))
    WebDriverWait(driver, timeout).until(element_present)
except TimeoutException:
    print "Timed out waiting for page to load"
danielhollas commented 1 year ago

@unkcpz I believe this one can be closed. The find_element selenium method waits implicitly so the solution from the OP is not needed.