##// END OF EJS Templates
use wait_for_output util function
Paul Ivanov -
Show More
@@ -1,28 +1,23 b''
1 //
1 //
2 // Test kernel interrupt
2 // Test kernel interrupt
3 //
3 //
4 casper.notebook_test(function () {
4 casper.notebook_test(function () {
5 this.evaluate(function () {
5 this.evaluate(function () {
6 var cell = IPython.notebook.get_cell(0);
6 var cell = IPython.notebook.get_cell(0);
7 cell.set_text('import time\nfor x in range(3):\n time.sleep(1)');
7 cell.set_text('import time\nfor x in range(3):\n time.sleep(1)');
8 cell.execute();
8 cell.execute();
9 });
9 });
10
10
11 this.thenClick('li#int_kernel');
11 this.thenClick('li#int_kernel');
12
12
13 this.waitFor(function () {
13 this.wait_for_output(0);
14 return this.evaluate(function get_output() {
15 var cell = IPython.notebook.get_cell(0);
16 return cell.output_area.outputs.length != 0;
17 })
18 });
19
14
20 this.then(function () {
15 this.then(function () {
21 var result = this.evaluate(function () {
16 var result = this.evaluate(function () {
22 var cell = IPython.notebook.get_cell(0);
17 var cell = IPython.notebook.get_cell(0);
23 var output = cell.output_area.outputs[0].ename;
18 var output = cell.output_area.outputs[0].ename;
24 return output;
19 return output;
25 })
20 })
26 this.test.assertEquals(result, 'KeyboardInterrupt', 'keyboard interrupt')
21 this.test.assertEquals(result, 'KeyboardInterrupt', 'keyboard interrupt')
27 });
22 });
28 });
23 });
General Comments 0
You need to be logged in to leave comments. Login now