##// END OF EJS Templates
Adding prompt area to non-CodeCells to indent content....
Adding prompt area to non-CodeCells to indent content. This is a reponse to the problem of having really long lines in Markdown cells, which makes the content difficult to read. Users want wide code cells, so we don't want to narrow everything. The solution here is to give a prompt area to the heading/md cells to narrow their content area slightly. The only problem is that this makes it more difficult to distinguish between output and md content that follows that output. The solve this, we are adding a narrow line between output and following md.

File last commit:

r13463:5dd21108
r13776:e285883b
Show More
check_interrupt.js
49 lines | 1.3 KiB | application/javascript | JavascriptLexer
Paul Ivanov
test kernel interrupt
r13289 //
// Test kernel interrupt
//
casper.notebook_test(function () {
this.evaluate(function () {
var cell = IPython.notebook.get_cell(0);
Paul Ivanov
yet another JS race condition fix...
r13463 cell.set_text(
'import time'+
'\nfor x in range(3):'+
'\n time.sleep(1)'
);
Paul Ivanov
test kernel interrupt
r13289 cell.execute();
});
Paul Ivanov
yet another JS race condition fix...
r13463 this.waitFor(function(){
return this.evaluate(function() {
return $("#notification_kernel")[0].textContent.indexOf('busy') !== -1;
});
});
Paul Ivanov
test keyboard interrupt shortcuts
r13297
// interrupt using menu item (Kernel -> Interrupt)
Paul Ivanov
test kernel interrupt
r13289 this.thenClick('li#int_kernel');
Paul Ivanov
use wait_for_output util function
r13295 this.wait_for_output(0);
Paul Ivanov
test kernel interrupt
r13289
this.then(function () {
Paul Ivanov
refactor of get_output_cell
r13299 var result = this.get_output_cell(0);
this.test.assertEquals(result.ename, 'KeyboardInterrupt', 'keyboard interrupt (mouseclick)');
Paul Ivanov
test keyboard interrupt shortcuts
r13297 });
// run cell 0 again, now interrupting using keyboard shortcut
this.thenEvaluate(function () {
cell.clear_output();
cell.execute();
});
// interrupt using Ctrl-M I keyboard shortcut
this.thenEvaluate( function() {
IPython.utils.press_ghetto(IPython.utils.keycodes.I)
});
this.wait_for_output(0);
this.then(function () {
Paul Ivanov
refactor of get_output_cell
r13299 var result = this.get_output_cell(0);
this.test.assertEquals(result.ename, 'KeyboardInterrupt', 'keyboard interrupt (shortcut)');
Paul Ivanov
test kernel interrupt
r13289 });
});