diff --git a/IPython/html/tests/notebook/dualmode.js b/IPython/html/tests/notebook/dualmode.js
index cd2d30e89..ee577c7ce 100644
--- a/IPython/html/tests/notebook/dualmode.js
+++ b/IPython/html/tests/notebook/dualmode.js
@@ -47,14 +47,44 @@ casper.notebook_test(function () {
this.evaluate(function(){
$('#keyboard_shortcuts a').click();
}, {});
+ });
+
+ // Wait for the dialog to fade in completely.
+ this.waitForSelector('div.modal', function() {
+ this.evaluate(function(){
+ IPython.modal_shown = false;
+ $('div.modal').on('shown.bs.modal', function (){
+ IPython.modal_shown = true;
+ });
+ $('div.modal').on('hidden.bs.modal', function (){
+ IPython.modal_shown = false;
+ });
+ });
+
+ });
+ this.waitFor(function () {
+ return this.evaluate(function(){
+ return IPython.modal_shown;
+ });
+ },
+ function() {
this.trigger_keydown('k');
this.validate_notebook_state('k in command mode while keyboard help is up', 'command', 3);
// Close keyboard help
this.evaluate(function(){
- $('div.modal button.close').click();
+ $('div.modal-footer button.btn-default').click();
}, {});
+ });
+
+ // Wait for the dialog to fade out completely.
+ this.waitFor(function () {
+ return this.evaluate(function(){
+ return !IPython.modal_shown;
+ });
+ },
+ function() {
this.trigger_keydown('k');
this.validate_notebook_state('k in command mode', 'command', 2);
diff --git a/IPython/html/tests/widgets/widget_selection.js b/IPython/html/tests/widgets/widget_selection.js
index c4f03cc86..25d5b868f 100644
--- a/IPython/html/tests/widgets/widget_selection.js
+++ b/IPython/html/tests/widgets/widget_selection.js
@@ -105,6 +105,9 @@ casper.notebook_test(function () {
this.test.assert(verify_selection(this, 2), 'List selection updated view states correctly.');
// Verify that selecting a multibutton option updates all of the others.
+ // Bootstrap3 has changed the toggle button group behavior. Two clicks
+ // are required to actually select an item.
+ this.cell_element_function(selection_index, multibtn_selector + ' .btn:nth-child(4)', 'click');
this.cell_element_function(selection_index, multibtn_selector + ' .btn:nth-child(4)', 'click');
});
this.wait_for_idle();