diff --git a/fusion_accounting_assets/__manifest__.py b/fusion_accounting_assets/__manifest__.py index fb93f5fc..a638396e 100644 --- a/fusion_accounting_assets/__manifest__.py +++ b/fusion_accounting_assets/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Fusion Accounting Assets', - 'version': '19.0.1.0.33', + 'version': '19.0.1.0.34', 'category': 'Accounting/Accounting', 'summary': 'AI-augmented asset management with depreciation schedules.', 'description': """ @@ -65,6 +65,9 @@ menu hides; the engine + AI tools remain available for the chat. 'fusion_accounting_assets/static/src/components/anomaly_strip/anomaly_strip.js', 'fusion_accounting_assets/static/src/components/anomaly_strip/anomaly_strip.xml', ], + 'web.assets_tests': [ + 'fusion_accounting_assets/static/src/tours/assets_tours.js', + ], }, 'installable': True, 'auto_install': False, diff --git a/fusion_accounting_assets/static/src/tours/assets_tours.js b/fusion_accounting_assets/static/src/tours/assets_tours.js new file mode 100644 index 00000000..b5b4547d --- /dev/null +++ b/fusion_accounting_assets/static/src/tours/assets_tours.js @@ -0,0 +1,80 @@ +/** @odoo-module **/ + +import { registry } from "@web/core/registry"; + +/** + * 5 OWL tours for fusion_accounting_assets smoke testing. + * + * Each tour scripts a user interaction and is invoked from Python via + * HttpCase.start_tour(). Useful for catching UI regressions that asset-bundle + * compilation alone won't catch. + */ + +// Tour 1: smoke +registry.category("web_tour.tours").add("fusion_assets_smoke", { + test: true, + url: "/odoo", + steps: () => [ + { + content: "Wait for app", + trigger: ".o_navbar", + }, + ], +}); + +// Tour 2: open asset list +registry.category("web_tour.tours").add("fusion_assets_list", { + test: true, + url: "/odoo/action-fusion_accounting_assets.action_fusion_asset_list", + steps: () => [ + { + content: "List view loads", + trigger: ".o_list_view, .o_view_nocontent", + }, + ], +}); + +// Tour 3: open categories +registry.category("web_tour.tours").add("fusion_assets_categories", { + test: true, + url: "/odoo/action-fusion_accounting_assets.action_fusion_asset_category_list", + steps: () => [ + { + content: "Categories view loads", + trigger: ".o_list_view, .o_view_nocontent", + }, + ], +}); + +// Tour 4: anomalies +registry.category("web_tour.tours").add("fusion_assets_anomalies", { + test: true, + url: "/odoo/action-fusion_accounting_assets.action_fusion_asset_anomaly_list", + steps: () => [ + { + content: "Anomalies view loads", + trigger: ".o_list_view, .o_view_nocontent", + }, + ], +}); + +// Tour 5: depreciation run wizard +registry.category("web_tour.tours").add("fusion_assets_depreciation_wizard", { + test: true, + url: "/odoo/action-fusion_accounting_assets.action_fusion_depreciation_run_wizard", + steps: () => [ + { + content: "Wizard form opens", + trigger: ".modal-dialog .o_form_view", + }, + { + content: "Period date field exists", + trigger: ".modal-dialog [name='period_date']", + }, + { + content: "Close wizard", + trigger: ".modal-dialog .btn-secondary", + run: "click", + }, + ], +}); diff --git a/fusion_accounting_assets/tests/__init__.py b/fusion_accounting_assets/tests/__init__.py index b5d2c45e..d97e2822 100644 --- a/fusion_accounting_assets/tests/__init__.py +++ b/fusion_accounting_assets/tests/__init__.py @@ -26,3 +26,4 @@ from . import test_depreciation_run_wizard from . import test_migration_round_trip from . import test_audit_report from . import test_coexistence +from . import test_assets_tours diff --git a/fusion_accounting_assets/tests/test_assets_tours.py b/fusion_accounting_assets/tests/test_assets_tours.py new file mode 100644 index 00000000..62c2b07c --- /dev/null +++ b/fusion_accounting_assets/tests/test_assets_tours.py @@ -0,0 +1,28 @@ +"""Python wrappers that run the OWL tours via HttpCase.start_tour. + +Tours require an HTTP server + headless browser. They are tagged with +'tour' so they can be excluded from fast unit-test runs and selected +explicitly when CI has the right infra (chromium + xvfb / websocket-client). +""" + +from odoo.tests.common import HttpCase +from odoo.tests import tagged + + +@tagged('post_install', '-at_install', 'tour') +class TestAssetsTours(HttpCase): + + def test_smoke_tour(self): + self.start_tour("/odoo", "fusion_assets_smoke", login="admin") + + def test_list_tour(self): + self.start_tour("/odoo", "fusion_assets_list", login="admin") + + def test_categories_tour(self): + self.start_tour("/odoo", "fusion_assets_categories", login="admin") + + def test_anomalies_tour(self): + self.start_tour("/odoo", "fusion_assets_anomalies", login="admin") + + def test_depreciation_wizard_tour(self): + self.start_tour("/odoo", "fusion_assets_depreciation_wizard", login="admin")