##// END OF EJS Templates
Explicitly set the current working directory when running tests...
Explicitly set the current working directory when running tests Because of the profile directory searching algorithm, if the current working directory has a directory named 'profile_default', that will be used instead of the temporary profile directory the tests expect.

File last commit:

r17339:592c5060
r17469:70f5afef
Show More
interrupt.js
45 lines | 1.2 KiB | application/javascript | JavascriptLexer
//
// Test kernel interrupt
//
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.execute();
});
this.wait_for_busy();
// interrupt using menu item (Kernel -> Interrupt)
this.thenClick('li#int_kernel');
this.wait_for_output(0);
this.then(function () {
var result = this.get_output_cell(0);
this.test.assertEquals(result.ename, 'KeyboardInterrupt', 'keyboard interrupt (mouseclick)');
});
// run cell 0 again, now interrupting using keyboard shortcut
this.thenEvaluate(function () {
var cell = IPython.notebook.get_cell(0);
cell.clear_output();
cell.execute();
});
// interrupt using ii keyboard shortcut
this.then(function(){
this.trigger_keydown('esc', 'i', 'i');
});
this.wait_for_output(0);
this.then(function () {
var result = this.get_output_cell(0);
this.test.assertEquals(result.ename, 'KeyboardInterrupt', 'keyboard interrupt (shortcut)');
});
});