Skip to content

Feature request: export SVG/PNG screen artifacts from @microsoft/tui-test #68

Description

@solanab

Summary

@microsoft/tui-test is very close to the Playwright-style terminal E2E workflow we want: real PTY, auto-waiting, locators, snapshots, and traces. One gap we hit in practice is the lack of a first-class way to export screen artifacts such as SVG or PNG for CI/debugging.

Current behavior

Today the main options appear to be:

  • expect(terminal).toMatchSnapshot()
  • terminal.serialize()
  • --trace + show-trace

Those are useful, but they are not a drop-in replacement for a standalone visual artifact file.

Why this matters

For terminal UIs with layout/alignment/box-drawing/color concerns (for example tmux popups, alternate-screen TUIs, dashboards, etc.), a text snapshot is sometimes not enough during failure triage.

In CI we often want to keep one or more artifacts such as:

  • popup.svg for crisp visual inspection
  • popup.png for easy upload/preview in CI systems
  • optional structured screen dump alongside the visual artifact

Right now that pushes us to bring in a second tool just for artifact capture, even though @microsoft/tui-test already covers the actual E2E interaction model very well.

Request

Would you consider adding one of these options?

  1. A direct API such as:
    • await terminal.screenshot({ path: "artifacts/popup.svg" })
    • await terminal.screenshot({ path: "artifacts/popup.png" })
  2. Or an assertion/artifact API such as:
    • await expect(terminal).toMatchSnapshot({ artifact: { svg: "..." } })
  3. Or a failure-artifact hook that writes visual output when a test fails.

Notes

  • SVG-only support would already be a big improvement.
  • PNG could be optional or platform-dependent if rasterization adds extra complexity.
  • The request is specifically about exporting the current rendered terminal screen as an artifact, not just keeping replay traces.

Thanks — the library already feels like the closest thing to Playwright for TUI testing, and artifact export would make it much easier to use as the single tool in CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions