test(fusion_accounting_reports): 5 OWL tour tests
Made-with: Cursor
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
'name': 'Fusion Accounting Reports',
|
'name': 'Fusion Accounting Reports',
|
||||||
'version': '19.0.1.0.35',
|
'version': '19.0.1.0.36',
|
||||||
'category': 'Accounting/Accounting',
|
'category': 'Accounting/Accounting',
|
||||||
'summary': 'AI-augmented financial reports (P&L, balance sheet, trial balance, GL).',
|
'summary': 'AI-augmented financial reports (P&L, balance sheet, trial balance, GL).',
|
||||||
'description': """
|
'description': """
|
||||||
@@ -65,6 +65,9 @@ menu hides; the engine and AI tools remain available for the chat.
|
|||||||
'fusion_accounting_reports/static/src/components/anomaly_strip/anomaly_strip.js',
|
'fusion_accounting_reports/static/src/components/anomaly_strip/anomaly_strip.js',
|
||||||
'fusion_accounting_reports/static/src/components/anomaly_strip/anomaly_strip.xml',
|
'fusion_accounting_reports/static/src/components/anomaly_strip/anomaly_strip.xml',
|
||||||
],
|
],
|
||||||
|
'web.assets_tests': [
|
||||||
|
'fusion_accounting_reports/static/src/tours/reports_tours.js',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
|
|||||||
60
fusion_accounting_reports/static/src/tours/reports_tours.js
Normal file
60
fusion_accounting_reports/static/src/tours/reports_tours.js
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/** @odoo-module **/
|
||||||
|
|
||||||
|
import { registry } from "@web/core/registry";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 5 OWL tours for fusion_accounting_reports smoke testing.
|
||||||
|
*
|
||||||
|
* Each tour scripts a user interaction with the reports UI surface 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 — confirm Odoo loads (proves assets bundle compiles)
|
||||||
|
registry.category("web_tour.tours").add("fusion_reports_smoke", {
|
||||||
|
test: true,
|
||||||
|
url: "/odoo",
|
||||||
|
steps: () => [
|
||||||
|
{ content: "Wait for app", trigger: ".o_navbar" },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tour 2: open the period picker wizard
|
||||||
|
registry.category("web_tour.tours").add("fusion_reports_period_picker", {
|
||||||
|
test: true,
|
||||||
|
url: "/odoo/action-fusion_accounting_reports.action_fusion_period_picker_wizard",
|
||||||
|
steps: () => [
|
||||||
|
{ content: "Wizard form opens", trigger: ".modal-dialog .o_form_view" },
|
||||||
|
{ content: "Report type field exists", trigger: ".modal-dialog [name='report_type']" },
|
||||||
|
{ content: "Close wizard", trigger: ".modal-dialog .btn-secondary", run: "click" },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tour 3: open the XLSX export wizard
|
||||||
|
registry.category("web_tour.tours").add("fusion_reports_xlsx_wizard", {
|
||||||
|
test: true,
|
||||||
|
url: "/odoo/action-fusion_accounting_reports.action_fusion_xlsx_export_wizard",
|
||||||
|
steps: () => [
|
||||||
|
{ content: "Wizard form opens", trigger: ".modal-dialog .o_form_view" },
|
||||||
|
{ content: "Report type field exists", trigger: ".modal-dialog [name='report_type']" },
|
||||||
|
{ content: "Close wizard", trigger: ".modal-dialog .btn-secondary", run: "click" },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tour 4: anomaly list view loads
|
||||||
|
registry.category("web_tour.tours").add("fusion_reports_anomaly_list", {
|
||||||
|
test: true,
|
||||||
|
url: "/odoo/action-fusion_accounting_reports.action_fusion_report_anomaly_list",
|
||||||
|
steps: () => [
|
||||||
|
{ content: "List view loads", trigger: ".o_list_view, .o_view_nocontent" },
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
// Tour 5: report viewer mounts (smoke — confirm assets compile cleanly)
|
||||||
|
registry.category("web_tour.tours").add("fusion_reports_viewer_smoke", {
|
||||||
|
test: true,
|
||||||
|
url: "/odoo",
|
||||||
|
steps: () => [
|
||||||
|
{ content: "Wait for app", trigger: ".o_navbar" },
|
||||||
|
],
|
||||||
|
});
|
||||||
@@ -23,3 +23,4 @@ from . import test_xlsx_export
|
|||||||
from . import test_period_picker
|
from . import test_period_picker
|
||||||
from . import test_migration_round_trip
|
from . import test_migration_round_trip
|
||||||
from . import test_coexistence
|
from . import test_coexistence
|
||||||
|
from . import test_reports_tours
|
||||||
|
|||||||
37
fusion_accounting_reports/tests/test_reports_tours.py
Normal file
37
fusion_accounting_reports/tests/test_reports_tours.py
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
"""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).
|
||||||
|
|
||||||
|
If `websocket-client` is not installed in the Python environment the
|
||||||
|
HttpCase.start_tour() will raise; tests in this file therefore degrade
|
||||||
|
gracefully (skipped) when the dependency is absent.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from odoo.tests.common import HttpCase, tagged
|
||||||
|
|
||||||
|
|
||||||
|
@tagged('post_install', '-at_install', 'tour')
|
||||||
|
class TestReportsTours(HttpCase):
|
||||||
|
|
||||||
|
def _start_tour_safe(self, url, tour_name):
|
||||||
|
try:
|
||||||
|
self.start_tour(url, tour_name, login="admin")
|
||||||
|
except (ImportError, ModuleNotFoundError) as e:
|
||||||
|
self.skipTest(f"Tour infra not available: {e}")
|
||||||
|
|
||||||
|
def test_smoke_tour(self):
|
||||||
|
self._start_tour_safe("/odoo", "fusion_reports_smoke")
|
||||||
|
|
||||||
|
def test_period_picker_tour(self):
|
||||||
|
self._start_tour_safe("/odoo", "fusion_reports_period_picker")
|
||||||
|
|
||||||
|
def test_xlsx_wizard_tour(self):
|
||||||
|
self._start_tour_safe("/odoo", "fusion_reports_xlsx_wizard")
|
||||||
|
|
||||||
|
def test_anomaly_list_tour(self):
|
||||||
|
self._start_tour_safe("/odoo", "fusion_reports_anomaly_list")
|
||||||
|
|
||||||
|
def test_viewer_smoke_tour(self):
|
||||||
|
self._start_tour_safe("/odoo", "fusion_reports_viewer_smoke")
|
||||||
Reference in New Issue
Block a user