Skip to content

feat: add Playwright E2E coverage and improve ribbon line-type workflows#226

Merged
mlightcad merged 1 commit intomainfrom
fix/213
Apr 20, 2026
Merged

feat: add Playwright E2E coverage and improve ribbon line-type workflows#226
mlightcad merged 1 commit intomainfrom
fix/213

Conversation

@mlightcad
Copy link
Copy Markdown
Owner

@mlightcad mlightcad commented Apr 20, 2026

Summary

  • Add Playwright-based end-to-end testing for cad-viewer-example, including config, smoke tests, and a DXF fixture.
  • Extend CI to install Playwright Chromium, run e2e tests, and upload Playwright artifacts on failure.
  • Improve ribbon property behavior so color, line weight, and line type changes apply to currently selected entities.
  • Enhance line type option rendering with inline SVG previews and increase ribbon property field width for better display.
  • Bump @mlightcad/data-model and @mlightcad/libredwg-converter versions and refresh lockfile entries.

Why

  • Provide automated browser-level regression coverage for core viewer loading and interaction flows.
  • Ensure property edits from the ribbon affect selected entities immediately, matching user expectations.
  • Improve line type preview fidelity beyond gradient-only fallbacks.
  • Keep dependency versions aligned with newer CAD stack releases.

What Changed

  • CI:
    • Update .github/workflows/ci.yml with Playwright browser install, e2e execution, and artifact upload.
  • Example app testing:
    • Add playwright.config.ts.
    • Add e2e/tests/smoke.spec.ts (upload screen, DXF load/render shell, basic mouse interactions with runtime error capture).
    • Add e2e/fixtures/minimal-line.dxf.
    • Add e2e scripts and @playwright/test dev dependency in packages/cad-viewer-example/package.json.
  • Viewer UI logic:
    • Add reusable selected-entity mutation helper in MlRibbonCommands.vue.
    • Apply ribbon color/lineweight/linetype updates to selected entities and trigger modified events.
    • Add previewSvgString support and resilient SVG extraction in lineTypeOptions.ts.
    • Render SVG previews in MlLineTypeSelect.vue with fallback background behavior.
    • Widen property field column in MlRibbonPropertyField.vue for improved content fit.
  • Dependencies:
    • Update root overrides in package.json and lockfile to @mlightcad/data-model@^1.7.22 and @mlightcad/libredwg-converter@^3.5.22.

Risks / Notes

  • v-html is used for line type SVG preview rendering; safety depends on trusted/sanitized SVG sources.
  • CI runtime may increase due to browser installation and e2e execution.
  • E2E tests currently focus on smoke coverage; deeper interaction/render assertions may be added later.

@mlightcad mlightcad merged commit 1a91991 into main Apr 20, 2026
2 checks passed
@mlightcad mlightcad deleted the fix/213 branch April 20, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant