Show More
@@ -1,49 +1,51 b'' | |||
|
1 | 1 | |
|
2 | 2 | // Test |
|
3 | 3 | casper.notebook_test(function () { |
|
4 | 4 | var a = 'print("a")'; |
|
5 | 5 | var index = this.append_cell(a); |
|
6 | 6 | this.execute_cell_then(index); |
|
7 | 7 | |
|
8 | 8 | var b = 'print("b")'; |
|
9 | 9 | index = this.append_cell(b); |
|
10 | 10 | this.execute_cell_then(index); |
|
11 | 11 | |
|
12 | 12 | var c = 'print("c")'; |
|
13 | 13 | index = this.append_cell(c); |
|
14 | 14 | this.execute_cell_then(index); |
|
15 | 15 | |
|
16 | 16 | this.then(function () { |
|
17 | 17 | |
|
18 | 18 | // Up and down in command mode |
|
19 | 19 | this.select_cell(3); |
|
20 | 20 | this.trigger_keydown('j'); |
|
21 | 21 | this.validate_notebook_state('j at end of notebook', 'command', 3); |
|
22 | 22 | this.trigger_keydown('down'); |
|
23 | 23 | this.validate_notebook_state('down at end of notebook', 'command', 3); |
|
24 | 24 | this.trigger_keydown('up'); |
|
25 | 25 | this.validate_notebook_state('up', 'command', 2); |
|
26 | 26 | this.select_cell(0); |
|
27 | 27 | this.validate_notebook_state('select 0', 'command', 0); |
|
28 | 28 | this.trigger_keydown('k'); |
|
29 | 29 | this.validate_notebook_state('k at top of notebook', 'command', 0); |
|
30 | 30 | this.trigger_keydown('up'); |
|
31 | 31 | this.validate_notebook_state('up at top of notebook', 'command', 0); |
|
32 | 32 | this.trigger_keydown('down'); |
|
33 | 33 | this.validate_notebook_state('down', 'command', 1); |
|
34 | 34 | |
|
35 | 35 | // Up and down in edit mode |
|
36 | 36 | this.click_cell_editor(3); |
|
37 | 37 | this.validate_notebook_state('click cell 3', 'edit', 3); |
|
38 | 38 | this.trigger_keydown('down'); |
|
39 | 39 | this.validate_notebook_state('down at end of notebook', 'edit', 3); |
|
40 | // cursor | |
|
40 | 41 | this.trigger_keydown('up'); |
|
41 | 42 | this.validate_notebook_state('up', 'edit', 2); |
|
42 | 43 | this.click_cell_editor(0); |
|
43 | 44 | this.validate_notebook_state('click 0', 'edit', 0); |
|
44 | 45 | this.trigger_keydown('up'); |
|
45 | 46 | this.validate_notebook_state('up at top of notebook', 'edit', 0); |
|
47 | // cursor | |
|
46 | 48 | this.trigger_keydown('down'); |
|
47 | 49 | this.validate_notebook_state('down', 'edit', 1); |
|
48 | 50 | }); |
|
49 | 51 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now