diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/account/static/tests/tours | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/account/static/tests/tours')
| -rw-r--r-- | addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js | 42 | ||||
| -rw-r--r-- | addons/account/static/tests/tours/tax_group_tests.js | 124 |
2 files changed, 166 insertions, 0 deletions
diff --git a/addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js b/addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js new file mode 100644 index 00000000..0d11b027 --- /dev/null +++ b/addons/account/static/tests/tours/account_dashboard_setup_bar_tests.js @@ -0,0 +1,42 @@ +odoo.define('account.dashboard.setup.tour', function (require) { + "use strict"; + + var core = require('web.core'); + var tour = require('web_tour.tour'); + + var _t = core._t; + + tour.register('account_render_report', { + test: true, + url: '/web', + }, [tour.stepUtils.showAppsMenuItem(), + { + id: 'account_menu_click', + trigger: '.o_app[data-menu-xmlid="account.menu_finance"]', + position: 'bottom', + }, { + trigger: '.o_data_row:first', + extra_trigger: '.breadcrumb', + }, { + trigger: '.o_control_panel button:contains("' + _t('Print') + '")', + }, { + trigger: '.o_control_panel .o_dropdown_menu a:contains("' + _t('Invoices without Payment') + '")', + }, { + trigger: 'iframe .o_report_layout_standard h2', + content: 'Primary color is correct', + run: function () { + if (this.$anchor.css('color') !== "rgb(18, 52, 86)") { + console.error('The primary color should be the one set on the company.'); + } + }, + }, { + trigger: 'iframe .o_report_layout_standard #informations div strong', + content: 'Secondary color is correct', + run: function () { + if (this.$anchor.css('color') !== "rgb(120, 145, 1)") { + console.error('The secondary color should be the one set on the company.'); + } + }, + } + ]); +}); diff --git a/addons/account/static/tests/tours/tax_group_tests.js b/addons/account/static/tests/tours/tax_group_tests.js new file mode 100644 index 00000000..08cb218f --- /dev/null +++ b/addons/account/static/tests/tours/tax_group_tests.js @@ -0,0 +1,124 @@ +odoo.define('account.tax.group.tour.tests', function (require) { + "use strict"; + + var core = require('web.core'); + var tour = require('web_tour.tour'); + var _t = core._t; + + tour.register('account_tax_group', { + test: true, + url: "/web", + }, [tour.stepUtils.showAppsMenuItem(), + { + content: "Go to Invoicing", + trigger: '.o_app[data-menu-xmlid="account.menu_finance"]', + edition: 'community', + }, + { + content: "Go to Accounting", + trigger: '.o_app[data-menu-xmlid="account_accountant.menu_accounting"]', + edition: 'enterprise', + }, + { + content: "Go to Vendors", + trigger: 'a:contains("Vendors")', + }, + { + content: "Go to Bills", + trigger: 'span:contains("Bills")', + }, + { + extra_trigger: '.breadcrumb:contains("Bills")', + content: "Create new bill", + trigger: '.o_list_button_add', + }, + // Set a vendor + { + content: "Add vendor", + trigger: 'div.o_field_widget.o_field_many2one[name="partner_id"] div input', + run: 'text Azure Interior', + }, + { + content: "Valid vendor", + trigger: '.ui-menu-item a:contains("Azure Interior")', + }, + // Add First product + { + content: "Add items", + trigger: 'div[name="invoice_line_ids"] .o_field_x2many_list_row_add a:contains("Add a line")', + }, + { + content: "Select input", + trigger: 'div[name="invoice_line_ids"] .o_list_view .o_selected_row .o_list_many2one:first input', + }, + { + content: "Type item", + trigger: 'div[name="invoice_line_ids"] .o_list_view .o_selected_row .o_list_many2one:first input', + run: "text Large Desk", + }, + { + content: "Valid item", + trigger: '.ui-menu-item-wrapper:contains("Large Desk")', + }, + // Save account.move + { + content: "Save the account move", + trigger: '.o_form_button_save', + }, + // Edit account.move + { + content: "Edit the account move", + trigger: '.o_form_button_edit', + }, + // Edit tax group amount + { + content: "Edit tax group amount", + trigger: '.oe_tax_group_amount_value', + }, + { + content: "Modify the input value", + trigger: '.tax_group_edit_input input', + run: function (actions) { + $('.tax_group_edit_input input').val(200); + $('.tax_group_edit_input input').select(); + var keydownEvent = jQuery.Event('keydown'); + keydownEvent.which = 13; + this.$anchor.trigger(keydownEvent); + }, + }, + // Check new value for total (with modified tax_group_amount). + { + content: "Valid total amount", + trigger: 'span[name="amount_total"]:contains("1,499.00")', + }, + // Modify the quantity of the object + { + content: "Select item quantity", + trigger: 'div[name="invoice_line_ids"] .o_list_view tbody tr.o_data_row .o_list_number[title="1.000"]', + }, + { + content: "Change item quantity", + trigger: 'div[name="invoice_line_ids"] .o_list_view tbody tr.o_data_row .o_list_number[title="1.000"] input', + run: 'text 2', + }, + { + content: "Valid the new value", + trigger: 'div[name="invoice_line_ids"] .o_list_view tbody tr.o_data_row .o_list_number[title="1.000"] input', + run: function (actions) { + var keydownEvent = jQuery.Event('keydown'); + keydownEvent.which = 13; + this.$anchor.trigger(keydownEvent); + }, + }, + // Save form + { + content: "Save the account move", + trigger: '.o_form_button_save', + }, + // Check new tax group value + { + content: "Check new value of tax group", + trigger: '.oe_tax_group_amount_value:contains("389.70")', + }, + ]); +}); |
