##// END OF EJS Templates
Merge pull request #6832 from minrk/request-only-once...
Merge pull request #6832 from minrk/request-only-once actually send only one kernel_info request

File last commit:

r18592:bbf8ee41
r18670:3d77d934 merge
Show More
widget_button.js
42 lines | 1.5 KiB | application/javascript | JavascriptLexer
Jonathan Frederic
Organized tests.
r14464 // Test widget button class
casper.notebook_test(function () {
index = this.append_cell(
'from IPython.html import widgets\n' +
'from IPython.display import display, clear_output\n' +
'print("Success")');
this.execute_cell_then(index);
var button_index = this.append_cell(
Jonathan Frederic
Renamed *Widget to *,...
r17598 'button = widgets.Button(description="Title")\n' +
MinRK
test coalesced output in js
r17307 'display(button)\n' +
Jonathan Frederic
Organized tests.
r14464 'print("Success")\n' +
'def handle_click(sender):\n' +
MinRK
test coalesced output in js
r17307 ' display("Clicked")\n' +
Jonathan Frederic
Organized tests.
r14464 'button.on_click(handle_click)');
this.execute_cell_then(button_index, function(index){
MinRK
test coalesced output in js
r17307 this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
Jonathan Frederic
Organized tests.
r14464 'Create button cell executed with correct output.');
this.test.assert(this.cell_element_exists(index,
'.widget-area .widget-subarea'),
'Widget subarea exists.');
this.test.assert(this.cell_element_exists(index,
'.widget-area .widget-subarea button'),
'Widget button exists.');
this.test.assert(this.cell_element_function(index,
'.widget-area .widget-subarea button', 'html')=='Title',
'Set button description.');
this.cell_element_function(index,
'.widget-area .widget-subarea button', 'click');
});
Jonathan Frederic
Remove sleep from the following,...
r14970 this.wait_for_output(button_index, 1);
this.then(function () {
MinRK
output[mime/type] -> output.data[mime/type] in javascript
r18592 this.test.assertEquals(this.get_output_cell(button_index, 1).data['text/plain'], "'Clicked'",
Jonathan Frederic
Remove sleep from the following,...
r14970 'Button click event fires.');
Jonathan Frederic
Organized tests.
r14464 });
});