mirror of
https://github.com/bringout/oca-ocb-mail.git
synced 2026-04-21 03:21:59 +02:00
19.0 vanilla
This commit is contained in:
parent
5df8c07b59
commit
daa394e8b0
2114 changed files with 564841 additions and 299642 deletions
|
|
@ -0,0 +1,65 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category('web_tour.tours').add('mailing_campaign', {
|
||||
url: '/odoo',
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: 'Select the "Email Marketing" app',
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: 'Select "Campaings" Navbar item',
|
||||
trigger: '.o_nav_entry[data-menu-xmlid="mass_mailing.menu_email_campaigns"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: 'Select "Newsletter" campaign',
|
||||
trigger: '.o_kanban_record:contains("Newsletter")',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: 'Add a line (create new mailing)',
|
||||
trigger: '.o_field_x2many_list_row_add a',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: 'Pick the basic theme',
|
||||
trigger: ".o_mailing_template_preview_wrapper [data-name='basic']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ":iframe .o_mass_mailing_value .o_layout",
|
||||
},
|
||||
{
|
||||
content: 'Fill in Subject',
|
||||
trigger: '#subject_0',
|
||||
run: "edit TestFromTour",
|
||||
},
|
||||
{
|
||||
content: 'Fill in Mailing list',
|
||||
trigger: '#contact_list_ids_0',
|
||||
run: "edit Newsletter",
|
||||
},
|
||||
{
|
||||
content: 'Pick "Newsletter" option',
|
||||
trigger: '.o_input_dropdown a:contains(Newsletter)',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: 'Save form',
|
||||
trigger: ".modal .o_form_button_save:contains(Save & Close)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "body:not(:has(.modal))",
|
||||
},
|
||||
{
|
||||
content: 'Check that newly created record is on the list',
|
||||
trigger: '[name="mailing_mail_ids"] td[name="subject"]:contains("TestFromTour")',
|
||||
},
|
||||
...stepUtils.saveForm(),
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add('mailing_editor', {
|
||||
url: '/odoo',
|
||||
steps: () => [stepUtils.showAppsMenuItem(), {
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'button.o_list_button_add',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'div[name="contact_list_ids"] .o_input_dropdown input[type="text"]',
|
||||
run: "edit Test",
|
||||
}, {
|
||||
trigger: 'div[name="contact_list_ids"] .ui-state-active',
|
||||
run: "click",
|
||||
}, {
|
||||
content: 'choose the theme "empty" to edit the mailing with snippets',
|
||||
trigger: '[name="body_arch"] .o_mailing_template_preview_wrapper [data-name="empty"]',
|
||||
run: "click",
|
||||
}, {
|
||||
content: 'wait for the editor to be rendered',
|
||||
trigger: '[name="body_arch"] :iframe .o_editable[data-editor-message="DRAG BUILDING BLOCKS HERE"]',
|
||||
}, {
|
||||
trigger: '.o_snippet[name="Text"] button',
|
||||
content: 'Click the "Text" snippet category to drop a snippet in the editor',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: ":iframe .o_snippet_preview_wrap:has(.s_title)",
|
||||
content: "Select the Title Snippet",
|
||||
run: "click",
|
||||
}, {
|
||||
content: 'wait for the snippet menu to finish the drop process',
|
||||
trigger: 'body:not(:has(.o_we_ongoing_insertion))',
|
||||
}, {
|
||||
content: 'verify that the title was inserted properly in the editor',
|
||||
trigger: '[name="body_arch"] :iframe .o_editable h1',
|
||||
}, {
|
||||
trigger: 'button.o_form_button_save',
|
||||
run: "click",
|
||||
}, {
|
||||
content: 'verify that the save failed (since the field "subject" was not set and it is required)',
|
||||
trigger: 'label.o_field_invalid',
|
||||
}, {
|
||||
content: 'verify that the edited mailing body was not lost during the failed save',
|
||||
trigger: '[name="body_arch"] :iframe .o_editable h1',
|
||||
}, {
|
||||
trigger: 'input#subject_0',
|
||||
run: "edit TestFromTour",
|
||||
}, {
|
||||
trigger: '.o_form_view', // blur previous input
|
||||
run: "click",
|
||||
},
|
||||
...stepUtils.saveForm(),
|
||||
{
|
||||
trigger: ':iframe .o_editable',
|
||||
}]});
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
import { boundariesIn } from "@html_editor/utils/position";
|
||||
import { setSelection } from "@html_editor/../tests/tours/helpers/editor";
|
||||
|
||||
registry.category("web_tour.tours").add('mailing_editor_theme', {
|
||||
url: '/odoo',
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: "Select the 'Email Marketing' app.",
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the create button to create a new mailing.",
|
||||
trigger: 'button.o_list_button_add',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Fill in Subject",
|
||||
trigger: '#subject_0',
|
||||
run: "edit Test Basic Theme",
|
||||
},
|
||||
{
|
||||
content: "Fill in Mailing list",
|
||||
trigger: '#contact_list_ids_0',
|
||||
run: "edit Newsletter",
|
||||
},
|
||||
{
|
||||
content: "Pick 'Newsletter' option",
|
||||
trigger: '.o_input_dropdown a:contains(Newsletter)',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".o_mailing_template_preview_wrapper",
|
||||
},
|
||||
{
|
||||
content: "Pick the basic theme",
|
||||
trigger: '.o_mailing_template_preview_wrapper [data-name="basic"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "html:not(:has(.o_mailing_template_preview_wrapper))",
|
||||
},
|
||||
{
|
||||
content: "Make sure the snippets menu is hidden",
|
||||
trigger: "html:not(:has(.o-snippets-menu))",
|
||||
},
|
||||
...stepUtils.saveForm(),
|
||||
{
|
||||
content: "Click on the New button to create another mailing",
|
||||
trigger: 'button.o_form_button_create',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".o_mailing_template_preview_wrapper",
|
||||
},
|
||||
{
|
||||
content: "Fill in Subject",
|
||||
trigger: '#subject_0',
|
||||
run: "edit Test Newsletter Theme",
|
||||
},
|
||||
{
|
||||
content: "Fill in Mailing list",
|
||||
trigger: '#contact_list_ids_0',
|
||||
run: "edit Newsletter",
|
||||
},
|
||||
{
|
||||
content: "Pick 'Newsletter' option",
|
||||
trigger: '.o_input_dropdown a:contains(Newsletter)',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Pick the newsletter theme",
|
||||
trigger: '.o_mailing_template_preview_wrapper [data-name="newsletter"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Make sure the snippets menu is displayed",
|
||||
trigger: ".o-snippets-menu",
|
||||
},
|
||||
...stepUtils.discardForm(),
|
||||
{
|
||||
content: 'Go back to previous mailing',
|
||||
trigger: 'td[name="subject"]:contains(Test Basic Theme)',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Make sure the snippets menu is hidden",
|
||||
trigger: "html:not(:has(.o-snippets-menu))",
|
||||
},
|
||||
{
|
||||
content: "Add some content to be selected afterwards",
|
||||
trigger: ':iframe p',
|
||||
run: "editor content",
|
||||
},
|
||||
{
|
||||
content: "Select text",
|
||||
trigger: ':iframe p:contains(content)',
|
||||
run() {
|
||||
const [anchorNode, anchorOffset, focusNode, focusOffset] = boundariesIn(
|
||||
this.anchor
|
||||
);
|
||||
setSelection({ anchorNode, anchorOffset, focusNode, focusOffset });
|
||||
}
|
||||
},
|
||||
{
|
||||
content: "Make sure the floating toolbar is visible",
|
||||
trigger: '.overlay:has(.o-we-toolbar)[style*="visible"]',
|
||||
},
|
||||
{
|
||||
content: "Expand Toolbar",
|
||||
trigger: ".o-we-toolbar button[name='expand_toolbar']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Open the color picker",
|
||||
trigger: ".o-select-color-foreground",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Open Solid tab",
|
||||
trigger: ".btn-tab.solid-tab",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Pick a color",
|
||||
trigger: '.o_font_color_selector button[data-color="o-color-1"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Check that color was applied",
|
||||
trigger: ':iframe p font.text-o-color-1',
|
||||
},
|
||||
...stepUtils.saveForm(),
|
||||
{
|
||||
content: "Go to 'Mailings' list view",
|
||||
trigger: '.breadcrumb a:contains(Mailings)',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Open newly created mailing",
|
||||
trigger: 'td:contains("Test Basic Theme")',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Make sure the snippets menu is hidden",
|
||||
trigger: "html:not(:has(.o-snippets-menu))",
|
||||
},
|
||||
{
|
||||
content: "Select content",
|
||||
trigger: ':iframe p:contains(content)',
|
||||
run() {
|
||||
const [anchorNode, anchorOffset, focusNode, focusOffset] = boundariesIn(
|
||||
this.anchor
|
||||
);
|
||||
setSelection({ anchorNode, anchorOffset, focusNode, focusOffset });
|
||||
}
|
||||
},
|
||||
{
|
||||
content: "Make sure the floating toolbar is visible",
|
||||
trigger: '.overlay:has(.o-we-toolbar)[style*="visible"]',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
|
||||
/*
|
||||
* Tour: unsubscribe from a mailing done on documents (aka not on contacts or
|
||||
* mailing lists). We assume email is not member of any mailing list in this test.
|
||||
*/
|
||||
registry.category("web_tour.tours").add('mailing_portal_unsubscribe_from_document', {
|
||||
steps: () => [
|
||||
{
|
||||
content: "Confirmation unsubscribe is done",
|
||||
trigger: "div#o_mailing_subscription_info span:contains('You are no longer part of our services and will not be contacted again.')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "No warning should be displayed",
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted:not(:has(p:contains('You will not receive any news from those mailing lists you are a member of')))",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Warning will not receive anything anymore",
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted p:contains('You will not hear from us anymore.')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Feedback textarea not displayed (see data)",
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Choose 'Other' reason",
|
||||
trigger: "fieldset label:contains('Other')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "This should display the Feedback area",
|
||||
trigger: "div#o_mailing_portal_subscription textarea",
|
||||
}, {
|
||||
content: "Write feedback reason",
|
||||
trigger: "textarea[name='feedback']",
|
||||
run: "edit My feedback",
|
||||
}, {
|
||||
content: "Hit Send",
|
||||
trigger: "button#button_feedback",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Confirmation feedback is sent",
|
||||
trigger: "div#o_mailing_subscription_feedback_info span:contains('Sent. Thanks you for your feedback!')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Revert exclusion list",
|
||||
trigger: "div#button_blocklist_remove",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Confirmation exclusion list is removed",
|
||||
trigger: "div#o_mailing_subscription_update_info span:contains('Email removed from our blocklist')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Now exclude me (again)",
|
||||
trigger: "div#button_blocklist_add",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Confirmation exclusion is done",
|
||||
trigger: "div#o_mailing_subscription_update_info span:contains('Email added to our blocklist')",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
* Tour: unsubscribe from a mailing done on documents (aka not on contacts or
|
||||
* mailing lists). We assume email is member of mailing lists in this test.
|
||||
*/
|
||||
registry.category("web_tour.tours").add('mailing_portal_unsubscribe_from_document_with_lists', {
|
||||
steps: () => [
|
||||
{
|
||||
content: "Confirmation unsubscribe is done",
|
||||
trigger: "div#o_mailing_subscription_info span:contains('You are no longer part of our services and will not be contacted again.')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Display warning about mailing lists",
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted p:contains('You will not receive any news from those mailing lists you are a member of')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Warning should contain reference to memberships",
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted li strong:contains('List1')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Feedback textarea not displayed (see data)",
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Choose 'Other' reason",
|
||||
trigger: "fieldset label:contains('Other')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "This should display the Feedback area",
|
||||
trigger: "div#o_mailing_portal_subscription textarea",
|
||||
}, {
|
||||
content: "Write feedback reason",
|
||||
trigger: "textarea[name='feedback']",
|
||||
run: "edit My feedback",
|
||||
}, {
|
||||
content: "Hit Send",
|
||||
trigger: "button#button_feedback",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Confirmation feedback is sent",
|
||||
trigger: "div#o_mailing_subscription_feedback_info span:contains('Sent. Thanks you for your feedback!')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Revert exclusion list",
|
||||
trigger: "div#button_blocklist_remove",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Confirmation exclusion list is removed",
|
||||
trigger: "div#o_mailing_subscription_update_info span:contains('Email removed from our blocklist')",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Now exclude me (again)",
|
||||
trigger: "div#button_blocklist_add",
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Confirmation exclusion is done",
|
||||
trigger: "div#o_mailing_subscription_update_info span:contains('Email added to our blocklist')",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
|
||||
/*
|
||||
* Tour: unsubscribe from a mailing done on lists (aka playing with opt-out flag
|
||||
* instead of directly blocking emails).
|
||||
*/
|
||||
registry.category("web_tour.tours").add("mailing_portal_unsubscribe_from_list", {
|
||||
steps: () => [
|
||||
{
|
||||
content: "Confirmation unsubscribe is done",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_info span:contains('You are no longer part of the List1, List2 mailing list')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Feedback textarea not displayed (see data)",
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Choose 'Other' reason",
|
||||
trigger: "fieldset label:contains('Other')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Write feedback reason",
|
||||
trigger: "textarea[name='feedback']",
|
||||
run: "edit My feedback",
|
||||
},
|
||||
{
|
||||
content: "Hit Send",
|
||||
trigger: "button#button_feedback",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation feedback is sent",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_feedback_info span:contains('Sent. Thanks you for your feedback!')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Now exclude me",
|
||||
trigger: "div#button_blocklist_add",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation exclusion is done",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_update_info span:contains('Email added to our blocklist')",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
/*
|
||||
* Tour: unsubscribe from a mailing done on lists (aka playing with opt-out flag
|
||||
* instead of directly blocking emails), then play with list subscriptions and
|
||||
* blocklist addition / removal. This is mainly an extended version of the tour
|
||||
* hereabove, easing debug and splitting checks.
|
||||
*/
|
||||
registry.category("web_tour.tours").add("mailing_portal_unsubscribe_from_list_with_update", {
|
||||
steps: () => [
|
||||
{
|
||||
content: "Confirmation unsubscribe is done",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_info span:contains('You are no longer part of the List1, List2 mailing list')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List1 is present, just opt-outed",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists li.list-group-item:contains('List1') span:contains('Not subscribed')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List3 is present, opt-outed (test starting data)",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists li.list-group-item:contains('List3') span:contains('Not subscribed')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List2 is proposed (not member -> proposal to join)",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists_additional li.list-group-item:contains('List2')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List4 is not proposed (not member but not private)",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists_additional:not(:has(li.list-group-item:contains('List4')))",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Feedback textarea not displayed (see data)",
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Choose 'Other' reason",
|
||||
trigger: "fieldset label:contains('Other')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Write feedback reason",
|
||||
trigger: "textarea[name='feedback']",
|
||||
run: "edit My feedback",
|
||||
},
|
||||
{
|
||||
content: "Hit Send",
|
||||
trigger: "button#button_feedback",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation feedback is sent",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_feedback_info span:contains('Sent. Thanks you for your feedback!')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Now exclude me",
|
||||
trigger: "div#button_blocklist_add",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation exclusion is done",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_update_info span:contains('Email added to our blocklist')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "This should disable the 'Update my subscriptions' (Apply changes) button",
|
||||
trigger: "div#o_mailing_subscription_blocklist:not(button#button_form_send)",
|
||||
},
|
||||
{
|
||||
content: "Revert exclusion list",
|
||||
trigger: "div#button_blocklist_remove",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation exclusion list is removed",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_update_info span:contains('Email removed from our blocklist')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "'Update my subscriptions' button usable again",
|
||||
trigger: "button#button_form_send:not([disabled])",
|
||||
},
|
||||
{
|
||||
content: "Choose the mailing list 3 to come back",
|
||||
trigger: "ul#o_mailing_subscription_form_lists input[title='List3']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Add list 2",
|
||||
trigger: "ul#o_mailing_subscription_form_lists_additional input[title='List2']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Update subscription",
|
||||
trigger: "button#button_form_send",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation changes are done",
|
||||
trigger: "div#o_mailing_subscription_update_info span:contains('Membership updated')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List 3 is noted as subscribed again",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists li.list-group-item:contains('List3') span:contains('Subscribed')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List 2 has joined the subscriptions",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists li.list-group-item:contains('List2') span:contains('Subscribed')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "No list in proposals",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_form_manage:not(:has(ul#o_mailing_subscription_form_lists_additional))",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "div#o_mailing_portal_subscription:not(fieldset)",
|
||||
},
|
||||
{
|
||||
content:
|
||||
"Feedback area is not displayed (nothing opt-out or no blocklist done, no feedback required)",
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Now exclude me (again)",
|
||||
trigger: "div#button_blocklist_add",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation exclusion is done",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_update_info span:contains('Email added to our blocklist')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Should display warning about mailing lists",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_form_blocklisted p:contains('You will not receive any news from those mailing lists you are a member of')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted li strong:contains('List3')",
|
||||
},
|
||||
{
|
||||
content: "Warning should contain reference to memberships",
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted li strong:contains('List2')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Give a reason for blocklist (first one)",
|
||||
trigger: "fieldset input.o_mailing_subscription_opt_out_reason:first",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Hit Send",
|
||||
trigger: "button#button_feedback",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation feedback is sent",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_feedback_info span:contains('Sent. Thanks you for your feedback!')",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,170 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
|
||||
/*
|
||||
* Tour: use 'my' portal page of mailing to manage mailing lists subscription
|
||||
* as well as manage blocklist (add / remove my own email from block list).
|
||||
*/
|
||||
registry.category("web_tour.tours").add("mailing_portal_unsubscribe_from_my", {
|
||||
steps: () => [
|
||||
{
|
||||
content: "List1 is present, opt-in member",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists li.list-group-item:contains('List1') span:contains('Subscribed')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List3 is present, opt-outed (test starting data)",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists li.list-group-item:contains('List3') span:contains('Not subscribed')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List2 is proposed (not member -> proposal to join)",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists_additional li.list-group-item:contains('List2')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List4 is not proposed (not member but not private)",
|
||||
trigger:
|
||||
"ul#o_mailing_subscription_form_lists_additional:not(:has(li.list-group-item:contains('List4')))",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List5 is not proposed (not member and not public)",
|
||||
trigger: "body:not(:has(li.list-group-item:contains('List5')))",
|
||||
},
|
||||
{
|
||||
trigger: "div#o_mailing_portal_subscription:not(fieldset)",
|
||||
},
|
||||
{
|
||||
content: "Feedback area is not displayed (nothing done, no feedback required)",
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List3: come back (choose to opt-in instead of opt-out)",
|
||||
trigger: "ul#o_mailing_subscription_form_lists input[title='List3']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List2: join (opt-in, not already member)",
|
||||
trigger: "ul#o_mailing_subscription_form_lists_additional input[title='List2']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "List1: opt-out",
|
||||
trigger: "ul#o_mailing_subscription_form_lists input[title='List1']",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Update subscription",
|
||||
trigger: "button#button_form_send",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation changes are done",
|
||||
trigger: "div#o_mailing_subscription_update_info span:contains('Membership updated')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
},
|
||||
{
|
||||
content:
|
||||
"Should make feedback reasons choice appear (feedback still not displayed, linked to reasons)",
|
||||
trigger: "div#o_mailing_portal_subscription fieldset",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Choose first reason, which should not display feedback (see data)",
|
||||
trigger: "fieldset input.o_mailing_subscription_opt_out_reason:first",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Feedback textarea not displayed (see data)",
|
||||
trigger: "div#o_mailing_portal_subscription:not(textarea)",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Choose 'Other' reason",
|
||||
trigger: "fieldset label:contains('Other')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "This should display the Feedback area",
|
||||
trigger: "div#o_mailing_portal_subscription textarea",
|
||||
},
|
||||
{
|
||||
content: "Write feedback reason",
|
||||
trigger: "textarea[name='feedback']",
|
||||
run: "edit My feedback",
|
||||
},
|
||||
{
|
||||
content: "Hit Send",
|
||||
trigger: "button#button_feedback",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation feedback is sent",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_feedback_info span:contains('Sent. Thanks you for your feedback!')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "textarea[disabled]",
|
||||
},
|
||||
{
|
||||
content: "Once sent feedback area is readonly",
|
||||
trigger: "fieldset input.o_mailing_subscription_opt_out_reason[disabled]",
|
||||
},
|
||||
{
|
||||
content: "Now exclude me",
|
||||
trigger: "div#button_blocklist_add",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation exclusion is done",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_update_info span:contains('Email added to our blocklist')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "This should disable the 'Update my subscriptions' (Apply changes) button",
|
||||
trigger: "div#o_mailing_subscription_blocklist:not(button#button_form_send)",
|
||||
},
|
||||
{
|
||||
content: "This should enabled Feedback again",
|
||||
trigger: "div#o_mailing_portal_subscription textarea",
|
||||
},
|
||||
{
|
||||
content: "Display warning about mailing lists",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_form_blocklisted p:contains('You will not receive any news from those mailing lists you are a member of')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted li strong:contains('List3')",
|
||||
},
|
||||
{
|
||||
content: "Warning should contain reference to memberships",
|
||||
trigger: "div#o_mailing_subscription_form_blocklisted li strong:contains('List2')",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Give a reason for blocklist (first one)",
|
||||
trigger: "fieldset input.o_mailing_subscription_opt_out_reason:first",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Hit Send",
|
||||
trigger: "button#button_feedback",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Confirmation feedback is sent",
|
||||
trigger:
|
||||
"div#o_mailing_subscription_feedback_info span:contains('Sent. Thanks you for your feedback!')",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
import { markup } from "@odoo/owl";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add('mass_mailing_code_view_tour', {
|
||||
url: '/odoo?debug=tests',
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'button.o_list_button_add',
|
||||
run: "click",
|
||||
}, {
|
||||
trigger: 'input#subject_0',
|
||||
content: markup('Pick the <b>email subject</b>.'),
|
||||
tooltipPosition: 'bottom',
|
||||
run: "edit Test",
|
||||
}, {
|
||||
trigger: 'div[name="contact_list_ids"] .o_input_dropdown input[type="text"]',
|
||||
content: 'Click on the dropdown to open it and then start typing to search.',
|
||||
run: "edit Test"
|
||||
}, {
|
||||
trigger: 'div[name="contact_list_ids"] .ui-state-active',
|
||||
content: 'Select item from dropdown',
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: 'div[name="body_arch"] .o_mailing_template_preview_wrapper [data-name="default"]',
|
||||
content: markup('Choose this <b>theme</b>.'),
|
||||
run: 'click',
|
||||
}, {
|
||||
trigger: '.o_codeview_btn',
|
||||
content: markup('Click here to switch to <b>code view</b>'),
|
||||
run: 'click'
|
||||
}, {
|
||||
trigger: "textarea.o_codeview",
|
||||
content: "Remove all content from codeview",
|
||||
run: function () {
|
||||
const element = document.querySelector(".o_codeview");
|
||||
element.value = "";
|
||||
},
|
||||
}, {
|
||||
trigger: '.o_codeview_btn',
|
||||
content: markup('Click here to switch back from <b>code view</b>'),
|
||||
run: 'click'
|
||||
}, {
|
||||
trigger: '[name="body_arch"] :iframe .o_mail_wrapper_td',
|
||||
content: 'Verify that the dropable zone was not removed',
|
||||
}, {
|
||||
trigger: ".o_builder_sidebar_open",
|
||||
content: "Wait for the html_builder to be visible",
|
||||
}, {
|
||||
trigger: '.o_snippet[name="Text"] button',
|
||||
content: 'Click the "Text" snippet category to drop a snippet in the editor',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: ".modal-body :iframe .o_snippet_preview_wrap:has(.s_title)",
|
||||
content: "Select the Title Snippet",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: '[name="body_arch"] :iframe .o_editable h1',
|
||||
content: 'Verify that the title was inserted properly in the editor',
|
||||
},
|
||||
...stepUtils.discardForm(),
|
||||
]
|
||||
});
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add('mass_mailing_dynamic_placeholder_tour', {
|
||||
url: '/odoo',
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(),
|
||||
{
|
||||
content: "Select the 'Email Marketing' app.",
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the create button to create a new mailing.",
|
||||
trigger: 'button.o_list_button_add',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Fill in Subject",
|
||||
trigger: '#subject_0',
|
||||
run: "edit Test Dynamic Placeholder",
|
||||
},
|
||||
{
|
||||
trigger: ".o_mailing_template_preview_wrapper",
|
||||
},
|
||||
{
|
||||
content: "Pick the basic theme",
|
||||
trigger: '.o_mailing_template_preview_wrapper [data-name="basic"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Insert text inside editable",
|
||||
trigger: ':iframe .odoo-editor-editable',
|
||||
async run(actions) {
|
||||
await actions.editor(`/`);
|
||||
const iframe = document.querySelector("iframe");
|
||||
iframe?.contentDocument?.querySelector(".note-editable").dispatchEvent(
|
||||
new InputEvent("input", {
|
||||
inputType: "insertText",
|
||||
data: "/",
|
||||
})
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
content: "Click on the the dynamic placeholder powerBox options",
|
||||
trigger: '.o-we-command-name:contains("Dynamic Placeholder")',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Check if the dynamic placeholder popover is opened",
|
||||
trigger: "div.o_model_field_selector_popover",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "filter the dph result",
|
||||
trigger: "div.o_model_field_selector_popover_search input[type='text']",
|
||||
run: "edit name",
|
||||
},
|
||||
{
|
||||
content: "Click on the first entry of the dynamic placeholder",
|
||||
trigger: 'div.o_model_field_selector_popover button:contains("Company Name")',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Enter a default value",
|
||||
trigger:
|
||||
'div.o_model_field_selector_popover .o_model_field_selector_default_value_input input[type="text"]',
|
||||
run: "edit defValue",
|
||||
},
|
||||
{
|
||||
content: "Click on the insert button",
|
||||
trigger: "div.o_model_field_selector_popover button:first-child",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Ensure the editable contain the dynamic placeholder t tag",
|
||||
trigger: `:iframe .note-editable.odoo-editor-editable t[t-out="object.company_name"]:contains("defValue")`,
|
||||
},
|
||||
{
|
||||
content: "Discard form changes",
|
||||
trigger: "button.o_form_button_cancel",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Wait for the form view to disappear",
|
||||
trigger: "body:not(:has(.o_form_sheet))",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add('snippets_mailing_menu_tabs', {
|
||||
url: '/odoo',
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(), {
|
||||
content: "Select the 'Email Marketing' app.",
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the create button to create a new mailing.",
|
||||
trigger: 'button.o_list_button_add',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the 'Start From Scratch' template.",
|
||||
trigger: '.o_mailing_template_preview_wrapper [data-name="empty"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the 'Design' tab.",
|
||||
trigger: 'button[data-name="theme"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Verify that the customize panel is not empty.",
|
||||
trigger: ".o_design_tab:not(:empty)",
|
||||
},
|
||||
{
|
||||
content: "Click on the style tab.",
|
||||
trigger: 'button[data-name="customize"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the 'Design' tab.",
|
||||
trigger: 'button[data-name="theme"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Verify that the customize panel is not empty.",
|
||||
trigger: ".tab-content .o_design_tab:not(:empty)",
|
||||
},
|
||||
...stepUtils.discardForm(),
|
||||
]});
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add('snippets_mailing_menu_toolbar', {
|
||||
url: '/odoo',
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(), {
|
||||
content: "Select the 'Email Marketing' app.",
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Click on the create button to create a new mailing.",
|
||||
trigger: 'button.o_list_button_add',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Wait for the theme selector to load.",
|
||||
trigger: '.o_mailing_template_preview_wrapper',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Make sure there does not exist a floating toolbar",
|
||||
trigger: "iframe:not(:visible)",
|
||||
run: function () {
|
||||
const iframeDocument = this.anchor.contentDocument;
|
||||
if (iframeDocument.querySelector('#toolbar.oe-floating')) {
|
||||
console.error('There should not be a floating toolbar in the iframe');
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
content: "Make sure the empty template is an option on non-mobile devices.",
|
||||
trigger: '.o_mailing_template_preview_wrapper [data-name="empty"]',
|
||||
},
|
||||
{
|
||||
content: "Click on the default 'welcome' template.",
|
||||
trigger: '.o_mailing_template_preview_wrapper [data-name="default"]',
|
||||
run: "click",
|
||||
},
|
||||
{ // necessary to wait for the cursor to be placed in the first p
|
||||
// and to avoid leaving the page before the selection is added
|
||||
content: "Wait for template selection event to be over.",
|
||||
trigger: ":iframe .odoo-editor-editable .o_editable",
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Make sure the snippets menu is not hidden",
|
||||
trigger: ".o-snippets-menu",
|
||||
},
|
||||
{
|
||||
content: "Wait for .s_text_block to be populated",
|
||||
trigger: ':iframe .s_text_block p',
|
||||
},
|
||||
{
|
||||
content: "Click and select p block inside the editor",
|
||||
trigger: 'iframe',
|
||||
run: function () {
|
||||
const iframeWindow = this.anchor.contentWindow;
|
||||
const iframeDocument = iframeWindow.document;
|
||||
const p = iframeDocument.querySelector('.s_text_block p');
|
||||
p.click();
|
||||
const selection = iframeWindow.getSelection();
|
||||
const range = iframeDocument.createRange();
|
||||
range.selectNodeContents(p);
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
},
|
||||
},
|
||||
{
|
||||
content: "Make sure the toolbar is there",
|
||||
trigger: ".overlay .o-we-toolbar",
|
||||
},
|
||||
...stepUtils.discardForm(),
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
import { stepUtils } from "@web_tour/tour_utils";
|
||||
|
||||
registry.category("web_tour.tours").add('snippets_mailing_menu_toolbar_mobile', {
|
||||
url: '/odoo',
|
||||
steps: () => [
|
||||
stepUtils.showAppsMenuItem(), {
|
||||
content: "Select the 'Email Marketing' app.",
|
||||
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
isActive: ["mobile"],
|
||||
content: "Click on the create button to create a new mailing.",
|
||||
trigger: 'button.o_list_button_add',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
isActive: ["mobile"],
|
||||
content: "Check templates available in theme selector",
|
||||
trigger: '.o_mailing_template_preview_wrapper',
|
||||
run: function () {
|
||||
if (this.anchor.querySelector("#empty")) {
|
||||
console.error('The empty template should not be visible on mobile.');
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
isActive: ["mobile"],
|
||||
content: "Make sure the toolbar isn't floating",
|
||||
trigger: ':iframe',
|
||||
run: function () {
|
||||
const iframeDocument = this.anchor.contentDocument;
|
||||
if (iframeDocument.querySelector('#toolbar.oe-floating')) {
|
||||
console.error('There should not be a floating toolbar in the iframe');
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
isActive: ["mobile"],
|
||||
content: "Click on the 'Start From Scratch' template.",
|
||||
trigger: '.o_mailing_template_preview_wrapper [data-name="default"]',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
isActive: ["mobile"],
|
||||
content: "Select an editable element",
|
||||
trigger: ':iframe .s_text_block',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
isActive: ["mobile"],
|
||||
content: "Make sure the snippets menu is hidden",
|
||||
trigger: ':iframe',
|
||||
run: function () {
|
||||
const iframeDocument = this.anchor.contentDocument;
|
||||
if (iframeDocument.querySelector(".o-snippets-menu")) {
|
||||
console.error('The snippet menu should be hidden');
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
isActive: ["mobile"],
|
||||
content: "Make sure the toolbar is there",
|
||||
trigger: ':iframe #toolbar.oe-floating',
|
||||
},
|
||||
...stepUtils.discardForm().map(command => ({...command, isActive: ["mobile"]})),
|
||||
]
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue