From 40ab9d2667f00044c149fbcbff732936c9d403bc Mon Sep 17 00:00:00 2001 From: vava-odoo Date: Mon, 17 Jun 2024 21:24:09 +0200 Subject: [PATCH] [IMP] *: add test tours for customizations task-3973514 --- tests/test_condominium/__init__.py | 0 tests/test_condominium/__manifest__.py | 14 +++ .../static/src/js/tours/fields_and_views.js | 99 +++++++++++++++++++ tests/test_condominium/tests/__init__.py | 1 + .../tests/test_condominium.py | 8 ++ 5 files changed, 122 insertions(+) create mode 100644 tests/test_condominium/__init__.py create mode 100644 tests/test_condominium/__manifest__.py create mode 100644 tests/test_condominium/static/src/js/tours/fields_and_views.js create mode 100644 tests/test_condominium/tests/__init__.py create mode 100644 tests/test_condominium/tests/test_condominium.py diff --git a/tests/test_condominium/__init__.py b/tests/test_condominium/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/test_condominium/__manifest__.py b/tests/test_condominium/__manifest__.py new file mode 100644 index 000000000..9b081eb95 --- /dev/null +++ b/tests/test_condominium/__manifest__.py @@ -0,0 +1,14 @@ +{ + 'name': 'test condominium industry', + 'version': '1.0', + 'category': 'Hidden/Tests', + 'description': """A module to test Condominium business flows.""", + 'depends': ['base'], + 'assets': { + 'web.assets_tests': [ + 'test_condominium/static/src/**/*', + ], + }, + 'installable': True, + 'license': 'LGPL-3', +} diff --git a/tests/test_condominium/static/src/js/tours/fields_and_views.js b/tests/test_condominium/static/src/js/tours/fields_and_views.js new file mode 100644 index 000000000..4d9d6d7eb --- /dev/null +++ b/tests/test_condominium/static/src/js/tours/fields_and_views.js @@ -0,0 +1,99 @@ +import { registry } from '@web/core/registry'; + +registry.category("web_tour.tours").add("condominium_properties_and_units", { + url: "/odoo", + steps: () => [ + { + "trigger": ".o_app[data-menu-xmlid='contacts\\.menu_contacts']", + "run": "click" + }, + { + "trigger": ".o-dropdown-item[data-menu-xmlid='condominium\\.contacts_property_config_menu']", + "run": "click" + }, + { + "trigger": ".o_facet_remove", + "run": "click" + }, + { + "trigger": ".o-dropdown[data-menu-xmlid='contacts\\.res_partner_menu_config']", + "run": "click" + }, + { + "trigger": ".o-dropdown-item[data-menu-xmlid='condominium\\.contacts_property_tags_config_menu']", + "run": "click" + }, + { + "trigger": ".o_list_button_add", + "run": "click" + }, + { + "trigger": ".o_field_widget[name='x_name'] > .o_input", + "run": "edit Tag" + }, + { + "trigger": ".o-dropdown-item[data-menu-xmlid='condominium\\.contacts_property_config_menu']", + "run": "click" + }, + { + "trigger": ".o_kanban_header input", + "run": "edit New Condominium" + }, + { + "trigger": ".o_kanban_add", + "run": "click" + }, + { + "trigger": ".o-kanban-button-new", + "run": "click" + }, + { + "trigger": ".o_field_widget[name='x_name'] > .o_input", + "run": "edit New Property" + }, + { + "trigger": ".o_field_widget[name='x_condominium_id'] .o-autocomplete--input", + "run": "click " + }, + { + "trigger": ".o-autocomplete--dropdown-item:contains('My ') > a", + "run": "click" + }, + { + "trigger": ".o_field_widget[name='x_partner_id'] .o-autocomplete--input", + "run": "click" + }, + { + "trigger": ".o-autocomplete--dropdown-item:nth-child(3) > a", + "run": "click" + }, + { + "trigger": ".o_field_widget[name='x_tenant_id'] .o-autocomplete--input", + "run": "click" + }, + { + "trigger": ".o-autocomplete--dropdown-item:nth-child(3) > a", + "run": "click" + }, + { + "trigger": ".o_field_widget[name='x_area'] > .o_input", + "run": "edit 120" + }, + { + "trigger": ".o_field_many2many_selection .o-autocomplete--input", + "run": "click" + }, + { + "trigger": ".o_field_widget[name='x_notes'] div[contenteditable='true']", + "run": "editor Some notes" + }, + { + "trigger": ".o_back_button > a", + "run": "click" + }, + { + "trigger": ".o_kanban_card_content", + "run": "click" + } +], +}); diff --git a/tests/test_condominium/tests/__init__.py b/tests/test_condominium/tests/__init__.py new file mode 100644 index 000000000..6a16bb47a --- /dev/null +++ b/tests/test_condominium/tests/__init__.py @@ -0,0 +1 @@ +from . import test_condominium diff --git a/tests/test_condominium/tests/test_condominium.py b/tests/test_condominium/tests/test_condominium.py new file mode 100644 index 000000000..00ecd1ea8 --- /dev/null +++ b/tests/test_condominium/tests/test_condominium.py @@ -0,0 +1,8 @@ +from odoo.tests import HttpCase, tagged + + +@tagged('post_install', '-at_install') +class TestUi(HttpCase): + + def test_fields_and_views(self): + self.start_tour("/web", 'condominium_properties_and_units', login="admin", watch=True)