[FIX] pos_restaurant: assertion of restaurant tour not ok
The pos_restaurant first test (test_01_pos_restaurant) has an assertion that failed due to the fact that the deleteion of an order is not awaited in the frontend. This led to the tour finishing very fast after the orm call and the assertion done just after that. We add steps in this test to see if the orm call has been done propely before ending the tour. Runbot Error: 22613, 22614 closes odoo/odoo#126779 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
@@ -14,7 +14,25 @@ class DoExt extends Do {
|
||||
}
|
||||
}
|
||||
|
||||
class Check {}
|
||||
class Check {
|
||||
isSyncStatusPending() {
|
||||
return [
|
||||
{
|
||||
trigger: ".pos-topheader .pos-rightheader .status-buttons .oe_status:has(.js_msg)",
|
||||
run: () => {},
|
||||
},
|
||||
];
|
||||
}
|
||||
isSyncStatusConnected() {
|
||||
return [
|
||||
{
|
||||
trigger:
|
||||
".pos-topheader .pos-rightheader .status-buttons .oe_status:has(.js_connected)",
|
||||
run: () => {},
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
class Execute {}
|
||||
|
||||
|
||||
@@ -68,12 +68,16 @@ Chrome.do.clickMenuButton();
|
||||
Chrome.do.clickTicketButton();
|
||||
TicketScreen.do.deleteOrder("-0001");
|
||||
Chrome.do.confirmPopup();
|
||||
Chrome.check.isSyncStatusPending();
|
||||
Chrome.check.isSyncStatusConnected();
|
||||
TicketScreen.do.selectOrder("-0003");
|
||||
Chrome.do.backToFloor();
|
||||
|
||||
// There should be 1 synced draft order.
|
||||
FloorScreen.check.orderCountSyncedInTableIs("5", "2");
|
||||
registry.category("web_tour.tours").add("pos_restaurant_sync", { test: true, url: "/pos/ui", steps: getSteps() });
|
||||
registry
|
||||
.category("web_tour.tours")
|
||||
.add("pos_restaurant_sync", { test: true, url: "/pos/ui", steps: getSteps() });
|
||||
|
||||
startSteps();
|
||||
|
||||
@@ -112,4 +116,6 @@ ProductScreen.check.totalAmountIs("2.20");
|
||||
Chrome.do.backToFloor();
|
||||
FloorScreen.check.orderCountSyncedInTableIs("4", "1");
|
||||
|
||||
registry.category("web_tour.tours").add("pos_restaurant_sync_second_login", { test: true, url: "/pos/ui", steps: getSteps() });
|
||||
registry
|
||||
.category("web_tour.tours")
|
||||
.add("pos_restaurant_sync_second_login", { test: true, url: "/pos/ui", steps: getSteps() });
|
||||
|
||||
Reference in New Issue
Block a user