Debian Codegraph @

addons/website_sale/static/tests/tours/website_sale_combo_configurator.js

raw symbols SCIP
1 import { registry } from '@web/core/registry';
2 import comboConfiguratorTourUtils from '@sale/js/tours/combo_configurator_tour_utils';
3 import productConfiguratorTourUtils from '@sale/js/tours/product_configurator_tour_utils';
4 import * as wsTourUtils from '@website_sale/js/tours/tour_utils';
5
6 registry
7 .category('web_tour.tours')
8 .add('website_sale_combo_configurator', {
9 url: '/shop?search=Combo product',
10 steps: () => [
11 ...wsTourUtils.addToCart({ productName: "Combo product", search: false , expectUnloadPage: true}),
12 // Assert that the combo configurator behaves as expected.
13 comboConfiguratorTourUtils.assertFooterButtonsDisabled(),
14 comboConfiguratorTourUtils.setQuantity(3),
15 comboConfiguratorTourUtils.selectComboItem("Product A1"),
16 ...productConfiguratorTourUtils.selectAndSetCustomAttribute(
17 "Product A1", "No variant attribute", "B", "Some custom value"
18 ),
19 ...productConfiguratorTourUtils.saveConfigurator(),
20 comboConfiguratorTourUtils.selectComboItem("Product B2"),
21 comboConfiguratorTourUtils.assertFooterButtonsEnabled(),
22 {
23 content: "Check that the tax disclaimer gets displayed",
24 trigger: '.js_main_product small:contains(Final price may vary based on selection)',
25 },
26 // Assert that the cart's content is correct.
27 {
28 content: "Proceed to checkout",
29 trigger: 'button:contains(Go to Checkout)',
30 run: 'click',
31 expectUnloadPage: true,
32 },
33 ...wsTourUtils.assertCartContains({ productName: "Combo product" }),
34 ...wsTourUtils.assertCartContains({ productName: "3 x Product A1" }),
35 ...wsTourUtils.assertCartContains({ productName: "3 x Product B2" }),
36 {
37 content: "Verify the first combo item's attributes",
38 trigger: 'div.o_cart_product:contains("No variant attribute: B: Some custom value")',
39 },
40 {
41 content: "Verify the combo product's quantity",
42 trigger: 'div[name="website_sale_cart_line_quantity"] input.quantity:value(3)',
43 },
44 {
45 content: "Verify the combo product's price (tax included)",
46 trigger: 'h6[name=website_sale_cart_line_price]:contains(106.95)',
47 },
48 {
49 content: "Verify the order's total price",
50 trigger: 'tr[name="o_order_total_untaxed"]:contains(93.00)',
51 },
52 // Assert that the combo quantity can be updated in the cart.
53 {
54 content: "Edit the combo quantity",
55 trigger: 'div[name="website_sale_cart_line_quantity"] input.quantity',
56 run: "edit 2 && click body",
57 },
58 ...wsTourUtils.assertCartContains({ productName: "2 x Product A1" }),
59 ...wsTourUtils.assertCartContains({ productName: "2 x Product B2" }),
60 {
61 content: "Verify the combo product's price",
62 trigger: 'h6[name=website_sale_cart_line_price]:contains(71.31)',
63 },
64 ],
65 });