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