Skip to content
Permalink
Browse files

🛡 updated tests

  • Loading branch information...
fedoranvar committed Jul 29, 2019
1 parent b1b059d commit 5ec08447aaf1cf2706c23826a228d705857070e4
Showing with 39 additions and 16 deletions.
  1. +39 −16 pos_menu/static/src/js/tour.js
@@ -6,31 +6,54 @@ odoo.define('pos_menu.tour', function(require) {

var _t = core._t;

tour.register('pos_menu_tour', {
url: "/web",
test: true,
}, [{
function pos_opening(pos){
return [{
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"], .oe_menu_toggler[data-menu-xmlid="point_of_sale.menu_point_root"]',
content: _t("Ready to launch your <b>point of sale</b>? <i>Click here</i>."),
position: 'bottom',
}, {
trigger: ".o_pos_kanban .o_kanban_record:not(:first) button.oe_kanban_action_button",
}, {
trigger: ".o_kanban_record:contains("+ pos +") .btn-primary:first",
content: _t("<p>Click to start the point of sale interface. It <b>runs on tablets</b>, laptops, or industrial hardware.</p><p>Once the session launched, the system continues to run without an internet connection.</p>"),
position: "bottom"
}, {
}, {
trigger: '.o_main_content:has(.loader:hidden)',
content: 'Wait for loading is finished',
timeout: 20000,
run: function () {
// it's a check
},
}];
}

function check_menu(menu){
return [{
content: "Switch to table or make dummy action",
trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected',
position: "bottom"
}, {
content: "Add product #1",
trigger: '.product-name:contains('+ menu[0] +')',
position: "bottom"
}, {
content: "Add product #2",
trigger: '.product-name:contains('+ menu[1] +')',
position: "bottom"
}, {
content: "Add product #3",
trigger: '.product-name:contains('+ menu[2] +')',
position: "bottom"
}, {
content: "Add product #4",
trigger: '.product-name:contains('+ menu[3] +')',
position: "bottom"
}];
}
}, {
content: "Switch to table or make dummy action",
trigger: '.table:not(.oe_invisible .neworder-button), .order-button.selected',
position: "bottom"
}, {
trigger: '.product-list .product-name:contains("Boni Oranges")',
content: "Add the product",
position: "top"
}]);

var steps = [];
var menu = ["Boni Oranges", "Black Grapes", "Carrots", "Conference pears"];
var pos = "Shop1";
steps = steps.concat(pos_opening(pos));
steps = steps.concat(check_menu(menu));

tour.register('pos_menu_tour', {url: '/web', test: true,}, steps);
});

0 comments on commit 5ec0844

Please sign in to comment.
You can’t perform that action at this time.