mirror of
https://github.com/jupyter/notebook.git
synced 2025-02-11 12:30:51 +08:00
Fix tests
This commit is contained in:
parent
f85a01041c
commit
1797243f7a
@ -149,7 +149,7 @@ casper.notebook_test(function () {
|
||||
'import time\n' +
|
||||
'textbox = widgets.Text()\n' +
|
||||
'display(textbox)\n' +
|
||||
'textbox.add_class("my-throttle-textbox", selector="input")\n' +
|
||||
'textbox._dom_classes = ["my-throttle-textbox"]\n' +
|
||||
'def handle_change(name, old, new):\n' +
|
||||
' display(len(new))\n' +
|
||||
' time.sleep(0.5)\n' +
|
||||
@ -166,7 +166,7 @@ casper.notebook_test(function () {
|
||||
'.my-throttle-textbox'), 'Textbox exists.');
|
||||
|
||||
// Send 20 characters
|
||||
this.sendKeys('.my-throttle-textbox', '....................');
|
||||
this.sendKeys('.my-throttle-textbox input', '....................');
|
||||
});
|
||||
|
||||
this.wait_for_widget(textbox);
|
||||
|
@ -11,7 +11,7 @@ casper.notebook_test(function () {
|
||||
'button = widgets.Button()\n'+
|
||||
'container.children = [button]\n'+
|
||||
'display(container)\n'+
|
||||
'container.add_class("my-test-class")\n'+
|
||||
'container._dom_classes = ["my-test-class"]\n'+
|
||||
'print("Success")\n');
|
||||
this.execute_cell_then(container_index, function(index){
|
||||
|
||||
@ -28,7 +28,7 @@ casper.notebook_test(function () {
|
||||
|
||||
this.test.assert(this.cell_element_exists(index,
|
||||
'.widget-area .widget-subarea .my-test-class'),
|
||||
'add_class works.');
|
||||
'_dom_classes works.');
|
||||
|
||||
this.test.assert(this.cell_element_exists(index,
|
||||
'.widget-area .widget-subarea .my-test-class button'),
|
||||
@ -49,7 +49,7 @@ casper.notebook_test(function () {
|
||||
});
|
||||
|
||||
index = this.append_cell(
|
||||
'container.remove_class("my-test-class")\n'+
|
||||
'container._dom_classes = []\n'+
|
||||
'print("Success")\n');
|
||||
this.execute_cell_then(index, function(index){
|
||||
|
||||
@ -58,7 +58,7 @@ casper.notebook_test(function () {
|
||||
|
||||
this.test.assert(! this.cell_element_exists(container_index,
|
||||
'.widget-area .widget-subarea .my-test-class'),
|
||||
'remove_class works.');
|
||||
'_dom_classes can be used to remove a class.');
|
||||
});
|
||||
|
||||
index = this.append_cell(
|
||||
|
@ -7,11 +7,11 @@ casper.notebook_test(function () {
|
||||
this.execute_cell_then(index);
|
||||
|
||||
var float_text = {};
|
||||
float_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-float-text';
|
||||
float_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-float-text input';
|
||||
float_text.index = this.append_cell(
|
||||
'float_widget = widgets.FloatText()\n' +
|
||||
'display(float_widget)\n' +
|
||||
'float_widget.add_class("my-second-float-text", selector="input")\n' +
|
||||
'float_widget._dom_classes = ["my-second-float-text"]\n' +
|
||||
'print(float_widget.model_id)\n');
|
||||
this.execute_cell_then(float_text.index, function(index){
|
||||
float_text.model_id = this.get_output_cell(index).text.trim();
|
||||
|
@ -27,7 +27,6 @@ casper.notebook_test(function () {
|
||||
// window. If we don't do this, the captured image will be black.
|
||||
'image.set_css({"background": "blue", "z-index": "9999", "position": "fixed", "top": "0px", "left": "0px"})\n' +
|
||||
'display(image)\n' +
|
||||
'image.add_class("my-test-image")\n' +
|
||||
'print("Success")\n');
|
||||
this.execute_cell_then(image_index, function(index){
|
||||
|
||||
|
@ -7,11 +7,11 @@ casper.notebook_test(function () {
|
||||
this.execute_cell_then(index);
|
||||
|
||||
var int_text = {};
|
||||
int_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-int-text';
|
||||
int_text.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-int-text input';
|
||||
int_text.index = this.append_cell(
|
||||
'int_widget = widgets.IntText()\n' +
|
||||
'display(int_widget)\n' +
|
||||
'int_widget.add_class("my-second-int-text", selector="input")\n' +
|
||||
'int_widget._dom_classes = ["my-second-int-text"]\n' +
|
||||
'print(int_widget.model_id)\n');
|
||||
this.execute_cell_then(int_text.index, function(index){
|
||||
int_text.model_id = this.get_output_cell(index).text.trim();
|
||||
@ -64,12 +64,12 @@ casper.notebook_test(function () {
|
||||
|
||||
var slider_query = '.widget-area .widget-subarea .widget-hbox-single .slider';
|
||||
var int_text2 = {};
|
||||
int_text2.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-num-test-text';
|
||||
int_text2.query = '.widget-area .widget-subarea .widget-hbox-single .my-second-num-test-text input';
|
||||
int_text2.index = this.append_cell(
|
||||
'intrange = [widgets.BoundedIntTextWidget(),\n' +
|
||||
' widgets.IntSliderWidget()]\n' +
|
||||
'[display(intrange[i]) for i in range(2)]\n' +
|
||||
'intrange[0].add_class("my-second-num-test-text", selector="input")\n' +
|
||||
'intrange[0]._dom_classes = ["my-second-num-test-text"]\n' +
|
||||
'print(intrange[0].model_id)\n');
|
||||
this.execute_cell_then(int_text2.index, function(index){
|
||||
int_text2.model_id = this.get_output_cell(index).text.trim();
|
||||
|
Loading…
Reference in New Issue
Block a user