summaryrefslogtreecommitdiff
path: root/addons/pos_restaurant/static/tests/tours/helpers/SplitBillScreenTourMethods.js
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-05-10 21:51:50 +0700
commit3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch)
treea44932296ef4a9b71d5f010906253d8c53727726 /addons/pos_restaurant/static/tests/tours/helpers/SplitBillScreenTourMethods.js
parent0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff)
initial commit 2
Diffstat (limited to 'addons/pos_restaurant/static/tests/tours/helpers/SplitBillScreenTourMethods.js')
-rw-r--r--addons/pos_restaurant/static/tests/tours/helpers/SplitBillScreenTourMethods.js65
1 files changed, 65 insertions, 0 deletions
diff --git a/addons/pos_restaurant/static/tests/tours/helpers/SplitBillScreenTourMethods.js b/addons/pos_restaurant/static/tests/tours/helpers/SplitBillScreenTourMethods.js
new file mode 100644
index 00000000..7f58a1fc
--- /dev/null
+++ b/addons/pos_restaurant/static/tests/tours/helpers/SplitBillScreenTourMethods.js
@@ -0,0 +1,65 @@
+odoo.define('pos_restaurant.tour.SplitBillScreenTourMethods', function (require) {
+ 'use strict';
+
+ const { createTourMethods } = require('point_of_sale.tour.utils');
+
+ class Do {
+ clickOrderline(name, totalQuantity) {
+ let trigger = `li.orderline .product-name:contains("${name}")`;
+ if (totalQuantity) {
+ trigger += ` ~ .info-list .info:contains("${totalQuantity}")`;
+ }
+ return [
+ {
+ content: `click '${name}' orderline with total quantity of '${totalQuantity}'`,
+ trigger,
+ },
+ ];
+ }
+ clickBack() {
+ return [
+ {
+ content: 'click back button',
+ trigger: `.splitbill-screen .button.back`,
+ },
+ ];
+ }
+ clickPay() {
+ return [
+ {
+ content: 'click pay button',
+ trigger: `.splitbill-screen .pay-button .button`
+ }
+ ]
+ }
+ }
+
+ class Check {
+ orderlineHas(name, totalQuantity, splitQuantity) {
+ return [
+ {
+ content: `'${name}' orderline has total quantity of '${totalQuantity}'`,
+ trigger: `li.orderline .product-name:contains("${name}") ~ .info-list .info:contains("${totalQuantity}")`,
+ run: () => {},
+ },
+ {
+ content: `'${name}' orderline has '${splitQuantity}' quantity to split`,
+ trigger: `li.orderline .product-name:contains("${name}") ~ .info-list .info em:contains("${splitQuantity}")`,
+ run: () => {},
+ },
+ ];
+ }
+ subtotalIs(amount) {
+ return [
+ {
+ content: `total amount of split is '${amount}'`,
+ trigger: `.splitbill-screen .order-info .subtotal:contains("${amount}")`,
+ },
+ ];
+ }
+ }
+
+ class Execute {}
+
+ return createTourMethods('SplitBillScreen', Do, Check, Execute);
+});