summaryrefslogtreecommitdiff
path: root/addons/pos_restaurant/static/tests/tours/ControlButtons.tour.js
blob: 3b6e499a97ad079f5d338041e6da6d22c36f525c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
odoo.define('pos_restaurant.tour.ControlButtons', function (require) {
    'use strict';

    const { TextAreaPopup } = require('pos_restaurant.tour.TextAreaPopupTourMethods');
    const { Chrome } = require('pos_restaurant.tour.ChromeTourMethods');
    const { FloorScreen } = require('pos_restaurant.tour.FloorScreenTourMethods');
    const { ProductScreen } = require('pos_restaurant.tour.ProductScreenTourMethods');
    const { SplitBillScreen } = require('pos_restaurant.tour.SplitBillScreenTourMethods');
    const { BillScreen } = require('pos_restaurant.tour.BillScreenTourMethods');
    const { getSteps, startSteps } = require('point_of_sale.tour.utils');
    var Tour = require('web_tour.tour');

    // signal to start generating steps
    // when finished, steps can be taken from getSteps
    startSteps();

    // Test TransferOrderButton
    FloorScreen.do.clickTable('T2');
    ProductScreen.exec.addOrderline('Water', '5', '2', '10.0');
    ProductScreen.do.clickTransferButton();
    FloorScreen.do.clickTable('T4');
    ProductScreen.do.clickOrderline('Water', '5', '2');
    Chrome.do.backToFloor();
    FloorScreen.do.clickTable('T2');
    ProductScreen.check.orderIsEmpty();
    Chrome.do.backToFloor();
    FloorScreen.do.clickTable('T4');
    ProductScreen.do.clickOrderline('Water', '5', '2');

    // Test SplitBillButton
    ProductScreen.do.clickSplitBillButton();
    SplitBillScreen.do.clickBack();

    // Test OrderlineNoteButton
    ProductScreen.do.clickNoteButton();
    TextAreaPopup.check.isShown();
    TextAreaPopup.do.inputText('test note');
    TextAreaPopup.do.clickConfirm();
    ProductScreen.check.orderlineHasNote('Water', '5', 'test note');
    ProductScreen.exec.addOrderline('Water', '8', '1', '8.0');

    // Test PrintBillButton
    ProductScreen.do.clickPrintBillButton();
    BillScreen.check.isShown();
    BillScreen.do.clickBack();

    Tour.register('ControlButtonsTour', { test: true, url: '/pos/ui' }, getSteps());
});