| 1 | import { registry } from "@web/core/registry"; |
| 2 | import { redirect } from "@web/core/utils/urls"; |
| 3 | import * as tourUtils from "@website_sale/js/tours/tour_utils"; |
| 4 | |
| 5 | registry.category("web_tour.tours").add('shop_mail', { |
| 6 | url: '/shop?search=Acoustic Bloc Screens', |
| 7 | steps: () => [ |
| 8 | ...tourUtils.addToCart({productName: 'Acoustic Bloc Screens', search: false, expectUnloadPage: true}), |
| 9 | tourUtils.goToCart(), |
| 10 | { |
| 11 | content: "check product is in cart, get cart id, go to backend", |
| 12 | trigger: 'div:has(a>h6:contains("Acoustic Bloc Screens"))', |
| 13 | run: function () { |
| 14 | const orderId = document.querySelector(".my_cart_quantity").dataset["orderId"]; |
| 15 | redirect("/odoo/action-sale.action_orders/" + orderId); |
| 16 | }, |
| 17 | expectUnloadPage: true, |
| 18 | }, |
| 19 | { |
| 20 | content: "click confirm", |
| 21 | trigger: '.btn[name="action_confirm"]', |
| 22 | run: "click", |
| 23 | }, |
| 24 | { |
| 25 | trigger: '.o_statusbar_status .o_arrow_button_current:contains("Sales Order")', |
| 26 | }, |
| 27 | { |
| 28 | content: "click send by email", |
| 29 | trigger: '.btn[name="action_quotation_send"]', |
| 30 | run: "click", |
| 31 | }, |
| 32 | { |
| 33 | isActive: ["body:not(:has(.modal-footer button[name='action_send_mail']))"], |
| 34 | trigger: ".modal-footer button[name='document_layout_save']", |
| 35 | content: "let's continue", |
| 36 | tooltipPosition: "bottom", |
| 37 | run: "click", |
| 38 | }, |
| 39 | { |
| 40 | content: "Open recipients dropdown", |
| 41 | trigger: ".modal .o_field_many2many_tags_email[name=partner_ids] input", |
| 42 | run: 'edit Interior24', |
| 43 | }, |
| 44 | { |
| 45 | content: "Select azure interior", |
| 46 | trigger: ".modal .ui-menu-item a:contains(Interior24)", |
| 47 | run: "click", |
| 48 | }, |
| 49 | { |
| 50 | trigger: '.modal .o_badge_text:contains("Azure")', |
| 51 | }, |
| 52 | { |
| 53 | content: "click Send email", |
| 54 | trigger: '.modal .btn.o_mail_send', |
| 55 | run: "click", |
| 56 | }, |
| 57 | { |
| 58 | trigger: "body:not(:has(.modal))", |
| 59 | }, |
| 60 | { |
| 61 | content: "wait mail to be sent, and go see it", |
| 62 | trigger: '.o-mail-Message-body:contains("Your"):contains("order")', |
| 63 | }, |
| 64 | ]}); |