From ca0af44d0463cfd5752c34540c780bc3a65eab1a 2014-06-04 19:10:29 From: Jonathan Frederic Date: 2014-06-04 19:10:29 Subject: [PATCH] Make int widget tests play nicely with slimer --- diff --git a/IPython/html/tests/widgets/widget_int.js b/IPython/html/tests/widgets/widget_int.js index 3639f2d..038fcbe 100644 --- a/IPython/html/tests/widgets/widget_int.js +++ b/IPython/html/tests/widgets/widget_int.js @@ -108,8 +108,11 @@ casper.notebook_test(function () { // Clear the int textbox value and then set it to 1 by emulating // keyboard presses. - this.cell_element_function(int_text2.index, int_text2.query, 'val', ['']); - this.sendKeys(int_text2.query, '1'); + this.evaluate(function(q){ + var textbox = IPython.notebook.element.find(q); + textbox.val('1'); + textbox.trigger('keyup'); + }, {q: int_text2.query}); }); this.wait_for_widget(int_text2); @@ -121,8 +124,11 @@ casper.notebook_test(function () { // Clear the int textbox value and then set it to 120 by emulating // keyboard presses. - this.cell_element_function(int_text2.index, int_text2.query, 'val', ['']); - this.sendKeys(int_text2.query, '120'); + this.evaluate(function(q){ + var textbox = IPython.notebook.element.find(q); + textbox.val('120'); + textbox.trigger('keyup'); + }, {q: int_text2.query}); }); this.wait_for_widget(int_text2); @@ -134,8 +140,11 @@ casper.notebook_test(function () { // Clear the int textbox value and then set it to 'hello world' by // emulating keyboard presses. 'hello world' should get filtered... - this.cell_element_function(int_text2.index, int_text2.query, 'val', ['']); - this.sendKeys(int_text2.query, 'hello world'); + this.evaluate(function(q){ + var textbox = IPython.notebook.element.find(q); + textbox.val('hello world'); + textbox.trigger('keyup'); + }, {q: int_text2.query}); }); this.wait_for_widget(int_text2);