Show More
@@ -1,43 +1,43 b'' | |||||
1 | // |
|
1 | // | |
2 | // Test merging two notebook cells. |
|
2 | // Test merging two notebook cells. | |
3 | // |
|
3 | // | |
4 | casper.notebook_test(function() { |
|
4 | casper.notebook_test(function() { | |
5 | var that = this; |
|
5 | var that = this; | |
6 | var set_cells_text = function () { |
|
6 | var set_cells_text = function () { | |
7 | that.evaluate(function() { |
|
7 | that.evaluate(function() { | |
8 | var cell_one = IPython.notebook.get_selected_cell(); |
|
8 | var cell_one = IPython.notebook.get_selected_cell(); | |
9 | cell_one.set_text('a = 5'); |
|
9 | cell_one.set_text('a = 5'); | |
10 | }); |
|
10 | }); | |
11 |
|
11 | |||
12 | that.trigger_keydown('b'); |
|
12 | that.trigger_keydown('b'); | |
13 |
|
13 | |||
14 | that.evaluate(function() { |
|
14 | that.evaluate(function() { | |
15 | var cell_two = IPython.notebook.get_selected_cell(); |
|
15 | var cell_two = IPython.notebook.get_selected_cell(); | |
16 | cell_two.set_text('print(a)'); |
|
16 | cell_two.set_text('print(a)'); | |
17 | }); |
|
17 | }); | |
18 | }; |
|
18 | }; | |
19 |
|
19 | |||
20 | this.evaluate(function () { |
|
20 | this.evaluate(function () { | |
21 | IPython.notebook.command_mode(); |
|
21 | IPython.notebook.command_mode(); | |
22 | }); |
|
22 | }); | |
23 |
|
23 | |||
24 | // merge_cell_above() |
|
24 | // merge_cell_above() | |
25 | set_cell_text(); |
|
25 | set_cells_text(); | |
26 | var output_above = this.evaluate(function () { |
|
26 | var output_above = this.evaluate(function () { | |
27 | IPython.notebook.merge_cell_above(); |
|
27 | IPython.notebook.merge_cell_above(); | |
28 | return IPython.notebook.get_selected_cell(); |
|
28 | return IPython.notebook.get_selected_cell(); | |
29 | }); |
|
29 | }); | |
30 |
|
30 | |||
31 | // merge_cell_below() |
|
31 | // merge_cell_below() | |
32 | set_cell_text(); |
|
32 | set_cells_text(); | |
33 | var output_below = this.evaluate(function() { |
|
33 | var output_below = this.evaluate(function() { | |
34 | IPython.notebook.select(0); |
|
34 | IPython.notebook.select(0); | |
35 | IPython.notebook.merge_cell_below(); |
|
35 | IPython.notebook.merge_cell_below(); | |
36 | return IPython.notebook.get_selected_cell(); |
|
36 | return IPython.notebook.get_selected_cell(); | |
37 | }); |
|
37 | }); | |
38 |
|
38 | |||
39 | this.test.assertEquals(output_above, 'a = 5\nprint(a)', |
|
39 | this.test.assertEquals(output_above, 'a = 5\nprint(a)', | |
40 | 'Successful merge_cell_above().'); |
|
40 | 'Successful merge_cell_above().'); | |
41 | this.test.assertEquals(output_below, 'a = 5\nprint(a)', |
|
41 | this.test.assertEquals(output_below, 'a = 5\nprint(a)', | |
42 | 'Successful merge_cell_below().'); |
|
42 | 'Successful merge_cell_below().'); | |
43 | }); |
|
43 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now