From cfb97e49ae198501c48e22378e86704074c0021a Mon Sep 17 00:00:00 2001 From: Daniel Libonati Date: Fri, 16 Aug 2024 11:48:05 -0300 Subject: [PATCH] [FIX] pos_event_sale: Added extra checks, remove numpad press on cash --- pos_event_sale/static/tests/tours/EventSale.tour.js | 6 +++++- .../tests/tours/EventSaleAvailability.tour.js | 11 ++++++++--- .../tests/tours/helpers/ProductScreenTourMethods.js | 13 ------------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/pos_event_sale/static/tests/tours/EventSale.tour.js b/pos_event_sale/static/tests/tours/EventSale.tour.js index 4d1f708d6f..58b12d3ab2 100644 --- a/pos_event_sale/static/tests/tours/EventSale.tour.js +++ b/pos_event_sale/static/tests/tours/EventSale.tour.js @@ -42,16 +42,20 @@ odoo.define("pos_event_sale.tour.EventSale", function (require) { TicketSelector.do.clickDisplayedTicket("Kids"); ProductScreen.check.selectedOrderlineHas("Les Misérables (Kids)", "1.0", "0.00"); TicketSelector.do.close(); + EventSelector.do.close(); // Payment ProductScreen.do.clickPayButton(); + PaymentScreen.check.isShown(); PaymentScreen.do.clickPaymentMethod("Cash"); - PaymentScreen.do.pressNumpad("3 0"); + // PaymentScreen.do.pressNumpad("3 0"); PaymentScreen.check.remainingIs("0.0"); PaymentScreen.check.validateButtonIsHighlighted(true); PaymentScreen.do.clickValidate(); + ReceiptScreen.check.isShown(); ReceiptScreen.check.totalAmountContains("30.0"); ReceiptScreen.do.clickNextOrder(); + ProductScreen.check.isShown(); Tour.register("EventSaleTour", {test: true, url: "/pos/ui"}, getSteps()); }); diff --git a/pos_event_sale/static/tests/tours/EventSaleAvailability.tour.js b/pos_event_sale/static/tests/tours/EventSaleAvailability.tour.js index 641849120a..9f1a6e4c55 100644 --- a/pos_event_sale/static/tests/tours/EventSaleAvailability.tour.js +++ b/pos_event_sale/static/tests/tours/EventSaleAvailability.tour.js @@ -17,7 +17,7 @@ odoo.define("pos_event_sale.tour.EventSaleAvailability", function (require) { startSteps(); // Add event through Add Event button - ProductScreen.do.clickOpenSessionButton(); + ProductScreen.do.confirmOpeningPopup(); ProductScreen.do.clickAddEventButton(); EventSelector.check.isShown(); EventSelector.check.eventHasAvailabilityLabel("Les Misérables", "5 remaining"); @@ -54,15 +54,20 @@ odoo.define("pos_event_sale.tour.EventSaleAvailability", function (require) { ); TicketSelector.check.ticketHasAvailabilityLabel("Standard", "Sold out"); TicketSelector.do.close(); + EventSelector.do.close(); // Finish order ProductScreen.do.clickPayButton(); + PaymentScreen.check.isShown(); PaymentScreen.do.clickPaymentMethod("Cash"); - PaymentScreen.do.pressNumpad("3 0"); + // PaymentScreen.do.pressNumpad("3 0"); + PaymentScreen.check.remainingIs("0.0"); PaymentScreen.do.clickValidate(); + ReceiptScreen.check.isShown(); ReceiptScreen.do.clickNextOrder(); + ProductScreen.check.isShown(); - // As the event is sold out now, we shouldn't be able to sell more + // // As the event is sold out now, we shouldn't be able to sell more ProductScreen.do.clickAddEventButton(); EventSelector.check.isShown(); EventSelector.check.eventHasAvailabilityLabel("Les Misérables", "Sold out"); diff --git a/pos_event_sale/static/tests/tours/helpers/ProductScreenTourMethods.js b/pos_event_sale/static/tests/tours/helpers/ProductScreenTourMethods.js index 4d0c779c29..3708fc2677 100644 --- a/pos_event_sale/static/tests/tours/helpers/ProductScreenTourMethods.js +++ b/pos_event_sale/static/tests/tours/helpers/ProductScreenTourMethods.js @@ -10,19 +10,6 @@ odoo.define("pos_event_sale.tour.ProductScreenTourMethods", function (require) { const {Do, Check, Execute} = require("point_of_sale.tour.ProductScreenTourMethods"); class DoExt extends Do { - clickOpenSessionButton() { - return [ - { - content: "click add open session button", - trigger: - '.opening-cash-control .footer .button.dynamic-size', - extra_trigger: function () { - return $('div.popups').html() == ''; - }, - }, - ]; - } - clickAddEventButton() { return [ {