From 5d19785e87191be457c82d78fd70f7f06f64eb91 Mon Sep 17 00:00:00 2001 From: M Pacer Date: Thu, 22 Mar 2018 19:34:45 -0700 Subject: [PATCH] small changes to naming things --- notebook/tests/selenium/utils.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/notebook/tests/selenium/utils.py b/notebook/tests/selenium/utils.py index 07f1b1d74..2ddcf664f 100644 --- a/notebook/tests/selenium/utils.py +++ b/notebook/tests/selenium/utils.py @@ -50,8 +50,11 @@ class Notebook: @property - def current_cell_index(self): - return self.cells.index(self.current_cell) + def current_index(self): + return self.index(self.current_cell) + + def index(self, cell): + return self.cells.index(cell) def remove_safety_check(self): """Disable request to save before closing window. @@ -64,7 +67,7 @@ class Notebook: """Changes us into command mode on currently focused cell """ - self.cells[0].send_keys(Keys.ESCAPE) + self.body.send_keys(Keys.ESCAPE) self.browser.execute_script("return Jupyter.notebook.handle_command_mode(" "Jupyter.notebook.get_cell(" "Jupyter.notebook.get_edit_index()))") @@ -114,9 +117,9 @@ class Notebook: self.current_cell.send_keys(Keys.ENTER, "\n") self.current_cell.send_keys(Keys.ENTER, line) if render: - self.execute_cell(self.current_cell_index) def execute_cell(self, index=0): + self.execute_cell(self.current_index) self.focus_cell(index) self.current_cell.send_keys(Keys.CONTROL, Keys.ENTER)