Documentation
¶
Index ¶
- type TUITestHarness
- type TestHarness
- func (h *TestHarness) AssertContainsText(expected string)
- func (h *TestHarness) AssertCurrentView(expected string)
- func (h *TestHarness) AssertModalClosed()
- func (h *TestHarness) AssertModalOpen()
- func (h *TestHarness) AssertNotContainsText(expected string)
- func (h *TestHarness) AssertWaitForText(text string, timeout time.Duration)
- func (h *TestHarness) Cleanup()
- func (h *TestHarness) ContainsText(expected string) bool
- func (h *TestHarness) ContainsTextCaseInsensitive(expected string) bool
- func (h *TestHarness) DumpScreen()
- func (h *TestHarness) GetApp() *app.S9s
- func (h *TestHarness) GetCellAt(x, y int) (rune, tcell.Style)
- func (h *TestHarness) GetCurrentView() string
- func (h *TestHarness) GetModalName() string
- func (h *TestHarness) GetScreen() tcell.SimulationScreen
- func (h *TestHarness) GetScreenLines() []string
- func (h *TestHarness) GetScreenText() string
- func (h *TestHarness) IsCmdVisible() bool
- func (h *TestHarness) IsModalOpen() bool
- func (h *TestHarness) SendBacktab()
- func (h *TestHarness) SendCtrlC()
- func (h *TestHarness) SendEnter()
- func (h *TestHarness) SendEsc()
- func (h *TestHarness) SendKey(key tcell.Key, r rune, mod tcell.ModMask)
- func (h *TestHarness) SendRune(r rune)
- func (h *TestHarness) SendTab()
- func (h *TestHarness) Start()
- func (h *TestHarness) String() string
- func (h *TestHarness) WaitForText(text string, timeout time.Duration) bool
- func (h *TestHarness) WaitForTextToDisappear(text string, timeout time.Duration) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TUITestHarness ¶
type TUITestHarness = TestHarness
func NewTUITestHarnessWithSize ¶
func NewTUITestHarnessWithSize(t *testing.T, width, height int) *TUITestHarness
NewTUITestHarnessWithSize creates a new TUI test harness with custom screen dimensions
type TestHarness ¶
type TestHarness struct {
// contains filtered or unexported fields
}
TestHarness provides a test harness for TUI testing using SimulationScreen
func NewTUITestHarness ¶
func NewTUITestHarness(t *testing.T) *TestHarness
NewTUITestHarness creates a new TUI test harness with a simulated screen
func (*TestHarness) AssertContainsText ¶
func (h *TestHarness) AssertContainsText(expected string)
AssertContainsText asserts that the screen contains the specified text
func (*TestHarness) AssertCurrentView ¶
func (h *TestHarness) AssertCurrentView(expected string)
AssertCurrentView asserts that the current view matches the expected view name
func (*TestHarness) AssertModalClosed ¶
func (h *TestHarness) AssertModalClosed()
AssertModalClosed asserts that no modal is open
func (*TestHarness) AssertModalOpen ¶
func (h *TestHarness) AssertModalOpen()
AssertModalOpen asserts that a modal is open
func (*TestHarness) AssertNotContainsText ¶
func (h *TestHarness) AssertNotContainsText(expected string)
AssertNotContainsText asserts that the screen does not contain the specified text
func (*TestHarness) AssertWaitForText ¶
func (h *TestHarness) AssertWaitForText(text string, timeout time.Duration)
AssertWaitForText asserts that text appears within the timeout
func (*TestHarness) Cleanup ¶
func (h *TestHarness) Cleanup()
Cleanup stops the application and cleans up resources
func (*TestHarness) ContainsText ¶
func (h *TestHarness) ContainsText(expected string) bool
ContainsText checks if the screen contains the specified text
func (*TestHarness) ContainsTextCaseInsensitive ¶
func (h *TestHarness) ContainsTextCaseInsensitive(expected string) bool
ContainsTextCaseInsensitive checks if the screen contains the text (case-insensitive)
func (*TestHarness) DumpScreen ¶
func (h *TestHarness) DumpScreen()
DumpScreen dumps the screen contents to the test log for debugging
func (*TestHarness) GetApp ¶
func (h *TestHarness) GetApp() *app.S9s
GetApp returns the underlying app instance for advanced testing
func (*TestHarness) GetCellAt ¶
func (h *TestHarness) GetCellAt(x, y int) (rune, tcell.Style)
GetCellAt returns the character and style at the specified position
func (*TestHarness) GetCurrentView ¶
func (h *TestHarness) GetCurrentView() string
GetCurrentView returns the name of the current view
func (*TestHarness) GetModalName ¶
func (h *TestHarness) GetModalName() string
GetModalName returns the name of the currently open modal
func (*TestHarness) GetScreen ¶
func (h *TestHarness) GetScreen() tcell.SimulationScreen
GetScreen returns the simulation screen for low-level testing
func (*TestHarness) GetScreenLines ¶
func (h *TestHarness) GetScreenLines() []string
GetScreenLines returns the screen content as a slice of lines
func (*TestHarness) GetScreenText ¶
func (h *TestHarness) GetScreenText() string
GetScreenText returns all text on the screen as a single string
func (*TestHarness) IsCmdVisible ¶
func (h *TestHarness) IsCmdVisible() bool
IsCmdVisible checks if the command line is visible
func (*TestHarness) IsModalOpen ¶
func (h *TestHarness) IsModalOpen() bool
IsModalOpen checks if a modal is currently open
func (*TestHarness) SendBacktab ¶
func (h *TestHarness) SendBacktab()
SendBacktab sends the Shift+Tab key
func (*TestHarness) SendRune ¶
func (h *TestHarness) SendRune(r rune)
SendRune sends a rune (character) to the application
func (*TestHarness) Start ¶
func (h *TestHarness) Start()
Start starts the application in a goroutine
func (*TestHarness) String ¶
func (h *TestHarness) String() string
String provides a string representation useful for debugging
func (*TestHarness) WaitForText ¶
func (h *TestHarness) WaitForText(text string, timeout time.Duration) bool
WaitForText waits for the specified text to appear on screen, with a timeout
func (*TestHarness) WaitForTextToDisappear ¶
func (h *TestHarness) WaitForTextToDisappear(text string, timeout time.Duration) bool
WaitForTextToDisappear waits for text to disappear from screen, with a timeout