Show More
@@ -91,7 +91,7 b' casper.notebook_test(function () {' | |||
|
91 | 91 | 'for widget in floatrange:\n' + |
|
92 | 92 | ' widget.max = 50.0\n' + |
|
93 | 93 | ' widget.min = -50.0\n' + |
|
94 |
' widget.value = 2 |
|
|
94 | ' widget.value = 25.0\n' + | |
|
95 | 95 | 'print("Success")\n'); |
|
96 | 96 | this.execute_cell_then(index, function(index){ |
|
97 | 97 | |
@@ -102,46 +102,7 b' casper.notebook_test(function () {' | |||
|
102 | 102 | 'Widget slider exists.'); |
|
103 | 103 | |
|
104 | 104 | this.test.assert(this.cell_element_function(floatrange_index, slider_query, |
|
105 |
'slider', ['value']) == 2 |
|
|
105 | 'slider', ['value']) == 25.0, | |
|
106 | 106 | 'Slider set to Python value.'); |
|
107 | ||
|
108 | // Clear the float textbox value and then set it to 1 by emulating | |
|
109 | // keyboard presses. | |
|
110 | this.cell_element_function(floatrange_index, float_text_query, 'val', ['']); | |
|
111 | this.sendKeys(float_text_query, '1'); | |
|
112 | }); | |
|
113 | ||
|
114 | this.wait(1500); // Wait for change to execute in kernel | |
|
115 | ||
|
116 | index = this.append_cell('for widget in floatrange:\n print(widget.value)\n'); | |
|
117 | this.execute_cell_then(index, function(index){ | |
|
118 | this.test.assert(this.get_output_cell(index).text == '1.0\n20.0\n', | |
|
119 | 'Float textbox set float range value'); | |
|
120 | ||
|
121 | // Clear the float textbox value and then set it to 120 by emulating | |
|
122 | // keyboard presses. | |
|
123 | this.cell_element_function(floatrange_index, float_text_query, 'val', ['']); | |
|
124 | this.sendKeys(float_text_query, '120'); | |
|
125 | }); | |
|
126 | ||
|
127 | this.wait(500); // Wait for change to execute in kernel | |
|
128 | ||
|
129 | index = this.append_cell('print(floatrange[0].value)\n'); | |
|
130 | this.execute_cell_then(index, function(index){ | |
|
131 | this.test.assert(this.get_output_cell(index).text == '50.0\n', | |
|
132 | 'Float textbox value bound'); | |
|
133 | ||
|
134 | // Clear the float textbox value and then set it to 'hello world' by | |
|
135 | // emulating keyboard presses. 'hello world' should get filtered... | |
|
136 | this.cell_element_function(floatrange_index, float_text_query, 'val', ['']); | |
|
137 | this.sendKeys(float_text_query, 'hello world'); | |
|
138 | }); | |
|
139 | ||
|
140 | this.wait(500); // Wait for change to execute in kernel | |
|
141 | ||
|
142 | index = this.append_cell('print(floatrange[0].value)\n'); | |
|
143 | this.execute_cell_then(index, function(index){ | |
|
144 | this.test.assert(this.get_output_cell(index).text == '50.0\n', | |
|
145 | 'Invalid float textbox characters ignored'); | |
|
146 | 107 | }); |
|
147 | 108 | }); No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now