From 31fce8270a91efb1cf10b560c7f425ea7fac7d47 Mon Sep 17 00:00:00 2001 From: Emilio Talamante Lugo Date: Fri, 12 Apr 2019 14:38:14 -0700 Subject: [PATCH 1/2] Converted clipboard js to selenium and rename undeleted to conventional name --- .../tests/notebook/clipboard_multiselect.js | 41 ------------------- .../selenium/test_clipboard_multiselect.py | 29 +++++++++++++ .../{undelete.py => test_undelete.py} | 0 3 files changed, 29 insertions(+), 41 deletions(-) delete mode 100644 notebook/tests/notebook/clipboard_multiselect.js create mode 100644 notebook/tests/selenium/test_clipboard_multiselect.py rename notebook/tests/selenium/{undelete.py => test_undelete.py} (100%) diff --git a/notebook/tests/notebook/clipboard_multiselect.js b/notebook/tests/notebook/clipboard_multiselect.js deleted file mode 100644 index 422693e36..000000000 --- a/notebook/tests/notebook/clipboard_multiselect.js +++ /dev/null @@ -1,41 +0,0 @@ - - -// Test -casper.notebook_test(function () { - this.append_cell('1'); - this.append_cell('2'); - this.append_cell('3'); - this.append_cell('4'); - this.append_cell('a5'); - this.append_cell('b6'); - this.append_cell('c7'); - this.append_cell('d8'); - - - - this.then(function () { - // Copy/paste/cut - this.select_cell(1); - this.select_cell(3, false); - - this.trigger_keydown('c'); // Copy - - this.select_cell(6) - this.select_cell(7,false) - - this.evaluate(function () { - $("#paste_cell_replace").click(); - }); - - var expected_state = ['', '1', '2', '3', '4', 'a5', '1' ,'2' ,'3', 'd8']; - - for (var i=1; i Date: Thu, 2 May 2019 09:56:28 -0700 Subject: [PATCH 2/2] Add some code style improvements by not using list comprehension when not required --- notebook/tests/selenium/test_clipboard_multiselect.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notebook/tests/selenium/test_clipboard_multiselect.py b/notebook/tests/selenium/test_clipboard_multiselect.py index 922244adf..360f016da 100644 --- a/notebook/tests/selenium/test_clipboard_multiselect.py +++ b/notebook/tests/selenium/test_clipboard_multiselect.py @@ -6,7 +6,7 @@ def test_clipboard_multiselect(notebook): # Cell contents setup values = ['1', '2', '3', '4', '5a', '6b', '7c', '8d'] - [notebook.append(i) for i in values] + notebook.extend(values) assert notebook.get_cells_contents() == ['', '1', '2', '3', '4', '5a', '6b', '7c', '8d'] @@ -23,7 +23,8 @@ def test_clipboard_multiselect(notebook): # Select the last four cells, cut them and paste them below the first cell notebook.select_cell_range(5, 8) wait_for_selector(notebook.browser, '.fa-cut.fa', single=True).click() - [notebook.body.send_keys(Keys.UP) for i in range(8)] + for i in range(8): + notebook.body.send_keys(Keys.UP) notebook.body.send_keys("v") assert notebook.get_cells_contents() == ['', '5a', '1', '2', '3', '1', '2', '3', '4']