|
|
|
|
@ -91,7 +91,7 @@ casper.notebook_test(function () {
|
|
|
|
|
'for widget in floatrange:\n' +
|
|
|
|
|
' widget.max = 50.0\n' +
|
|
|
|
|
' widget.min = -50.0\n' +
|
|
|
|
|
' widget.value = 20.0\n' +
|
|
|
|
|
' widget.value = 25.0\n' +
|
|
|
|
|
'print("Success")\n');
|
|
|
|
|
this.execute_cell_then(index, function(index){
|
|
|
|
|
|
|
|
|
|
@ -102,46 +102,7 @@ casper.notebook_test(function () {
|
|
|
|
|
'Widget slider exists.');
|
|
|
|
|
|
|
|
|
|
this.test.assert(this.cell_element_function(floatrange_index, slider_query,
|
|
|
|
|
'slider', ['value']) == 20.0,
|
|
|
|
|
'slider', ['value']) == 25.0,
|
|
|
|
|
'Slider set to Python value.');
|
|
|
|
|
|
|
|
|
|
// Clear the float textbox value and then set it to 1 by emulating
|
|
|
|
|
// keyboard presses.
|
|
|
|
|
this.cell_element_function(floatrange_index, float_text_query, 'val', ['']);
|
|
|
|
|
this.sendKeys(float_text_query, '1');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.wait(1500); // Wait for change to execute in kernel
|
|
|
|
|
|
|
|
|
|
index = this.append_cell('for widget in floatrange:\n print(widget.value)\n');
|
|
|
|
|
this.execute_cell_then(index, function(index){
|
|
|
|
|
this.test.assert(this.get_output_cell(index).text == '1.0\n20.0\n',
|
|
|
|
|
'Float textbox set float range value');
|
|
|
|
|
|
|
|
|
|
// Clear the float textbox value and then set it to 120 by emulating
|
|
|
|
|
// keyboard presses.
|
|
|
|
|
this.cell_element_function(floatrange_index, float_text_query, 'val', ['']);
|
|
|
|
|
this.sendKeys(float_text_query, '120');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.wait(500); // Wait for change to execute in kernel
|
|
|
|
|
|
|
|
|
|
index = this.append_cell('print(floatrange[0].value)\n');
|
|
|
|
|
this.execute_cell_then(index, function(index){
|
|
|
|
|
this.test.assert(this.get_output_cell(index).text == '50.0\n',
|
|
|
|
|
'Float textbox value bound');
|
|
|
|
|
|
|
|
|
|
// Clear the float textbox value and then set it to 'hello world' by
|
|
|
|
|
// emulating keyboard presses. 'hello world' should get filtered...
|
|
|
|
|
this.cell_element_function(floatrange_index, float_text_query, 'val', ['']);
|
|
|
|
|
this.sendKeys(float_text_query, 'hello world');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.wait(500); // Wait for change to execute in kernel
|
|
|
|
|
|
|
|
|
|
index = this.append_cell('print(floatrange[0].value)\n');
|
|
|
|
|
this.execute_cell_then(index, function(index){
|
|
|
|
|
this.test.assert(this.get_output_cell(index).text == '50.0\n',
|
|
|
|
|
'Invalid float textbox characters ignored');
|
|
|
|
|
});
|
|
|
|
|
});
|