Complete testing system: pyproject.toml (pytest markers), test.sh orchestrator with auto app start/stop and colorful summary, pre-push hook, Gitea Actions workflow. New QA tests: API health (7 endpoints), responsive (3 viewports), log monitoring (ERROR/ORA-/Traceback detection), real GoMag sync, PL/SQL package validation, smoke prod (read-only). Converted test_app_basic.py and test_integration.py to pytest. Added pytestmark to all existing tests (unit/e2e/oracle). E2E conftest upgraded: console error collector, screenshot on failure, auto-detect live app on :5003. Usage: ./test.sh ci (30s) | ./test.sh full (2-3min) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
56 lines
2.2 KiB
Python
56 lines
2.2 KiB
Python
"""E2E: Order detail modal structure and inline mapping."""
|
|
import pytest
|
|
from playwright.sync_api import Page, expect
|
|
|
|
pytestmark = pytest.mark.e2e
|
|
|
|
|
|
def test_order_detail_modal_has_roa_ids(page: Page, app_url: str):
|
|
"""R9: Verify order detail modal contains all ROA ID labels."""
|
|
page.goto(f"{app_url}/logs")
|
|
page.wait_for_load_state("networkidle")
|
|
|
|
modal = page.locator("#orderDetailModal")
|
|
expect(modal).to_be_attached()
|
|
|
|
modal_html = modal.inner_html()
|
|
assert "ID Comanda ROA" in modal_html, "Missing 'ID Comanda ROA' label in order detail modal"
|
|
assert "ID Partener" in modal_html, "Missing 'ID Partener' label in order detail modal"
|
|
assert "ID Adr. Facturare" in modal_html, "Missing 'ID Adr. Facturare' label in order detail modal"
|
|
assert "ID Adr. Livrare" in modal_html, "Missing 'ID Adr. Livrare' label in order detail modal"
|
|
|
|
|
|
def test_order_detail_items_table_columns(page: Page, app_url: str):
|
|
"""R9: Verify items table has all required columns."""
|
|
page.goto(f"{app_url}/logs")
|
|
page.wait_for_load_state("networkidle")
|
|
|
|
headers = page.locator("#orderDetailModal thead th")
|
|
texts = headers.all_text_contents()
|
|
|
|
# Current columns (may evolve — check dashboard.html for source of truth)
|
|
required_columns = ["SKU", "Produs", "CODMAT", "Cant.", "Pret", "Valoare"]
|
|
for col in required_columns:
|
|
assert col in texts, f"Column '{col}' missing from order detail items table. Found: {texts}"
|
|
|
|
|
|
def test_quick_map_from_order_detail(page: Page, app_url: str):
|
|
"""R9+R11: Verify quick map modal is reachable from order detail context."""
|
|
page.goto(f"{app_url}/logs")
|
|
page.wait_for_load_state("networkidle")
|
|
|
|
modal = page.locator("#quickMapModal")
|
|
expect(modal).to_be_attached()
|
|
|
|
expect(page.locator("#qmCodmatLines")).to_be_attached()
|
|
expect(page.locator("#qmPctWarning")).to_be_attached()
|
|
|
|
|
|
def test_dashboard_navigates_to_logs(page: Page, app_url: str):
|
|
"""Verify the sidebar on the dashboard contains a link to the logs page."""
|
|
page.goto(f"{app_url}/")
|
|
page.wait_for_load_state("networkidle")
|
|
|
|
logs_link = page.locator("a[href='/logs']")
|
|
expect(logs_link).to_be_visible()
|