[FIX] mail, test_mail: make mail_tour work

This tour was broken since the following refactoring:
https://github.com/odoo/odoo/commit/cd34f6de727d5b3858420cff3c9d3c5995c4e75c

With this commit, mail_tour should work correctly, and
is automatically run on runbot.

Note that the tour is automatically run in the module `test_mail`,
so that the tips are not displayed by installing Discuss.

Task-ID 1912730

closes odoo/odoo#29040
This commit is contained in:
Alexandre Kühn
2018-11-26 16:26:34 +00:00
parent 00bf6709a8
commit 9df8e88046
2 changed files with 45 additions and 3 deletions
+35 -3
View File
@@ -6,21 +6,53 @@ var tour = require('web_tour.tour');
var _t = core._t;
tour.register('mail_tour', [{
tour.register('mail_tour', {
url: "/web",
}, [tour.STEPS.SHOW_APPS_MENU_ITEM, {
trigger: '.o_app[data-menu-xmlid="mail.menu_root_discuss"]',
content: _t('Want to <b>get in touch</b> with your contacts? <i>Discuss with them here.</i>'),
position: 'right',
edition: 'community',
}, {
trigger: '.o_app[data-menu-xmlid="mail.menu_root_discuss"]',
content: _t('Want to <b>get in touch</b> with your contacts? <i>Discuss with them here.</i>'),
position: 'bottom',
edition: 'enterprise',
}, {
trigger: '.o_mail_discuss .o_mail_discuss_sidebar .o_add[data-type="public"]',
content: _t("<p>Channels make it easy to organize information across different topics and groups.</p> <p>Try to <b>create your first channel</b> (e.g. sales, marketing, product XYZ, after work party, etc).</p>"),
position: 'bottom',
}, {
trigger: '.o_mail_discuss .o_mail_discuss_sidebar .o_mail_add_thread[data-type="public"]',
content: _t("<p>Create a channel here.</p>"),
position: 'right',
run: function (actions) {
var t = new Date().getTime();
actions.text("SomeChannel_" + t, this.$anchor.find("input"));
},
}, {
trigger: ".ui-menu-item > a",
auto: true,
in_modal: false,
}, {
trigger: '.o_mail_discuss .o_composer_text_field',
content: _t("<p><b>Write a message</b> to the members of the channel here.</p> <p>You can notify someone with <i>'@'</i> or link another channel with <i>'#'</i>. Start your message with <i>'/'</i> to get the list of possible commands.</p>"),
position: "top",
width: 350,
run: function (actions) {
var t = new Date().getTime();
actions.text("SomeText_" + t, this.$anchor);
},
}, {
trigger: ".o_mail_discuss .o_mail_thread .o_thread_message_star",
trigger: '.o_mail_discuss .o_thread_composer .o_composer_button_send',
content: _t("Post your message on the thread"),
position: "top",
}, {
trigger: '.o_mail_discuss .o_mail_thread .o_thread_message_star',
content: _t("Messages can be <b>starred</b> to remind you to check back later."),
position: "right",
}, {
trigger: '.o_mail_discuss .o_mail_item_item[data-thread-id="mailbox_starred"]',
trigger: '.o_mail_discuss .o_mail_discuss_item[data-thread-id="mailbox_starred"]',
content: _t("Once a message has been starred, you can come back and review it at any time here."),
position: "bottom",
}, {
+10
View File
@@ -0,0 +1,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.tests
@odoo.tests.tagged('post_install', '-at_install')
class TestUi(odoo.tests.HttpCase):
def test_01_project_tour(self):
self.phantom_js("/web", "odoo.__DEBUG__.services['web_tour.tour'].run('mail_tour')", "odoo.__DEBUG__.services['web_tour.tour'].tours.mail_tour.ready", login="admin")