Show More
@@ -31,11 +31,13 b' casper.notebook_test(function () {' | |||||
31 | var result = this.get_output_cell(0); |
|
31 | var result = this.get_output_cell(0); | |
32 | var num_cells = this.get_cells_length(); |
|
32 | var num_cells = this.get_cells_length(); | |
33 | this.test.assertEquals(result.text, '11\n', 'cell execute (using ctrl-enter)'); |
|
33 | this.test.assertEquals(result.text, '11\n', 'cell execute (using ctrl-enter)'); | |
34 |
this.test.assertEquals(num_cells, |
|
34 | this.test.assertEquals(num_cells, 2, 'ctrl-enter adds a new cell at the bottom') | |
35 | }); |
|
35 | }); | |
36 |
|
36 | |||
37 | // do it again with the keyboard shortcut |
|
37 | // do it again with the keyboard shortcut | |
38 | this.thenEvaluate(function () { |
|
38 | this.thenEvaluate(function () { | |
|
39 | IPython.notebook.select(1); | |||
|
40 | IPython.notebook.delete_cell(); | |||
39 | var cell = IPython.notebook.get_cell(0); |
|
41 | var cell = IPython.notebook.get_cell(0); | |
40 | cell.set_text('a=12; print(a)'); |
|
42 | cell.set_text('a=12; print(a)'); | |
41 | cell.clear_output(); |
|
43 | cell.clear_output(); | |
@@ -48,7 +50,7 b' casper.notebook_test(function () {' | |||||
48 | var result = this.get_output_cell(0); |
|
50 | var result = this.get_output_cell(0); | |
49 | var num_cells = this.get_cells_length(); |
|
51 | var num_cells = this.get_cells_length(); | |
50 | this.test.assertEquals(result.text, '12\n', 'cell execute (using shift-enter)'); |
|
52 | this.test.assertEquals(result.text, '12\n', 'cell execute (using shift-enter)'); | |
51 |
this.test.assertEquals(num_cells, |
|
53 | this.test.assertEquals(num_cells, 1, 'shift-enter adds no new cell at the bottom') | |
52 | }); |
|
54 | }); | |
53 |
|
55 | |||
54 | // press the "play" triangle button in the toolbar |
|
56 | // press the "play" triangle button in the toolbar |
@@ -4,11 +4,12 b'' | |||||
4 | casper.notebook_test(function() { |
|
4 | casper.notebook_test(function() { | |
5 | var output = this.evaluate(function () { |
|
5 | var output = this.evaluate(function () { | |
6 | // Fill in test data. |
|
6 | // Fill in test data. | |
|
7 | IPython.notebook.command_mode(); | |||
7 | var set_cell_text = function () { |
|
8 | var set_cell_text = function () { | |
8 | var cell_one = IPython.notebook.get_selected_cell(); |
|
9 | var cell_one = IPython.notebook.get_selected_cell(); | |
9 | cell_one.set_text('a = 5'); |
|
10 | cell_one.set_text('a = 5'); | |
10 |
|
11 | |||
11 | IPython.notebook.insert_cell_below('code'); |
|
12 | IPython.utils.press(IPython.keycodes.b) | |
12 | var cell_two = IPython.notebook.get_selected_cell(); |
|
13 | var cell_two = IPython.notebook.get_selected_cell(); | |
13 | cell_two.set_text('print(a)'); |
|
14 | cell_two.set_text('print(a)'); | |
14 | }; |
|
15 | }; | |
@@ -31,7 +32,7 b' casper.notebook_test(function() {' | |||||
31 | }); |
|
32 | }); | |
32 |
|
33 | |||
33 | this.test.assertEquals(output.above, 'a = 5\nprint(a)', |
|
34 | this.test.assertEquals(output.above, 'a = 5\nprint(a)', | |
34 |
'Successful |
|
35 | 'Successful merge_cell_above().'); | |
35 | this.test.assertEquals(output.below, 'a = 5\nprint(a)', |
|
36 | this.test.assertEquals(output.below, 'a = 5\nprint(a)', | |
36 |
'Successful |
|
37 | 'Successful merge_cell_below().'); | |
37 | }); |
|
38 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now