diff --git a/addons/web_tour/static/src/js/running_tour_action_helper.js b/addons/web_tour/static/src/js/running_tour_action_helper.js index cee5a221cc4..f0c27750b4a 100644 --- a/addons/web_tour/static/src/js/running_tour_action_helper.js +++ b/addons/web_tour/static/src/js/running_tour_action_helper.js @@ -110,7 +110,7 @@ var RunningTourActionHelper = core.Class.extend({ values.$element.focusInEnd(); values.$element.trigger($.Event( "keyup", {key: '_', keyCode: 95})); } - values.$element.trigger("change"); + values.$element[0].dispatchEvent(new Event("change", { bubbles: true, cancelable: false })); }, _text_blur: function (values, text) { this._text(values, text); diff --git a/addons/web_tour/static/src/js/tour_manager.js b/addons/web_tour/static/src/js/tour_manager.js index 8e180c96150..a6b35709cce 100644 --- a/addons/web_tour/static/src/js/tour_manager.js +++ b/addons/web_tour/static/src/js/tour_manager.js @@ -189,7 +189,7 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, { // redirect to its starting point (or /web by default) window.location.href = window.location.origin + (tour.url || '/web'); }, - run: function (tour_name, step_delay) { + run: async function (tour_name, step_delay) { console.log(_.str.sprintf("Preparing tour %s", tour_name)); if (this.running_tour) { this._deactivate_tip(this.active_tooltips[this.running_tour]); @@ -534,7 +534,12 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, { tip.run.call(tip.widget, action_helper); } else if (tip.run !== undefined) { var m = tip.run.match(/^([a-zA-Z0-9_]+) *(?:\(? *(.+?) *\)?)?$/); - action_helper[m[1]](m[2]); + try { + action_helper[m[1]](m[2]); + } catch (e) { + console.error(`Tour ${tour_name} failed at step ${self._describeTip(tip)}: ${e.message}`); + throw e; + } } else if (tour.current_step === tour.steps.length - 1) { console.log('Tour %s: ignoring action (auto) of last step', tour_name); } else {