Click to start the point of sale interface. It runs on tablets, laptops, or industrial hardware.
Once the session launched, the system continues to run without an internet connection.
"), + position: "bottom" + }, { + content: "Switch to table or make dummy action", + trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected', + position: "bottom", + timeout: 20000, + }, { + content: 'waiting for loading to finish', + trigger: '.order-button.neworder-button', + }]; + } + + function add_product_to_order(product_name) { + return [{ + content: 'buy ' + product_name, + trigger: '.product-list .product-name:contains("' + product_name + '")', + }, { + content: 'the ' + product_name + ' have been added to the order', + trigger: '.order .product-name:contains("' + product_name + '")', + }]; + } + + function simulate_keyup_event(number) { + var event = $.Event('keyup'); + event.which = number; + event.keyCode = number; + $('body').trigger(event); + } + + function update_qty_for_product(qty) { + return [{ + content: "Make dummy action and update product qty", + trigger: '.order-button.selected', + run: function(){ + simulate_keyup_event(96 + qty); + }, + }, { + content: 'Check the qty', + trigger: '.orderline.selected .info em:contains(' + qty + ')', + }]; + } + + function open_cashier_popup_and_close_it() { + return [{ + content: "Open cashier selection popup", + trigger: '.username', + }, { + content: "Make dummy action and simulate escape button clicking", + trigger: '.modal-dialog:not(".oe_hidden") p.title', + run: function(){ + simulate_keyup_event(27); + setTimeout(function () { + if ($('.modal-dialog:not(".oe_hidden")').length) { + console.log('error'); + } else { + console.log('ok'); + } + }, 50); + }, + }, { + content: "Make dummy action in order to properly pass the check for closed popups", + trigger: '.order-button.selected', + }]; + } + + var steps = []; + steps = steps.concat(open_pos_neworder()); + steps = steps.concat(add_product_to_order('Miscellaneous')); + steps = steps.concat(update_qty_for_product(3)); + steps = steps.concat(open_cashier_popup_and_close_it()); + + tour.register('pos_keyboard_tour', { test: true, url: '/web' }, steps); + +}); diff --git a/pos_keyboard/tests/__init__.py b/pos_keyboard/tests/__init__.py new file mode 100644 index 0000000..add1db2 --- /dev/null +++ b/pos_keyboard/tests/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). + +from . import test_pos_keyboard diff --git a/pos_keyboard/tests/test_pos_keyboard.py b/pos_keyboard/tests/test_pos_keyboard.py new file mode 100644 index 0000000..6842968 --- /dev/null +++ b/pos_keyboard/tests/test_pos_keyboard.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +# Copyright 2019 Kolushov Alexandr