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