diff --git a/IPython/html/tests/casperjs/test_cases/check_interrupt.js b/IPython/html/tests/casperjs/test_cases/check_interrupt.js
index 643b27f..4a1666c 100644
--- a/IPython/html/tests/casperjs/test_cases/check_interrupt.js
+++ b/IPython/html/tests/casperjs/test_cases/check_interrupt.js
@@ -4,10 +4,20 @@
casper.notebook_test(function () {
this.evaluate(function () {
var cell = IPython.notebook.get_cell(0);
- cell.set_text('import time\nfor x in range(3):\n time.sleep(1)');
+ cell.set_text(
+ 'import time'+
+ '\nfor x in range(3):'+
+ '\n time.sleep(1)'
+ );
cell.execute();
});
+ this.waitFor(function(){
+ return this.evaluate(function() {
+ return $("#notification_kernel")[0].textContent.indexOf('busy') !== -1;
+ });
+ });
+
// interrupt using menu item (Kernel -> Interrupt)
this.thenClick('li#int_kernel');
diff --git a/IPython/html/tests/casperjs/util.js b/IPython/html/tests/casperjs/util.js
index 392fb33..4c12f3f 100644
--- a/IPython/html/tests/casperjs/util.js
+++ b/IPython/html/tests/casperjs/util.js
@@ -67,6 +67,10 @@ casper.wait_for_output = function (cell_num) {
},
// pass parameter from the test suite js to the browser code js
{c : cell_num});
+ },
+ function then() { },
+ function timeout() {
+ this.echo("wait_for_output timedout!");
});
});
};