ghciwatch icon indicating copy to clipboard operation
ghciwatch copied to clipboard

[DUX-1985] Test the TUI

Open 9999years opened this issue 1 year ago • 0 comments

The --tui is cool and we need a new framework to test it. I think asciinema fits the bill.

The basic idea is:

  • Let users customize the set of log events that are printed to stdout and the set of log events that are sent to the JSON logs separately (this will let us continue to use debug- and trace-level log events to drive the tests while keeping the output identical to what users will see when running ghciwatch in typical use-cases)
  • Run tests under asciinema to record terminal output
  • Insert asciicast marker events in the recording to denote timestamps to check screenshots at
  • Use the asciicast crate to parse the asciicast files and feed the output to the avt crate to render them onto a grid of characters, then compare the expected and actual output

The big missing feature here is mouse events. I'm not sure how to send mouse events to a program in an automated fashion.

From SyncLinear.com | DUX-1985

9999years avatar Mar 01 '24 00:03 9999years