mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-21 04:10:17 +08:00
repeat test with keyboard shortcut
This commit is contained in:
parent
23a7eb325d
commit
34c9ad36a2
@ -21,6 +21,31 @@ casper.notebook_test(function () {
|
||||
var output = cell.output_area.outputs[0].text;
|
||||
return output;
|
||||
})
|
||||
this.test.assertEquals(result, '10\n', 'stdout output matches')
|
||||
this.test.assertEquals(result, '10\n', 'cell execute (using js)')
|
||||
});
|
||||
|
||||
|
||||
// do it again with the keyboard shortcut
|
||||
this.thenEvaluate(function () {
|
||||
var cell = IPython.notebook.get_cell(0);
|
||||
cell.set_text('a=11; print(a)');
|
||||
cell.clear_output()
|
||||
$(document).trigger($.Event('keydown', {which: 13, ctrlKey: true}))
|
||||
});
|
||||
|
||||
this.waitFor(function () {
|
||||
return this.evaluate(function get_output() {
|
||||
var cell = IPython.notebook.get_cell(0);
|
||||
return cell.output_area.outputs.length != 0;
|
||||
})
|
||||
});
|
||||
|
||||
this.then(function () {
|
||||
var result = this.evaluate(function () {
|
||||
var cell = IPython.notebook.get_cell(0);
|
||||
var output = cell.output_area.outputs[0].text;
|
||||
return output;
|
||||
})
|
||||
this.test.assertEquals(result, '11\n', 'cell execute (using ctrl-enter)')
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user