Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] web_tour: add a startTour helper on odoo #32441

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion addons/web_tour/static/src/js/tour_service.js
Expand Up @@ -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;
});
});
Expand Down
2 changes: 1 addition & 1 deletion odoo/tests/common.py
Expand Up @@ -936,7 +936,7 @@ def start_tour(self, url_path, tour_name, step_delay=None, **kwargs):
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)

Expand Down