From c44e851d5b4ab4def2bce3e4c910a708e2072a87 Mon Sep 17 00:00:00 2001 From: Joseph Caburnay Date: Wed, 8 Jun 2022 09:11:48 +0000 Subject: [PATCH] [FIX] pos_loyalty: fix runbot error Use of `addOrderline` presses the numpad, after clicking the product, even if the quantity of the product being added is only 1. Because of this, there might be a rogue press which calls `_updateSelectedOrderline` at the wrong timing. This can be proven by looking at the screenshot where the quantity of `Small Shelf` is 11, not 1. In this particular failing tour, the sequence of steps properly aligned resulting to this runbot issue. To make sure runbot isn't failing randomly, we replace `addOrderline` with manual `click product` and `orderline check`. Runbot: 3883, 3884, 3886 X-original-commit: 40aef1c4161f21801c1bbae823d9b5c46a035478 Part-of: odoo/odoo#93124 --- .../static/src/js/tours/PosLoyaltyRewardButtonTour.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/pos_loyalty/static/src/js/tours/PosLoyaltyRewardButtonTour.js b/addons/pos_loyalty/static/src/js/tours/PosLoyaltyRewardButtonTour.js index 798ba7e5860..c5e4e8b7ff2 100644 --- a/addons/pos_loyalty/static/src/js/tours/PosLoyaltyRewardButtonTour.js +++ b/addons/pos_loyalty/static/src/js/tours/PosLoyaltyRewardButtonTour.js @@ -98,9 +98,11 @@ PosLoyalty.exec.finalizeOrder('Cash', '10'); // Promotion: 2 items of shelves, get desk_pad/monitor_stand free // This is the 5th order. -ProductScreen.exec.addOrderline('Wall Shelf Unit', '1'); +ProductScreen.do.clickDisplayedProduct('Wall Shelf Unit'); +ProductScreen.check.selectedOrderlineHas('Wall Shelf Unit', '1.00'); PosLoyalty.check.isRewardButtonHighlighted(false); -ProductScreen.exec.addOrderline('Small Shelf', '1'); +ProductScreen.do.clickDisplayedProduct('Small Shelf'); +ProductScreen.check.selectedOrderlineHas('Small Shelf', '1.00'); PosLoyalty.check.isRewardButtonHighlighted(true); // Click reward product. Should be automatically added as reward. ProductScreen.do.clickDisplayedProduct('Desk Pad');