add wait_for_output(cell, index)

so you can wait for at least n outputs
MinRK 12 years ago
parent 3c2ff965ef
commit d07e03b7c9

@ -57,15 +57,18 @@ casper.delete_current_notebook = function () {
});
};
// wait for output in a given cell
casper.wait_for_output = function (cell_num) {
this.waitFor(function (c) {
return this.evaluate(function get_output(c) {
var cell = IPython.notebook.get_cell(c);
return cell.output_area.outputs.length != 0;
},
// pass parameter from the test suite js to the browser code js
{c : cell_num});
// wait for the nth output in a given cell
casper.wait_for_output = function (cell_num, out_num) {
out_num = out_num || 0;
this.then(function() {
this.waitFor(function (c, o) {
return this.evaluate(function get_output(c, o) {
var cell = IPython.notebook.get_cell(c);
return cell.output_area.outputs.length > o;
},
// pass parameter from the test suite js to the browser code js
{c : cell_num, o : out_num});
});
},
function then() { },
function timeout() {

Loading…
Cancel
Save