mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-03 03:41:14 +08:00
Fix checking if kernel is running through Selenium
Avoid error "Jupyter.notebook.kernel is null"
This commit is contained in:
parent
ed96937401
commit
fb2286585c
@ -300,7 +300,9 @@ class Notebook:
|
||||
trigger_keystrokes(self.body, keys)
|
||||
|
||||
def is_kernel_running(self):
|
||||
return self.browser.execute_script("return Jupyter.notebook.kernel.is_connected()")
|
||||
return self.browser.execute_script(
|
||||
"return Jupyter.notebook.kernel && Jupyter.notebook.kernel.is_connected()"
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def new_notebook(cls, browser, kernel_name='kernel-python3'):
|
||||
@ -455,4 +457,3 @@ def validate_dualmode_state(notebook, mode, index):
|
||||
assert is_focused_on(index) #The specified cell is focused
|
||||
|
||||
assert is_only_cell_edit(index) #The specified cell is the only one in edit mode
|
||||
|
Loading…
Reference in New Issue
Block a user