chore: import enterprise addons 19.0 bulk snapshot

This commit is contained in:
1b-agent committed 2026-09-16 10:13:08 +00:00
commit ca4af030d3
39951 files changed
+15570005

No files matched your search

@@ -0,0 +1,143 @@
import * as Chrome from "@point_of_sale/../tests/pos/tours/utils/chrome_util";
import * as ProductScreen from "@point_of_sale/../tests/pos/tours/utils/product_screen_util";
import * as PaymentScreen from "@point_of_sale/../tests/pos/tours/utils/payment_screen_util";
import * as ReceiptScreen from "@point_of_sale/../tests/pos/tours/utils/receipt_screen_util";
import * as Dialog from "@point_of_sale/../tests/generic_helpers/dialog_util";
import * as combo from "@point_of_sale/../tests/pos/tours/utils/combo_popup_util";
import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add("PreparationDisplayTour", {
steps: () =>
[
// First order should send these orderlines to preparation:
// - Letter Tray x10
Chrome.startPoS(),
Dialog.confirm("Open Register"),
ProductScreen.addOrderline("Letter Tray", "10"),
ProductScreen.selectedOrderlineHas("Letter Tray", "10"),
ProductScreen.addOrderline("Magnetic Board", "5"),
ProductScreen.selectedOrderlineHas("Magnetic Board", "5"),
ProductScreen.addOrderline("Monitor Stand", "1"),
ProductScreen.selectedOrderlineHas("Monitor Stand", "1"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.remainingIs("0.0"),
PaymentScreen.validateButtonIsHighlighted(true),
PaymentScreen.clickValidate(),
ReceiptScreen.clickNextOrder(),
// Should not send anything to preparation
ProductScreen.addOrderline("Magnetic Board", "5"),
ProductScreen.selectedOrderlineHas("Magnetic Board", "5"),
ProductScreen.addOrderline("Monitor Stand", "1"),
ProductScreen.selectedOrderlineHas("Monitor Stand", "1"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.remainingIs("0.0"),
PaymentScreen.validateButtonIsHighlighted(true),
PaymentScreen.clickValidate(),
ReceiptScreen.clickNextOrder(),
].flat(),
});
registry.category("web_tour.tours").add("PreparationDisplayPrinterTour", {
steps: () =>
[
Chrome.startPoS(),
Dialog.confirm("Open Register"),
ProductScreen.addOrderline("Letter Tray"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.clickValidate(),
//This steps is making sure that we atleast tried to call the printer
Dialog.is({ title: "Printing failed" }),
].flat(),
});
registry.category("web_tour.tours").add("PreparationDisplayTourConfigurableProduct", {
steps: () =>
[
Chrome.startPoS(),
Dialog.confirm("Open Register"),
ProductScreen.clickDisplayedProduct("Configurable Chair"),
Dialog.confirm(),
ProductScreen.addCustomerNote("Test customer note - orderline"),
ProductScreen.totalAmountIs("11.0"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.remainingIs("0.0"),
PaymentScreen.validateButtonIsHighlighted(true),
PaymentScreen.clickValidate(),
ReceiptScreen.isShown(),
].flat(),
});
registry.category("web_tour.tours").add("MakePosOrderWithCombo", {
steps: () =>
[
Chrome.startPoS(),
Dialog.confirm("Open Register"),
ProductScreen.clickDisplayedProduct("Office Combo"),
combo.select("Combo Product 3"),
combo.select("Combo Product 5"),
combo.select("Combo Product 7"),
Dialog.confirm(),
ProductScreen.selectedOrderlineHasDirect("Office Combo", "1"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.remainingIs("0.0"),
PaymentScreen.validateButtonIsHighlighted(true),
PaymentScreen.clickValidate(),
].flat(),
});
registry.category("web_tour.tours").add("test_sending_order_in_preparation_should_not_sync_more", {
steps: () =>
[
Chrome.startPoS(),
Dialog.confirm("Open Register"),
ProductScreen.clickDisplayedProduct("Desk Organizer", true, "1.0"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.clickValidate(),
ReceiptScreen.isShown(),
ReceiptScreen.clickNextOrder(),
].flat(),
});
registry.category("web_tour.tours").add("PosOrderCreationTourPdis", {
steps: () =>
[
Chrome.startPoS(),
Dialog.confirm("Open Register"),
// Make simple order "Eat in"
ProductScreen.clickDisplayedProduct("Desk Pad", true, "1.0"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.clickValidate(),
ReceiptScreen.clickNextOrder(),
// Make Takeaway order for tomorrow
ProductScreen.clickDisplayedProduct("Letter Tray", true, "1.0"),
ProductScreen.selectPreset("Eat in", "Takeaway"),
Chrome.selectSlotDays("6"),
Chrome.selectPresetTimingSlotIndex("1"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.clickValidate(),
ReceiptScreen.clickNextOrder(),
// Make a Delivery order
ProductScreen.clickDisplayedProduct("Whiteboard Pen", true, "1.0"),
ProductScreen.selectPreset("Eat in", "Delivery"),
ProductScreen.clickPayButton(),
PaymentScreen.clickPaymentMethod("Bank"),
PaymentScreen.clickValidate(),
ReceiptScreen.clickNextOrder(),
].flat(),
});
@@ -0,0 +1,83 @@
import * as PrepDisplay from "@pos_enterprise/../tests/tours/preparation_display/utils/preparation_display_util";
import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add("PreparationDisplayFrontEndTour", {
steps: () =>
[
PrepDisplay.hasOrderCard({
orderNumber: "001",
productName: "Office Combo",
quantity: 1,
comboLine: ["Combo Product 3", "Combo Product 5", "Combo Product 7"],
}),
PrepDisplay.clickOrderline("001", "Combo Product 3"),
PrepDisplay.isStrickedOrderline("001", "Combo Product 3"),
PrepDisplay.clickOrder("001"),
PrepDisplay.setStage("Ready"),
PrepDisplay.hasOrderCard({
orderNumber: "001",
productName: "Office Combo",
quantity: 1,
comboLine: "Combo Product 3",
}),
PrepDisplay.setStage("To prepare"),
PrepDisplay.clickRecall(),
PrepDisplay.hasOrderCard({
orderNumber: "001",
productName: "Office Combo",
quantity: 1,
comboLine: ["Combo Product 3", "Combo Product 5", "Combo Product 7"],
}),
].flat(),
});
registry.category("web_tour.tours").add("PreparationDisplayFilterTour", {
steps: () =>
[
// By default, no filter selected so you see all orders
PrepDisplay.hasOrderCard({ productName: "Desk Pad" }),
PrepDisplay.hasOrderCard({ productName: "Letter Tray" }),
PrepDisplay.hasOrderCard({ productName: "Whiteboard Pen" }),
PrepDisplay.checkOrderCardCount(3),
//Test time filters
PrepDisplay.clickFilterButton(),
PrepDisplay.clickFilterName("Today"),
PrepDisplay.checkOrderCardCount(2),
PrepDisplay.clickFilterName("Next days"),
PrepDisplay.checkOrderCardCount(3),
PrepDisplay.clearFilterButton(),
PrepDisplay.checkOrderCardCount(3),
// Test reset filters
PrepDisplay.clickFilterName("Eat in"),
PrepDisplay.checkOrderCardCount(1),
PrepDisplay.clickFilterName("Takeaway"),
PrepDisplay.checkOrderCardCount(2),
PrepDisplay.clickFilterName("Delivery"),
PrepDisplay.checkOrderCardCount(3),
PrepDisplay.clearFilterButton(),
// Test product filters
PrepDisplay.clickFilterName("Desk Pad"),
PrepDisplay.checkOrderCardCount(1),
PrepDisplay.clickFilterName("Letter Tray"),
PrepDisplay.checkOrderCardCount(2),
PrepDisplay.clickFilterName("Whiteboard Pen"),
PrepDisplay.checkOrderCardCount(3),
PrepDisplay.clearFilterButton(),
// Test product category filters
PrepDisplay.clickFilterName("Desk test"),
PrepDisplay.checkOrderCardCount(1),
PrepDisplay.clearFilterButton(),
// Mix filters
PrepDisplay.clickFilterName("Eat in"),
PrepDisplay.clickFilterName("Takeaway"),
PrepDisplay.checkOrderCardCount(2),
PrepDisplay.clickFilterName("Next days"),
PrepDisplay.checkOrderCardCount(1),
PrepDisplay.clickFilterName("Today"),
PrepDisplay.checkOrderCardCount(2),
PrepDisplay.clickFilterName("Desk Pad"),
PrepDisplay.checkOrderCardCount(1),
PrepDisplay.clearFilterButton(),
].flat(),
});
@@ -0,0 +1,135 @@
export function hasOrderCard({
orderNumber,
productName,
quantity,
cancelledQty,
note,
comboLine,
}) {
let trigger = `.o_pdis_order_card`;
if (orderNumber) {
trigger += `:has(.o_pdis_tracking_number:contains("${orderNumber}"))`;
}
if (productName) {
trigger += `:has(.o_pdis_product-name:contains("${productName}"))`;
}
if (quantity) {
quantity = parseFloat(quantity) % 1 === 0 ? parseInt(quantity).toString() : quantity;
trigger += `:has(.o_pdis_todo:contains("${quantity}x"))`;
}
if (cancelledQty) {
cancelledQty =
parseFloat(cancelledQty) % 1 === 0 ? parseInt(cancelledQty).toString() : cancelledQty;
trigger += `:has(.o_pdis--cancelled:contains("${cancelledQty}x"))`;
}
if (note) {
trigger += `:has(.o_tag_badge_text:contains("${note}"))`;
}
if (Array.isArray(comboLine)) {
comboLine.forEach((line) => {
trigger += `:has(.o_preparation_display_orderline.ms-4.fst-italic .o_pdis_product-name:contains("${line}"))`;
});
} else if (comboLine) {
trigger += `:has(.o_preparation_display_orderline.ms-4.fst-italic .o_pdis_product-name:contains("${comboLine}"))`;
}
const args = JSON.stringify(arguments[0]);
return [
{
content: `Check order card with attributes: ${args}`,
trigger,
},
];
}
export function setStage(stageName) {
return [
{
content: `change stage '${stageName}'`,
trigger: `.o_pdis_navbar_stage:contains("${stageName}")`,
run: "click",
},
{
content: `Current stage '${stageName}'`,
trigger: `.o_pdis_navbar_stage.selected:contains("${stageName}")`,
},
];
}
export function clickOrder(orderNumber) {
return [
{
content: `Click on order with number: ${orderNumber}`,
trigger: `.o_pdis_order_card_header:has(.o_pdis_tracking_number:contains("${orderNumber}")`,
run: "click",
},
];
}
export function clickOrderline(orderNumber, productName) {
return [
{
content: `Click on orderline with order number: ${orderNumber} and product name ${productName}`,
trigger: `.o_pdis_order_card:has(.o_pdis_tracking_number:contains("${orderNumber}")) .o_preparation_display_orderline:has(.o_pdis_product-name:contains("${productName}"))`,
run: "click",
},
];
}
export function isStrickedOrderline(orderNumber, productName) {
return [
{
content: `Check if orderline stricked with order number: ${orderNumber} and product name ${productName}`,
trigger: `.o_pdis_order_card:has(.o_pdis_tracking_number:contains("${orderNumber}")) .o_preparation_display_orderline:has(.o_pdis_product-name:contains("${productName}").text-decoration-line-through)`,
},
];
}
export function clickRecall() {
return [
{
content: "Click on the Recall button",
trigger: `.btn.btn-light:contains("Recall")`,
run: "click",
},
];
}
export function clearFilterButton() {
return [
{
content: "Click on the Clear Filter button",
trigger: `.btn.btn-info:contains("Clear All Filter")`,
run: "click",
},
];
}
export function clickFilterButton() {
return [
{
content: "Click on the Filter button",
trigger: `.btn.position-relative.h-100.px-4.rounded-0.border-end.shadow-none`,
run: "click",
},
];
}
export function checkOrderCardCount(n) {
return {
content: `Check that there is ${n} order cards displayed`,
trigger: ".o_pdis_orders",
run: function () {
const count = document.querySelectorAll(".o_pdis_orders .o_pdis_order_card").length;
if (count !== n) {
throw new Error(`Expected ${n} order cards, but found ${count}.`);
}
},
};
}
export function clickFilterName(name) {
return {
trigger: `.o_pdis_sidebar span:contains("${name}")`,
run: "click",
};
}