[IMP] web_tour: add a startTour helper on odoo
As a start_tour helper was added on the python side (PR #32316), a javascript helper counterpart was needed as suggested on the PR. closes odoo/odoo#32441 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
@@ -105,7 +105,8 @@ return session.is_bound.then(function () {
|
||||
observer.disconnect();
|
||||
};
|
||||
}
|
||||
|
||||
// helper to start a tour manually (or from a python test with its counterpart start_tour function)
|
||||
odoo.startTour = tour_manager.run.bind(tour_manager);
|
||||
return tour_manager;
|
||||
});
|
||||
});
|
||||
|
||||
@@ -936,7 +936,7 @@ class HttpCase(TransactionCase):
|
||||
optional delay between steps `step_delay`. Other arguments from
|
||||
`browser_js` can be passed as keyword arguments."""
|
||||
step_delay = ', %s' % step_delay if step_delay else ''
|
||||
code = kwargs.pop('code', "odoo.__DEBUG__.services['web_tour.tour'].run('%s'%s)" % (tour_name, step_delay))
|
||||
code = kwargs.pop('code', "odoo.startTour('%s'%s)" % (tour_name, step_delay))
|
||||
ready = kwargs.pop('ready', "odoo.__DEBUG__.services['web_tour.tour'].tours.%s.ready" % tour_name)
|
||||
return self.browser_js(url_path=url_path, code=code, ready=ready, **kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user