Skip to content

Commit

Permalink
[FIX] pos_event_sale: Added extra checks, remove numpad press on cash
Browse files Browse the repository at this point in the history
  • Loading branch information
dal-adhoc authored and maq-adhoc committed Nov 1, 2024
1 parent 4f4a208 commit 22db143
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
6 changes: 5 additions & 1 deletion pos_event_sale/static/tests/tours/EventSale.tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
11 changes: 8 additions & 3 deletions pos_event_sale/static/tests/tours/EventSaleAvailability.tour.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 [
{
Expand Down

0 comments on commit 22db143

Please sign in to comment.