##// END OF EJS Templates
This feature was discussed in #6123, but it doesn't look like anything was ever incorporated into the IPython Notebook....
This feature was discussed in #6123, but it doesn't look like anything was ever incorporated into the IPython Notebook. Here's a brief overview of the changes: - Display of messages from other clients can be toggled on and off from within a notebook, either using the ``<M-m>e`` keyboard shortcut in the web UI, or through the option in the "Kernel" menu. - notebook.js controls whether messages are displayed through a callback that is invoked from kernel.js when no callbacks are available for a message. - The UI displays ``execute_input`` messages originating from an other clients in new cells at the end of the notebook. Output messages (``execute_result`` et al.) will only be displayed if a cell exists with a matching message ID. Pending design questions: - Should each ``execute_input`` message cause a new cell to be created? - Should new cells be placed at the end of the notebook, or elsewhere? If the latter, what criteria should be followed?

File last commit:

r18910:4100b1b7
r19164:17ac8ca3
Show More
widget_button.js
44 lines | 1.7 KiB | application/javascript | JavascriptLexer
// Test widget button class
casper.notebook_test(function () {
var button_index = this.append_cell(
'from IPython.html import widgets\n' +
'from IPython.display import display, clear_output\n' +
'button = widgets.Button(description="Title")\n' +
'display(button)\n' +
'print("Success")\n' +
'def handle_click(sender):\n' +
' display("Clicked")\n' +
'button.on_click(handle_click)');
this.execute_cell_then(button_index, function(index){
this.test.assertEquals(this.get_output_cell(index).text, 'Success\n',
'Create button cell executed with correct output.');
});
// Wait for the widgets to actually display.
var widget_button_selector = '.widget-area .widget-subarea button';
this.wait_for_element(button_index, widget_button_selector);
// Continue with the tests.
this.then(function() {
this.test.assert(this.cell_element_exists(button_index,
'.widget-area .widget-subarea'),
'Widget subarea exists.');
this.test.assert(this.cell_element_exists(button_index,
widget_button_selector),
'Widget button exists.');
this.test.assert(this.cell_element_function(button_index,
widget_button_selector, 'html')=='Title',
'Set button description.');
this.cell_element_function(button_index,
widget_button_selector, 'click');
});
this.wait_for_output(button_index, 1);
this.then(function () {
this.test.assertEquals(this.get_output_cell(button_index, 1).data['text/plain'], "'Clicked'",
'Button click event fires.');
});
});