| 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('shop_sale_gift_card', { |
| 5 |
url: '/shop', |
| 6 |
steps: () => [ |
| 7 |
|
| 8 |
...tourUtils.addToCart({ productName: "TEST - Small Drawer", expectUnloadPage: true }), |
| 9 |
tourUtils.goToCart(), |
| 10 |
{ |
| 11 |
content: 'insert gift card code', |
| 12 |
trigger: 'form[name="coupon_code"] input[name="promo"]', |
| 13 |
run: "edit GIFT_CARD", |
| 14 |
}, |
| 15 |
{ |
| 16 |
content: 'validate the gift card', |
| 17 |
trigger: 'form[name="coupon_code"] button[type="submit"]', |
| 18 |
run: "click", |
| 19 |
expectUnloadPage: true, |
| 20 |
}, |
| 21 |
{ |
| 22 |
content: 'check gift card line', |
| 23 |
trigger: "#cart_products div>h6:contains(PAY WITH GIFT CARD)", |
| 24 |
}, |
| 25 |
{ |
| 26 |
content: "Insert promo", |
| 27 |
trigger: 'form[name="coupon_code"] input[name="promo"]', |
| 28 |
run: "edit 10PERCENT", |
| 29 |
}, |
| 30 |
{ |
| 31 |
content: "Validate the promo", |
| 32 |
trigger: 'form[name="coupon_code"] button[type="submit"]', |
| 33 |
run: "click", |
| 34 |
expectUnloadPage: true, |
| 35 |
}, |
| 36 |
{ |
| 37 |
content: "Check promo", |
| 38 |
trigger: "#cart_products div>h6:contains(10% on your order)", |
| 39 |
}, |
| 40 |
{ |
| 41 |
content: "Click on Continue Shopping", |
| 42 |
trigger: "div.card-body a:contains(Continue shopping)", |
| 43 |
run: "click", |
| 44 |
expectUnloadPage: true, |
| 45 |
}, |
| 46 |
...tourUtils.addToCart({ productName: "TEST - Gift Card", expectUnloadPage: true }), |
| 47 |
tourUtils.goToCart({quantity: 2}), |
| 48 |
], |
| 49 |
}); |