##// END OF EJS Templates
try to shutdown at the end of every notebook run...
try to shutdown at the end of every notebook run this line causes noise in the test suite, but if we just ignore it, we'll never get to the bottom of it. It seems to only happen when running 'iptest js', and *not* when running the 'casperjs test' command directly, with a notebookserver that was launched manually.

File last commit:

r13278:0ab30694
r13288:f4ebc6b7
Show More
execute_code_cell.js
32 lines | 1013 B | application/javascript | JavascriptLexer
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249 //
// Test code cell execution.
//
Paul Ivanov
pep8 style function names
r13275 casper.notebook_test(function () {
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249 this.evaluate(function () {
Paul Ivanov
consistently get the first cell
r13260 var cell = IPython.notebook.get_cell(0);
Thomas Kluyver
Use Python 3 compatible syntax in tests
r13278 cell.set_text('a=10; print(a)');
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249 cell.execute();
});
Paul Ivanov
eliminate hardcoded wait, now wait on outputs...
r13277
this.waitFor(function () {
return this.evaluate(function get_output() {
var cell = IPython.notebook.get_cell(0);
return cell.output_area.outputs.length != 0;
})
}, null, function on_timeout() {
this.echo( this.evaluate( function() {
IPython.notebook.save_notebook();
return IPython.notebook.notebook_name;
}) + ".ipynb is the name of the notebook which failed");
});
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249
David Wyde
Wrap CasperJS tests in a helper function to reduce boilerplate.
r13253 this.then(function () {
var result = this.evaluate(function () {
var cell = IPython.notebook.get_cell(0);
Paul Ivanov
less convoluted way of grabbing output
r13259 var output = cell.output_area.outputs[0].text;
David Wyde
Wrap CasperJS tests in a helper function to reduce boilerplate.
r13253 return output;
})
this.test.assertEquals(result, '10\n', 'stdout output matches')
});
David Wyde
Add CasperJS utility functions, and tests for code and...
r13249 });