Show More
@@ -200,14 +200,13 b' casper.notebook_test(function () {' | |||
|
200 | 200 | 'Button click event fires.'); |
|
201 | 201 | }); |
|
202 | 202 | |
|
203 | index = this.append_cell( | |
|
204 |
|
|
|
205 | 'print("Success")'); | |
|
206 | this.execute_cell_then(index, function(index){ | |
|
203 | // Close the button widget asynchronisly. | |
|
204 | index = this.append_cell('button.close()\n'); | |
|
205 | this.execute_cell(index); | |
|
207 | 206 | |
|
208 | this.test.assert(this.get_output_cell(index).text == 'Success\n', | |
|
209 | 'Close button cell executed with correct output.'); | |
|
207 | this.wait(500); // Wait for the button to close. | |
|
210 | 208 | |
|
209 | this.then(function(){ | |
|
211 | 210 | this.test.assert(! this.cell_element_exists(button_index, |
|
212 | 211 | '.widget-area .widget-subarea button'), |
|
213 | 212 | 'Widget button doesn\'t exists.'); |
@@ -336,7 +335,7 b' casper.notebook_test(function () {' | |||
|
336 | 335 | this.sendKeys(float_text_query, '1'); |
|
337 | 336 | }); |
|
338 | 337 | |
|
339 |
this.wait(500); // Wait for |
|
|
338 | this.wait(500); // Wait for change to execute in kernel | |
|
340 | 339 | |
|
341 | 340 | index = this.append_cell('print(floatrange.value)\n'); |
|
342 | 341 | this.execute_cell_then(index, function(index){ |
@@ -349,7 +348,7 b' casper.notebook_test(function () {' | |||
|
349 | 348 | this.sendKeys(float_text_query, '120'); |
|
350 | 349 | }); |
|
351 | 350 | |
|
352 |
this.wait(500); // Wait for |
|
|
351 | this.wait(500); // Wait for change to execute in kernel | |
|
353 | 352 | |
|
354 | 353 | index = this.append_cell('print(floatrange.value)\n'); |
|
355 | 354 | this.execute_cell_then(index, function(index){ |
@@ -362,7 +361,7 b' casper.notebook_test(function () {' | |||
|
362 | 361 | this.sendKeys(float_text_query, 'hello world'); |
|
363 | 362 | }); |
|
364 | 363 | |
|
365 |
this.wait(500); // Wait for |
|
|
364 | this.wait(500); // Wait for change to execute in kernel | |
|
366 | 365 | |
|
367 | 366 | index = this.append_cell('print(floatrange.value)\n'); |
|
368 | 367 | this.execute_cell_then(index, function(index){ |
@@ -370,5 +369,56 b' casper.notebook_test(function () {' | |||
|
370 | 369 | 'Invalid float textbox characters ignored'); |
|
371 | 370 | }); |
|
372 | 371 | |
|
372 | // Test float widget /////////////////////////////////////////////////////// | |
|
373 | var float_text_query_2 = '.widget-area .widget-subarea .widget-hbox-single .my-second-float-text'; | |
|
374 | ||
|
375 | var float_index = this.append_cell( | |
|
376 | 'float_widget = widgets.FloatWidget()\n' + | |
|
377 | 'display(float_widget)\n' + | |
|
378 | 'float_widget.add_class("my-second-float-text")\n' + | |
|
379 | 'print("Success")\n'); | |
|
380 | this.execute_cell_then(float_index, function(index){ | |
|
381 | ||
|
382 | this.test.assert(this.get_output_cell(index).text == 'Success\n', | |
|
383 | 'Create float cell executed with correct output.'); | |
|
384 | ||
|
385 | this.test.assert(this.cell_element_exists(index, | |
|
386 | '.widget-area .widget-subarea'), | |
|
387 | 'Widget subarea exists.'); | |
|
388 | ||
|
389 | this.test.assert(this.cell_element_exists(index, float_text_query_2), | |
|
390 | 'Widget float textbox exists.'); | |
|
391 | ||
|
392 | this.cell_element_function(float_index, float_text_query_2, 'val', ['']); | |
|
393 | this.sendKeys(float_text_query_2, '1.05'); | |
|
394 | }); | |
|
395 | ||
|
396 | this.wait(500); // Wait for change to execute in kernel | |
|
397 | ||
|
398 | index = this.append_cell('print(float_widget.value)\n'); | |
|
399 | this.execute_cell_then(index, function(index){ | |
|
400 | this.test.assert(this.get_output_cell(index).text == '1.05\n', | |
|
401 | 'Float textbox value set.'); | |
|
402 | this.cell_element_function(float_index, float_text_query_2, 'val', ['']); | |
|
403 | this.sendKeys(float_text_query_2, '123456789.0'); | |
|
404 | }); | |
|
405 | ||
|
406 | this.wait(500); // Wait for change to execute in kernel | |
|
407 | ||
|
408 | index = this.append_cell('print(float_widget.value)\n'); | |
|
409 | this.execute_cell_then(index, function(index){ | |
|
410 | this.test.assert(this.get_output_cell(index).text == '123456789.0\n', | |
|
411 | 'Long float textbox value set (probably triggers throttling).'); | |
|
412 | this.cell_element_function(float_index, float_text_query_2, 'val', ['']); | |
|
413 | this.sendKeys(float_text_query_2, '12hello'); | |
|
414 | }); | |
|
415 | ||
|
416 | this.wait(500); // Wait for change to execute in kernel | |
|
417 | ||
|
418 | index = this.append_cell('print(float_widget.value)\n'); | |
|
419 | this.execute_cell_then(index, function(index){ | |
|
420 | this.test.assert(this.get_output_cell(index).text == '12.0\n', | |
|
421 | 'Float textbox value set.'); | |
|
422 | }); | |
|
373 | 423 | }); |
|
374 | 424 |
General Comments 0
You need to be logged in to leave comments.
Login now