test(fusion_accounting_assets): 5 OWL tour tests
Mirrors Phase 1 + 2 tour pattern: HttpCase.start_tour wrappers tagged 'tour' so they skip cleanly when websocket-client is absent. Tours cover smoke (/odoo loads), the asset list / category list / anomaly list views, and the depreciation-run wizard form. Bundle is wired via web.assets_tests. Verified locally: 5 tests registered, all skip with "websocket-client module is not installed" (expected — no chromium in the dev container). Made-with: Cursor
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
'name': 'Fusion Accounting Assets',
|
'name': 'Fusion Accounting Assets',
|
||||||
'version': '19.0.1.0.33',
|
'version': '19.0.1.0.34',
|
||||||
'category': 'Accounting/Accounting',
|
'category': 'Accounting/Accounting',
|
||||||
'summary': 'AI-augmented asset management with depreciation schedules.',
|
'summary': 'AI-augmented asset management with depreciation schedules.',
|
||||||
'description': """
|
'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.js',
|
||||||
'fusion_accounting_assets/static/src/components/anomaly_strip/anomaly_strip.xml',
|
'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,
|
'installable': True,
|
||||||
'auto_install': False,
|
'auto_install': False,
|
||||||
|
|||||||
80
fusion_accounting_assets/static/src/tours/assets_tours.js
Normal file
80
fusion_accounting_assets/static/src/tours/assets_tours.js
Normal file
@@ -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",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
@@ -26,3 +26,4 @@ from . import test_depreciation_run_wizard
|
|||||||
from . import test_migration_round_trip
|
from . import test_migration_round_trip
|
||||||
from . import test_audit_report
|
from . import test_audit_report
|
||||||
from . import test_coexistence
|
from . import test_coexistence
|
||||||
|
from . import test_assets_tours
|
||||||
|
|||||||
28
fusion_accounting_assets/tests/test_assets_tours.py
Normal file
28
fusion_accounting_assets/tests/test_assets_tours.py
Normal file
@@ -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")
|
||||||
Reference in New Issue
Block a user