##// END OF EJS Templates
Fix tests
Jonathan Frederic -
Show More
@@ -149,7 +149,7 b' casper.notebook_test(function () {'
149 'import time\n' +
149 'import time\n' +
150 'textbox = widgets.Text()\n' +
150 'textbox = widgets.Text()\n' +
151 'display(textbox)\n' +
151 'display(textbox)\n' +
152 'textbox.add_class("my-throttle-textbox", selector="input")\n' +
152 'textbox._dom_classes = ["my-throttle-textbox"]\n' +
153 'def handle_change(name, old, new):\n' +
153 'def handle_change(name, old, new):\n' +
154 ' display(len(new))\n' +
154 ' display(len(new))\n' +
155 ' time.sleep(0.5)\n' +
155 ' time.sleep(0.5)\n' +
@@ -166,7 +166,7 b' casper.notebook_test(function () {'
166 '.my-throttle-textbox'), 'Textbox exists.');
166 '.my-throttle-textbox'), 'Textbox exists.');
167
167
168 // Send 20 characters
168 // Send 20 characters
169 this.sendKeys('.my-throttle-textbox', '....................');
169 this.sendKeys('.my-throttle-textbox input', '....................');
170 });
170 });
171
171
172 this.wait_for_widget(textbox);
172 this.wait_for_widget(textbox);
@@ -11,7 +11,7 b' casper.notebook_test(function () {'
11 'button = widgets.Button()\n'+
11 'button = widgets.Button()\n'+
12 'container.children = [button]\n'+
12 'container.children = [button]\n'+
13 'display(container)\n'+
13 'display(container)\n'+
14 'container.add_class("my-test-class")\n'+
14 'container._dom_classes = ["my-test-class"]\n'+
15 'print("Success")\n');
15 'print("Success")\n');
16 this.execute_cell_then(container_index, function(index){
16 this.execute_cell_then(container_index, function(index){
17
17
@@ -28,7 +28,7 b' casper.notebook_test(function () {'
28
28
29 this.test.assert(this.cell_element_exists(index,
29 this.test.assert(this.cell_element_exists(index,
30 '.widget-area .widget-subarea .my-test-class'),
30 '.widget-area .widget-subarea .my-test-class'),
31 'add_class works.');
31 '_dom_classes works.');
32
32
33 this.test.assert(this.cell_element_exists(index,
33 this.test.assert(this.cell_element_exists(index,
34 '.widget-area .widget-subarea .my-test-class button'),
34 '.widget-area .widget-subarea .my-test-class button'),
@@ -49,7 +49,7 b' casper.notebook_test(function () {'
49 });
49 });
50
50
51 index = this.append_cell(
51 index = this.append_cell(
52 'container.remove_class("my-test-class")\n'+
52 'container._dom_classes = []\n'+
53 'print("Success")\n');
53 'print("Success")\n');
54 this.execute_cell_then(index, function(index){
54 this.execute_cell_then(index, function(index){
55
55
@@ -58,7 +58,7 b' casper.notebook_test(function () {'
58
58
59 this.test.assert(! this.cell_element_exists(container_index,
59 this.test.assert(! this.cell_element_exists(container_index,
60 '.widget-area .widget-subarea .my-test-class'),
60 '.widget-area .widget-subarea .my-test-class'),
61 'remove_class works.');
61 '_dom_classes can be used to remove a class.');
62 });
62 });
63
63
64 index = this.append_cell(
64 index = this.append_cell(
@@ -7,11 +7,11 b' casper.notebook_test(function () {'
7 this.execute_cell_then(index);
7 this.execute_cell_then(index);
8
8
9 var float_text = {};
9 var float_text = {};
10 float_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-float-text';
10 float_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-float-text input';
11 float_text.index = this.append_cell(
11 float_text.index = this.append_cell(
12 'float_widget = widgets.FloatText()\n' +
12 'float_widget = widgets.FloatText()\n' +
13 'display(float_widget)\n' +
13 'display(float_widget)\n' +
14 'float_widget.add_class("my-second-float-text", selector="input")\n' +
14 'float_widget._dom_classes = ["my-second-float-text"]\n' +
15 'print(float_widget.model_id)\n');
15 'print(float_widget.model_id)\n');
16 this.execute_cell_then(float_text.index, function(index){
16 this.execute_cell_then(float_text.index, function(index){
17 float_text.model_id = this.get_output_cell(index).text.trim();
17 float_text.model_id = this.get_output_cell(index).text.trim();
@@ -27,7 +27,6 b' casper.notebook_test(function () {'
27 // window. If we don't do this, the captured image will be black.
27 // window. If we don't do this, the captured image will be black.
28 'image.set_css({"background": "blue", "z-index": "9999", "position": "fixed", "top": "0px", "left": "0px"})\n' +
28 'image.set_css({"background": "blue", "z-index": "9999", "position": "fixed", "top": "0px", "left": "0px"})\n' +
29 'display(image)\n' +
29 'display(image)\n' +
30 'image.add_class("my-test-image")\n' +
31 'print("Success")\n');
30 'print("Success")\n');
32 this.execute_cell_then(image_index, function(index){
31 this.execute_cell_then(image_index, function(index){
33
32
@@ -7,11 +7,11 b' casper.notebook_test(function () {'
7 this.execute_cell_then(index);
7 this.execute_cell_then(index);
8
8
9 var int_text = {};
9 var int_text = {};
10 int_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-int-text';
10 int_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-int-text input';
11 int_text.index = this.append_cell(
11 int_text.index = this.append_cell(
12 'int_widget = widgets.IntText()\n' +
12 'int_widget = widgets.IntText()\n' +
13 'display(int_widget)\n' +
13 'display(int_widget)\n' +
14 'int_widget.add_class("my-second-int-text", selector="input")\n' +
14 'int_widget._dom_classes = ["my-second-int-text"]\n' +
15 'print(int_widget.model_id)\n');
15 'print(int_widget.model_id)\n');
16 this.execute_cell_then(int_text.index, function(index){
16 this.execute_cell_then(int_text.index, function(index){
17 int_text.model_id = this.get_output_cell(index).text.trim();
17 int_text.model_id = this.get_output_cell(index).text.trim();
@@ -64,12 +64,12 b' casper.notebook_test(function () {'
64
64
65 var slider_query = '.widget-area .widget-subarea .widget-hbox-single .slider';
65 var slider_query = '.widget-area .widget-subarea .widget-hbox-single .slider';
66 var int_text2 = {};
66 var int_text2 = {};
67 int_text2.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-num-test-text';
67 int_text2.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-num-test-text input';
68 int_text2.index = this.append_cell(
68 int_text2.index = this.append_cell(
69 'intrange = [widgets.BoundedIntTextWidget(),\n' +
69 'intrange = [widgets.BoundedIntTextWidget(),\n' +
70 ' widgets.IntSliderWidget()]\n' +
70 ' widgets.IntSliderWidget()]\n' +
71 '[display(intrange[i]) for i in range(2)]\n' +
71 '[display(intrange[i]) for i in range(2)]\n' +
72 'intrange[0].add_class("my-second-num-test-text", selector="input")\n' +
72 'intrange[0]._dom_classes = ["my-second-num-test-text"]\n' +
73 'print(intrange[0].model_id)\n');
73 'print(intrange[0].model_id)\n');
74 this.execute_cell_then(int_text2.index, function(index){
74 this.execute_cell_then(int_text2.index, function(index){
75 int_text2.model_id = this.get_output_cell(index).text.trim();
75 int_text2.model_id = this.get_output_cell(index).text.trim();
General Comments 0
You need to be logged in to leave comments. Login now