From 3092800a469c77bf90f45af455c83f8df8f0c01d Mon Sep 17 00:00:00 2001 From: M Pacer Date: Thu, 22 Mar 2018 14:41:44 -0700 Subject: [PATCH] add wait_for_selector to the cells property and to_command_mode --- notebook/tests/selenium/utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/notebook/tests/selenium/utils.py b/notebook/tests/selenium/utils.py index 9aad3fbf8..949ff9776 100644 --- a/notebook/tests/selenium/utils.py +++ b/notebook/tests/selenium/utils.py @@ -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()))")