mirror of
https://github.com/bringout/oca-ocb-sale.git
synced 2026-04-28 09:12:07 +02:00
19.0 vanilla
This commit is contained in:
parent
79f83631d5
commit
73afc09215
6267 changed files with 1534193 additions and 1130106 deletions
|
|
@ -0,0 +1,41 @@
|
|||
import { registry } from '@web/core/registry';
|
||||
import configuratorTourUtils from '@sale/js/tours/combo_configurator_tour_utils';
|
||||
import * as wsTourUtils from '@website_sale/js/tours/tour_utils';
|
||||
import stockConfiguratorTourUtils from '@website_sale_stock/js/tours/combo_configurator_tour_utils';
|
||||
|
||||
registry
|
||||
.category('web_tour.tours')
|
||||
.add('website_sale_stock_combo_configurator', {
|
||||
url: '/shop?search=Combo product',
|
||||
steps: () => [
|
||||
...wsTourUtils.addToCart({ productName: "Combo product", search: false, expectUnloadPage: true }),
|
||||
configuratorTourUtils.assertQuantity(1),
|
||||
// Assert that it's impossible to add less than 1 product.
|
||||
configuratorTourUtils.setQuantity(0),
|
||||
configuratorTourUtils.assertQuantity(1),
|
||||
{
|
||||
content: "Verify that the quantity decrease button is disabled",
|
||||
trigger: `
|
||||
.sale-combo-configurator-dialog
|
||||
button[name=sale_quantity_button_minus]:disabled
|
||||
`,
|
||||
},
|
||||
// Assert that an error is shown if the requested quantity isn't available.
|
||||
configuratorTourUtils.setQuantity(3),
|
||||
stockConfiguratorTourUtils.assertQuantityNotAvailable("Test product"),
|
||||
// Assert that a warning is shown if all available quantity is selected.
|
||||
configuratorTourUtils.setQuantity(2),
|
||||
configuratorTourUtils.selectComboItem("Test product"),
|
||||
stockConfiguratorTourUtils.assertAllQuantitySelected("Test product"),
|
||||
// Assert that it's impossible to add more products than available.
|
||||
configuratorTourUtils.setQuantity(3),
|
||||
configuratorTourUtils.assertQuantity(2),
|
||||
{
|
||||
content: "Verify that the quantity increase button is disabled",
|
||||
trigger: `
|
||||
.sale-combo-configurator-dialog
|
||||
button[name=sale_quantity_button_plus]:disabled
|
||||
`,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import { registry } from "@web/core/registry";
|
||||
|
||||
registry.category("web_tour.tours").add('website_sale_stock_message_after_close_onfigurator_modal_with_optional_products', {
|
||||
// This tour relies on a data created from the python test.
|
||||
url: '/shop?search=Product With Optional (TEST)',
|
||||
steps: () => [{
|
||||
content: "Select Customizable Desk",
|
||||
trigger: '.oe_product_cart a:contains("Product With Optional (TEST)")',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
content: "Check that the stock quantity is displayed and correct",
|
||||
trigger: '#threshold_message:contains("30")',
|
||||
}, {
|
||||
content: "Add to cart",
|
||||
trigger: '#add_to_cart',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
trigger: 'table.o_sale_product_configurator_table',
|
||||
},
|
||||
{
|
||||
content: "Continue shoppping",
|
||||
trigger: 'button[name="website_sale_product_configurator_continue_button"]',
|
||||
run: 'click',
|
||||
}, {
|
||||
content: "Check that the stock quantity is displayed and correct after adding to cart",
|
||||
trigger: '#threshold_message:contains("29")',
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
registry.category("web_tour.tours").add('website_sale_stock_message_after_close_onfigurator_modal_without_optional_products', {
|
||||
// This tour relies on a data created from the python test.
|
||||
url: '/shop?search=Product Without Optional (TEST)',
|
||||
steps: () => [{
|
||||
content: "Select Office Lamp",
|
||||
trigger: '.oe_product_cart a:contains("Product Without Optional (TEST)")',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
content: "Check that the stock quantity is displayed and correct",
|
||||
trigger: '#threshold_message:contains("30")',
|
||||
}, {
|
||||
content: "Add to cart",
|
||||
trigger: '#add_to_cart',
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Check that the stock quantity is displayed and correct after adding to cart",
|
||||
trigger: '#threshold_message:contains("29")',
|
||||
}
|
||||
]
|
||||
});
|
||||
|
|
@ -1,48 +1,47 @@
|
|||
/** @odoo-module **/
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
import tour from 'web_tour.tour';
|
||||
|
||||
tour.register('website_sale_stock_multilang', {
|
||||
test: true,
|
||||
registry.category("web_tour.tours").add('website_sale_stock_multilang', {
|
||||
url: '/fr/shop?search=unavailable',
|
||||
},
|
||||
[{
|
||||
content: "Open unavailable product page",
|
||||
trigger: 'a[content="unavailable_product"]',
|
||||
}, {
|
||||
content: "Check out of stock message",
|
||||
trigger: '#out_of_stock_message:contains("Hors-stock")',
|
||||
run: () => {}, // This is a check.
|
||||
}, {
|
||||
content: "Check price",
|
||||
trigger: 'span:contains("123,45")',
|
||||
run: () => {}, // This is a check.
|
||||
}, {
|
||||
content: "Open language selector",
|
||||
trigger: '.js_language_selector button',
|
||||
}, {
|
||||
content: "Switch to English",
|
||||
trigger: '.js_change_lang[data-url_code="en"]',
|
||||
}, {
|
||||
content: "Check out of stock message",
|
||||
trigger: '#out_of_stock_message:contains("Out of stock")',
|
||||
run: () => {}, // This is a check.
|
||||
}, {
|
||||
content: "Check price",
|
||||
trigger: 'span:contains("123.45")',
|
||||
run: () => {}, // This is a check.
|
||||
}, {
|
||||
content: "Open language selector",
|
||||
trigger: '.js_language_selector button',
|
||||
}, {
|
||||
content: "Switch to French",
|
||||
trigger: '.js_change_lang[data-url_code="fr"]',
|
||||
}, {
|
||||
content: "Check out of stock message",
|
||||
trigger: '#out_of_stock_message:contains("Hors-stock")',
|
||||
run: () => {}, // This is a check.
|
||||
}, {
|
||||
content: "Check price",
|
||||
trigger: 'span:contains("123,45")',
|
||||
run: () => {}, // This is a check.
|
||||
}]);
|
||||
steps: () => [{
|
||||
content: "Open unavailable product page",
|
||||
trigger: 'a:contains("unavailable_product")',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
content: "Check out of stock message",
|
||||
trigger: '#out_of_stock_message:contains("Hors-stock")',
|
||||
}, {
|
||||
content: "Check price",
|
||||
trigger: 'span:contains("123,45")',
|
||||
}, {
|
||||
content: "Open language selector",
|
||||
trigger: '.js_language_selector button',
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Switch to English",
|
||||
trigger: '.js_change_lang[data-url_code="en"]',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
content: "Check out of stock message",
|
||||
trigger: '#out_of_stock_message:contains("Out of stock")',
|
||||
}, {
|
||||
content: "Check price",
|
||||
trigger: 'span:contains("123.45")',
|
||||
}, {
|
||||
content: "Open language selector",
|
||||
trigger: '.js_language_selector button',
|
||||
run: "click",
|
||||
}, {
|
||||
content: "Switch to French",
|
||||
trigger: '.js_change_lang[data-url_code="fr"]',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
}, {
|
||||
content: "Check out of stock message",
|
||||
trigger: '#out_of_stock_message:contains("Hors-stock")',
|
||||
}, {
|
||||
content: "Check price",
|
||||
trigger: 'span:contains("123,45")',
|
||||
}],
|
||||
});
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
import { registry } from '@web/core/registry';
|
||||
import configuratorTourUtils from '@sale/js/tours/product_configurator_tour_utils';
|
||||
import * as wsTourUtils from '@website_sale/js/tours/tour_utils';
|
||||
import stockConfiguratorTourUtils from '@website_sale_stock/js/tours/product_configurator_tour_utils';
|
||||
|
||||
registry
|
||||
.category('web_tour.tours')
|
||||
.add('website_sale_stock_product_configurator', {
|
||||
url: '/shop?search=Main product',
|
||||
steps: () => [
|
||||
...wsTourUtils.addToCart({ productName: "Main product", search: false, expectUnloadPage: true }),
|
||||
configuratorTourUtils.assertProductQuantity("Main product", 1),
|
||||
// Assert that it's impossible to add less than 1 product (only for the main product).
|
||||
configuratorTourUtils.setProductQuantity("Main product", 0),
|
||||
configuratorTourUtils.assertProductQuantity("Main product", 1),
|
||||
{
|
||||
content: "check that decrease button is disabled",
|
||||
trigger: `.modal button[name=sale_quantity_button_minus]:disabled`,
|
||||
},
|
||||
// Assert that it's impossible to add more products than available.
|
||||
configuratorTourUtils.setProductQuantity("Main product", 20),
|
||||
configuratorTourUtils.assertProductQuantity("Main product", 10),
|
||||
{
|
||||
content: "check that increase button is disabled",
|
||||
trigger: `.modal button[name=sale_quantity_button_plus]:disabled`,
|
||||
},
|
||||
// Assert that the "Out of stock" variant of the optional product can't be sold.
|
||||
...stockConfiguratorTourUtils.assertOptionalProductOutOfStock(
|
||||
"Optional product (Out of stock)"
|
||||
),
|
||||
// Add the "Out of stock" variant by selecting the "In stock" variant, adding it, and
|
||||
// selecting the "Out of stock" variant again.
|
||||
configuratorTourUtils.selectAttribute("Optional product", "Stock", "In stock"),
|
||||
configuratorTourUtils.addOptionalProduct("Optional product (In stock)"),
|
||||
configuratorTourUtils.selectAttribute("Optional product", "Stock", "Out of stock"),
|
||||
// Assert that the "Out of stock" variant of the optional product still can't be sold.
|
||||
...stockConfiguratorTourUtils.assertProductOutOfStock("Optional product (Out of stock)"),
|
||||
configuratorTourUtils.assertFooterButtonsDisabled(),
|
||||
// Remove the "Out of stock" variant.
|
||||
configuratorTourUtils.removeOptionalProduct("Optional product"),
|
||||
{
|
||||
content: "Proceed to checkout",
|
||||
trigger: 'button:contains(Go to Checkout)',
|
||||
run: 'click',
|
||||
expectUnloadPage: true,
|
||||
},
|
||||
{
|
||||
content: "Verify the quantity in the cart",
|
||||
trigger: 'div.o_cart_product input.quantity[value="10"]',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
|
@ -1,32 +1,32 @@
|
|||
/** @odoo-module **/
|
||||
import { registry } from "@web/core/registry";
|
||||
|
||||
import tour from 'web_tour.tour';
|
||||
|
||||
tour.register('back_in_stock_notification_product', {
|
||||
test: true,
|
||||
registry.category("web_tour.tours").add('back_in_stock_notification_product', {
|
||||
url: '/shop?search=Macbook%20Pro',
|
||||
},
|
||||
[
|
||||
steps: () => [
|
||||
{
|
||||
content: "Open product page",
|
||||
trigger: 'a:contains("Macbook Pro")',
|
||||
run: "click",
|
||||
expectUnloadPage: true,
|
||||
},
|
||||
{
|
||||
content: "Click on 'Be notified when back in stock'",
|
||||
trigger: '#product_stock_notification_message',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Fill email form",
|
||||
trigger: 'div[id="stock_notification_form"] input[name="email"]',
|
||||
run: 'text test@test.test',
|
||||
run: "edit test@test.test",
|
||||
},
|
||||
{
|
||||
content: "Click on the button",
|
||||
trigger: '#product_stock_notification_form_submit_button',
|
||||
run: "click",
|
||||
},
|
||||
{
|
||||
content: "Success Message",
|
||||
trigger: '#stock_notification_success_message',
|
||||
},
|
||||
],
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue