| 1 | import { registry } from "@web/core/registry"; |
| 2 | import * as tourUtils from "@website_sale/js/tours/tour_utils"; |
| 3 | |
| 4 | registry.category("web_tour.tours").add('update_billing_shipping_address', { |
| 5 | url: '/shop', |
| 6 | steps: () => [ |
| 7 | ...tourUtils.addToCart({ productName: "Office Chair Black TEST", expectUnloadPage: true }), |
| 8 | tourUtils.goToCart({quantity: 1}), |
| 9 | tourUtils.goToCheckout(), |
| 10 | tourUtils.confirmOrder(), |
| 11 | { |
| 12 | content: "Edit Address", |
| 13 | trigger: '#delivery_and_billing a:contains("Edit")', |
| 14 | run: "click", |
| 15 | expectUnloadPage: true, |
| 16 | }, |
| 17 | { |
| 18 | content: "Edit billing address which is shipping address too", |
| 19 | trigger: 'a.js_edit_address', |
| 20 | run: "click", |
| 21 | expectUnloadPage: true, |
| 22 | }, |
| 23 | { |
| 24 | content: "Empty the phone field", |
| 25 | trigger: 'input[name="phone"]', |
| 26 | run: "clear", |
| 27 | }, |
| 28 | { |
| 29 | content: "Save address", |
| 30 | trigger: "a[name='website_sale_main_button']", |
| 31 | run: "click", |
| 32 | }, |
| 33 | { |
| 34 | content: "Check there is a warning for required field.", |
| 35 | trigger: ':invalid', |
| 36 | }, |
| 37 | ], |
| 38 | }); |