[GH-ISSUE #572] QUESTION/REQUEST: Automation for the program using tview #419

Open
opened 2026-03-04 01:04:48 +03:00 by kerem · 1 comment
Owner

Originally created by @ArmenuhiKocharyan on GitHub (Mar 4, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/572

Hi,

We have a program which creates a terminal based UI for our GO script.
We need to automate test cases for the UI.
Is there any library/ test tool/ test framework for tview?

Thanks in advance.

Originally created by @ArmenuhiKocharyan on GitHub (Mar 4, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/572 Hi, We have a program which creates a terminal based UI for our GO script. We need to automate test cases for the UI. Is there any library/ test tool/ test framework for tview? Thanks in advance.
Author
Owner

@rivo commented on GitHub (Mar 11, 2021):

I have had something in mind for the longest time (since I started this project, actually) but haven't had the time to implement it. Basically, the idea is to create a mock tcell.Screen implementation that can be used instead of the regular Screen objects which write to the console.

This mock object would basically run "headless". It would be able to output a unique hash based on its current content, which could then be compared to a hash stored in the test cases. If a hash differs, it would mean there is an unwanted side effect somewhere (or the change was intentional and the test case hash needs to be updated). It should also be easily possible to log the screen's current state to the console (maybe when the go test -v flag is set?) so one can visually inspect the test case results or debug it.

I'm trying to figure out ways to dedicate more time to tview and I believe this test suite would be one of the first things I'd tackle given more time.

<!-- gh-comment-id:796910605 --> @rivo commented on GitHub (Mar 11, 2021): I have had something in mind for the longest time (since I started this project, actually) but haven't had the time to implement it. Basically, the idea is to create a mock [`tcell.Screen`](https://pkg.go.dev/github.com/gdamore/tcell#Screen) implementation that can be used instead of the regular `Screen` objects which write to the console. This mock object would basically run "headless". It would be able to output a unique hash based on its current content, which could then be compared to a hash stored in the test cases. If a hash differs, it would mean there is an unwanted side effect somewhere (or the change was intentional and the test case hash needs to be updated). It should also be easily possible to log the screen's current state to the console (maybe when the `go test -v` flag is set?) so one can visually inspect the test case results or debug it. I'm trying to figure out ways to dedicate more time to `tview` and I believe this test suite would be one of the first things I'd tackle given more time.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#419
No description provided.