##// END OF EJS Templates
repeat test with keyboard shortcut
Paul Ivanov -
Show More
@@ -21,6 +21,31 b' casper.notebook_test(function () {'
21 var output = cell.output_area.outputs[0].text;
21 var output = cell.output_area.outputs[0].text;
22 return output;
22 return output;
23 })
23 })
24 this.test.assertEquals(result, '10\n', 'stdout output matches')
24 this.test.assertEquals(result, '10\n', 'cell execute (using js)')
25 });
26
27
28 // do it again with the keyboard shortcut
29 this.thenEvaluate(function () {
30 var cell = IPython.notebook.get_cell(0);
31 cell.set_text('a=11; print(a)');
32 cell.clear_output()
33 $(document).trigger($.Event('keydown', {which: 13, ctrlKey: true}))
34 });
35
36 this.waitFor(function () {
37 return this.evaluate(function get_output() {
38 var cell = IPython.notebook.get_cell(0);
39 return cell.output_area.outputs.length != 0;
40 })
41 });
42
43 this.then(function () {
44 var result = this.evaluate(function () {
45 var cell = IPython.notebook.get_cell(0);
46 var output = cell.output_area.outputs[0].text;
47 return output;
48 })
49 this.test.assertEquals(result, '11\n', 'cell execute (using ctrl-enter)')
25 });
50 });
26 });
51 });
General Comments 0
You need to be logged in to leave comments. Login now