mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-18 11:55:46 +08:00
add wait_for_selector to the cells property and to_command_mode
This commit is contained in:
parent
c220215aa8
commit
3092800a46
@ -32,6 +32,10 @@ class Notebook:
|
||||
|
||||
@property
|
||||
def cells(self):
|
||||
"""Gets all cells once they are visible.
|
||||
|
||||
"""
|
||||
wait_for_selector(self.browser, ".cell")
|
||||
return self.browser.find_elements_by_class_name("cell")
|
||||
|
||||
|
||||
@ -48,8 +52,9 @@ class Notebook:
|
||||
|
||||
def to_command_mode(self):
|
||||
"""Changes us into command mode on currently focused cell
|
||||
|
||||
"""
|
||||
self.browser.switch_to.active_element.send_keys(Keys.ESCAPE)
|
||||
self.cells[0].send_keys(Keys.ESCAPE)
|
||||
self.browser.execute_script("return Jupyter.notebook.handle_command_mode("
|
||||
"Jupyter.notebook.get_cell("
|
||||
"Jupyter.notebook.get_edit_index()))")
|
||||
|
Loading…
Reference in New Issue
Block a user