Replacing time.sleep for a conditional waiting method

pull/4445/head
Emilio Talamante Lugo 7 years ago
parent b892d7c8c6
commit 23adb8e919

@ -6,7 +6,7 @@ def test_shutdown(notebook):
notebook.browser.find_element_by_id('shutdown_kernel').click()
notebook.browser.find_element_by_class_name('btn.btn-default.btn-sm.btn-danger').click()
notebook.wait_explicitly(3)
notebook.wait_for_element_availability("cell")
notebook.execute_cell(0)
assert not notebook.is_kernel_running()

@ -195,8 +195,8 @@ class Notebook:
wait = WebDriverWait(self.browser, 10)
element = wait.until(EC.staleness_of(cell))
def wait_explicitly(self, seconds=0):
time.sleep(seconds)
def wait_for_element_availability(self, element):
_wait_for(self.browser, By.CLASS_NAME, element, visible=True)
def get_cells_contents(self):
JS = 'return Jupyter.notebook.get_cells().map(function(c) {return c.get_text();})'

Loading…
Cancel
Save