From e14172d8514246ce856b5b0f7e70d14d8510555b Mon Sep 17 00:00:00 2001 From: MinRK Date: Fri, 7 Feb 2014 13:49:30 -0800 Subject: [PATCH] adjust some events in nb_roundtrip hopefully should address some intermittent failures due to race conditions --- IPython/html/tests/notebook/roundtrip.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/IPython/html/tests/notebook/roundtrip.js b/IPython/html/tests/notebook/roundtrip.js index 8190a6c57..a9319b9c8 100644 --- a/IPython/html/tests/notebook/roundtrip.js +++ b/IPython/html/tests/notebook/roundtrip.js @@ -64,9 +64,12 @@ function clear_and_execute(that, code) { IPython.notebook.get_cell(0).clear_output(); IPython.notebook.get_cell(1).clear_output(); }); - that.set_cell_text(0, code); - that.execute_cell(0); -} + that.then(function () { + that.set_cell_text(0, code); + that.execute_cell(0); + that.wait_for_idle(); + }); +}; casper.notebook_test(function () { this.evaluate(function () { @@ -77,13 +80,9 @@ casper.notebook_test(function () { "IPython.notebook.insert_cell_below('code')" ].join('\n') ); - - cell.execute(); }); - this.wait_for_output(0); - - this.then(function ( ) { + this.execute_cell_then(0, function () { var result = this.get_output_cell(0); var num_cells = this.get_cells_length(); this.test.assertEquals(num_cells, 2, '%%javascript magic works');