Show More
@@ -8,6 +8,8 b' casper.notebook_test(function () {' | |||||
8 | cell.execute(); |
|
8 | cell.execute(); | |
9 | }); |
|
9 | }); | |
10 |
|
10 | |||
|
11 | ||||
|
12 | // interrupt using menu item (Kernel -> Interrupt) | |||
11 | this.thenClick('li#int_kernel'); |
|
13 | this.thenClick('li#int_kernel'); | |
12 |
|
14 | |||
13 | this.wait_for_output(0); |
|
15 | this.wait_for_output(0); | |
@@ -18,6 +20,28 b' casper.notebook_test(function () {' | |||||
18 | var output = cell.output_area.outputs[0].ename; |
|
20 | var output = cell.output_area.outputs[0].ename; | |
19 | return output; |
|
21 | return output; | |
20 | }) |
|
22 | }) | |
21 | this.test.assertEquals(result, 'KeyboardInterrupt', 'keyboard interrupt') |
|
23 | this.test.assertEquals(result, 'KeyboardInterrupt', 'keyboard interrupt (mouseclick)'); | |
|
24 | }); | |||
|
25 | ||||
|
26 | // run cell 0 again, now interrupting using keyboard shortcut | |||
|
27 | this.thenEvaluate(function () { | |||
|
28 | cell.clear_output(); | |||
|
29 | cell.execute(); | |||
|
30 | }); | |||
|
31 | ||||
|
32 | // interrupt using Ctrl-M I keyboard shortcut | |||
|
33 | this.thenEvaluate( function() { | |||
|
34 | IPython.utils.press_ghetto(IPython.utils.keycodes.I) | |||
|
35 | }); | |||
|
36 | ||||
|
37 | this.wait_for_output(0); | |||
|
38 | ||||
|
39 | this.then(function () { | |||
|
40 | var result = this.evaluate(function () { | |||
|
41 | var cell = IPython.notebook.get_cell(0); | |||
|
42 | var output = cell.output_area.outputs[0].ename; | |||
|
43 | return output; | |||
|
44 | }); | |||
|
45 | this.test.assertEquals(result, 'KeyboardInterrupt', 'keyboard interrupt (shortcut)'); | |||
22 | }); |
|
46 | }); | |
23 | }); |
|
47 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now