[REF] *: Unify _t and _lt

The goal of this commit is to prepare ground to remove
lazytranslate function _lt() and keep only _t()
for a better understanding of the use of the translation function.

In this commit,

the translate function _t() has been updated to return the translation
if they are loaded. If not, it throws an error.
the lazytranslate function _lt() returns _t() function.
Corollaries :
Steps in test tours are now a function that returns an array of steps
to avoid any interpolation of _t in this ones before translations has
been loaded.

Example :

registry.category("web_tour.tours").add("example", {
    test: true,
    steps: () => [
        {...},
        {...},
    ],
});

task-3292454

closes odoo/odoo#124157

Related: odoo/enterprise#43153
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit is contained in:
Pierre Pulinckx (pipu)
2023-07-19 13:13:16 +02:00
parent ac90aa077d
commit 8bfa76a842
204 changed files with 3342 additions and 2887 deletions
@@ -11,7 +11,7 @@ var _t = core._t;
registry.category("web_tour.tours").add('account_tour', {
url: "/web",
sequence: 60,
steps: [
steps: () => [
...stepUtils.goToAppSteps('account.menu_finance', _t('Send invoices to your customers in no time with the <b>Invoicing app</b>.')),
{
trigger: "a.o_onboarding_step_action[data-method=action_open_step_company_data]",
@@ -10,7 +10,7 @@
registry.category("web_tour.tours").add('account_render_report', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(),
steps: () => [stepUtils.showAppsMenuItem(),
{
id: 'account_menu_click',
trigger: '.o_app[data-menu-xmlid="account.menu_finance"]',
@@ -7,7 +7,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('account_tax_group', {
test: true,
url: "/web",
steps: [stepUtils.showAppsMenuItem(),
steps: () => [stepUtils.showAppsMenuItem(),
{
id: 'account_menu_click',
content: "Go to Invoicing",
@@ -4,6 +4,7 @@ import { _t } from "web.core";
import Widget from "web.Widget";
import { computeScore } from "@auth_password_policy/password_policy";
import { sprintf } from "@web/core/utils/strings";
import { translationIsReady } from "@web/core/l10n/translation";
export default Widget.extend({
tagName: "meter",
@@ -22,6 +23,9 @@ export default Widget.extend({
this._required = required;
this._recommended = recommended;
},
willStart() {
return translationIsReady
},
start() {
var helpMessage = _t(
"Required: %s.\n\nHint: increase length, use multiple words and use non-letter characters to increase your password's strength."
+5 -5
View File
@@ -76,7 +76,7 @@ function closeProfileDialog({content, totp_state}) {
registry.category("web_tour.tours").add('totp_tour_setup', {
test: true,
url: '/web',
steps: [...openUserProfileAtSecurityTab(), {
steps: () => [...openUserProfileAtSecurityTab(), {
content: "Open totp wizard",
trigger: 'button[name=action_totp_enable_wizard]',
}, {
@@ -121,7 +121,7 @@ registry.category("web_tour.tours").add('totp_tour_setup', {
registry.category("web_tour.tours").add('totp_login_enabled', {
test: true,
url: '/',
steps: [{
steps: () => [{
content: "check that we're on the login page or go to it",
trigger: 'input#login, a:contains(Sign in)'
}, {
@@ -161,7 +161,7 @@ registry.category("web_tour.tours").add('totp_login_enabled', {
registry.category("web_tour.tours").add('totp_login_device', {
test: true,
url: '/',
steps: [{
steps: () => [{
content: "check that we're on the login page or go to it",
trigger: 'input#login, a:contains(Sign in)'
}, {
@@ -242,7 +242,7 @@ registry.category("web_tour.tours").add('totp_login_device', {
registry.category("web_tour.tours").add('totp_login_disabled', {
test: true,
url: '/',
steps: [{
steps: () => [{
content: "check that we're on the login page or go to it",
trigger: 'input#login, a:contains(Sign in)'
}, {
@@ -270,7 +270,7 @@ const columns = {};
registry.category("web_tour.tours").add('totp_admin_disables', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
content: 'Go to settings',
trigger: '[data-menu-xmlid="base.menu_administration"]'
}, {
@@ -39,7 +39,7 @@ function openAccountSettingsTab() {
registry.category("web_tour.tours").add('totp_admin_self_invite', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(), ...openAccountSettingsTab(), {
steps: () => [stepUtils.showAppsMenuItem(), ...openAccountSettingsTab(), {
content: "open the user's form",
trigger: "td.o_data_cell:contains(admin)",
}, {
@@ -62,7 +62,7 @@ registry.category("web_tour.tours").add('totp_admin_self_invite', {
registry.category("web_tour.tours").add('totp_admin_invite', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(), ...openAccountSettingsTab(), {
steps: () => [stepUtils.showAppsMenuItem(), ...openAccountSettingsTab(), {
content: "open the user's form",
trigger: "td.o_data_cell:contains(demo)",
}, {
@@ -6,7 +6,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('totportal_tour_setup', {
test: true,
url: '/my/security',
steps: [{
steps: () => [{
content: "Open totp wizard",
trigger: 'button#auth_totp_portal_enable',
}, {
@@ -44,7 +44,7 @@ registry.category("web_tour.tours").add('totportal_tour_setup', {
registry.category("web_tour.tours").add('totportal_login_enabled', {
test: true,
url: '/',
steps: [{
steps: () => [{
content: "check that we're on the login page or go to it",
trigger: 'input#login, a:contains(Sign in)'
}, {
@@ -101,7 +101,7 @@ registry.category("web_tour.tours").add('totportal_login_enabled', {
registry.category("web_tour.tours").add('totportal_login_disabled', {
test: true,
url: '/',
steps: [{
steps: () => [{
content: "check that we're on the login page or go to it",
trigger: 'input#login, a:contains(Sign in)'
}, {
@@ -15,7 +15,7 @@
registry.category("web_tour.tours").add('calendar_appointments_hour_tour', {
url: '/web',
test: true,
steps: [stepUtils.showAppsMenuItem(),
steps: () => [stepUtils.showAppsMenuItem(),
{
trigger: '.o_app[data-menu-xmlid="calendar.mail_menu_calendar"]',
content: 'Open Calendar',
@@ -6,7 +6,7 @@
registry.category("web_tour.tours").add('debug_menu_set_defaults', {
test: true,
url: '/web?debug=1',
steps: [
steps: () => [
...stepUtils.goToAppSteps('contacts.menu_contacts', "Open the contacts menu"),
{
content: "Create a new contact",
+1 -1
View File
@@ -11,7 +11,7 @@ registry.category("web_tour.tours").add('crm_tour', {
url: "/web",
rainbowManMessage: _t("Congrats, best of luck catching such big fish! :)"),
sequence: 10,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="crm.crm_menu_root"]',
content: Markup(_t('Ready to boost your sales? Let\'s have a look at your <b>Pipeline</b>.')),
position: 'bottom',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('create_crm_team_tour', {
url: "/web",
test: true,
steps: [
steps: () => [
...stepUtils.goToAppSteps('crm.crm_menu_root'),
{
trigger: 'button[data-menu-xmlid="crm.crm_menu_config"]',
@@ -6,7 +6,7 @@
registry.category("web_tour.tours").add('crm_email_and_phone_propagation_edit_save', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
trigger: '.o_app[data-menu-xmlid="crm.crm_menu_root"]',
@@ -26,7 +26,7 @@
registry.category("web_tour.tours").add('crm_email_and_phone_propagation_remove_email_and_phone', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
trigger: '.o_app[data-menu-xmlid="crm.crm_menu_root"]',
@@ -6,7 +6,7 @@ const today = luxon.DateTime.now();
registry.category("web_tour.tours").add('crm_forecast', {
test: true,
url: "/web",
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
trigger: ".o_app[data-menu-xmlid='crm.crm_menu_root']",
@@ -6,7 +6,7 @@
registry.category("web_tour.tours").add('crm_rainbowman', {
test: true,
url: "/web",
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
trigger: ".o_app[data-menu-xmlid='crm.crm_menu_root']",
@@ -1,40 +1,51 @@
/** @odoo-module **/
import { registry } from "@web/core/registry";
import {Markup} from "web.utils";
import { Markup } from "web.utils";
import core from "web.core";
import "web.legacy_tranlations_loaded";
import "@crm/js/tours/crm";
import { patch } from "@web/core/utils/patch";
var _t = core._t;
var DragOppToWonStepIndex = registry.category("web_tour.tours").get("crm_tour").steps.findIndex(step => {
return (step.id === 'drag_opportunity_to_won_step');
});
registry.category("web_tour.tours").get("crm_tour").steps.splice(DragOppToWonStepIndex + 1, 0, {
/**
* Add some steps between "Drag your opportunity to <b>Won</b> when you get
* the deal. Congrats!" and "Let’s have a look at an Opportunity." to
* include the steps related to the lead generation (crm_iap_mine).
* This eases the on boarding for the Lead Generation process.
*
*/
trigger: ".o_button_generate_leads",
content: Markup(_t("Looking for more opportunities?<br>Try the <b>Lead Generation</b> tool.")),
position: "bottom",
run: function (actions) {
actions.auto('.o_button_generate_leads');
patch(registry.category("web_tour.tours").get("crm_tour"), "patch_crm_tour", {
steps() {
const originalSteps = this._super();
const DragOppToWonStepIndex = originalSteps.findIndex(
(step) => step.id === "drag_opportunity_to_won_step"
);
return originalSteps.splice(
DragOppToWonStepIndex + 1,
0,
{
/**
* Add some steps between "Drag your opportunity to <b>Won</b> when you get
* the deal. Congrats!" and "Let’s have a look at an Opportunity." to
* include the steps related to the lead generation (crm_iap_mine).
* This eases the on boarding for the Lead Generation process.
*
*/
trigger: ".o_button_generate_leads",
content: Markup(_t("Looking for more opportunities?<br>Try the <b>Lead Generation</b> tool.")),
position: "bottom",
run: function (actions) {
actions.auto('.o_button_generate_leads');
},
},
{
trigger: ".modal-body .o_industry",
content: _t("Which Industry do you want to target?"),
position: "right",
},
{
trigger: ".modal-footer button[name=action_submit]",
content: _t("Now, just let the magic happen!"),
position: "bottom",
run: function (actions) {
actions.auto(".modal-footer button[special=cancel]");
},
}
);
},
}, {
trigger: '.modal-body .o_industry',
content: _t("Which Industry do you want to target?"),
position: "right",
}, {
trigger: '.modal-footer button[name=action_submit]',
content: _t("Now, just let the magic happen!"),
position: "bottom",
run: function (actions) {
actions.auto('.modal-footer button[special=cancel]');
}
});
@@ -12,7 +12,7 @@ registry.category("web_tour.tours").add('event_tour', {
url: '/web',
rainbowManMessage: _t("Great! Now all you have to do is wait for your attendees to show up!"),
sequence: 210,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="event.event_main_menu"]',
content: Markup(_t("Ready to <b>organize events</b> in a few minutes? Let's get started!")),
position: 'bottom',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('event_configurator_tour', {
url: "/web",
test: true,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="sale.sale_menu_root"]',
edition: 'community'
}, {
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('hr_employee_tour', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
content: "Open Employees app",
@@ -2,19 +2,30 @@
import { stepUtils } from "@web_tour/tour_service/tour_utils";
import { registry } from "@web/core/registry";
import { patch } from "@web/core/utils/patch";
/**
* As 'hr' changes the flow a bit and displays the user preferences form in a full view instead of
* a modal, we adapt the steps of the original tour accordingly.
*/
registry.category("web_tour.tours").get('mail/static/tests/tours/user_modify_own_profile_tour.js').steps = [{
content: 'Open user account menu',
trigger: '.o_user_menu button',
}, {
content: "Open preferences / profile screen",
trigger: '[data-menu=settings]',
}, {
content: "Update the email address",
trigger: 'div[name="email"] input',
run: 'text updatedemail@example.com',
}, ...stepUtils.saveForm()];
patch(registry.category("web_tour.tours").get("mail/static/tests/tours/user_modify_own_profile_tour.js"), "patch_user_modify_own_profile_tour", {
steps() {
return [
{
content: 'Open user account menu',
trigger: '.o_user_menu button',
},
{
content: "Open preferences / profile screen",
trigger: '[data-menu=settings]',
},
{
content: "Update the email address",
trigger: 'div[name="email"] input',
run: 'text updatedemail@example.com',
},
...stepUtils.saveForm(),
];
}
});
@@ -10,7 +10,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('hr_expense_tour' , {
url: "/web",
rainbowManMessage: _t("There you go - expense management in a nutshell!"),
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="hr_expense.menu_hr_expense_root"]',
content: _t("Wasting time recording your receipts? Let’s try a better way."),
position: 'right',
@@ -6,7 +6,7 @@
registry.category("web_tour.tours").add('hr_expense_test_tour', {
test: true,
url: "/web",
steps: [stepUtils.showAppsMenuItem(),
steps: () => [stepUtils.showAppsMenuItem(),
{
content: "Go to Expense",
trigger: '.o_app[data-menu-xmlid="hr_expense.menu_hr_expense_root"]',
@@ -14,7 +14,7 @@ registry.category("web_tour.tours").add('hr_holidays_tour', {
url: '/web',
rainbowManMessage: _t("Congrats, we can see that your request has been validated."),
test: false,
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
trigger: '.o_app[data-menu-xmlid="hr_holidays.menu_hr_holidays_root"]',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('time_off_request_calendar_view', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(),
steps: () => [stepUtils.showAppsMenuItem(),
{
content: "Open Time Off app",
trigger: '.o_app[data-menu-xmlid="hr_holidays.menu_hr_holidays_root"]',
@@ -13,7 +13,7 @@ registry.category("web_tour.tours").add('hr_recruitment_tour',{
rainbowManMessage: markup(_t("<div>Great job! You hired a new colleague!</div><div>Try the Website app to publish job offers online.</div>")),
fadeout: 'very_slow',
sequence: 230,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="hr_recruitment.menu_hr_recruitment_root"]',
content: Markup(_t("Let's have a look at how to <b>improve</b> your <b>hiring process</b>.")),
position: 'right',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('hr_skills_tour', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
content: "Open Employees app",
@@ -14,14 +14,14 @@ const requestChatSteps = [
registry.category("web_tour.tours").add("im_livechat_request_chat", {
test: true,
steps: requestChatSteps,
steps: () => requestChatSteps,
shadow_dom: ".o-livechat-root",
});
registry.category("web_tour.tours").add("im_livechat_request_chat_and_send_message", {
test: true,
shadow_dom: ".o-livechat-root",
steps: [
steps: () => [
...requestChatSteps,
{
trigger: ".o-mail-Composer-input",
@@ -61,7 +61,7 @@ const commonSteps = [
registry.category("web_tour.tours").add("im_livechat_chatbot_steps_sequence_tour", {
test: true,
url: "/web",
steps: [
steps: () => [
...commonSteps,
{
trigger: 'button:contains("Save & Close")',
@@ -80,7 +80,7 @@ registry.category("web_tour.tours").add("im_livechat_chatbot_steps_sequence_tour
registry.category("web_tour.tours").add("im_livechat_chatbot_steps_sequence_with_move_tour", {
test: true,
url: "/web",
steps: [
steps: () => [
...commonSteps,
{
trigger: 'button:contains("Save & New")',
+24 -20
View File
@@ -1,23 +1,27 @@
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { registry } from "@web/core/registry";
import "account.tour";
import "account.tour";
import { registry } from "@web/core/registry";
let account_tour = registry.category("web_tour.tours").get("account_tour");
// Remove the step suggesting to change the name as it is done another way (document number)
account_tour.steps = account_tour.steps.filter(step => step.trigger != "input[name=name]");
// Configure the AFIP Responsibility
let partner_step_idx = account_tour.steps.findIndex(step => step.trigger == 'div[name=partner_id] input');
account_tour.steps.splice(partner_step_idx + 2, 0, {
patch(registry.category("web_tour.tours").get("account_tour"), "patch_account_tour", {
steps() {
const originalSteps = this._super();
// Remove the step suggesting to change the name as it is done another way (document number)
const filteredSteps = originalSteps.filter((step) => step.trigger != "input[name=name]");
const stepIndex = filteredSteps.findIndex((step) => step.trigger == 'div[name=partner_id] input');
filteredSteps.splice(stepIndex + 2, 0, {
// FIXME WOWL: this selector needs to work in both legacy and non-legacy views
trigger: "div[name=l10n_ar_afip_responsibility_type_id] input",
extra_trigger: "[name=move_type] [raw-value=out_invoice], [name=move_type][raw-value=out_invoice]",
position: "bottom",
content: "Set the AFIP Responsability",
run: "text IVA",
})
account_tour.steps.splice(partner_step_idx + 3, 0, {
trigger: ".ui-menu-item > a:contains('IVA').ui-state-active",
auto: true,
in_modal: false,
})
trigger: "div[name=l10n_ar_afip_responsibility_type_id] input",
extra_trigger: "[name=move_type] [raw-value=out_invoice], [name=move_type][raw-value=out_invoice]",
position: "bottom",
content: "Set the AFIP Responsability",
run: "text IVA",
})
filteredSteps.splice(stepIndex + 3, 0, {
trigger: ".ui-menu-item > a:contains('IVA').ui-state-active",
auto: true,
in_modal: false,
});
return filteredSteps;
}
});
@@ -7,7 +7,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('order_lunch_tour', {
url: "/web",
test: true,
steps: [{
steps: () => [{
trigger: 'a[data-menu-xmlid="lunch.menu_lunch"]',
content: _t("Start by accessing the lunch app."),
position: 'bottom',
@@ -8,7 +8,7 @@ import { Markup } from "web.utils";
registry.category("web_tour.tours").add("mail_tour", {
url: "/web#action=mail.action_discuss",
sequence: 80,
steps: [
steps: () => [
{
trigger: ".o-mail-DiscussCategory-channel .o-mail-DiscussCategory-add",
content: Markup(
@@ -4,7 +4,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add("mail.load_message_order", {
test: true,
steps: [
steps: () => [
{
trigger: ".o-mail-DiscussCategoryItem:contains(MyTestChannel)",
run: "click",
@@ -6,7 +6,7 @@ registry
.category("web_tour.tours")
.add("mail/static/tests/tours/discuss_channel_as_guest_tour.js", {
test: true,
steps: [
steps: () => [
{
content: "Channel secret token has been hidden on welcome page",
trigger: ".o-mail-WelcomePage",
@@ -5,7 +5,7 @@ import { createFile, inputFiles } from "web.test_utils_file";
registry.category("web_tour.tours").add("mail/static/tests/tours/discuss_public_tour.js", {
test: true,
steps: [
steps: () => [
{
trigger: ".o-mail-DiscussPublic",
extraTrigger: ".o-mail-Thread",
@@ -7,7 +7,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add("mail/static/tests/tours/dynamic_placeholder_tour.js", {
url: "/web",
test: true,
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
content: 'Go into the Setting "app"',
@@ -4,7 +4,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add("mail_activity_schedule_from_chatter", {
test: true,
steps: [
steps: () => [
{
trigger: "button:contains('Activities')",
},
@@ -11,7 +11,7 @@ import { createFile, inputFiles } from "web.test_utils_file";
*/
registry.category("web_tour.tours").add("mail/static/tests/tours/mail_full_composer_test_tour.js", {
test: true,
steps: [
steps: () => [
{
content: "Click on Send Message",
trigger: "button:contains(Send message)",
@@ -7,7 +7,7 @@ import { registry } from "@web/core/registry";
*/
registry.category("web_tour.tours").add("mail/static/tests/tours/user_modify_own_profile_tour.js", {
test: true,
steps: [
steps: () => [
{
content: "Open user account menu",
trigger: ".o_user_menu button",
@@ -11,7 +11,7 @@
url: '/web',
rainbowManMessage: _t('Congratulations, I love your first mailing. :)'),
sequence: 200,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
content: _t("Let's try the Email Marketing app."),
width: 225,
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category('web_tour.tours').add('mailing_campaign', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
content: 'Select the "Email Marketing" app',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('mailing_editor', {
url: '/web',
test: true,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
}, {
trigger: 'button.o_list_button_add',
@@ -7,7 +7,7 @@ import { boundariesIn, setSelection } from "@web_editor/js/editor/odoo-editor/sr
registry.category("web_tour.tours").add('mailing_editor_theme', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
content: "Select the 'Email Marketing' app.",
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('snippets_mailing_menu_tabs', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(), {
content: "Select the 'Email Marketing' app.",
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('snippets_mailing_menu_toolbar', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(), {
content: "Select the 'Email Marketing' app.",
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('snippets_mailing_menu_toolbar_mobile', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(), {
content: "Select the 'Email Marketing' app.",
trigger: '.o_app[data-menu-xmlid="mass_mailing.mass_mailing_menu_root"]',
@@ -5,7 +5,7 @@ import { stepUtils } from '@web_tour/tour_service/tour_utils';
registry.category("web_tour.tours").add('test_mrp_manual_consumption', {
test: true,
steps: [
steps: () => [
{
trigger: 'div[name=move_raw_ids] td[name="quantity_done"]:last:contains("5.00")',
run: () => {},
@@ -134,6 +134,7 @@
'mrp_subcontracting/static/src/subcontracting_portal/*',
'web/static/src/start.js',
'web/static/src/legacy/legacy_setup.js',
('remove', 'web/static/src/core/emoji_picker/emoji_data.js'),
],
},
'uninstall_hook': 'uninstall_hook',
@@ -2,20 +2,21 @@
import { registry } from "@web/core/registry";
const subcontractingPortalSteps = [{
trigger: 'table > tbody > tr a:has(span:contains(WH/IN/00))',
content: 'Select the picking to open the backend view.',
run: 'click',
},{
trigger: 'iframe .o_subcontracting_portal',
content: 'Wait the subcontracting portal to be loaded.',
run: function () {},
}, {
trigger: 'iframe button[name="action_show_details"]',
run: 'click',
}];
registry.category("web_tour.tours").add('subcontracting_portal_tour', {
test: true,
url: '/my/productions',
steps: subcontractingPortalSteps });
steps: () => [
{
trigger: 'table > tbody > tr a:has(span:contains(WH/IN/00))',
content: 'Select the picking to open the backend view.',
run: 'click',
},{
trigger: 'iframe .o_subcontracting_portal',
content: 'Wait the subcontracting portal to be loaded.',
run: function () {},
}, {
trigger: 'iframe button[name="action_show_details"]',
run: 'click',
}
],
});
+1
View File
@@ -146,6 +146,7 @@
'point_of_sale.assets_qunit_tests': [
('include', 'point_of_sale._assets_pos'),
# dependencies of web.tests_assets (in the web tests, these come from assets_backend)
'web/static/tests/patch_translations.js',
'web/static/src/owl2_compatibility/app.js',
'web/static/lib/jquery/jquery.js',
'web/static/lib/jquery/jquery.browser.js',
@@ -5,9 +5,9 @@
<!-- spinner from https://loading.io/css/ -->
<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>
<!-- FIXME POSREF restore skip button? -->
<t t-if="false and pos.loadingSkipButtonIsShown">
<!-- <t t-if="false and pos.loadingSkipButtonIsShown">
<h1 class="message">Connecting to devices</h1>
</t>
</t> -->
</div>
</div>
</t>
@@ -10,7 +10,7 @@ registry.category("web_tour.tours").add("point_of_sale_tour", {
url: "/web",
rainbowMan: false,
sequence: 45,
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
trigger: '.o_app[data-menu-xmlid="point_of_sale.menu_point_root"]',
@@ -8,103 +8,110 @@ import { Chrome } from "@point_of_sale/../tests/tours/helpers/ChromeTourMethods"
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
// Order 1 is at Product Screen
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Desk Pad", "1", "2", "2.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0001", "Ongoing");
// Order 2 is at Payment Screen
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Monitor Stand", "3", "4", "12.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0002", "Payment");
// Order 3 is at Receipt Screen
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Whiteboard Pen", "5", "6", "30.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0003", "Receipt");
// Select order 1, should be at Product Screen
TicketScreen.do.selectOrder("-0001");
ProductScreen.check.productIsDisplayed("Desk Pad");
ProductScreen.check.selectedOrderlineHas("Desk Pad", "1.0", "2.0");
// Select order 2, should be at Payment Screen
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0002");
PaymentScreen.check.emptyPaymentlines("12.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
// Select order 3, should be at Receipt Screen
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0003");
ReceiptScreen.check.totalAmountContains("30.0");
// Pay order 1, with change
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0001");
ProductScreen.check.isShown();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "20");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.totalAmountContains("2.0");
// Order 1 now should have Receipt status
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0001", "Receipt");
// Select order 3, should still be at Receipt Screen
// and the total amount doesn't change.
TicketScreen.do.selectOrder("-0003");
ReceiptScreen.check.totalAmountContains("30.0");
// click next screen on order 3
// then delete the new empty order
ReceiptScreen.do.clickNextOrder();
ProductScreen.check.orderIsEmpty();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0004");
TicketScreen.do.deleteOrder("-0001");
// After deleting order 1 above, order 2 became
// the 2nd-row order and it has payment status
TicketScreen.check.nthRowContains(2, "Payment");
TicketScreen.do.deleteOrder("-0002");
Chrome.do.confirmPopup();
TicketScreen.do.clickNewTicket();
// Invoice an order
ProductScreen.exec.addOrderline("Whiteboard Pen", "5", "6");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickInvoiceButton();
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
registry.category("web_tour.tours").add("ChromeTour", { test: true, url: "/pos/ui", steps: getSteps() });
registry
.category("web_tour.tours")
.add("ChromeTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
// Order 1 is at Product Screen
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Desk Pad", "1", "2", "2.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0001", "Ongoing");
// Order 2 is at Payment Screen
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Monitor Stand", "3", "4", "12.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0002", "Payment");
// Order 3 is at Receipt Screen
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Whiteboard Pen", "5", "6", "30.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0003", "Receipt");
// Select order 1, should be at Product Screen
TicketScreen.do.selectOrder("-0001");
ProductScreen.check.productIsDisplayed("Desk Pad");
ProductScreen.check.selectedOrderlineHas("Desk Pad", "1.0", "2.0");
// Select order 2, should be at Payment Screen
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0002");
PaymentScreen.check.emptyPaymentlines("12.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
// Select order 3, should be at Receipt Screen
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0003");
ReceiptScreen.check.totalAmountContains("30.0");
// Pay order 1, with change
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0001");
ProductScreen.check.isShown();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "20");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.totalAmountContains("2.0");
// Order 1 now should have Receipt status
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.checkStatus("-0001", "Receipt");
// Select order 3, should still be at Receipt Screen
// and the total amount doesn't change.
TicketScreen.do.selectOrder("-0003");
ReceiptScreen.check.totalAmountContains("30.0");
// click next screen on order 3
// then delete the new empty order
ReceiptScreen.do.clickNextOrder();
ProductScreen.check.orderIsEmpty();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0004");
TicketScreen.do.deleteOrder("-0001");
// After deleting order 1 above, order 2 became
// the 2nd-row order and it has payment status
TicketScreen.check.nthRowContains(2, "Payment");
TicketScreen.do.deleteOrder("-0002");
Chrome.do.confirmPopup();
TicketScreen.do.clickNewTicket();
// Invoice an order
ProductScreen.exec.addOrderline("Whiteboard Pen", "5", "6");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickInvoiceButton();
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
return getSteps();
}
});
@@ -6,20 +6,28 @@ import { ReceiptScreen } from "@point_of_sale/../tests/tours/helpers/ReceiptScre
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Zero Amount Product");
ProductScreen.check.selectedOrderlineHas("Zero Amount Product", "1.0", "1.0");
ProductScreen.do.pressNumpad("+/- 1");
ProductScreen.check.selectedOrderlineHas("Zero Amount Product", "-1.0", "-1.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.00");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
registry.category("web_tour.tours").add("FixedTaxNegativeQty", { test: true, url: "/pos/ui", steps: getSteps() });
registry
.category("web_tour.tours")
.add("FixedTaxNegativeQty", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Zero Amount Product");
ProductScreen.check.selectedOrderlineHas("Zero Amount Product", "1.0", "1.0");
ProductScreen.do.pressNumpad("+/- 1");
ProductScreen.check.selectedOrderlineHas("Zero Amount Product", "-1.0", "-1.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.00");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
return getSteps();
}
});
@@ -8,266 +8,305 @@ import { ReceiptScreen } from "@point_of_sale/../tests/tours/helpers/ReceiptScre
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
registry
.category("web_tour.tours")
.add("PaymentScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.emptyPaymentlines("52.8");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "11");
PaymentScreen.check.selectedPaymentlineHas("Cash", "11.00");
PaymentScreen.check.remainingIs("41.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
// remove the selected paymentline with multiple backspace presses
PaymentScreen.do.pressNumpad("Backspace Backspace");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "0");
PaymentScreen.check.selectedPaymentlineHas("Cash", "0.00");
PaymentScreen.do.clickPaymentlineDelButton("Cash", "0", true);
PaymentScreen.check.emptyPaymentlines("52.8");
// Pay with bank, the selected line should have full amount
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
// remove the line using the delete button
PaymentScreen.do.clickPaymentlineDelButton("Bank", "52.8");
// Use +10 and +50 to increment the amount of the paymentline
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.pressNumpad("+10");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "10");
PaymentScreen.check.remainingIs("42.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.pressNumpad("+50");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "60");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("7.2");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickPaymentlineDelButton("Cash", "60.0");
// Multiple paymentlines
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.pressNumpad("1");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "1");
PaymentScreen.check.remainingIs("51.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.fillPaymentLineAmountMobile("Bank", "5");
PaymentScreen.do.pressNumpad("5");
PaymentScreen.check.remainingIs("46.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.emptyPaymentlines("52.8");
return getSteps();
}
});
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "11");
PaymentScreen.check.selectedPaymentlineHas("Cash", "11.00");
PaymentScreen.check.remainingIs("41.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
// remove the selected paymentline with multiple backspace presses
PaymentScreen.do.pressNumpad("Backspace Backspace");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "0");
PaymentScreen.check.selectedPaymentlineHas("Cash", "0.00");
PaymentScreen.do.clickPaymentlineDelButton("Cash", "0", true);
PaymentScreen.check.emptyPaymentlines("52.8");
// Pay with bank, the selected line should have full amount
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
// remove the line using the delete button
PaymentScreen.do.clickPaymentlineDelButton("Bank", "52.8");
// Use +10 and +50 to increment the amount of the paymentline
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.pressNumpad("+10");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "10");
PaymentScreen.check.remainingIs("42.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.pressNumpad("+50");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "60");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("7.2");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickPaymentlineDelButton("Cash", "60.0");
// Multiple paymentlines
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.pressNumpad("1");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "1");
PaymentScreen.check.remainingIs("51.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.fillPaymentLineAmountMobile("Bank", "5");
PaymentScreen.do.pressNumpad("5");
PaymentScreen.check.remainingIs("46.8");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
registry
.category("web_tour.tours")
.add("PaymentScreenTour2", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Letter Tray", "1", "10");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.enterPaymentLineAmount("Bank", "1000");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PaymentScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Letter Tray", "1", "10");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.enterPaymentLineAmount("Bank", "1000");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
.add("PaymentScreenRoundingUp", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("2.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test", "-1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("-2.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PaymentScreenTour2", { test: true, url: "/pos/ui", steps: getSteps() });
.add("PaymentScreenRoundingDown", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.95");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test", "-1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("-1.95");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("2.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test", "-1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("-2.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PaymentScreenRoundingUp", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.95");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test", "-1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("-1.95");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
.add("PaymentScreenRoundingHalfUp", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test 1.2", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test 1.25", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.5");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test 1.4", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.5");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test 1.2", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.pressNumpad("2");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "2");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("1.0");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PaymentScreenRoundingDown", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test 1.2", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test 1.25", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.5");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test 1.4", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.5");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Product Test 1.2", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.00");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.pressNumpad("2");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "2");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("1.0");
.add("PaymentScreenRoundingHalfUpCashAndBank", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test 40", "1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("40.00");
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.pressNumpad("3 8");
PaymentScreen.do.fillPaymentLineAmountMobile("Bank", "38");
PaymentScreen.check.remainingIs("2.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.do.clickInvoiceButton();
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.do.clickNextOrder();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test 41", "1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("41.00");
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.pressNumpad("3 8");
PaymentScreen.do.fillPaymentLineAmountMobile("Bank", "38");
PaymentScreen.check.remainingIs("3.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.do.clickInvoiceButton();
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PaymentScreenRoundingHalfUp", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test 40", "1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("40.00");
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.pressNumpad("3 8");
PaymentScreen.do.fillPaymentLineAmountMobile("Bank", "38");
PaymentScreen.check.remainingIs("2.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.do.clickInvoiceButton();
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.do.clickNextOrder();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test 41", "1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("41.00");
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.pressNumpad("3 8");
PaymentScreen.do.fillPaymentLineAmountMobile("Bank", "38");
PaymentScreen.check.remainingIs("3.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.do.clickInvoiceButton();
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
registry.category("web_tour.tours").add("PaymentScreenRoundingHalfUpCashAndBank", {
test: true,
url: "/pos/ui",
steps: getSteps(),
});
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.95");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "5");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("3.05");
PaymentScreen.check.totalDueIs("1.95");
registry
.category("web_tour.tours")
.add("PaymentScreenTotalDueWithOverPayment", { test: true, url: "/pos/ui", steps: getSteps() });
.add("PaymentScreenTotalDueWithOverPayment", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Product Test", "1");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("1.95");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "5");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("3.05");
PaymentScreen.check.totalDueIs("1.95");
return getSteps()
}
});
@@ -5,73 +5,80 @@ import { ProductConfigurator } from "@point_of_sale/../tests/tours/helpers/Produ
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
ProductScreen.do.confirmOpeningPopup();
// Go by default to home category
ProductScreen.do.clickHomeCategory();
// Click on Configurable Chair product
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.check.isShown();
// Cancel configuration, not product should be in order
ProductConfigurator.do.cancelAttributes();
ProductScreen.check.orderIsEmpty();
// Click on Configurable Chair product
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.check.isShown();
// Pick Color
ProductConfigurator.do.pickColor("Red");
// Pick Radio
ProductConfigurator.do.pickSelect("Metal");
// Pick Select
ProductConfigurator.do.pickRadio("Other");
// Fill in custom attribute
ProductConfigurator.do.fillCustomAttribute("Custom Fabric");
// Confirm configuration
ProductConfigurator.do.confirmAttributes();
// Check that the product has been added to the order with correct attributes and price
ProductScreen.check.selectedOrderlineHas(
"Configurable Chair (Red, Metal, Other: Custom Fabric)",
"1.0",
"11.0"
);
// Orderlines with the same attributes should be merged
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.do.pickColor("Red");
ProductConfigurator.do.pickSelect("Metal");
ProductConfigurator.do.pickRadio("Other");
ProductConfigurator.do.fillCustomAttribute("Custom Fabric");
ProductConfigurator.do.confirmAttributes();
ProductScreen.check.selectedOrderlineHas(
"Configurable Chair (Red, Metal, Other: Custom Fabric)",
"2.0",
"22.0"
);
// Orderlines with different attributes shouldn't be merged
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.do.pickColor("Blue");
ProductConfigurator.do.pickSelect("Metal");
ProductConfigurator.do.pickRadio("Leather");
ProductConfigurator.do.confirmAttributes();
ProductScreen.check.selectedOrderlineHas(
"Configurable Chair (Blue, Metal, Leather)",
"1.0",
"10.0"
);
registry.category("web_tour.tours").add("ProductConfiguratorTour", { test: true, url: "/pos/ui", steps: getSteps() });
registry
.category("web_tour.tours")
.add("ProductConfiguratorTour", {
test: true,
url: "/pos/ui",
steps: () => {
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
ProductScreen.do.confirmOpeningPopup();
// Go by default to home category
ProductScreen.do.clickHomeCategory();
// Click on Configurable Chair product
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.check.isShown();
// Cancel configuration, not product should be in order
ProductConfigurator.do.cancelAttributes();
ProductScreen.check.orderIsEmpty();
// Click on Configurable Chair product
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.check.isShown();
// Pick Color
ProductConfigurator.do.pickColor("Red");
// Pick Radio
ProductConfigurator.do.pickSelect("Metal");
// Pick Select
ProductConfigurator.do.pickRadio("Other");
// Fill in custom attribute
ProductConfigurator.do.fillCustomAttribute("Custom Fabric");
// Confirm configuration
ProductConfigurator.do.confirmAttributes();
// Check that the product has been added to the order with correct attributes and price
ProductScreen.check.selectedOrderlineHas(
"Configurable Chair (Red, Metal, Other: Custom Fabric)",
"1.0",
"11.0"
);
// Orderlines with the same attributes should be merged
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.do.pickColor("Red");
ProductConfigurator.do.pickSelect("Metal");
ProductConfigurator.do.pickRadio("Other");
ProductConfigurator.do.fillCustomAttribute("Custom Fabric");
ProductConfigurator.do.confirmAttributes();
ProductScreen.check.selectedOrderlineHas(
"Configurable Chair (Red, Metal, Other: Custom Fabric)",
"2.0",
"22.0"
);
// Orderlines with different attributes shouldn't be merged
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Configurable Chair");
ProductConfigurator.do.pickColor("Blue");
ProductConfigurator.do.pickSelect("Metal");
ProductConfigurator.do.pickRadio("Leather");
ProductConfigurator.do.confirmAttributes();
ProductScreen.check.selectedOrderlineHas(
"Configurable Chair (Blue, Metal, Leather)",
"1.0",
"10.0"
);
return getSteps();
}
});
@@ -7,156 +7,171 @@ import { TextAreaPopup } from "@point_of_sale/../tests/tours/helpers/TextAreaPop
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
registry.category("web_tour.tours").add("ProductScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
// Go by default to home category
ProductScreen.do.clickHomeCategory();
// Clicking product multiple times should increment quantity
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.0", "5.10");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "2.0", "10.20");
// Clicking product should add new orderline and select the orderline
// If orderline exists, increment the quantity
ProductScreen.do.clickDisplayedProduct("Letter Tray");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "1.0", "5.28");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "3.0", "15.30");
// Check effects of clicking numpad buttons
ProductScreen.do.clickOrderline("Letter Tray", "1");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "0.0", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "3", "15.30");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "0.0", "0.0");
ProductScreen.do.pressNumpad("1");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.0", "5.1");
ProductScreen.do.pressNumpad("2");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "12.0", "61.2");
ProductScreen.do.pressNumpad("3");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.0", "627.3");
ProductScreen.do.pressNumpad(". 5");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "629.85");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("1");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "123.5");
ProductScreen.do.pressNumpad("1 .");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "1,358.5");
ProductScreen.do.pressNumpad("Disc");
ProductScreen.check.modeIsActive("Disc");
ProductScreen.do.pressNumpad("5 .");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "1,290.58");
ProductScreen.do.pressNumpad("Qty");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.orderIsEmpty();
// Check different subcategories
ProductScreen.do.clickSubcategory("Desks");
ProductScreen.check.productIsDisplayed("Desk Pad");
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickSubcategory("Miscellaneous");
ProductScreen.check.productIsDisplayed("Whiteboard Pen");
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickSubcategory("Chairs");
ProductScreen.check.productIsDisplayed("Letter Tray");
ProductScreen.do.clickHomeCategory();
// Add two orderlines and update quantity
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.do.clickDisplayedProduct("Wall Shelf Unit");
ProductScreen.do.clickOrderline("Whiteboard Pen", "1.0");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.0");
ProductScreen.do.pressNumpad("2");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.0");
ProductScreen.do.clickOrderline("Wall Shelf Unit", "1.0");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "1.0");
ProductScreen.do.pressNumpad("2");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "2.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.orderIsEmpty();
// Add multiple orderlines then delete each of them until empty
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.do.clickDisplayedProduct("Wall Shelf Unit");
ProductScreen.do.clickDisplayedProduct("Small Shelf");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.do.clickDisplayedProduct("Monitor Stand");
ProductScreen.do.clickOrderline("Whiteboard Pen", "1.0");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.clickOrderline("Wall Shelf Unit", "1.0");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.clickOrderline("Small Shelf", "1.0");
ProductScreen.check.selectedOrderlineHas("Small Shelf", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Small Shelf", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.clickOrderline("Magnetic Board", "1.0");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.orderIsEmpty();
// Test OrderlineCustomerNoteButton
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.0");
ProductScreen.do.clickOrderlineCustomerNoteButton();
TextAreaPopup.check.isShown();
TextAreaPopup.do.inputText("Test customer note");
TextAreaPopup.do.clickConfirm();
ProductScreen.check.orderlineHasCustomerNote("Desk Organizer", "1", "Test customer note");
return getSteps();
}
});
// Go by default to home category
ProductScreen.do.clickHomeCategory();
registry.category("web_tour.tours").add("FiscalPositionNoTax", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct('Test Product');
ProductScreen.check.totalAmountIs('100.00');
ProductScreen.do.changeFiscalPosition('No Tax');
ProductScreen.check.noDiscountApplied("100.00");
ProductScreen.check.totalAmountIs('86.96');
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.check.remainingIs('0.00');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
ReceiptScreen.check.noOrderlineContainsDiscount();
return getSteps()
}
});
// Clicking product multiple times should increment quantity
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.0", "5.10");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "2.0", "10.20");
// Clicking product should add new orderline and select the orderline
// If orderline exists, increment the quantity
ProductScreen.do.clickDisplayedProduct("Letter Tray");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "1.0", "5.28");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "3.0", "15.30");
// Check effects of clicking numpad buttons
ProductScreen.do.clickOrderline("Letter Tray", "1");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "0.0", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "3", "15.30");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "0.0", "0.0");
ProductScreen.do.pressNumpad("1");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.0", "5.1");
ProductScreen.do.pressNumpad("2");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "12.0", "61.2");
ProductScreen.do.pressNumpad("3");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.0", "627.3");
ProductScreen.do.pressNumpad(". 5");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "629.85");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("1");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "123.5");
ProductScreen.do.pressNumpad("1 .");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "1,358.5");
ProductScreen.do.pressNumpad("Disc");
ProductScreen.check.modeIsActive("Disc");
ProductScreen.do.pressNumpad("5 .");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "123.5", "1,290.58");
ProductScreen.do.pressNumpad("Qty");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.orderIsEmpty();
// Check different subcategories
ProductScreen.do.clickSubcategory("Desks");
ProductScreen.check.productIsDisplayed("Desk Pad");
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickSubcategory("Miscellaneous");
ProductScreen.check.productIsDisplayed("Whiteboard Pen");
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickSubcategory("Chairs");
ProductScreen.check.productIsDisplayed("Letter Tray");
ProductScreen.do.clickHomeCategory();
// Add two orderlines and update quantity
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.do.clickDisplayedProduct("Wall Shelf Unit");
ProductScreen.do.clickOrderline("Whiteboard Pen", "1.0");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.0");
ProductScreen.do.pressNumpad("2");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.0");
ProductScreen.do.clickOrderline("Wall Shelf Unit", "1.0");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "1.0");
ProductScreen.do.pressNumpad("2");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "2.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.orderIsEmpty();
// Add multiple orderlines then delete each of them until empty
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.do.clickDisplayedProduct("Wall Shelf Unit");
ProductScreen.do.clickDisplayedProduct("Small Shelf");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.do.clickDisplayedProduct("Monitor Stand");
ProductScreen.do.clickOrderline("Whiteboard Pen", "1.0");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.clickOrderline("Wall Shelf Unit", "1.0");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.clickOrderline("Small Shelf", "1.0");
ProductScreen.check.selectedOrderlineHas("Small Shelf", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Small Shelf", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.clickOrderline("Magnetic Board", "1.0");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "0.0");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.orderIsEmpty();
// Test OrderlineCustomerNoteButton
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.0");
ProductScreen.do.clickOrderlineCustomerNoteButton();
TextAreaPopup.check.isShown();
TextAreaPopup.do.inputText("Test customer note");
TextAreaPopup.do.clickConfirm();
ProductScreen.check.orderlineHasCustomerNote("Desk Organizer", "1", "Test customer note");
registry.category("web_tour.tours").add("ProductScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct('Test Product');
ProductScreen.check.totalAmountIs('100.00');
ProductScreen.do.changeFiscalPosition('No Tax');
ProductScreen.check.noDiscountApplied("100.00");
ProductScreen.check.totalAmountIs('86.96');
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.check.remainingIs('0.00');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
ReceiptScreen.check.noOrderlineContainsDiscount();
registry.category("web_tour.tours").add("FiscalPositionNoTax", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.enterOpeningAmount('90');
ProductScreen.do.confirmOpeningPopup();
ProductScreen.check.checkSecondCashClosingDetailsLineAmount('10.00', '-');
registry.category("web_tour.tours").add("CashClosingDetails", { test: true, url: "/pos/ui", steps: getSteps() });
registry.category("web_tour.tours").add("CashClosingDetails", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.enterOpeningAmount('90');
ProductScreen.do.confirmOpeningPopup();
ProductScreen.check.checkSecondCashClosingDetailsLineAmount('10.00', '-');
return getSteps()
}
});
@@ -9,105 +9,119 @@ import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/util
import { registry } from "@web/core/registry";
import { nbsp } from "@web/core/utils/strings";
startSteps();
// press close button in receipt screen
ProductScreen.exec.addOrderline("Letter Tray", "10", "5");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
// letter tray has 10% tax (search SRC)
ReceiptScreen.check.totalAmountContains("55.0");
ReceiptScreen.do.clickNextOrder();
// send email in receipt screen
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Desk Pad", "6", "5", "30.0");
ProductScreen.exec.addOrderline("Whiteboard Pen", "6", "6", "36.0");
ProductScreen.exec.addOrderline("Monitor Stand", "6", "1", "6.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "70");
PaymentScreen.check.remainingIs("2.0");
PaymentScreen.do.pressNumpad("0");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "700");
PaymentScreen.check.remainingIs("0.00");
PaymentScreen.check.changeIs("628.0");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.check.totalAmountContains("72.0");
ReceiptScreen.do.setEmail("test@receiptscreen.com");
ReceiptScreen.do.clickSend();
ReceiptScreen.check.emailIsSuccessful();
ReceiptScreen.do.clickNextOrder();
// order with tip
// check if tip amount is displayed
ProductScreen.exec.addOrderline("Desk Pad", "6", "5");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickTipButton();
NumberPopup.do.enterValue("1");
NumberPopup.check.inputShownIs("1");
NumberPopup.do.clickConfirm();
PaymentScreen.check.emptyPaymentlines("31.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.check.totalAmountContains(`$${nbsp}30.00 + $${nbsp}1.00 tip`);
ReceiptScreen.do.clickNextOrder();
// Test customer note in receipt
ProductScreen.exec.addOrderline("Desk Pad", "1", "5");
ProductScreen.exec.addCustomerNote("Test customer note");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.customerNoteIsThere("Test customer note");
registry
.category("web_tour.tours")
.add("ReceiptScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Test Product", "1");
ProductScreen.do.selectPriceList("special_pricelist");
ProductScreen.check.discountOriginalPriceIs("7.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.discountAmountIs("0.7");
registry.category("web_tour.tours").add("ReceiptScreenDiscountWithPricelistTour", {
test: true,
url: "/pos/ui",
steps: getSteps(),
.add("ReceiptScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
// press close button in receipt screen
ProductScreen.exec.addOrderline("Letter Tray", "10", "5");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
// letter tray has 10% tax (search SRC)
ReceiptScreen.check.totalAmountContains("55.0");
ReceiptScreen.do.clickNextOrder();
// send email in receipt screen
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Desk Pad", "6", "5", "30.0");
ProductScreen.exec.addOrderline("Whiteboard Pen", "6", "6", "36.0");
ProductScreen.exec.addOrderline("Monitor Stand", "6", "1", "6.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "70");
PaymentScreen.check.remainingIs("2.0");
PaymentScreen.do.pressNumpad("0");
PaymentScreen.do.fillPaymentLineAmountMobile("Cash", "700");
PaymentScreen.check.remainingIs("0.00");
PaymentScreen.check.changeIs("628.0");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.check.totalAmountContains("72.0");
ReceiptScreen.do.setEmail("test@receiptscreen.com");
ReceiptScreen.do.clickSend();
ReceiptScreen.check.emailIsSuccessful();
ReceiptScreen.do.clickNextOrder();
// order with tip
// check if tip amount is displayed
ProductScreen.exec.addOrderline("Desk Pad", "6", "5");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickTipButton();
NumberPopup.do.enterValue("1");
NumberPopup.check.inputShownIs("1");
NumberPopup.do.clickConfirm();
PaymentScreen.check.emptyPaymentlines("31.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.check.totalAmountContains(`$${nbsp}30.00 + $${nbsp}1.00 tip`);
ReceiptScreen.do.clickNextOrder();
// Test customer note in receipt
ProductScreen.exec.addOrderline("Desk Pad", "1", "5");
ProductScreen.exec.addCustomerNote("Test customer note");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.customerNoteIsThere("Test customer note");
return getSteps();
}
});
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Desk Pad", "5", "5");
ProductScreen.check.selectedOrderlineHas("Desk Pad", "5");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.do.clickNextOrder();
ProductScreen.check.isShown();
// Close the session
Chrome.do.clickMenuButton();
ProductScreen.do.clickCloseButton();
ProductScreen.do.closeWithCashAmount("25");
ProductScreen.check.cashDifferenceIs("0.00");
ProductScreen.do.clickCloseSession();
ProductScreen.check.lastClosingCashIs("25.00");
registry
.category("web_tour.tours")
.add("OrderPaidInCash", { test: true, url: "/pos/ui", steps: getSteps() });
.add("ReceiptScreenDiscountWithPricelistTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Test Product", "1");
ProductScreen.do.selectPriceList("special_pricelist");
ProductScreen.check.discountOriginalPriceIs("7.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.discountAmountIs("0.7");
return getSteps();
},
});
registry
.category("web_tour.tours")
.add("OrderPaidInCash", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Desk Pad", "5", "5");
ProductScreen.check.selectedOrderlineHas("Desk Pad", "5");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ReceiptScreen.check.receiptIsThere();
ReceiptScreen.do.clickNextOrder();
ProductScreen.check.isShown();
// Close the session
Chrome.do.clickMenuButton();
ProductScreen.do.clickCloseButton();
ProductScreen.do.closeWithCashAmount("25");
ProductScreen.check.cashDifferenceIs("0.00");
ProductScreen.do.clickCloseSession();
ProductScreen.check.lastClosingCashIs("25.00");
return getSteps();
}
});
@@ -10,159 +10,166 @@ import { Chrome } from "@point_of_sale/../tests/tours/helpers/ChromeTourMethods"
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
registry
.category("web_tour.tours")
.add("TicketScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "3");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0002");
Chrome.do.confirmPopup();
TicketScreen.do.clickDiscard();
ProductScreen.check.orderIsEmpty();
ProductScreen.exec.addOrderline("Desk Pad", "1", "2");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0001");
Chrome.do.confirmPopup();
TicketScreen.do.clickDiscard();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "-0003");
TicketScreen.do.clickDiscard();
ProductScreen.exec.addOrderline("Desk Pad", "1", "2");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "Nicole Ford");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "3");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Brandon Freeman");
ProductScreen.do.clickPayButton();
PaymentScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(3, "Brandon Freeman");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "2", "4");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(4, "Receipt");
TicketScreen.do.selectFilter("Receipt");
TicketScreen.check.nthRowContains(2, "Receipt");
TicketScreen.do.selectFilter("Payment");
TicketScreen.check.nthRowContains(2, "Payment");
TicketScreen.do.selectFilter("Ongoing");
TicketScreen.check.nthRowContains(2, "Ongoing");
TicketScreen.do.selectFilter("All active orders");
TicketScreen.check.nthRowContains(4, "Receipt");
TicketScreen.do.search("Customer", "Nicole");
TicketScreen.check.nthRowContains(2, "Nicole");
TicketScreen.do.search("Customer", "Brandon");
TicketScreen.check.nthRowContains(2, "Brandon");
TicketScreen.do.search("Receipt Number", "-0005");
TicketScreen.check.nthRowContains(2, "Receipt");
// Close the TicketScreen to see the current order which is in ReceiptScreen.
// This is just to remove the search string in the search bar.
TicketScreen.do.clickDiscard();
ReceiptScreen.check.isShown();
// Open again the TicketScreen to check the Paid filter.
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectFilter("Paid");
TicketScreen.check.nthRowContains(2, "-0005");
// Pay the order that was in PaymentScreen.
TicketScreen.do.selectFilter("Payment");
TicketScreen.do.selectOrder("-0004");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickNextOrder();
ProductScreen.check.isShown();
// Check that the Paid filter will show the 2 synced orders.
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectFilter("Paid");
TicketScreen.check.nthRowContains(3, "Brandon Freeman");
TicketScreen.check.nthRowContains(2, "-0005");
// Invoice order
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.orderWidgetIsNotEmpty();
TicketScreen.do.clickControlButton("Invoice");
Chrome.do.confirmPopup();
PartnerListScreen.check.isShown();
PartnerListScreen.do.clickPartner("Colleen Diaz");
TicketScreen.check.partnerIs("Colleen Diaz");
// Reprint receipt
TicketScreen.do.clickControlButton("Print Receipt");
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickBack();
// When going back, the ticket screen should be in its previous state.
TicketScreen.check.filterIs("Paid");
// Test refund //
TicketScreen.do.clickDiscard();
ProductScreen.check.isShown();
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickRefund();
// Filter should be automatically 'Paid'.
TicketScreen.check.filterIs("Paid");
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.partnerIs("Colleen Diaz");
TicketScreen.do.clickOrderline("Desk Pad");
TicketScreen.do.pressNumpad("3");
// Error should show because 2 is more than the number
// that can be refunded.
ErrorPopup.do.clickConfirm();
TicketScreen.do.clickDiscard();
ProductScreen.do.goBackToMainScreen();
ProductScreen.check.isShown();
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0005");
TicketScreen.do.clickOrderline("Desk Pad");
TicketScreen.do.pressNumpad("1");
TicketScreen.check.toRefundTextContains("To Refund: 1.00");
TicketScreen.do.confirmRefund();
ProductScreen.do.goBackToMainScreen();
ProductScreen.check.isShown();
ProductScreen.check.selectedOrderlineHas("Desk Pad", "-1.00");
// Try changing the refund line to positive number.
// Error popup should show.
ProductScreen.do.pressNumpad("2");
ErrorPopup.do.clickConfirm();
// Change the refund line quantity to -3 -- not allowed
// so error popup.
ProductScreen.do.pressNumpad("+/- 3");
ErrorPopup.do.clickConfirm();
// Change the refund line quantity to -2 -- allowed.
ProductScreen.do.pressNumpad("+/- 2");
ProductScreen.check.selectedOrderlineHas("Desk Pad", "-2.00");
// Check if the amount being refunded changed to 2.
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.toRefundTextContains("Refunding 2.00");
TicketScreen.do.clickDiscard();
ProductScreen.do.goBackToMainScreen();
// Pay the refund order.
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickNextOrder();
// Check refunded quantity.
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.refundedNoteContains("2.00 Refunded");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "3");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0002");
Chrome.do.confirmPopup();
TicketScreen.do.clickDiscard();
ProductScreen.check.orderIsEmpty();
ProductScreen.exec.addOrderline("Desk Pad", "1", "2");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0001");
Chrome.do.confirmPopup();
TicketScreen.do.clickDiscard();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "-0003");
TicketScreen.do.clickDiscard();
ProductScreen.exec.addOrderline("Desk Pad", "1", "2");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Nicole Ford");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "Nicole Ford");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "3");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Brandon Freeman");
ProductScreen.do.clickPayButton();
PaymentScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(3, "Brandon Freeman");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "2", "4");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(4, "Receipt");
TicketScreen.do.selectFilter("Receipt");
TicketScreen.check.nthRowContains(2, "Receipt");
TicketScreen.do.selectFilter("Payment");
TicketScreen.check.nthRowContains(2, "Payment");
TicketScreen.do.selectFilter("Ongoing");
TicketScreen.check.nthRowContains(2, "Ongoing");
TicketScreen.do.selectFilter("All active orders");
TicketScreen.check.nthRowContains(4, "Receipt");
TicketScreen.do.search("Customer", "Nicole");
TicketScreen.check.nthRowContains(2, "Nicole");
TicketScreen.do.search("Customer", "Brandon");
TicketScreen.check.nthRowContains(2, "Brandon");
TicketScreen.do.search("Receipt Number", "-0005");
TicketScreen.check.nthRowContains(2, "Receipt");
// Close the TicketScreen to see the current order which is in ReceiptScreen.
// This is just to remove the search string in the search bar.
TicketScreen.do.clickDiscard();
ReceiptScreen.check.isShown();
// Open again the TicketScreen to check the Paid filter.
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectFilter("Paid");
TicketScreen.check.nthRowContains(2, "-0005");
// Pay the order that was in PaymentScreen.
TicketScreen.do.selectFilter("Payment");
TicketScreen.do.selectOrder("-0004");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickNextOrder();
ProductScreen.check.isShown();
// Check that the Paid filter will show the 2 synced orders.
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectFilter("Paid");
TicketScreen.check.nthRowContains(3, "Brandon Freeman");
TicketScreen.check.nthRowContains(2, "-0005");
// Invoice order
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.orderWidgetIsNotEmpty();
TicketScreen.do.clickControlButton("Invoice");
Chrome.do.confirmPopup();
PartnerListScreen.check.isShown();
PartnerListScreen.do.clickPartner("Colleen Diaz");
TicketScreen.check.partnerIs("Colleen Diaz");
// Reprint receipt
TicketScreen.do.clickControlButton("Print Receipt");
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickBack();
// When going back, the ticket screen should be in its previous state.
TicketScreen.check.filterIs("Paid");
// Test refund //
TicketScreen.do.clickDiscard();
ProductScreen.check.isShown();
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickRefund();
// Filter should be automatically 'Paid'.
TicketScreen.check.filterIs("Paid");
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.partnerIs("Colleen Diaz");
TicketScreen.do.clickOrderline("Desk Pad");
TicketScreen.do.pressNumpad("3");
// Error should show because 2 is more than the number
// that can be refunded.
ErrorPopup.do.clickConfirm();
TicketScreen.do.clickDiscard();
ProductScreen.do.goBackToMainScreen();
ProductScreen.check.isShown();
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0005");
TicketScreen.do.clickOrderline("Desk Pad");
TicketScreen.do.pressNumpad("1");
TicketScreen.check.toRefundTextContains("To Refund: 1.00");
TicketScreen.do.confirmRefund();
ProductScreen.do.goBackToMainScreen();
ProductScreen.check.isShown();
ProductScreen.check.selectedOrderlineHas("Desk Pad", "-1.00");
// Try changing the refund line to positive number.
// Error popup should show.
ProductScreen.do.pressNumpad("2");
ErrorPopup.do.clickConfirm();
// Change the refund line quantity to -3 -- not allowed
// so error popup.
ProductScreen.do.pressNumpad("+/- 3");
ErrorPopup.do.clickConfirm();
// Change the refund line quantity to -2 -- allowed.
ProductScreen.do.pressNumpad("+/- 2");
ProductScreen.check.selectedOrderlineHas("Desk Pad", "-2.00");
// Check if the amount being refunded changed to 2.
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.toRefundTextContains("Refunding 2.00");
TicketScreen.do.clickDiscard();
ProductScreen.do.goBackToMainScreen();
// Pay the refund order.
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickNextOrder();
// Check refunded quantity.
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0005");
TicketScreen.check.refundedNoteContains("2.00 Refunded");
registry.category("web_tour.tours").add("TicketScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
return getSteps();
}
});
@@ -353,4 +353,4 @@ steps = steps.concat([
},
]);
registry.category("web_tour.tours").add("pos_basic_order", { test: true, url: "/pos/ui", steps });
registry.category("web_tour.tours").add("pos_basic_order", { test: true, url: "/pos/ui", steps: () => steps });
@@ -324,4 +324,8 @@ steps = steps.concat([
},
]);
registry.category("web_tour.tours").add("pos_pricelist", { test: true, url: "/pos/ui", steps });
registry.category("web_tour.tours").add("pos_pricelist", {
test: true,
url: "/pos/ui",
steps: () => steps,
});
+1 -1
View File
@@ -5,7 +5,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('portal_load_homepage', {
test: true,
url: '/my',
steps: [
steps: () => [
{
content: "Check portal is loaded",
trigger: 'a[href*="/my/account"]:contains("Edit"):first',
+85 -77
View File
@@ -10,81 +10,89 @@ import { SelectionPopup } from "@point_of_sale/../tests/tours/helpers/SelectionP
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
registry
.category("web_tour.tours")
.add("PosHrTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
PosHr.check.loginScreenIsShown();
PosHr.do.clickLoginButton();
SelectionPopup.check.isShown();
SelectionPopup.check.hasSelectionItem("Pos Employee1");
SelectionPopup.check.hasSelectionItem("Pos Employee2");
SelectionPopup.check.hasSelectionItem("Mitchell Admin");
SelectionPopup.do.clickItem("Pos Employee1");
NumberPopup.check.isShown();
NumberPopup.do.enterValue("25");
NumberPopup.check.inputShownIs("••");
NumberPopup.do.pressNumpad("8 1");
NumberPopup.do.fillPopupValue("2581");
NumberPopup.check.inputShownIs("••••");
NumberPopup.do.clickConfirm();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
PosHr.do.clickLoginButton();
SelectionPopup.do.clickItem("Pos Employee1");
NumberPopup.check.isShown();
NumberPopup.do.enterValue("25");
NumberPopup.check.inputShownIs("••");
NumberPopup.do.pressNumpad("8 0");
NumberPopup.do.fillPopupValue("2580");
NumberPopup.check.inputShownIs("••••");
NumberPopup.do.clickConfirm();
ProductScreen.check.isShown();
ProductScreen.do.confirmOpeningPopup();
PosHr.check.cashierNameIs("Pos Employee1");
PosHr.do.clickCashierName();
SelectionPopup.do.clickItem("Mitchell Admin");
PosHr.check.cashierNameIs("Mitchell Admin");
Chrome.do.clickMenuButton();
PosHr.do.clickLockButton();
PosHr.do.clickLoginButton();
SelectionPopup.do.clickItem("Pos Employee2");
NumberPopup.do.enterValue("12");
NumberPopup.check.inputShownIs("••");
NumberPopup.do.pressNumpad("3 4");
NumberPopup.do.fillPopupValue("1234");
NumberPopup.check.inputShownIs("••••");
NumberPopup.do.clickConfirm();
ProductScreen.check.isShown();
ProductScreen.do.clickHomeCategory();
// Create orders and check if the ticket list has the right employee for each order
// order for employee 2
ProductScreen.exec.addOrderline("Desk Pad", "1", "2");
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "Pos Employee2");
// order for employee 1
Chrome.do.clickMenuButton();
PosHr.do.clickLockButton();
PosHr.exec.login("Pos Employee1", "2580");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "4");
ProductScreen.check.totalAmountIs("4.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "Pos Employee2");
TicketScreen.check.nthRowContains(3, "Pos Employee1");
// order for admin
PosHr.do.clickCashierName();
SelectionPopup.do.clickItem("Mitchell Admin");
PosHr.check.cashierNameIs("Mitchell Admin");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "8");
ProductScreen.check.totalAmountIs("8.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(4, "Mitchell Admin");
PosHr.check.loginScreenIsShown();
PosHr.do.clickLoginButton();
SelectionPopup.check.isShown();
SelectionPopup.check.hasSelectionItem("Pos Employee1");
SelectionPopup.check.hasSelectionItem("Pos Employee2");
SelectionPopup.check.hasSelectionItem("Mitchell Admin");
SelectionPopup.do.clickItem("Pos Employee1");
NumberPopup.check.isShown();
NumberPopup.do.enterValue("25");
NumberPopup.check.inputShownIs("••");
NumberPopup.do.pressNumpad("8 1");
NumberPopup.do.fillPopupValue("2581");
NumberPopup.check.inputShownIs("••••");
NumberPopup.do.clickConfirm();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
PosHr.do.clickLoginButton();
SelectionPopup.do.clickItem("Pos Employee1");
NumberPopup.check.isShown();
NumberPopup.do.enterValue("25");
NumberPopup.check.inputShownIs("••");
NumberPopup.do.pressNumpad("8 0");
NumberPopup.do.fillPopupValue("2580");
NumberPopup.check.inputShownIs("••••");
NumberPopup.do.clickConfirm();
ProductScreen.check.isShown();
ProductScreen.do.confirmOpeningPopup();
PosHr.check.cashierNameIs("Pos Employee1");
PosHr.do.clickCashierName();
SelectionPopup.do.clickItem("Mitchell Admin");
PosHr.check.cashierNameIs("Mitchell Admin");
Chrome.do.clickMenuButton();
PosHr.do.clickLockButton();
PosHr.do.clickLoginButton();
SelectionPopup.do.clickItem("Pos Employee2");
NumberPopup.do.enterValue("12");
NumberPopup.check.inputShownIs("••");
NumberPopup.do.pressNumpad("3 4");
NumberPopup.do.fillPopupValue("1234");
NumberPopup.check.inputShownIs("••••");
NumberPopup.do.clickConfirm();
ProductScreen.check.isShown();
ProductScreen.do.clickHomeCategory();
// Create orders and check if the ticket list has the right employee for each order
// order for employee 2
ProductScreen.exec.addOrderline("Desk Pad", "1", "2");
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "Pos Employee2");
// order for employee 1
Chrome.do.clickMenuButton();
PosHr.do.clickLockButton();
PosHr.exec.login("Pos Employee1", "2580");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "4");
ProductScreen.check.totalAmountIs("4.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "Pos Employee2");
TicketScreen.check.nthRowContains(3, "Pos Employee1");
// order for admin
PosHr.do.clickCashierName();
SelectionPopup.do.clickItem("Mitchell Admin");
PosHr.check.cashierNameIs("Mitchell Admin");
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Desk Pad", "1", "8");
ProductScreen.check.totalAmountIs("8.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(4, "Mitchell Admin");
registry.category("web_tour.tours").add("PosHrTour", { test: true, url: "/pos/ui", steps: getSteps() });
return getSteps();
}
});
@@ -9,97 +9,112 @@ import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/util
import { registry } from "@web/core/registry";
//#region EWalletProgramTour1
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Topup 50$ for partner_aaa
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
PosLoyalty.check.orderTotalIs("50.00");
ProductScreen.do.clickPayButton(false);
// If there's no partner, we asked to redirect to the partner list screen.
Chrome.do.confirmPopup();
PartnerListScreen.check.isShown();
PartnerListScreen.do.clickPartner("AAAAAAA");
PosLoyalty.exec.finalizeOrder("Cash", "50");
// Topup 10$ for partner_bbb
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
ProductScreen.exec.addOrderline("Top-up eWallet", "1", "10");
PosLoyalty.check.orderTotalIs("10.00");
PosLoyalty.exec.finalizeOrder("Cash", "10");
registry.category("web_tour.tours").add("EWalletProgramTour1", { test: true, url: "/pos/web", steps: getSteps() });
registry
.category("web_tour.tours")
.add("EWalletProgramTour1", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Topup 50$ for partner_aaa
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
PosLoyalty.check.orderTotalIs("50.00");
ProductScreen.do.clickPayButton(false);
// If there's no partner, we asked to redirect to the partner list screen.
Chrome.do.confirmPopup();
PartnerListScreen.check.isShown();
PartnerListScreen.do.clickPartner("AAAAAAA");
PosLoyalty.exec.finalizeOrder("Cash", "50");
// Topup 10$ for partner_bbb
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
ProductScreen.exec.addOrderline("Top-up eWallet", "1", "10");
PosLoyalty.check.orderTotalIs("10.00");
PosLoyalty.exec.finalizeOrder("Cash", "10");
return getSteps();
}
});
//#endregion
//#region EWalletProgramTour2
const getEWalletText = (suffix) => "eWallet" + (suffix !== "" ? ` ${suffix}` : "");
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Whiteboard Pen", "2", "6", "12.00");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
// Consume partner_bbb's full eWallet.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.exec.addOrderline("Desk Pad", "6", "6", "36.00");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("26.00");
PosLoyalty.exec.finalizeOrder("Cash", "26");
// Switching partners should work.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
ProductScreen.exec.addOrderline("Desk Pad", "2", "19", "38.00");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("0.00");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
PosLoyalty.check.orderTotalIs("38.00");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
// Refund with eWallet.
// - Make an order to refund.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
ProductScreen.exec.addOrderline("Whiteboard Pen", "1", "20", "20.00");
PosLoyalty.check.orderTotalIs("20.00");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// - Refund order.
ProductScreen.do.clickRefund();
TicketScreen.check.filterIs("Paid");
TicketScreen.do.selectOrder("-0004");
TicketScreen.check.partnerIs("BBBBBBB");
TicketScreen.do.confirmRefund();
ProductScreen.check.isShown();
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Refund") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Refund"));
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
registry.category("web_tour.tours").add("EWalletProgramTour2", { test: true, url: "/pos/web", steps: getSteps() });
registry
.category("web_tour.tours")
.add("EWalletProgramTour2", {
test: true,
url: "/pos/web",
steps: () => {
const getEWalletText = (suffix) => "eWallet" + (suffix !== "" ? ` ${suffix}` : "");
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Whiteboard Pen", "2", "6", "12.00");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
// Consume partner_bbb's full eWallet.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.exec.addOrderline("Desk Pad", "6", "6", "36.00");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("26.00");
PosLoyalty.exec.finalizeOrder("Cash", "26");
// Switching partners should work.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
ProductScreen.exec.addOrderline("Desk Pad", "2", "19", "38.00");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("0.00");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
PosLoyalty.check.orderTotalIs("38.00");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
// Refund with eWallet.
// - Make an order to refund.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
ProductScreen.exec.addOrderline("Whiteboard Pen", "1", "20", "20.00");
PosLoyalty.check.orderTotalIs("20.00");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// - Refund order.
ProductScreen.do.clickRefund();
TicketScreen.check.filterIs("Paid");
TicketScreen.do.selectOrder("-0004");
TicketScreen.check.partnerIs("BBBBBBB");
TicketScreen.do.confirmRefund();
ProductScreen.check.isShown();
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Refund") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Refund"));
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
return getSteps();
}
});
//#endregion
@@ -8,71 +8,96 @@ import { registry } from "@web/core/registry";
import { TicketScreen } from "@point_of_sale/../tests/tours/helpers/TicketScreenTourMethods";
//#region GiftCardProgramCreateSetTour1
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Gift Card");
PosLoyalty.check.orderTotalIs("50.00");
PosLoyalty.exec.finalizeOrder("Cash", "50");
registry
.category("web_tour.tours")
.add("GiftCardProgramCreateSetTour1", { test: true, url: "/pos/web", steps: getSteps() });
.add("GiftCardProgramCreateSetTour1", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Gift Card");
PosLoyalty.check.orderTotalIs("50.00");
PosLoyalty.exec.finalizeOrder("Cash", "50");
return getSteps();
}
});
//#endregion
//#region GiftCardProgramCreateSetTour2
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.do.enterCode("044123456");
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
registry
.category("web_tour.tours")
.add("GiftCardProgramCreateSetTour2", { test: true, url: "/pos/web", steps: getSteps() });
.add("GiftCardProgramCreateSetTour2", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.do.enterCode("044123456");
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
return getSteps();
}
});
//#endregion
//#region GiftCardProgramScanUseTour
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Pay the 5$ gift card.
ProductScreen.do.clickDisplayedProduct("Gift Card");
TextInputPopup.check.isShown();
TextInputPopup.do.inputText("044123456");
TextInputPopup.do.clickConfirm();
PosLoyalty.check.orderTotalIs("5.00");
PosLoyalty.exec.finalizeOrder("Cash", "5");
// Partially use the gift card. (4$)
ProductScreen.exec.addOrderline("Desk Pad", "2", "2", "4.0");
PosLoyalty.do.enterCode("044123456");
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
// Use the remaining of the gift card. (5$ - 4$ = 1$)
ProductScreen.exec.addOrderline("Whiteboard Pen", "6", "6", "36.0");
PosLoyalty.do.enterCode("044123456");
PosLoyalty.check.orderTotalIs("35.00");
PosLoyalty.exec.finalizeOrder("Cash", "35");
registry
.category("web_tour.tours")
.add("GiftCardProgramScanUseTour", { test: true, url: "/pos/web", steps: getSteps() });
.add("GiftCardProgramScanUseTour", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Pay the 5$ gift card.
ProductScreen.do.clickDisplayedProduct("Gift Card");
TextInputPopup.check.isShown();
TextInputPopup.do.inputText("044123456");
TextInputPopup.do.clickConfirm();
PosLoyalty.check.orderTotalIs("5.00");
PosLoyalty.exec.finalizeOrder("Cash", "5");
// Partially use the gift card. (4$)
ProductScreen.exec.addOrderline("Desk Pad", "2", "2", "4.0");
PosLoyalty.do.enterCode("044123456");
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
// Use the remaining of the gift card. (5$ - 4$ = 1$)
ProductScreen.exec.addOrderline("Whiteboard Pen", "6", "6", "36.0");
PosLoyalty.do.enterCode("044123456");
PosLoyalty.check.orderTotalIs("35.00");
PosLoyalty.exec.finalizeOrder("Cash", "35");
return getSteps();
}
});
//#endregion
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Magnetic Board", "1"); // 1.98
PosLoyalty.check.orderTotalIs("1.98");
PosLoyalty.exec.finalizeOrder("Cash", "20");
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0001");
TicketScreen.do.clickOrderline("Magnetic Board");
TicketScreen.do.pressNumpad("1");
TicketScreen.do.confirmRefund();
ProductScreen.check.isShown();
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "-1.00");
ProductScreen.exec.addOrderline("Gift Card", "1");
ProductScreen.check.selectedOrderlineHas("Gift Card", "1");
PosLoyalty.check.orderTotalIs("0.0");
registry
.category("web_tour.tours")
.add("GiftCardWithRefundtTour", { test: true, url: "/pos/web", steps: getSteps() });
.add("GiftCardWithRefundtTour", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Magnetic Board", "1"); // 1.98
PosLoyalty.check.orderTotalIs("1.98");
PosLoyalty.exec.finalizeOrder("Cash", "20");
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0001");
TicketScreen.do.clickOrderline("Magnetic Board");
TicketScreen.do.pressNumpad("1");
TicketScreen.do.confirmRefund();
ProductScreen.check.isShown();
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "-1.00");
ProductScreen.exec.addOrderline("Gift Card", "1");
ProductScreen.check.selectedOrderlineHas("Gift Card", "1");
PosLoyalty.check.orderTotalIs("0.0");
return getSteps();
}
});
@@ -6,71 +6,79 @@ import { SelectionPopup } from "@point_of_sale/../tests/tours/helpers/SelectionP
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
const getEWalletText = (suffix) => "eWallet" + (suffix !== "" ? ` ${suffix}` : "");
registry
.category("web_tour.tours")
.add("MultipleGiftWalletProgramsTour", {
test: true,
url: "/pos/web",
steps: () => {
const getEWalletText = (suffix) => "eWallet" + (suffix !== "" ? ` ${suffix}` : "");
startSteps();
// One card for gift_card_1.
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Gift Card");
SelectionPopup.check.hasSelectionItem("gift_card_1");
SelectionPopup.check.hasSelectionItem("gift_card_2");
SelectionPopup.do.clickItem("gift_card_1");
ProductScreen.check.selectedOrderlineHas("Gift Card");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("1 0");
PosLoyalty.check.orderTotalIs("10.00");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// One card for gift_card_1.
ProductScreen.do.clickDisplayedProduct("Gift Card");
SelectionPopup.do.clickItem("gift_card_2");
ProductScreen.check.selectedOrderlineHas("Gift Card");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("2 0");
PosLoyalty.check.orderTotalIs("20.00");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Top up ewallet_1 for AAAAAAA.
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
SelectionPopup.check.hasSelectionItem("ewallet_1");
SelectionPopup.check.hasSelectionItem("ewallet_2");
SelectionPopup.do.clickItem("ewallet_1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("3 0");
PosLoyalty.check.orderTotalIs("30.00");
PosLoyalty.exec.finalizeOrder("Cash", "30");
// Top up ewallet_2 for AAAAAAA.
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
SelectionPopup.do.clickItem("ewallet_2");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("4 0");
PosLoyalty.check.orderTotalIs("40.00");
PosLoyalty.exec.finalizeOrder("Cash", "40");
// Top up ewallet_1 for BBBBBBB.
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
SelectionPopup.do.clickItem("ewallet_1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
PosLoyalty.check.orderTotalIs("50.00");
PosLoyalty.exec.finalizeOrder("Cash", "50");
// Consume 12$ from ewallet_1 of AAAAAAA.
ProductScreen.exec.addOrderline("Whiteboard Pen", "2", "6", "12.00");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
SelectionPopup.check.hasSelectionItem("ewallet_1");
SelectionPopup.check.hasSelectionItem("ewallet_2");
SelectionPopup.do.clickItem("ewallet_1");
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
startSteps();
// One card for gift_card_1.
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Gift Card");
SelectionPopup.check.hasSelectionItem("gift_card_1");
SelectionPopup.check.hasSelectionItem("gift_card_2");
SelectionPopup.do.clickItem("gift_card_1");
ProductScreen.check.selectedOrderlineHas("Gift Card");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("1 0");
PosLoyalty.check.orderTotalIs("10.00");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// One card for gift_card_1.
ProductScreen.do.clickDisplayedProduct("Gift Card");
SelectionPopup.do.clickItem("gift_card_2");
ProductScreen.check.selectedOrderlineHas("Gift Card");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("2 0");
PosLoyalty.check.orderTotalIs("20.00");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Top up ewallet_1 for AAAAAAA.
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
SelectionPopup.check.hasSelectionItem("ewallet_1");
SelectionPopup.check.hasSelectionItem("ewallet_2");
SelectionPopup.do.clickItem("ewallet_1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("3 0");
PosLoyalty.check.orderTotalIs("30.00");
PosLoyalty.exec.finalizeOrder("Cash", "30");
// Top up ewallet_2 for AAAAAAA.
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
SelectionPopup.do.clickItem("ewallet_2");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
ProductScreen.do.pressNumpad("Price");
ProductScreen.check.modeIsActive("Price");
ProductScreen.do.pressNumpad("4 0");
PosLoyalty.check.orderTotalIs("40.00");
PosLoyalty.exec.finalizeOrder("Cash", "40");
// Top up ewallet_1 for BBBBBBB.
ProductScreen.do.clickDisplayedProduct("Top-up eWallet");
SelectionPopup.do.clickItem("ewallet_1");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("BBBBBBB");
PosLoyalty.check.orderTotalIs("50.00");
PosLoyalty.exec.finalizeOrder("Cash", "50");
// Consume 12$ from ewallet_1 of AAAAAAA.
ProductScreen.exec.addOrderline("Whiteboard Pen", "2", "6", "12.00");
PosLoyalty.check.eWalletButtonState({ highlighted: false });
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAAAAAA");
PosLoyalty.check.eWalletButtonState({ highlighted: true, text: getEWalletText("Pay") });
PosLoyalty.do.clickEWalletButton(getEWalletText("Pay"));
SelectionPopup.check.hasSelectionItem("ewallet_1");
SelectionPopup.check.hasSelectionItem("ewallet_2");
SelectionPopup.do.clickItem("ewallet_1");
PosLoyalty.check.orderTotalIs("0.00");
PosLoyalty.exec.finalizeOrder("Cash", "0");
registry.category("web_tour.tours").add("MultipleGiftWalletProgramsTour", { test: true, url: "/pos/web", steps: getSteps() });
return getSteps();
}
});
@@ -5,159 +5,184 @@ import { ProductScreen } from "@point_of_sale/../tests/tours/helpers/ProductScre
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
registry
.category("web_tour.tours")
.add("PosLoyaltyLoyaltyProgram1", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Order1: Generates 2 points.
ProductScreen.exec.addOrderline("Whiteboard Pen", "2");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
PosLoyalty.check.orderTotalIs("6.40");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Order2: Consumes points to get free product.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.00");
// At this point, Test Partner AAA has 4 points.
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "3.00");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("6.40");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Order3: Generate 4 points.
// - Initially gets free product, but was removed automatically by changing the
// number of items to zero.
// - It's impossible to checked here if the free product reward is really removed
// so we check in the backend the number of orders that consumed the reward.
ProductScreen.exec.addOrderline("Whiteboard Pen", "4");
PosLoyalty.check.orderTotalIs("12.80");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.pressNumpad("Backspace");
// At this point, the reward line should have been automatically removed
// because there is not enough points to purchase it. Unfortunately, we
// can't check that here.
PosLoyalty.check.orderTotalIs("0.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "3.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "4.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.check.orderTotalIs("12.80");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Order1: Generates 2 points.
ProductScreen.exec.addOrderline("Whiteboard Pen", "2");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
PosLoyalty.check.orderTotalIs("6.40");
PosLoyalty.exec.finalizeOrder("Cash", "10");
return getSteps();
}
});
// Order2: Consumes points to get free product.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.00");
// At this point, Test Partner AAA has 4 points.
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "3.00");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("6.40");
PosLoyalty.exec.finalizeOrder("Cash", "10");
registry
.category("web_tour.tours")
.add("PosLoyaltyLoyaltyProgram2", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
// Order1: Immediately set the customer to Test Partner AAA which has 4 points.
// - He has enough points to purchase a free product but since there is still
// no product in the order, reward button should not yet be highlighted.
// - Furthermore, clicking the reward product should not add it as reward product.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
// No item in the order, so reward button is off.
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("3.20");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Order2: Generate 4 points for Test Partner CCC.
// - Reference: Order2_CCC
// - But set Test Partner BBB first as the customer.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner BBB");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "3.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "4.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner CCC");
PosLoyalty.check.customerIs("Test Partner CCC");
PosLoyalty.check.orderTotalIs("12.80");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Order3: Generate 3 points for Test Partner BBB.
// - Reference: Order3_BBB
// - But set Test Partner CCC first as the customer.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner CCC");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.exec.addOrderline("Whiteboard Pen", "3");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner BBB");
PosLoyalty.check.customerIs("Test Partner BBB");
PosLoyalty.check.orderTotalIs("9.60");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Order4: Should not have reward because the customer will be removed.
// - Reference: Order4_no_reward
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner CCC");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
ProductScreen.do.clickPartnerButton();
// This deselects the customer.
PosLoyalty.do.unselectPartner();
PosLoyalty.check.customerIs("Customer");
PosLoyalty.check.orderTotalIs("6.40");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Order3: Generate 4 points.
// - Initially gets free product, but was removed automatically by changing the
// number of items to zero.
// - It's impossible to checked here if the free product reward is really removed
// so we check in the backend the number of orders that consumed the reward.
ProductScreen.exec.addOrderline("Whiteboard Pen", "4");
PosLoyalty.check.orderTotalIs("12.80");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.pressNumpad("Backspace");
// At this point, the reward line should have been automatically removed
// because there is not enough points to purchase it. Unfortunately, we
// can't check that here.
PosLoyalty.check.orderTotalIs("0.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "3.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "4.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
return getSteps();
}
});
PosLoyalty.check.orderTotalIs("12.80");
PosLoyalty.exec.finalizeOrder("Cash", "20");
registry
.category("web_tour.tours")
.add("PosLoyaltyLoyaltyProgram3", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Generates 10.2 points and use points to get the reward product with zero sale price
ProductScreen.exec.addOrderline('Desk Organizer', '2');
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer('Test Partner AAA');
// At this point, the free_product program is triggered.
// The reward button should be highlighted.
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
PosLoyalty.check.hasRewardLine('Free Product - Whiteboard Pen', '0.0', '1.00');
PosLoyalty.check.orderTotalIs('10.2');
PosLoyalty.exec.finalizeOrder('Cash', '10.2');
registry.category("web_tour.tours").add("PosLoyaltyLoyaltyProgram1", { test: true, url: "/pos/web", steps: getSteps() });
startSteps();
ProductScreen.do.clickHomeCategory();
// Order1: Immediately set the customer to Test Partner AAA which has 4 points.
// - He has enough points to purchase a free product but since there is still
// no product in the order, reward button should not yet be highlighted.
// - Furthermore, clicking the reward product should not add it as reward product.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner AAA");
// No item in the order, so reward button is off.
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("3.20");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Order2: Generate 4 points for Test Partner CCC.
// - Reference: Order2_CCC
// - But set Test Partner BBB first as the customer.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner BBB");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "2.00");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "3.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "4.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner CCC");
PosLoyalty.check.customerIs("Test Partner CCC");
PosLoyalty.check.orderTotalIs("12.80");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Order3: Generate 3 points for Test Partner BBB.
// - Reference: Order3_BBB
// - But set Test Partner CCC first as the customer.
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner CCC");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.exec.addOrderline("Whiteboard Pen", "3");
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner BBB");
PosLoyalty.check.customerIs("Test Partner BBB");
PosLoyalty.check.orderTotalIs("9.60");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Order4: Should not have reward because the customer will be removed.
// - Reference: Order4_no_reward
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
ProductScreen.check.selectedOrderlineHas("Whiteboard Pen", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("Test Partner CCC");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
ProductScreen.do.clickPartnerButton();
// This deselects the customer.
PosLoyalty.do.unselectPartner();
PosLoyalty.check.customerIs("Customer");
PosLoyalty.check.orderTotalIs("6.40");
PosLoyalty.exec.finalizeOrder("Cash", "10");
registry.category("web_tour.tours").add("PosLoyaltyLoyaltyProgram2", { test: true, url: "/pos/web", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Generates 10.2 points and use points to get the reward product with zero sale price
ProductScreen.exec.addOrderline('Desk Organizer', '2');
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer('Test Partner AAA');
// At this point, the free_product program is triggered.
// The reward button should be highlighted.
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
PosLoyalty.check.hasRewardLine('Free Product - Whiteboard Pen', '0.0', '1.00');
PosLoyalty.check.orderTotalIs('10.2');
PosLoyalty.exec.finalizeOrder('Cash', '10.2');
registry.category("web_tour.tours").add("PosLoyaltyLoyaltyProgram3", { test: true, url: "/pos/web", steps: getSteps() });
return getSteps();
}
});
@@ -6,181 +6,205 @@ import { SelectionPopup } from "@point_of_sale/../tests/tours/helpers/SelectionP
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Desk Organizer", "2");
// At this point, the free_product program is triggered.
// The reward button should be highlighted.
PosLoyalty.check.isRewardButtonHighlighted(true);
// Since the reward button is highlighted, clicking the reward product should be added as reward.
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "3.00");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-5.10", "1.00");
// In the succeeding 2 clicks on the product, it is considered as a regular product.
// In the third click, the product will be added as reward.
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "6.00");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-10.20", "2.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("25.50");
// Finalize order that consumed a reward.
PosLoyalty.exec.finalizeOrder("Cash", "30");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "2.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-5.10", "1.00");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "0.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "2.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
// Finalize order but without the reward.
// This step is important. When syncing the order, no reward should be synced.
PosLoyalty.check.orderTotalIs("10.20");
PosLoyalty.exec.finalizeOrder("Cash", "20");
ProductScreen.exec.addOrderline("Magnetic Board", "2");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
ProductScreen.do.clickOrderline("Magnetic Board", "3.00");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "3.00");
ProductScreen.do.pressNumpad("6");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "6.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-6.40", "2.00");
// Finalize order that consumed a reward.
PosLoyalty.check.orderTotalIs("11.88");
PosLoyalty.exec.finalizeOrder("Cash", "20");
ProductScreen.exec.addOrderline("Magnetic Board", "6");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickOrderline("Magnetic Board", "6.00");
ProductScreen.do.pressNumpad("Backspace");
// At this point, the reward should have been removed.
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "0.00");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "1.00");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "2.00");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "3.00");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("5.94");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Promotion: 2 items of shelves, get desk_pad/monitor_stand free
// This is the 5th order.
ProductScreen.do.clickDisplayedProduct("Wall Shelf Unit");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Small Shelf");
ProductScreen.check.selectedOrderlineHas("Small Shelf", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
// Click reward product. Should be automatically added as reward.
ProductScreen.do.clickDisplayedProduct("Desk Pad");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product", "-1.98", "1.00");
// Remove the reward line. The next steps will check if cashier
// can select from the different reward products.
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.do.pressNumpad("Backspace");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - [Desk Pad, Monitor Stand]");
SelectionPopup.check.hasSelectionItem("Monitor Stand");
SelectionPopup.check.hasSelectionItem("Desk Pad");
SelectionPopup.do.clickItem("Desk Pad");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product", "-1.98", "1.00");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.do.pressNumpad("Backspace");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - [Desk Pad, Monitor Stand]");
SelectionPopup.check.hasSelectionItem("Monitor Stand");
SelectionPopup.check.hasSelectionItem("Desk Pad");
SelectionPopup.do.clickItem("Monitor Stand");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.00", "3.19");
PosLoyalty.check.hasRewardLine("Free Product", "-3.19", "1.00");
PosLoyalty.check.orderTotalIs("4.81");
PosLoyalty.exec.finalizeOrder("Cash", "10");
registry
.category("web_tour.tours")
.add("PosLoyaltyFreeProductTour", { test: true, url: "/pos/web", steps: getSteps() });
startSteps();
.add("PosLoyaltyFreeProductTour", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Desk Organizer", "2");
// At this point, the free_product program is triggered.
// The reward button should be highlighted.
PosLoyalty.check.isRewardButtonHighlighted(true);
// Since the reward button is highlighted, clicking the reward product should be added as reward.
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "3.00");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-5.10", "1.00");
// In the succeeding 2 clicks on the product, it is considered as a regular product.
// In the third click, the product will be added as reward.
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "6.00");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-10.20", "2.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("25.50");
// Finalize order that consumed a reward.
PosLoyalty.exec.finalizeOrder("Cash", "30");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "2.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-5.10", "1.00");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "0.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "1.00");
ProductScreen.do.clickDisplayedProduct("Desk Organizer");
ProductScreen.check.selectedOrderlineHas("Desk Organizer", "2.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
// Finalize order but without the reward.
// This step is important. When syncing the order, no reward should be synced.
PosLoyalty.check.orderTotalIs("10.20");
PosLoyalty.exec.finalizeOrder("Cash", "20");
ProductScreen.exec.addOrderline("Magnetic Board", "2");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
ProductScreen.do.clickOrderline("Magnetic Board", "3.00");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "3.00");
ProductScreen.do.pressNumpad("6");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "6.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - Whiteboard Pen");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-6.40", "2.00");
// Finalize order that consumed a reward.
PosLoyalty.check.orderTotalIs("11.88");
PosLoyalty.exec.finalizeOrder("Cash", "20");
ProductScreen.exec.addOrderline("Magnetic Board", "6");
ProductScreen.do.clickDisplayedProduct("Whiteboard Pen");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
ProductScreen.do.clickOrderline("Magnetic Board", "6.00");
ProductScreen.do.pressNumpad("Backspace");
// At this point, the reward should have been removed.
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "0.00");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "1.00");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "2.00");
ProductScreen.do.clickDisplayedProduct("Magnetic Board");
ProductScreen.check.selectedOrderlineHas("Magnetic Board", "3.00");
PosLoyalty.check.hasRewardLine("Free Product - Whiteboard Pen", "-3.20", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.orderTotalIs("5.94");
PosLoyalty.exec.finalizeOrder("Cash", "10");
// Promotion: 2 items of shelves, get desk_pad/monitor_stand free
// This is the 5th order.
ProductScreen.do.clickDisplayedProduct("Wall Shelf Unit");
ProductScreen.check.selectedOrderlineHas("Wall Shelf Unit", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.do.clickDisplayedProduct("Small Shelf");
ProductScreen.check.selectedOrderlineHas("Small Shelf", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(true);
// Click reward product. Should be automatically added as reward.
ProductScreen.do.clickDisplayedProduct("Desk Pad");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product", "-1.98", "1.00");
// Remove the reward line. The next steps will check if cashier
// can select from the different reward products.
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.do.pressNumpad("Backspace");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - [Desk Pad, Monitor Stand]");
SelectionPopup.check.hasSelectionItem("Monitor Stand");
SelectionPopup.check.hasSelectionItem("Desk Pad");
SelectionPopup.do.clickItem("Desk Pad");
PosLoyalty.check.isRewardButtonHighlighted(false);
PosLoyalty.check.hasRewardLine("Free Product", "-1.98", "1.00");
ProductScreen.do.pressNumpad("Backspace");
ProductScreen.do.pressNumpad("Backspace");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.claimReward("Free Product - [Desk Pad, Monitor Stand]");
SelectionPopup.check.hasSelectionItem("Monitor Stand");
SelectionPopup.check.hasSelectionItem("Desk Pad");
SelectionPopup.do.clickItem("Monitor Stand");
PosLoyalty.check.isRewardButtonHighlighted(false);
ProductScreen.check.selectedOrderlineHas("Monitor Stand", "1.00", "3.19");
PosLoyalty.check.hasRewardLine("Free Product", "-3.19", "1.00");
PosLoyalty.check.orderTotalIs("4.81");
PosLoyalty.exec.finalizeOrder("Cash", "10");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAA Partner");
ProductScreen.exec.addOrderline("Test Product A", "1");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.clickRewardButton();
SelectionPopup.do.clickItem("Free Product - Test Product A");
PosLoyalty.check.hasRewardLine("Free Product - Test Product A", "-11.50", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PosLoyaltyFreeProductTour2", { test: true, url: "/pos/web", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct('Test Product A');
ProductScreen.check.selectedOrderlineHas('Test Product A', '1.00', '40.00');
ProductScreen.do.clickDisplayedProduct('Test Product B');
ProductScreen.check.selectedOrderlineHas('Test Product B', '1.00', '40.00');
PosLoyalty.do.clickRewardButton();
SelectionPopup.do.clickItem("$ 10 per order on specific products");
PosLoyalty.check.hasRewardLine('$ 10 per order on specific products', '-10.00', '1.00');
PosLoyalty.check.orderTotalIs('60.00');
.add("PosLoyaltyFreeProductTour2", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickPartnerButton();
ProductScreen.do.clickCustomer("AAA Partner");
ProductScreen.exec.addOrderline("Test Product A", "1");
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.clickRewardButton();
SelectionPopup.do.clickItem("Free Product - Test Product A");
PosLoyalty.check.hasRewardLine("Free Product - Test Product A", "-11.50", "1.00");
PosLoyalty.check.isRewardButtonHighlighted(false);
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PosLoyaltySpecificDiscountTour", { test: true, url: "/pos/web", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct('Test Product A');
ProductScreen.do.clickDisplayedProduct('Test Product C');
PosLoyalty.check.orderTotalIs('130.00');
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.clickRewardButton();
PosLoyalty.check.orderTotalIs('130.00');
.add("PosLoyaltySpecificDiscountTour", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct('Test Product A');
ProductScreen.check.selectedOrderlineHas('Test Product A', '1.00', '40.00');
ProductScreen.do.clickDisplayedProduct('Test Product B');
ProductScreen.check.selectedOrderlineHas('Test Product B', '1.00', '40.00');
PosLoyalty.do.clickRewardButton();
SelectionPopup.do.clickItem("$ 10 per order on specific products");
PosLoyalty.check.hasRewardLine('$ 10 per order on specific products', '-10.00', '1.00');
PosLoyalty.check.orderTotalIs('60.00');
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PosLoyaltySpecificDiscountWithFreeProductTour", { test: true, url: "/pos/web", steps: getSteps() });
.add("PosLoyaltySpecificDiscountWithFreeProductTour", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct('Test Product A');
ProductScreen.do.clickDisplayedProduct('Test Product C');
PosLoyalty.check.orderTotalIs('130.00');
PosLoyalty.check.isRewardButtonHighlighted(true);
PosLoyalty.do.clickRewardButton();
PosLoyalty.check.orderTotalIs('130.00');
return getSteps();
}
});
@@ -5,212 +5,240 @@ import { ProductScreen } from "@point_of_sale/../tests/tours/helpers/ProductScre
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// --- PoS Loyalty Tour Basic Part 1 ---
// Generate coupons for PosLoyaltyTour2.
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// basic order
// just accept the automatically applied promo program
// applied programs:
// - on cheapest product
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.88");
PosLoyalty.do.selectRewardLine("on the cheapest product");
PosLoyalty.check.orderTotalIs("13.12");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// remove the reward from auto promo program
// no applied programs
ProductScreen.exec.addOrderline("Whiteboard Pen", "6");
PosLoyalty.check.hasRewardLine("on the cheapest product", "-2.88");
PosLoyalty.check.orderTotalIs("16.32");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.check.orderTotalIs("19.2");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// order with coupon code from coupon program
// applied programs:
// - coupon program
ProductScreen.exec.addOrderline("Desk Organizer", "9");
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.59");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.check.orderTotalIs("45.90");
PosLoyalty.do.enterCode("invalid_code");
PosLoyalty.check.notificationMessageContains("invalid_code");
PosLoyalty.do.enterCode("1234");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-15.30");
PosLoyalty.exec.finalizeOrder("Cash", "50");
// Use coupon but eventually remove the reward
// applied programs:
// - on cheapest product
ProductScreen.exec.addOrderline("Letter Tray", "4");
ProductScreen.exec.addOrderline("Desk Organizer", "9");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-4.75");
PosLoyalty.check.orderTotalIs("62.27");
PosLoyalty.do.enterCode("5678");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-15.30");
PosLoyalty.check.orderTotalIs("46.97");
PosLoyalty.exec.removeRewardLine("Free Product");
PosLoyalty.check.orderTotalIs("62.27");
PosLoyalty.exec.finalizeOrder("Cash", "90");
// specific product discount
// applied programs:
// - on cheapest product
// - on specific products
ProductScreen.exec.addOrderline("Magnetic Board", "10"); // 1.98
ProductScreen.exec.addOrderline("Desk Organizer", "3"); // 5.1
ProductScreen.exec.addOrderline("Letter Tray", "4"); // 4.8 tax 10%
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-1.78");
PosLoyalty.check.orderTotalIs("54.44");
PosLoyalty.do.enterCode("promocode");
PosLoyalty.check.hasRewardLine("50% on specific products", "-16.66"); // 17.55 - 1.78*0.5
PosLoyalty.check.orderTotalIs("37.78");
PosLoyalty.exec.finalizeOrder("Cash", "50");
registry
.category("web_tour.tours")
.add("PosLoyaltyTour1", { test: true, url: "/pos/web", steps: getSteps() });
.add("PosLoyaltyTour1", {
test: true,
url: "/pos/web",
steps: () => {
// --- PoS Loyalty Tour Basic Part 1 ---
// Generate coupons for PosLoyaltyTour2.
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// basic order
// just accept the automatically applied promo program
// applied programs:
// - on cheapest product
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.88");
PosLoyalty.do.selectRewardLine("on the cheapest product");
PosLoyalty.check.orderTotalIs("13.12");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// remove the reward from auto promo program
// no applied programs
ProductScreen.exec.addOrderline("Whiteboard Pen", "6");
PosLoyalty.check.hasRewardLine("on the cheapest product", "-2.88");
PosLoyalty.check.orderTotalIs("16.32");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.check.orderTotalIs("19.2");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// order with coupon code from coupon program
// applied programs:
// - coupon program
ProductScreen.exec.addOrderline("Desk Organizer", "9");
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.59");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.check.orderTotalIs("45.90");
PosLoyalty.do.enterCode("invalid_code");
PosLoyalty.check.notificationMessageContains("invalid_code");
PosLoyalty.do.enterCode("1234");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-15.30");
PosLoyalty.exec.finalizeOrder("Cash", "50");
// Use coupon but eventually remove the reward
// applied programs:
// - on cheapest product
ProductScreen.exec.addOrderline("Letter Tray", "4");
ProductScreen.exec.addOrderline("Desk Organizer", "9");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-4.75");
PosLoyalty.check.orderTotalIs("62.27");
PosLoyalty.do.enterCode("5678");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-15.30");
PosLoyalty.check.orderTotalIs("46.97");
PosLoyalty.exec.removeRewardLine("Free Product");
PosLoyalty.check.orderTotalIs("62.27");
PosLoyalty.exec.finalizeOrder("Cash", "90");
// specific product discount
// applied programs:
// - on cheapest product
// - on specific products
ProductScreen.exec.addOrderline("Magnetic Board", "10"); // 1.98
ProductScreen.exec.addOrderline("Desk Organizer", "3"); // 5.1
ProductScreen.exec.addOrderline("Letter Tray", "4"); // 4.8 tax 10%
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-1.78");
PosLoyalty.check.orderTotalIs("54.44");
PosLoyalty.do.enterCode("promocode");
PosLoyalty.check.hasRewardLine("50% on specific products", "-16.66"); // 17.55 - 1.78*0.5
PosLoyalty.check.orderTotalIs("37.78");
PosLoyalty.exec.finalizeOrder("Cash", "50");
return getSteps();
}
});
// --- PoS Loyalty Tour Basic Part 2 ---
// Using the coupons generated from PosLoyaltyTour1.
startSteps();
ProductScreen.do.clickHomeCategory();
// Test that global discount and cheapest product discounts can be accumulated.
// Applied programs:
// - global discount
// - on cheapest discount
ProductScreen.exec.addOrderline("Desk Organizer", "10"); // 5.1
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.59");
ProductScreen.exec.addOrderline("Letter Tray", "4"); // 4.8 tax 10%
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.75");
PosLoyalty.do.enterCode("123456");
PosLoyalty.check.hasRewardLine("10% on your order", "-5.10");
PosLoyalty.check.hasRewardLine("10% on your order", "-1.64");
PosLoyalty.check.orderTotalIs("60.63"); //SUBTOTAL
PosLoyalty.exec.finalizeOrder("Cash", "70");
// Scanning coupon twice.
// Also apply global discount on top of free product to check if the
// calculated discount is correct.
// Applied programs:
// - coupon program (free product)
// - global discount
// - on cheapest discount
ProductScreen.exec.addOrderline("Desk Organizer", "11"); // 5.1 per item
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-4.59");
PosLoyalty.check.orderTotalIs("51.51");
// add global discount and the discount will be replaced
PosLoyalty.do.enterCode("345678");
PosLoyalty.check.hasRewardLine("10% on your order", "-5.15");
// add free product coupon (for qty=11, free=4)
// the discount should change after having free products
// it should go back to cheapest discount as it is higher
PosLoyalty.do.enterCode("5678");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-20.40");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-4.59");
// set quantity to 18
// free qty stays the same since the amount of points on the card only allows for 4 free products
ProductScreen.do.pressNumpad("Backspace 8");
PosLoyalty.check.hasRewardLine("10% on your order", "-6.68");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-20.40");
// scan the code again and check notification
PosLoyalty.do.enterCode("5678");
PosLoyalty.check.orderTotalIs("60.13");
PosLoyalty.exec.finalizeOrder("Cash", "65");
// Specific products discount (with promocode) and free product (1357)
// Applied programs:
// - discount on specific products
// - free product
ProductScreen.exec.addOrderline("Desk Organizer", "6"); // 5.1 per item
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.59");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.do.enterCode("promocode");
PosLoyalty.check.hasRewardLine("50% on specific products", "-15.30");
PosLoyalty.do.enterCode("1357");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-10.20");
PosLoyalty.check.hasRewardLine("50% on specific products", "-10.20");
PosLoyalty.check.orderTotalIs("10.20");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Check reset program
// Enter two codes and reset the programs.
// The codes should be checked afterwards. They should return to new.
// Applied programs:
// - cheapest product
ProductScreen.exec.addOrderline("Monitor Stand", "6"); // 3.19 per item
PosLoyalty.do.enterCode("098765");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.87");
PosLoyalty.check.hasRewardLine("10% on your order", "-1.63");
PosLoyalty.check.orderTotalIs("14.64");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.check.hasRewardLine("10% on your order", "-1.91");
PosLoyalty.check.orderTotalIs("17.23");
PosLoyalty.do.resetActivePrograms();
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.87");
PosLoyalty.check.orderTotalIs("16.27");
PosLoyalty.exec.finalizeOrder("Cash", "20");
registry
.category("web_tour.tours")
.add("PosLoyaltyTour2", {
test: true,
url: "/pos/web",
steps: () => {
// --- PoS Loyalty Tour Basic Part 2 ---
// Using the coupons generated from PosLoyaltyTour1.
startSteps();
ProductScreen.do.clickHomeCategory();
// Test that global discount and cheapest product discounts can be accumulated.
// Applied programs:
// - global discount
// - on cheapest discount
ProductScreen.exec.addOrderline("Desk Organizer", "10"); // 5.1
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.59");
ProductScreen.exec.addOrderline("Letter Tray", "4"); // 4.8 tax 10%
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.75");
PosLoyalty.do.enterCode("123456");
PosLoyalty.check.hasRewardLine("10% on your order", "-5.10");
PosLoyalty.check.hasRewardLine("10% on your order", "-1.64");
PosLoyalty.check.orderTotalIs("60.63"); //SUBTOTAL
PosLoyalty.exec.finalizeOrder("Cash", "70");
// Scanning coupon twice.
// Also apply global discount on top of free product to check if the
// calculated discount is correct.
// Applied programs:
// - coupon program (free product)
// - global discount
// - on cheapest discount
ProductScreen.exec.addOrderline("Desk Organizer", "11"); // 5.1 per item
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-4.59");
PosLoyalty.check.orderTotalIs("51.51");
// add global discount and the discount will be replaced
PosLoyalty.do.enterCode("345678");
PosLoyalty.check.hasRewardLine("10% on your order", "-5.15");
// add free product coupon (for qty=11, free=4)
// the discount should change after having free products
// it should go back to cheapest discount as it is higher
PosLoyalty.do.enterCode("5678");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-20.40");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-4.59");
// set quantity to 18
// free qty stays the same since the amount of points on the card only allows for 4 free products
ProductScreen.do.pressNumpad("Backspace 8");
PosLoyalty.check.hasRewardLine("10% on your order", "-6.68");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-20.40");
// scan the code again and check notification
PosLoyalty.do.enterCode("5678");
PosLoyalty.check.orderTotalIs("60.13");
PosLoyalty.exec.finalizeOrder("Cash", "65");
// Specific products discount (with promocode) and free product (1357)
// Applied programs:
// - discount on specific products
// - free product
ProductScreen.exec.addOrderline("Desk Organizer", "6"); // 5.1 per item
PosLoyalty.check.hasRewardLine("on the cheapest product", "-4.59");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.do.enterCode("promocode");
PosLoyalty.check.hasRewardLine("50% on specific products", "-15.30");
PosLoyalty.do.enterCode("1357");
PosLoyalty.check.hasRewardLine("Free Product - Desk Organizer", "-10.20");
PosLoyalty.check.hasRewardLine("50% on specific products", "-10.20");
PosLoyalty.check.orderTotalIs("10.20");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Check reset program
// Enter two codes and reset the programs.
// The codes should be checked afterwards. They should return to new.
// Applied programs:
// - cheapest product
ProductScreen.exec.addOrderline("Monitor Stand", "6"); // 3.19 per item
PosLoyalty.do.enterCode("098765");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.87");
PosLoyalty.check.hasRewardLine("10% on your order", "-1.63");
PosLoyalty.check.orderTotalIs("14.64");
PosLoyalty.exec.removeRewardLine("90% on the cheapest product");
PosLoyalty.check.hasRewardLine("10% on your order", "-1.91");
PosLoyalty.check.orderTotalIs("17.23");
PosLoyalty.do.resetActivePrograms();
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.87");
PosLoyalty.check.orderTotalIs("16.27");
PosLoyalty.exec.finalizeOrder("Cash", "20");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PosLoyaltyTour3", {
test: true,
url: "/pos/web",
steps: () => {
// --- PoS Loyalty Tour Basic Part 3 ---
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Promo Product");
PosLoyalty.check.orderTotalIs("34.50");
ProductScreen.do.clickDisplayedProduct("Product B");
PosLoyalty.check.hasRewardLine("100% on specific products", "25.00");
ProductScreen.do.clickDisplayedProduct("Product A");
PosLoyalty.check.hasRewardLine("100% on specific products", "15.00");
PosLoyalty.check.orderTotalIs("34.50");
ProductScreen.do.clickDisplayedProduct("Product A");
PosLoyalty.check.hasRewardLine("100% on specific products", "21.82");
PosLoyalty.check.hasRewardLine("100% on specific products", "18.18");
PosLoyalty.check.orderTotalIs("49.50");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PosLoyaltyTour4", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Test Product 1", "1");
ProductScreen.exec.addOrderline("Test Product 2", "1");
ProductScreen.do.selectPriceList("Public Pricelist");
PosLoyalty.do.enterCode("abcda");
PosLoyalty.check.orderTotalIs("0.00");
ProductScreen.do.selectPriceList("Test multi-currency");
PosLoyalty.check.orderTotalIs("0.00");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PosLoyaltyTour2", { test: true, url: "/pos/web", steps: getSteps() });
// --- PoS Loyalty Tour Basic Part 3 ---
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.do.clickDisplayedProduct("Promo Product");
PosLoyalty.check.orderTotalIs("34.50");
ProductScreen.do.clickDisplayedProduct("Product B");
PosLoyalty.check.hasRewardLine("100% on specific products", "25.00");
ProductScreen.do.clickDisplayedProduct("Product A");
PosLoyalty.check.hasRewardLine("100% on specific products", "15.00");
PosLoyalty.check.orderTotalIs("34.50");
ProductScreen.do.clickDisplayedProduct("Product A");
PosLoyalty.check.hasRewardLine("100% on specific products", "21.82");
PosLoyalty.check.hasRewardLine("100% on specific products", "18.18");
PosLoyalty.check.orderTotalIs("49.50");
registry
.category("web_tour.tours")
.add("PosLoyaltyTour3", { test: true, url: "/pos/web", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Test Product 1", "1");
ProductScreen.exec.addOrderline("Test Product 2", "1");
ProductScreen.do.selectPriceList("Public Pricelist");
PosLoyalty.do.enterCode("abcda");
PosLoyalty.check.orderTotalIs("0.00");
ProductScreen.do.selectPriceList("Test multi-currency");
PosLoyalty.check.orderTotalIs("0.00");
registry
.category("web_tour.tours")
.add("PosLoyaltyTour4", { test: true, url: "/pos/web", steps: getSteps() });
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Test Product 1", "1.00", "100");
PosLoyalty.do.clickDiscountButton();
PosLoyalty.do.clickConfirmButton();
ProductScreen.check.totalAmountIs("92.00");
registry
.category("web_tour.tours")
.add("PosCouponTour5", { test: true, url: "/pos/web", steps: getSteps() });
.add("PosCouponTour5", {
test: true,
url: "/pos/web",
steps: () => {
startSteps();
ProductScreen.do.clickHomeCategory();
ProductScreen.exec.addOrderline("Test Product 1", "1.00", "100");
PosLoyalty.do.clickDiscountButton();
PosLoyalty.do.clickConfirmButton();
ProductScreen.check.totalAmountIs("92.00");
return getSteps();
}
});
@@ -5,32 +5,46 @@ import { ProductScreen } from "@point_of_sale/../tests/tours/helpers/ProductScre
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// First tour should not get any automatic rewards
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Not valid -> date
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.checkNoClaimableRewards();
PosLoyalty.exec.finalizeOrder("Cash", "20");
registry.category("web_tour.tours").add("PosLoyaltyValidity1", { test: true, url: "/pos/web", steps: getSteps() });
// Second tour
startSteps();
ProductScreen.do.clickHomeCategory();
// Valid
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.88");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Not valid -> usage
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.checkNoClaimableRewards();
PosLoyalty.exec.finalizeOrder("Cash", "20");
registry.category("web_tour.tours").add("PosLoyaltyValidity2", { test: true, url: "/pos/web", steps: getSteps() });
registry
.category("web_tour.tours")
.add("PosLoyaltyValidity1", {
test: true,
url: "/pos/web",
steps: () => {
// First tour should not get any automatic rewards
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickHomeCategory();
// Not valid -> date
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.checkNoClaimableRewards();
PosLoyalty.exec.finalizeOrder("Cash", "20");
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("PosLoyaltyValidity2", {
test: true,
url: "/pos/web",
steps: () => {
// Second tour
startSteps();
ProductScreen.do.clickHomeCategory();
// Valid
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.hasRewardLine("90% on the cheapest product", "-2.88");
PosLoyalty.exec.finalizeOrder("Cash", "20");
// Not valid -> usage
ProductScreen.exec.addOrderline("Whiteboard Pen", "5");
PosLoyalty.check.checkNoClaimableRewards();
PosLoyalty.exec.finalizeOrder("Cash", "20");
return getSteps();
}
});
@@ -9,111 +9,128 @@ import { ErrorPopup } from "@point_of_sale/../tests/tours/helpers/ErrorPopupTour
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("48.0");
PaymentScreen.check.emptyPaymentlines("48.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.do.enterPaymentLineAmount("Online payment", "48");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "48.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
OnlinePaymentPopup.check.isShown();
OnlinePaymentPopup.check.amountIs("48.0");
OnlinePaymentPopup.do.fakeOnlinePaymentPaidData();
OnlinePaymentPopup.check.isNotShown();
ReceiptScreen.check.isShown();
ReceiptScreen.check.receiptIsThere();
registry
.category("web_tour.tours")
.add("OnlinePaymentLocalFakePaidDataTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("48.0");
PaymentScreen.check.emptyPaymentlines("48.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.do.enterPaymentLineAmount("Online payment", "48");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "48.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
OnlinePaymentPopup.check.isShown();
OnlinePaymentPopup.check.amountIs("48.0");
OnlinePaymentPopup.do.fakeOnlinePaymentPaidData();
OnlinePaymentPopup.check.isNotShown();
ReceiptScreen.check.isShown();
ReceiptScreen.check.receiptIsThere();
return getSteps()
}
});
registry
.category("web_tour.tours")
.add("OnlinePaymentLocalFakePaidDataTour", { test: true, url: "/pos/ui", steps: getSteps() });
.add("OnlinePaymentErrorsTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("48.0");
PaymentScreen.check.emptyPaymentlines("48.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.do.enterPaymentLineAmount("Online payment", "47");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "47.0");
PaymentScreen.check.remainingIs("1.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "2");
PaymentScreen.check.selectedPaymentlineHas("Cash", "2.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("1.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
PaymentScreen.do.clickPaymentline("Online payment", "47.0");
PaymentScreen.do.clickPaymentlineDelButton("Online payment", "47.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "46.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "0.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
PaymentScreen.do.clickPaymentline("Online payment", "0.0");
PaymentScreen.do.clickPaymentlineDelButton("Online payment", "0.0");
PaymentScreen.do.clickPaymentline("Cash", "2.0");
PaymentScreen.do.enterPaymentLineAmount("Cash", "3");
PaymentScreen.check.selectedPaymentlineHas("Cash", "3.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "-1.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("48.0");
PaymentScreen.check.emptyPaymentlines("48.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.do.enterPaymentLineAmount("Online payment", "47");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "47.0");
PaymentScreen.check.remainingIs("1.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(false);
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.enterPaymentLineAmount("Cash", "2");
PaymentScreen.check.selectedPaymentlineHas("Cash", "2.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("1.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
PaymentScreen.do.clickPaymentline("Online payment", "47.0");
PaymentScreen.do.clickPaymentlineDelButton("Online payment", "47.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "46.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "0.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
PaymentScreen.do.clickPaymentline("Online payment", "0.0");
PaymentScreen.do.clickPaymentlineDelButton("Online payment", "0.0");
PaymentScreen.do.clickPaymentline("Cash", "2.0");
PaymentScreen.do.enterPaymentLineAmount("Cash", "3");
PaymentScreen.check.selectedPaymentlineHas("Cash", "3.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "-1.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
ErrorPopup.check.isShown();
ErrorPopup.do.clickConfirm();
return getSteps();
}
});
registry
.category("web_tour.tours")
.add("OnlinePaymentErrorsTour", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("48.0");
PaymentScreen.check.emptyPaymentlines("48.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.do.enterPaymentLineAmount("Online payment", "48");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "48.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
OnlinePaymentPopup.check.isShown();
OnlinePaymentPopup.check.amountIs("48.0");
OnlinePaymentPopup.check.waitForOnlinePayment();
OnlinePaymentPopup.check.isNotShown();
ReceiptScreen.check.isShown();
ReceiptScreen.check.receiptIsThere();
Chrome.do.closeSession();
registry
.category("web_tour.tours")
.add("OnlinePaymentServerFakePaymentTour", { test: true, url: "/pos/ui", steps: getSteps() });
.add("OnlinePaymentServerFakePaymentTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Letter Tray", "10");
ProductScreen.check.selectedOrderlineHas("Letter Tray", "10.0");
ProductScreen.do.clickPayButton();
PaymentScreen.check.totalIs("48.0");
PaymentScreen.check.emptyPaymentlines("48.0");
PaymentScreen.do.clickPaymentMethod("Online payment");
PaymentScreen.do.enterPaymentLineAmount("Online payment", "48");
PaymentScreen.check.selectedPaymentlineHas("Online payment", "48.0");
PaymentScreen.check.remainingIs("0.0");
PaymentScreen.check.changeIs("0.0");
PaymentScreen.check.validateButtonIsHighlighted(true);
PaymentScreen.do.clickValidate();
OnlinePaymentPopup.check.isShown();
OnlinePaymentPopup.check.amountIs("48.0");
OnlinePaymentPopup.check.waitForOnlinePayment();
OnlinePaymentPopup.check.isNotShown();
ReceiptScreen.check.isShown();
ReceiptScreen.check.receiptIsThere();
Chrome.do.closeSession();
return getSteps();
}
});
@@ -10,51 +10,59 @@ import { BillScreen } from "@pos_restaurant/../tests/tours/helpers/BillScreenTou
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
registry
.category("web_tour.tours")
.add("ControlButtonsTour", {
test: true,
url: "/pos/ui",
steps: () => {
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
// Test TransferOrderButton
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Water", "5", "2", "10.0");
ProductScreen.do.clickTransferButton();
FloorScreen.do.clickTable("4");
ProductScreen.do.clickOrderline("Water", "5", "2");
Chrome.do.backToFloor();
FloorScreen.do.clickTable("2");
ProductScreen.check.orderIsEmpty();
Chrome.do.backToFloor();
FloorScreen.do.clickTable("4");
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.clickOk();
// Test GuestButton
ProductScreen.do.clickGuestButton();
NumberPopup.do.enterValue("15");
NumberPopup.check.inputShownIs("15");
NumberPopup.do.clickConfirm();
ProductScreen.check.guestNumberIs("15");
ProductScreen.do.clickGuestButton();
NumberPopup.do.enterValue("5");
NumberPopup.check.inputShownIs("5");
NumberPopup.do.clickConfirm();
ProductScreen.check.guestNumberIs("5");
// Test TransferOrderButton
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Water", "5", "2", "10.0");
ProductScreen.do.clickTransferButton();
FloorScreen.do.clickTable("4");
ProductScreen.do.clickOrderline("Water", "5", "2");
Chrome.do.backToFloor();
FloorScreen.do.clickTable("2");
ProductScreen.check.orderIsEmpty();
Chrome.do.backToFloor();
FloorScreen.do.clickTable("4");
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.clickOk();
// Test GuestButton
ProductScreen.do.clickGuestButton();
NumberPopup.do.enterValue("15");
NumberPopup.check.inputShownIs("15");
NumberPopup.do.clickConfirm();
ProductScreen.check.guestNumberIs("15");
ProductScreen.do.clickGuestButton();
NumberPopup.do.enterValue("5");
NumberPopup.check.inputShownIs("5");
NumberPopup.do.clickConfirm();
ProductScreen.check.guestNumberIs("5");
registry.category("web_tour.tours").add("ControlButtonsTour", { test: true, url: "/pos/ui", steps: getSteps() });
return getSteps();
}
});
@@ -8,114 +8,121 @@ import { ProductScreen } from "@pos_restaurant/../tests/tours/helpers/ProductScr
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
// check floors if they contain their corresponding tables
FloorScreen.check.selectedFloorIs("Main Floor");
FloorScreen.check.hasTable("2");
FloorScreen.check.hasTable("4");
FloorScreen.check.hasTable("5");
FloorScreen.do.clickFloor("Second Floor");
FloorScreen.check.hasTable("3");
FloorScreen.check.hasTable("1");
// clicking table in active mode does not open product screen
// instead, table is selected
FloorScreen.do.clickEdit();
FloorScreen.do.clickTable("3");
FloorScreen.check.selectedTableIs("3");
FloorScreen.do.clickTable("1");
FloorScreen.check.selectedTableIs("1");
// test add table
FloorScreen.do.clickFloor("Main Floor");
FloorScreen.do.clickAddTable();
FloorScreen.check.selectedTableIs("1");
FloorScreen.do.clickRename();
TextInputPopup.check.isShown();
TextInputPopup.do.inputText("100");
TextInputPopup.do.clickConfirm();
FloorScreen.do.clickTable("100");
FloorScreen.check.selectedTableIs("100");
// test duplicate table
FloorScreen.do.clickDuplicate();
// the name is the first number available on the floor
FloorScreen.check.selectedTableIs("1");
FloorScreen.do.clickRename();
TextInputPopup.check.isShown();
TextInputPopup.do.inputText("1111");
TextInputPopup.do.clickConfirm();
FloorScreen.do.clickTable("1111");
FloorScreen.check.selectedTableIs("1111");
// switch floor, switch back and check if
// the new tables are still there
FloorScreen.do.clickFloor("Second Floor");
FloorScreen.check.hasTable("3");
FloorScreen.check.hasTable("1");
//test duplicate multiple tables
FloorScreen.do.clickTable("1");
FloorScreen.check.selectedTableIs("1");
FloorScreen.do.ctrlClickTable("3");
FloorScreen.check.selectedTableIs("3");
FloorScreen.do.clickDuplicate();
FloorScreen.check.selectedTableIs("2");
FloorScreen.check.selectedTableIs("4");
//test delete multiple tables
FloorScreen.do.clickTrash();
Chrome.do.confirmPopup();
FloorScreen.do.clickFloor("Main Floor");
FloorScreen.check.hasTable("2");
FloorScreen.check.hasTable("4");
FloorScreen.check.hasTable("5");
FloorScreen.check.hasTable("100");
FloorScreen.check.hasTable("1111");
// test delete table
FloorScreen.do.clickTable("2");
FloorScreen.check.selectedTableIs("2");
FloorScreen.do.clickTrash();
Chrome.do.confirmPopup();
// change number of seats
FloorScreen.do.clickTable("4");
FloorScreen.check.selectedTableIs("4");
FloorScreen.do.clickSeats();
NumberPopup.do.pressNumpad("Backspace 9");
NumberPopup.do.fillPopupValue("9");
NumberPopup.check.inputShownIs("9");
NumberPopup.do.clickConfirm();
FloorScreen.check.tableSeatIs("4", "9");
// change number of seat when the input is already selected
FloorScreen.do.clickTable("4");
FloorScreen.check.selectedTableIs("4");
FloorScreen.do.clickSeats();
NumberPopup.do.enterValue("15");
NumberPopup.check.inputShownIs("15");
NumberPopup.do.clickConfirm();
FloorScreen.check.tableSeatIs("4", "15");
// change shape
FloorScreen.do.clickTable("4");
FloorScreen.do.changeShapeTo("round");
// Opening product screen in main floor should go back to main floor
FloorScreen.do.closeEdit();
FloorScreen.check.tableIsNotSelected("4");
FloorScreen.do.clickTable("4");
ProductScreen.check.isShown();
Chrome.do.backToFloor();
// Opening product screen in second floor should go back to second floor
FloorScreen.do.clickFloor("Second Floor");
FloorScreen.check.hasTable("3");
FloorScreen.do.clickTable("3");
registry.category("web_tour.tours").add("FloorScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
registry
.category("web_tour.tours")
.add("FloorScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
// check floors if they contain their corresponding tables
FloorScreen.check.selectedFloorIs("Main Floor");
FloorScreen.check.hasTable("2");
FloorScreen.check.hasTable("4");
FloorScreen.check.hasTable("5");
FloorScreen.do.clickFloor("Second Floor");
FloorScreen.check.hasTable("3");
FloorScreen.check.hasTable("1");
// clicking table in active mode does not open product screen
// instead, table is selected
FloorScreen.do.clickEdit();
FloorScreen.do.clickTable("3");
FloorScreen.check.selectedTableIs("3");
FloorScreen.do.clickTable("1");
FloorScreen.check.selectedTableIs("1");
// test add table
FloorScreen.do.clickFloor("Main Floor");
FloorScreen.do.clickAddTable();
FloorScreen.check.selectedTableIs("1");
FloorScreen.do.clickRename();
TextInputPopup.check.isShown();
TextInputPopup.do.inputText("100");
TextInputPopup.do.clickConfirm();
FloorScreen.do.clickTable("100");
FloorScreen.check.selectedTableIs("100");
// test duplicate table
FloorScreen.do.clickDuplicate();
// the name is the first number available on the floor
FloorScreen.check.selectedTableIs("1");
FloorScreen.do.clickRename();
TextInputPopup.check.isShown();
TextInputPopup.do.inputText("1111");
TextInputPopup.do.clickConfirm();
FloorScreen.do.clickTable("1111");
FloorScreen.check.selectedTableIs("1111");
// switch floor, switch back and check if
// the new tables are still there
FloorScreen.do.clickFloor("Second Floor");
FloorScreen.check.hasTable("3");
FloorScreen.check.hasTable("1");
//test duplicate multiple tables
FloorScreen.do.clickTable("1");
FloorScreen.check.selectedTableIs("1");
FloorScreen.do.ctrlClickTable("3");
FloorScreen.check.selectedTableIs("3");
FloorScreen.do.clickDuplicate();
FloorScreen.check.selectedTableIs("2");
FloorScreen.check.selectedTableIs("4");
//test delete multiple tables
FloorScreen.do.clickTrash();
Chrome.do.confirmPopup();
FloorScreen.do.clickFloor("Main Floor");
FloorScreen.check.hasTable("2");
FloorScreen.check.hasTable("4");
FloorScreen.check.hasTable("5");
FloorScreen.check.hasTable("100");
FloorScreen.check.hasTable("1111");
// test delete table
FloorScreen.do.clickTable("2");
FloorScreen.check.selectedTableIs("2");
FloorScreen.do.clickTrash();
Chrome.do.confirmPopup();
// change number of seats
FloorScreen.do.clickTable("4");
FloorScreen.check.selectedTableIs("4");
FloorScreen.do.clickSeats();
NumberPopup.do.pressNumpad("Backspace 9");
NumberPopup.do.fillPopupValue("9");
NumberPopup.check.inputShownIs("9");
NumberPopup.do.clickConfirm();
FloorScreen.check.tableSeatIs("4", "9");
// change number of seat when the input is already selected
FloorScreen.do.clickTable("4");
FloorScreen.check.selectedTableIs("4");
FloorScreen.do.clickSeats();
NumberPopup.do.enterValue("15");
NumberPopup.check.inputShownIs("15");
NumberPopup.do.clickConfirm();
FloorScreen.check.tableSeatIs("4", "15");
// change shape
FloorScreen.do.clickTable("4");
FloorScreen.do.changeShapeTo("round");
// Opening product screen in main floor should go back to main floor
FloorScreen.do.closeEdit();
FloorScreen.check.tableIsNotSelected("4");
FloorScreen.do.clickTable("4");
ProductScreen.check.isShown();
Chrome.do.backToFloor();
// Opening product screen in second floor should go back to second floor
FloorScreen.do.clickFloor("Second Floor");
FloorScreen.check.hasTable("3");
FloorScreen.do.clickTable("3");
return getSteps();
}
});
@@ -8,36 +8,44 @@ import { TicketScreen } from "@point_of_sale/../tests/tours/helpers/TicketScreen
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
registry
.category("web_tour.tours")
.add("RefundStayCurrentTableTour", {
test: true,
url: "/pos/ui",
steps: () => {
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
// Create first order and pay it
FloorScreen.do.clickTable("2");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Water");
ProductScreen.check.selectedOrderlineHas("Water");
ProductScreen.check.totalAmountIs("6.60");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
// Go to another table and refund one of the product
FloorScreen.do.clickTable("4");
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0001");
TicketScreen.do.clickOrderline("Coca-Cola");
TicketScreen.do.pressNumpad("2");
TicketScreen.check.toRefundTextContains("To Refund: 2.00");
TicketScreen.do.confirmRefund();
ProductScreen.check.isShown();
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.check.totalAmountIs("-4.40");
// Create first order and pay it
FloorScreen.do.clickTable("2");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Water");
ProductScreen.check.selectedOrderlineHas("Water");
ProductScreen.check.totalAmountIs("6.60");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
// Go to another table and refund one of the product
FloorScreen.do.clickTable("4");
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickRefund();
TicketScreen.do.selectOrder("-0001");
TicketScreen.do.clickOrderline("Coca-Cola");
TicketScreen.do.pressNumpad("2");
TicketScreen.check.toRefundTextContains("To Refund: 2.00");
TicketScreen.do.confirmRefund();
ProductScreen.check.isShown();
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.check.totalAmountIs("-4.40");
registry.category("web_tour.tours").add("RefundStayCurrentTableTour", { test: true, url: "/pos/ui", steps: getSteps() });
return getSteps();
}
});
@@ -10,108 +10,130 @@ import { TicketScreen } from "@point_of_sale/../tests/tours/helpers/TicketScreen
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
registry
.category("web_tour.tours")
.add("SplitBillScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
FloorScreen.do.clickTable("2");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Water", "5", "2", "10.0");
ProductScreen.exec.addOrderline("Minute Maid", "3", "2", "6.0");
ProductScreen.exec.addOrderline("Coca-Cola", "1", "2", "2.0");
ProductScreen.do.clickSplitBillButton();
// Check if the screen contains all the orderlines
SplitBillScreen.check.orderlineHas("Water", "5", "0");
SplitBillScreen.check.orderlineHas("Minute Maid", "3", "0");
SplitBillScreen.check.orderlineHas("Coca-Cola", "1", "0");
// split 3 water and 1 coca-cola
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "5", "1");
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "5", "3");
SplitBillScreen.check.subtotalIs("6.0");
SplitBillScreen.do.clickOrderline("Coca-Cola");
SplitBillScreen.check.orderlineHas("Coca-Cola", "1", "1");
SplitBillScreen.check.subtotalIs("8.0");
// click pay to split, go back to check the lines
SplitBillScreen.do.clickPay();
PaymentScreen.do.clickBack();
ProductScreen.do.clickOrderline("Water", "3.0");
ProductScreen.do.clickOrderline("Coca-Cola", "1.0");
// go back to the original order and see if the order is changed
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0001");
ProductScreen.check.isShown();
ProductScreen.do.clickOrderline("Water", "2.0");
ProductScreen.do.clickOrderline("Minute Maid", "3.0");
return getSteps();
}
});
FloorScreen.do.clickTable("2");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Water", "5", "2", "10.0");
ProductScreen.exec.addOrderline("Minute Maid", "3", "2", "6.0");
ProductScreen.exec.addOrderline("Coca-Cola", "1", "2", "2.0");
ProductScreen.do.clickSplitBillButton();
registry
.category("web_tour.tours")
.add("SplitBillScreenTour2", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Water", "1", "2.0");
ProductScreen.exec.addOrderline("Minute Maid", "1", "2.0");
ProductScreen.exec.addOrderline("Coca-Cola", "1", "2.0");
Chrome.do.backToFloor();
FloorScreen.do.clickTable("2");
ProductScreen.do.clickSplitBillButton();
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "1", "1");
SplitBillScreen.do.clickOrderline("Coca-Cola");
SplitBillScreen.check.orderlineHas("Coca-Cola", "1", "1");
SplitBillScreen.do.clickPay();
PaymentScreen.do.clickBack();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0002");
ProductScreen.do.clickOrderline("Water", "1.0");
ProductScreen.do.clickOrderline("Coca-Cola", "1.0");
ProductScreen.check.totalAmountIs("4.00");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0001");
ProductScreen.do.clickOrderline("Minute Maid", "1.0");
ProductScreen.check.totalAmountIs("2.00");
return getSteps();
}
});
// Check if the screen contains all the orderlines
SplitBillScreen.check.orderlineHas("Water", "5", "0");
SplitBillScreen.check.orderlineHas("Minute Maid", "3", "0");
SplitBillScreen.check.orderlineHas("Coca-Cola", "1", "0");
registry
.category("web_tour.tours")
.add("SplitBillScreenTour3", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
FloorScreen.do.clickTable("2");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Water", "2", "2", "4.00");
ProductScreen.do.clickSplitBillButton();
// Check if the screen contains all the orderlines
SplitBillScreen.check.orderlineHas("Water", "2", "0");
// split 1 water
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "2", "1");
SplitBillScreen.check.subtotalIs("2.0");
// click pay to split, and pay
SplitBillScreen.do.clickPay();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
// Check if the receiptscreen suggests us to continue the order
ReceiptScreen.do.clickContinueOrder();
// Check if there is still water in the order
ProductScreen.check.isShown();
ProductScreen.do.clickOrderline("Water", "1.0");
ProductScreen.do.clickPayButton(true);
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
// Check if there is no more order to continue
ReceiptScreen.do.clickNextOrder();
// split 3 water and 1 coca-cola
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "5", "1");
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "5", "3");
SplitBillScreen.check.subtotalIs("6.0");
SplitBillScreen.do.clickOrderline("Coca-Cola");
SplitBillScreen.check.orderlineHas("Coca-Cola", "1", "1");
SplitBillScreen.check.subtotalIs("8.0");
// click pay to split, go back to check the lines
SplitBillScreen.do.clickPay();
PaymentScreen.do.clickBack();
ProductScreen.do.clickOrderline("Water", "3.0");
ProductScreen.do.clickOrderline("Coca-Cola", "1.0");
// go back to the original order and see if the order is changed
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0001");
ProductScreen.check.isShown();
ProductScreen.do.clickOrderline("Water", "2.0");
ProductScreen.do.clickOrderline("Minute Maid", "3.0");
registry.category("web_tour.tours").add("SplitBillScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Water", "1", "2.0");
ProductScreen.exec.addOrderline("Minute Maid", "1", "2.0");
ProductScreen.exec.addOrderline("Coca-Cola", "1", "2.0");
Chrome.do.backToFloor();
FloorScreen.do.clickTable("2");
ProductScreen.do.clickSplitBillButton();
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "1", "1");
SplitBillScreen.do.clickOrderline("Coca-Cola");
SplitBillScreen.check.orderlineHas("Coca-Cola", "1", "1");
SplitBillScreen.do.clickPay();
PaymentScreen.do.clickBack();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0002");
ProductScreen.do.clickOrderline("Water", "1.0");
ProductScreen.do.clickOrderline("Coca-Cola", "1.0");
ProductScreen.check.totalAmountIs("4.00");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectOrder("-0001");
ProductScreen.do.clickOrderline("Minute Maid", "1.0");
ProductScreen.check.totalAmountIs("2.00");
registry.category("web_tour.tours").add("SplitBillScreenTour2", { test: true, url: "/pos/ui", steps: getSteps() });
startSteps();
FloorScreen.do.clickTable("2");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.exec.addOrderline("Water", "2", "2", "4.00");
ProductScreen.do.clickSplitBillButton();
// Check if the screen contains all the orderlines
SplitBillScreen.check.orderlineHas("Water", "2", "0");
// split 1 water
SplitBillScreen.do.clickOrderline("Water");
SplitBillScreen.check.orderlineHas("Water", "2", "1");
SplitBillScreen.check.subtotalIs("2.0");
// click pay to split, and pay
SplitBillScreen.do.clickPay();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
// Check if the receiptscreen suggests us to continue the order
ReceiptScreen.do.clickContinueOrder();
// Check if there is still water in the order
ProductScreen.check.isShown();
ProductScreen.do.clickOrderline("Water", "1.0");
ProductScreen.do.clickPayButton(true);
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
// Check if there is no more order to continue
ReceiptScreen.do.clickNextOrder();
registry.category("web_tour.tours").add("SplitBillScreenTour3", { test: true, url: "/pos/ui", steps: getSteps() });
return getSteps();
}
});
@@ -7,60 +7,65 @@ import { Chrome } from "@pos_restaurant/../tests/tours/helpers/ChromeTourMethods
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
ProductScreen.do.confirmOpeningPopup();
// New Ticket button should not be in the ticket screen if no table is selected.
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.noNewTicketButton();
TicketScreen.do.clickDiscard();
// Deleting the last order in the table brings back to floorscreen
FloorScreen.do.clickTable("4");
ProductScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "-0001");
TicketScreen.do.deleteOrder("-0001");
TicketScreen.do.clickDiscard();
// Create 2 items in a table. From floorscreen, delete 1 item. Then select the other item.
// Correct order and screen should be displayed and the BackToFloorButton is shown.
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Minute Maid", "1", "2");
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Coca-Cola", "2", "2");
ProductScreen.check.totalAmountIs("4.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("2", "3");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0003");
Chrome.do.confirmPopup();
TicketScreen.do.selectOrder("-0002");
ProductScreen.check.isShown();
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.backToFloor();
// Make sure that order is deleted properly.
FloorScreen.do.clickTable("5");
ProductScreen.exec.addOrderline("Minute Maid", "1", "3");
ProductScreen.check.totalAmountIs("3.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("5", "1");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0004");
Chrome.do.confirmPopup();
TicketScreen.do.clickDiscard();
FloorScreen.check.isShown();
FloorScreen.do.clickTable("5");
ProductScreen.check.orderIsEmpty();
registry
.category("web_tour.tours")
.add("PosResTicketScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
.add("PosResTicketScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
// New Ticket button should not be in the ticket screen if no table is selected.
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.noNewTicketButton();
TicketScreen.do.clickDiscard();
// Deleting the last order in the table brings back to floorscreen
FloorScreen.do.clickTable("4");
ProductScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains(2, "-0001");
TicketScreen.do.deleteOrder("-0001");
TicketScreen.do.clickDiscard();
// Create 2 items in a table. From floorscreen, delete 1 item. Then select the other item.
// Correct order and screen should be displayed and the BackToFloorButton is shown.
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Minute Maid", "1", "2");
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.exec.addOrderline("Coca-Cola", "2", "2");
ProductScreen.check.totalAmountIs("4.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("2", "3");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0003");
Chrome.do.confirmPopup();
TicketScreen.do.selectOrder("-0002");
ProductScreen.check.isShown();
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.backToFloor();
// Make sure that order is deleted properly.
FloorScreen.do.clickTable("5");
ProductScreen.exec.addOrderline("Minute Maid", "1", "3");
ProductScreen.check.totalAmountIs("3.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("5", "1");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0004");
Chrome.do.confirmPopup();
TicketScreen.do.clickDiscard();
FloorScreen.check.isShown();
FloorScreen.do.clickTable("5");
ProductScreen.check.orderIsEmpty();
return getSteps();
}
});
@@ -11,140 +11,146 @@ import { Chrome } from "@pos_restaurant/../tests/tours/helpers/ChromeTourMethods
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
// Create order that is synced when draft.
// order 1
ProductScreen.do.confirmOpeningPopup();
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Minute Maid", "1", "2");
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("2", "1");
FloorScreen.do.clickTable("2");
ProductScreen.check.totalAmountIs("2.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
// order 2
ProductScreen.exec.addOrderline("Coca-Cola", "2", "2");
ProductScreen.check.totalAmountIs("4.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("2", "2");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains("2", "Tipping");
TicketScreen.do.clickDiscard();
// Create without syncing the draft.
// order 3
FloorScreen.do.clickTable("5");
ProductScreen.exec.addOrderline("Minute Maid", "3", "2");
ProductScreen.check.totalAmountIs("6.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
// order 4
ProductScreen.exec.addOrderline("Coca-Cola", "4", "2");
ProductScreen.check.totalAmountIs("8.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("5", "4");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains("4", "Tipping");
// Tip 20% on order1
TicketScreen.do.selectOrder("-0001");
TipScreen.check.isShown();
TipScreen.check.totalAmountIs("2.0");
TipScreen.check.percentAmountIs("15%", "0.30");
TipScreen.check.percentAmountIs("20%", "0.40");
TipScreen.check.percentAmountIs("25%", "0.50");
TipScreen.do.clickPercentTip("20%");
TipScreen.check.inputAmountIs("0.40");
Chrome.do.backToFloor();
FloorScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
// Tip 25% on order3
TicketScreen.do.selectOrder("-0003");
TipScreen.check.isShown();
TipScreen.check.totalAmountIs("6.0");
TipScreen.check.percentAmountIs("15%", "0.90");
TipScreen.check.percentAmountIs("20%", "1.20");
TipScreen.check.percentAmountIs("25%", "1.50");
TipScreen.do.clickPercentTip("25%");
TipScreen.check.inputAmountIs("1.50");
Chrome.do.backToFloor();
FloorScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
// finalize order 4 then tip custom amount
TicketScreen.do.selectOrder("-0004");
ProductScreen.check.isShown();
ProductScreen.check.totalAmountIs("8.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
TipScreen.check.totalAmountIs("8.0");
TipScreen.check.percentAmountIs("15%", "1.20");
TipScreen.check.percentAmountIs("20%", "1.60");
TipScreen.check.percentAmountIs("25%", "2.00");
TipScreen.do.setCustomTip("1.00");
TipScreen.check.inputAmountIs("1.00");
Chrome.do.backToFloor();
FloorScreen.check.isShown();
// settle tips here
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectFilter("Tipping");
TicketScreen.check.tipContains("1.00");
TicketScreen.do.settleTips();
TicketScreen.do.selectFilter("All active orders");
TicketScreen.check.nthRowContains(2, "Ongoing");
// tip order2 during payment
// tip screen should not show after validating payment screen
TicketScreen.do.selectOrder("-0002");
ProductScreen.check.isShown();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickTipButton();
NumberPopup.check.isShown();
NumberPopup.do.enterValue("1");
NumberPopup.check.inputShownIs("1");
NumberPopup.do.clickConfirm();
PaymentScreen.check.emptyPaymentlines("5.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
// order 5
// Click directly on "settle" without selecting a Tip
ReceiptScreen.do.clickNextOrder();
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Minute Maid", "3", "2");
ProductScreen.check.totalAmountIs("6.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
TipScreen.do.clickSettle();
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickNextOrder();
FloorScreen.check.isShown();
registry
.category("web_tour.tours")
.add("PosResTipScreenTour", { test: true, url: "/pos/ui", steps: getSteps() });
.add("PosResTipScreenTour", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
// Create order that is synced when draft.
// order 1
ProductScreen.do.confirmOpeningPopup();
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Minute Maid", "1", "2");
ProductScreen.check.totalAmountIs("2.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("2", "1");
FloorScreen.do.clickTable("2");
ProductScreen.check.totalAmountIs("2.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
// order 2
ProductScreen.exec.addOrderline("Coca-Cola", "2", "2");
ProductScreen.check.totalAmountIs("4.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("2", "2");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains("2", "Tipping");
TicketScreen.do.clickDiscard();
// Create without syncing the draft.
// order 3
FloorScreen.do.clickTable("5");
ProductScreen.exec.addOrderline("Minute Maid", "3", "2");
ProductScreen.check.totalAmountIs("6.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
// order 4
ProductScreen.exec.addOrderline("Coca-Cola", "4", "2");
ProductScreen.check.totalAmountIs("8.0");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("5", "4");
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.check.nthRowContains("4", "Tipping");
// Tip 20% on order1
TicketScreen.do.selectOrder("-0001");
TipScreen.check.isShown();
TipScreen.check.totalAmountIs("2.0");
TipScreen.check.percentAmountIs("15%", "0.30");
TipScreen.check.percentAmountIs("20%", "0.40");
TipScreen.check.percentAmountIs("25%", "0.50");
TipScreen.do.clickPercentTip("20%");
TipScreen.check.inputAmountIs("0.40");
Chrome.do.backToFloor();
FloorScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
// Tip 25% on order3
TicketScreen.do.selectOrder("-0003");
TipScreen.check.isShown();
TipScreen.check.totalAmountIs("6.0");
TipScreen.check.percentAmountIs("15%", "0.90");
TipScreen.check.percentAmountIs("20%", "1.20");
TipScreen.check.percentAmountIs("25%", "1.50");
TipScreen.do.clickPercentTip("25%");
TipScreen.check.inputAmountIs("1.50");
Chrome.do.backToFloor();
FloorScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
// finalize order 4 then tip custom amount
TicketScreen.do.selectOrder("-0004");
ProductScreen.check.isShown();
ProductScreen.check.totalAmountIs("8.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
TipScreen.check.totalAmountIs("8.0");
TipScreen.check.percentAmountIs("15%", "1.20");
TipScreen.check.percentAmountIs("20%", "1.60");
TipScreen.check.percentAmountIs("25%", "2.00");
TipScreen.do.setCustomTip("1.00");
TipScreen.check.inputAmountIs("1.00");
Chrome.do.backToFloor();
FloorScreen.check.isShown();
// settle tips here
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.selectFilter("Tipping");
TicketScreen.check.tipContains("1.00");
TicketScreen.do.settleTips();
TicketScreen.do.selectFilter("All active orders");
TicketScreen.check.nthRowContains(2, "Ongoing");
// tip order2 during payment
// tip screen should not show after validating payment screen
TicketScreen.do.selectOrder("-0002");
ProductScreen.check.isShown();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickTipButton();
NumberPopup.check.isShown();
NumberPopup.do.enterValue("1");
NumberPopup.check.inputShownIs("1");
NumberPopup.do.clickConfirm();
PaymentScreen.check.emptyPaymentlines("5.0");
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
// order 5
// Click directly on "settle" without selecting a Tip
ReceiptScreen.do.clickNextOrder();
FloorScreen.do.clickTable("2");
ProductScreen.exec.addOrderline("Minute Maid", "3", "2");
ProductScreen.check.totalAmountIs("6.0");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Bank");
PaymentScreen.do.clickValidate();
TipScreen.check.isShown();
TipScreen.do.clickSettle();
ReceiptScreen.check.isShown();
ReceiptScreen.do.clickNextOrder();
FloorScreen.check.isShown();
return getSteps();
}
});
@@ -9,113 +9,124 @@ import { TicketScreen } from "@point_of_sale/../tests/tours/helpers/TicketScreen
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
startSteps();
ProductScreen.do.confirmOpeningPopup();
// Create first order
FloorScreen.do.clickTable("5");
ProductScreen.check.orderBtnIsPresent();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.doubleClickOrderline("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Water");
ProductScreen.check.selectedOrderlineHas("Water");
ProductScreen.check.orderlineIsToOrder("Water");
ProductScreen.check.orderlineIsToSkip("Coca-Cola");
ProductScreen.do.clickOrderButton();
ProductScreen.check.orderlinesHaveNoChange();
ProductScreen.check.isPrintingError();
ProductScreen.check.totalAmountIs("4.40");
// Create 2nd order (paid)
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Minute Maid");
ProductScreen.check.selectedOrderlineHas("Minute Maid");
ProductScreen.check.totalAmountIs("4.40");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
// After clicking next order, floor screen is shown.
// It should have 1 as number of draft synced order.
FloorScreen.check.orderCountSyncedInTableIs("5", "1");
FloorScreen.do.clickTable("5");
ProductScreen.check.totalAmountIs("4.40");
// Create another draft order and go back to floor
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Minute Maid");
ProductScreen.check.selectedOrderlineHas("Minute Maid");
Chrome.do.backToFloor();
// At floor screen, there should be 2 synced draft orders
FloorScreen.check.orderCountSyncedInTableIs("5", "2");
// Delete the first order then go back to floor
FloorScreen.do.clickTable("5");
ProductScreen.check.isShown();
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() });
startSteps();
.add("pos_restaurant_sync", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
// Create first order
FloorScreen.do.clickTable("5");
ProductScreen.check.orderBtnIsPresent();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.doubleClickOrderline("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Water");
ProductScreen.check.selectedOrderlineHas("Water");
ProductScreen.check.orderlineIsToOrder("Water");
ProductScreen.check.orderlineIsToSkip("Coca-Cola");
ProductScreen.do.clickOrderButton();
ProductScreen.check.orderlinesHaveNoChange();
ProductScreen.check.isPrintingError();
ProductScreen.check.totalAmountIs("4.40");
// Create 2nd order (paid)
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Minute Maid");
ProductScreen.check.selectedOrderlineHas("Minute Maid");
ProductScreen.check.totalAmountIs("4.40");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
// After clicking next order, floor screen is shown.
// It should have 1 as number of draft synced order.
FloorScreen.check.orderCountSyncedInTableIs("5", "1");
FloorScreen.do.clickTable("5");
ProductScreen.check.totalAmountIs("4.40");
// Create another draft order and go back to floor
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.clickNewTicket();
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola");
ProductScreen.do.clickDisplayedProduct("Minute Maid");
ProductScreen.check.selectedOrderlineHas("Minute Maid");
Chrome.do.backToFloor();
// At floor screen, there should be 2 synced draft orders
FloorScreen.check.orderCountSyncedInTableIs("5", "2");
// Delete the first order then go back to floor
FloorScreen.do.clickTable("5");
ProductScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
TicketScreen.do.deleteOrder("-0001");
Chrome.do.confirmPopup();
TicketScreen.do.selectOrder("-0003");
Chrome.do.backToFloor();
// There should be 1 synced draft order.
FloorScreen.check.orderCountSyncedInTableIs("5", "2");
return getSteps();
}
});
/* pos_restaurant_sync_second_login
*
* This tour should be run after the first tour is done.
*/
// There is one draft synced order from the previous tour
FloorScreen.do.clickTable("5");
ProductScreen.check.totalAmountIs("4.40");
// Test transfering an order
ProductScreen.do.clickTransferButton();
FloorScreen.do.clickTable("4");
// Test if products still get merged after transfering the order
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola", "2.0");
ProductScreen.check.totalAmountIs("6.60");
ProductScreen.do.pressNumpad("1");
ProductScreen.check.totalAmountIs("4.40");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
// At this point, there are no draft orders.
FloorScreen.do.clickTable("2");
ProductScreen.check.isShown();
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickTransferButton();
FloorScreen.do.clickTable("4");
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.totalAmountIs("2.20");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("4", "1");
*
* This tour should be run after the first tour is done.
*/
registry
.category("web_tour.tours")
.add("pos_restaurant_sync_second_login", { test: true, url: "/pos/ui", steps: getSteps() });
.add("pos_restaurant_sync_second_login", {
test: true,
url: "/pos/ui",
steps: () => {
startSteps();
// There is one draft synced order from the previous tour
FloorScreen.do.clickTable("5");
ProductScreen.check.totalAmountIs("4.40");
// Test transfering an order
ProductScreen.do.clickTransferButton();
FloorScreen.do.clickTable("4");
// Test if products still get merged after transfering the order
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.selectedOrderlineHas("Coca-Cola", "2.0");
ProductScreen.check.totalAmountIs("6.60");
ProductScreen.do.pressNumpad("1");
ProductScreen.check.totalAmountIs("4.40");
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod("Cash");
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
// At this point, there are no draft orders.
FloorScreen.do.clickTable("2");
ProductScreen.check.isShown();
ProductScreen.check.orderIsEmpty();
ProductScreen.do.clickTransferButton();
FloorScreen.do.clickTable("4");
ProductScreen.do.clickDisplayedProduct("Coca-Cola");
ProductScreen.check.totalAmountIs("2.20");
Chrome.do.backToFloor();
FloorScreen.check.orderCountSyncedInTableIs("4", "1");
return getSteps();
}
});
+124 -84
View File
@@ -8,93 +8,133 @@ import { TicketScreen } from "@point_of_sale/../tests/tours/helpers/TicketScreen
import { getSteps, startSteps } from "@point_of_sale/../tests/tours/helpers/utils";
import { registry } from "@web/core/registry";
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
registry
.category("web_tour.tours")
.add('PosSettleOrder', {
test: true,
url: '/pos/ui',
steps: () => {
// signal to start generating steps
// when finished, steps can be taken from getSteps
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.selectFirstOrder();
ProductScreen.check.selectedOrderlineHas('Pizza Chicken', 9);
ProductScreen.do.pressNumpad('Qty 2'); // Change the quantity of the product to 2
ProductScreen.check.selectedOrderlineHas('Pizza Chicken', 2);
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
return getSteps();
}
});
registry
.category("web_tour.tours")
.add('PosSettleOrderIncompatiblePartner', {
test: true,
url: '/pos/ui',
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
// The second item in the list is the first sale.order.
ProductScreen.do.selectNthOrder(2);
ProductScreen.check.selectedOrderlineHas('product1', 1);
ProductScreen.check.totalAmountIs("10.00");
ProductScreen.do.clickQuotationButton();
// The first item in the list is the second sale.order.
// Selecting the 2nd sale.order should use a new order,
// therefore, the total amount will change.
ProductScreen.do.selectNthOrder(1);
ProductScreen.check.selectedOrderlineHas('product2', 1);
ProductScreen.check.totalAmountIs("11.00");
return getSteps();
}
});
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.selectFirstOrder();
ProductScreen.check.selectedOrderlineHas('Pizza Chicken', 9);
ProductScreen.do.pressNumpad('Qty 2'); // Change the quantity of the product to 2
ProductScreen.check.selectedOrderlineHas('Pizza Chicken', 2);
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
Chrome.do.clickMenuButton();
Chrome.do.clickTicketButton();
registry
.category("web_tour.tours")
.add('PosSettleOrder2', {
test: true,
url: '/pos/ui',
steps: () => {
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.selectFirstOrder();
ProductScreen.do.clickOrderline("Product A", "1");
ProductScreen.check.selectedOrderlineHas('Product A', '1.00');
ProductScreen.do.clickOrderline("Product B", "1");
ProductScreen.do.pressNumpad('Qty 0');
ProductScreen.check.selectedOrderlineHas('Product B', '0.00');
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.check.remainingIs('0.0');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
return getSteps();
}
});
registry.category("web_tour.tours").add('PosSettleOrder', { test: true, url: '/pos/ui', steps: getSteps() });
registry
.category("web_tour.tours")
.add('PosRefundDownpayment', {
test: true,
url: '/pos/ui',
steps: () => {
startSteps();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.downPaymentFirstOrder();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Cash');
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
ProductScreen.do.clickRefund();
// Filter should be automatically 'Paid'.
TicketScreen.check.filterIs('Paid');
TicketScreen.do.selectOrder('-0001');
TicketScreen.do.clickOrderline('Down Payment');
TicketScreen.do.pressNumpad('1');
TicketScreen.do.confirmRefund();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Cash');
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
return getSteps();
}
});
startSteps();
registry
.category("web_tour.tours")
.add('PosSettleOrderRealTime', {
test: true,
url: '/pos/ui',
steps: () => {
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
// The second item in the list is the first sale.order.
ProductScreen.do.selectNthOrder(2);
ProductScreen.check.selectedOrderlineHas('product1', 1);
ProductScreen.check.totalAmountIs("10.00");
startSteps();
ProductScreen.do.clickQuotationButton();
// The first item in the list is the second sale.order.
// Selecting the 2nd sale.order should use a new order,
// therefore, the total amount will change.
ProductScreen.do.selectNthOrder(1);
ProductScreen.check.selectedOrderlineHas('product2', 1);
ProductScreen.check.totalAmountIs("11.00");
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.selectFirstOrder();
ProductScreen.check.totalAmountIs(40);
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
registry.category("web_tour.tours").add('PosSettleOrderIncompatiblePartner', { test: true, url: '/pos/ui', steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.selectFirstOrder();
ProductScreen.do.clickOrderline("Product A", "1");
ProductScreen.check.selectedOrderlineHas('Product A', '1.00');
ProductScreen.do.clickOrderline("Product B", "1");
ProductScreen.do.pressNumpad('Qty 0');
ProductScreen.check.selectedOrderlineHas('Product B', '0.00');
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.check.remainingIs('0.0');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
registry.category("web_tour.tours").add('PosSettleOrder2', { test: true, url: '/pos/ui', steps: getSteps() });
startSteps();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.downPaymentFirstOrder();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Cash');
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
ProductScreen.do.clickRefund();
// Filter should be automatically 'Paid'.
TicketScreen.check.filterIs('Paid');
TicketScreen.do.selectOrder('-0001');
TicketScreen.do.clickOrderline('Down Payment');
TicketScreen.do.pressNumpad('1');
TicketScreen.do.confirmRefund();
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Cash');
PaymentScreen.do.clickValidate();
ReceiptScreen.do.clickNextOrder();
registry.category("web_tour.tours").add('PosRefundDownpayment', { test: true, url: '/pos/ui', steps: getSteps() });
startSteps();
ProductScreen.do.confirmOpeningPopup();
ProductScreen.do.clickQuotationButton();
ProductScreen.do.selectFirstOrder();
ProductScreen.check.totalAmountIs(40);
ProductScreen.do.clickPayButton();
PaymentScreen.do.clickPaymentMethod('Bank');
PaymentScreen.do.clickValidate();
ReceiptScreen.check.isShown();
registry.category("web_tour.tours").add('PosSettleOrderRealTime', { test: true, url: '/pos/ui', steps: getSteps() });
return getSteps();
}
});
@@ -5,7 +5,7 @@ import { PosSelf } from "./tour_utils";
registry.category("web_tour.tours").add("self_order_after_each_cart_tour", {
test: true,
steps: [
steps: () => [
// Verify if the self is open and My Orders is not displayed because we are in "meal" mode
PosSelf.check.isNotNotification(),
PosSelf.check.isNotPrimaryBtn("My Orders"),
@@ -5,7 +5,7 @@ import { PosSelf } from "./tour_utils";
registry.category("web_tour.tours").add("self_order_after_meal_cart_tour", {
test: true,
steps: [
steps: () => [
// Verify if the self is open and My Orders is not displayed because we are in "meal" mode
PosSelf.check.isNotNotification(),
PosSelf.check.isNotPrimaryBtn("My Orders"),
@@ -5,7 +5,7 @@ import { PosSelf } from "./tour_utils";
registry.category("web_tour.tours").add("self_order_after_meal_product_tour", {
test: true,
steps: [
steps: () => [
// Verify if the self is open
PosSelf.check.isNotNotification(),
PosSelf.check.isNotPrimaryBtn("My Orders"),
@@ -5,7 +5,7 @@ import { PosSelf } from "./tour_utils";
registry.category("web_tour.tours").add("self_order_menu_only_tour", {
test: true,
steps: [
steps: () => [
PosSelf.check.isNotPrimaryBtn("My Orders"),
PosSelf.check.isPrimaryBtn("View Menu"),
PosSelf.action.clickPrimaryBtn("View Menu"),
@@ -10,7 +10,7 @@ registry.category("web_tour.tours").add('project_tour', {
sequence: 110,
url: "/web",
rainbowManMessage: _t("Congratulations, you are now a master of project management."),
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="project.menu_main_pm"]',
content: Markup(_t('Want a better way to <b>manage your projects</b>? <i>It starts here.</i>')),
position: 'right',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('personal_stage_tour', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="project.menu_main_pm"]',
}, {
content: "Open Pig Project",
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('burndown_chart_tour', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="project.menu_main_pm"]',
}, {
content: 'Open "Burndown Chart Test" project menu',
@@ -93,11 +93,17 @@ const projectSharingSteps = [...stepUtils.goToAppSteps("project.menu_main_pm", '
registry.category("web_tour.tours").add('project_sharing_tour', {
test: true,
url: '/web',
steps: projectSharingSteps });
steps: () => {
return projectSharingSteps;
}
});
// The begining of the project sharing feature
const projectSharingStepIndex = projectSharingSteps.findIndex(s => s.id && s.id === 'project_sharing_feature');
registry.category("web_tour.tours").add('portal_project_sharing_tour', {
registry.category("web_tour.tours").add("portal_project_sharing_tour", {
test: true,
url: '/my/projects',
steps: projectSharingSteps.slice(projectSharingStepIndex, projectSharingSteps.length) });
url: "/my/projects",
steps: () => {
// The begining of the project sharing feature
const projectSharingStepIndex = projectSharingSteps.findIndex(s => s?.id === 'project_sharing_feature');
return projectSharingSteps.slice(projectSharingStepIndex, projectSharingSteps.length);
}
});
@@ -30,7 +30,7 @@ function openProjectUpdateAndReturnToTasks(view, viewClass) {
registry.category("web_tour.tours").add('project_update_tour', {
test: true,
url: '/web',
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="project.menu_main_pm"]',
}, {
trigger: '.o-kanban-button-new',
@@ -11,7 +11,7 @@ import PurchaseAdditionalTourSteps from "purchase.purchase_steps";
registry.category("web_tour.tours").add('purchase_tour' , {
url: "/web",
sequence: 40,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="purchase.menu_purchase_root"]',
content: _t("Let's try the Purchase app to manage the flow from purchase to reception and invoice control."),
position: 'right',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('purchase_matrix_tour', {
url: "/web",
test: true,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: '.o_app[data-menu-xmlid="purchase.menu_purchase_root"]',
}, {
trigger: ".o_list_button_add",
+2 -2
View File
@@ -12,7 +12,7 @@ registry.category("web_tour.tours").add("sale_tour", {
url: "/web",
rainbowMan: false,
sequence: 20,
steps: [stepUtils.showAppsMenuItem(), {
steps: () => [stepUtils.showAppsMenuItem(), {
trigger: ".o_app[data-menu-xmlid='sale.sale_menu_root']",
content: _t("Open Sales app to send your first quotation in a few clicks."),
position: "right",
@@ -85,7 +85,7 @@ registry.category("web_tour.tours").add("sale_quote_tour", {
rainbowMan: true,
rainbowManMessage: markup(_t("<b>Congratulations</b>, your first quotation is sent!<br>Check your email to validate the quote.")),
sequence: 30,
steps: [{
steps: () => [{
trigger: ".o_field_res_partner_many2one[name='partner_id']",
extra_trigger: ".o_sale_order",
content: _t("Write a company name to create one, or see suggestions."),
@@ -6,7 +6,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('sale_signature', {
test: true,
url: '/my/quotes',
steps: [
steps: () => [
{
content: "open the test SO",
trigger: 'a:containsExact("test SO")',
@@ -7,7 +7,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('sale_timesheet_tour', {
test: true,
url: '/web',
steps: [...stepUtils.goToAppSteps("sale.sale_menu_root", 'Go to the Sales App'),
steps: () => [...stepUtils.goToAppSteps("sale.sale_menu_root", 'Go to the Sales App'),
{
trigger: 'button.o_list_button_add',
content: 'Click on CREATE button to create a quotation with service products.',
@@ -4,7 +4,7 @@
registry.category("web_tour.tours").add('test_stock_route_diagram_report', {
test: true,
steps: [
steps: () => [
{
trigger: '.o_kanban_record',
extra_trigger: '.o_breadcrumb',
@@ -10,7 +10,7 @@ registry.category("web_tour.tours").add('survey_tour', {
url: "/web",
rainbowManMessage: _t("Congratulations! You are now ready to collect feedback like a pro :-)"),
sequence: 225,
steps: [
steps: () => [
...stepUtils.goToAppSteps('survey.menu_surveys', Markup(_t("Ready to change the way you <b>gather data</b>?"))),
{
trigger: '.btn-outline-primary.o_survey_load_sample',
@@ -103,4 +103,4 @@ var lastSteps = [{
registry.category("web_tour.tours").add('test_certification_failure', {
test: true,
url: '/survey/start/4ead4bc8-b8f2-4760-a682-1fde8daaaaac',
steps: [].concat(failSteps, retrySteps, failSteps, lastSteps) });
steps: () => [].concat(failSteps, retrySteps, failSteps, lastSteps) });
@@ -16,7 +16,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('test_certification_success', {
test: true,
url: '/survey/start/4ead4bc8-b8f2-4760-a682-1fde8daaaaac',
steps: [{ // Page-1
steps: () => [{ // Page-1
content: "Clicking on Start Certification",
trigger: 'button.btn.btn-primary.btn-lg:contains("Start Certification")',
}, { // Question: Do we sell Acoustic Bloc Screens?
+1 -1
View File
@@ -5,7 +5,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('test_survey', {
test: true,
url: '/survey/start/b137640d-14d4-4748-9ef6-344caaaaaae',
steps: [
steps: () => [
// Page-1
{
content: 'Click on Start',
@@ -5,7 +5,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('test_survey_chained_conditional_questions', {
test: true,
url: '/survey/start/3cfadce3-3f7e-41da-920d-10fa0eb19527',
steps: [
steps: () => [
{
content: 'Click on Start',
trigger: 'button.btn:contains("Start")',
@@ -6,7 +6,7 @@ import { stepUtils } from "@web_tour/tour_service/tour_utils";
registry.category("web_tour.tours").add('survey_tour_test_survey_form_triggers', {
test: true,
url: '/web',
steps: [
steps: () => [
stepUtils.showAppsMenuItem(),
{
content: 'Go to Survey',
@@ -5,7 +5,7 @@ import { registry } from "@web/core/registry";
registry.category("web_tour.tours").add('test_survey_prefill', {
test: true,
url: '/survey/start/b137640d-14d4-4748-9ef6-344caaaaaae',
steps: [{ // Page-1
steps: () => [{ // Page-1
trigger: 'button.btn.btn-primary.btn-lg:contains("Start Survey")',
}, { // Question: Where do you live?
trigger: 'div.js_question-wrapper:contains("Where do you live?") input',
@@ -1,17 +1,24 @@
/** @odoo-module **/
import { registry } from "@web/core/registry";
import surveySessionTools from "survey.session_tour_tools";
import { accessSurveysteps } from "./survey_tour_session_tools";
/**
* Small tour that will simply start the session and wait for attendees.
*/
registry.category("web_tour.tours").add('test_survey_session_create_tour', {
registry.category("web_tour.tours").add("test_survey_session_create_tour", {
url: "/web",
test: true,
steps: [].concat(surveySessionTools.accessSurveySteps, [{
trigger: 'button[name="action_start_session"]',
}, {
trigger: '.o_survey_session_attendees_count:contains("0")',
run: function () {} // check session is correctly started
}])});
steps: () => {
return [
...accessSurveysteps,
{
trigger: 'button[name="action_start_session"]',
},
{
trigger: '.o_survey_session_attendees_count:contains("0")',
run: function () {}, // check session is correctly started
},
];
},
});

Some files were not shown because too many files have changed in this diff Show More