testing

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DebugDriver

type DebugDriver struct {
	// contains filtered or unexported fields
}

DebugDriver provides debug panel testing operations

func (*DebugDriver) Eventually

func (d *DebugDriver) Eventually(condition func() bool, timeout time.Duration, msgAndArgs ...interface{})

Eventually waits for a condition to be true within a timeout

func (*DebugDriver) GetContent

func (d *DebugDriver) GetContent() string

GetContent returns the debug panel content

func (*DebugDriver) GetMessages

func (d *DebugDriver) GetMessages() []string

GetMessages returns debug messages (parsed from content)

func (*DebugDriver) IsVisible

func (d *DebugDriver) IsVisible() bool

IsVisible returns whether the debug panel is visible

type HelpDriver

type HelpDriver struct {
	// contains filtered or unexported fields
}

HelpDriver provides help panel testing operations

func (*HelpDriver) GetContent

func (h *HelpDriver) GetContent() string

GetContent returns the help panel content

func (*HelpDriver) IsVisible

func (h *HelpDriver) IsVisible() bool

IsVisible returns whether the help panel is visible

type InputDriver

type InputDriver struct {
	// contains filtered or unexported fields
}

InputDriver provides input panel testing operations

func (*InputDriver) AssertContains

func (i *InputDriver) AssertContains(substring string, msgAndArgs ...interface{}) *InputDriver

func (*InputDriver) AssertNotContains

func (i *InputDriver) AssertNotContains(substring string, msgAndArgs ...interface{}) *InputDriver

func (*InputDriver) Clear

func (i *InputDriver) Clear() *InputDriver

Clear clears the input field

func (*InputDriver) GetContent

func (i *InputDriver) GetContent() string

GetContent returns the current input content

func (*InputDriver) PressEnter

func (i *InputDriver) PressEnter() *InputDriver

PressEnter simulates pressing the enter key

func (*InputDriver) Type

func (i *InputDriver) Type(text string) *InputDriver

Type simulates typing text into the input field NOTE: Certain special characters like '?' and '!' cause the input system to hang. Avoid using punctuation in test messages until this GUI input issue is resolved.

func (*InputDriver) TypeAndEnter

func (i *InputDriver) TypeAndEnter(text string) *InputDriver

TypeAndEnter types text and presses enter

type LayoutDriver

type LayoutDriver struct {
	// contains filtered or unexported fields
}

LayoutDriver provides layout testing operations

func (*LayoutDriver) PressF1

func (l *LayoutDriver) PressF1() *LayoutDriver

PressF1 simulates pressing F1 (help)

func (*LayoutDriver) PressTab

func (l *LayoutDriver) PressTab() *LayoutDriver

PressTab simulates pressing tab to cycle focus

type MessagesDriver

type MessagesDriver struct {
	// contains filtered or unexported fields
}

MessagesDriver provides messages panel testing operations

func (*MessagesDriver) AssertContains

func (m *MessagesDriver) AssertContains(substring string, msgAndArgs ...interface{}) *MessagesDriver

func (*MessagesDriver) AssertNotContains

func (m *MessagesDriver) AssertNotContains(substring string, msgAndArgs ...interface{}) *MessagesDriver

func (*MessagesDriver) Eventually

func (m *MessagesDriver) Eventually(condition func() bool, timeout time.Duration, msgAndArgs ...interface{})

Eventually waits for a condition to be true within a timeout

func (*MessagesDriver) GetContent

func (m *MessagesDriver) GetContent() string

GetContent returns the messages panel content

func (*MessagesDriver) GetMessages

func (m *MessagesDriver) GetMessages() []types.Message

GetMessages returns all messages in the chat (parsed from content)

func (*MessagesDriver) IsLoading

func (m *MessagesDriver) IsLoading() bool

IsLoading returns whether the messages panel is showing loading state

func (*MessagesDriver) ScrollToBottom

func (m *MessagesDriver) ScrollToBottom() *MessagesDriver

ScrollToBottom scrolls to the bottom of messages

func (*MessagesDriver) ScrollToTop

func (m *MessagesDriver) ScrollToTop() *MessagesDriver

ScrollToTop scrolls to the top of messages

type StatusDriver

type StatusDriver struct {
	// contains filtered or unexported fields
}

StatusDriver provides status panel testing operations

func (*StatusDriver) AssertContains

func (s *StatusDriver) AssertContains(substring string, msgAndArgs ...interface{}) *StatusDriver

func (*StatusDriver) GetContent

func (s *StatusDriver) GetContent() string

GetContent returns the status bar content

type TUIDriver

type TUIDriver struct {
	// contains filtered or unexported fields
}

TUIDriver provides a high-level interface for testing TUI interactions

func NewTUIDriver

func NewTUIDriver(t *testing.T) *TUIDriver

NewTUIDriver creates a new TUI driver for testing

func (*TUIDriver) Close

func (d *TUIDriver) Close()

Close cleans up the testing driver

func (*TUIDriver) Debug

func (d *TUIDriver) Debug() *DebugDriver

Debug returns a driver for the debug panel

func (*TUIDriver) ExpectMessage

func (d *TUIDriver) ExpectMessage(userMessage string) *genie.MockResponseBuilder

ExpectMessage sets up a mock expectation for a user message and returns a response builder

func (*TUIDriver) FocusInput

func (d *TUIDriver) FocusInput() *TUIDriver

FocusInput explicitly focuses the input view and ensures it's editable

func (*TUIDriver) Help

func (d *TUIDriver) Help() *HelpDriver

Help returns a driver for the help panel

func (*TUIDriver) Input

func (d *TUIDriver) Input() *InputDriver

Input returns a driver for the input panel

func (*TUIDriver) Layout

func (d *TUIDriver) Layout() *LayoutDriver

Layout returns a driver for layout operations

func (*TUIDriver) Messages

func (d *TUIDriver) Messages() *MessagesDriver

Messages returns a driver for the messages panel

func (*TUIDriver) Status

func (d *TUIDriver) Status() *StatusDriver

Status returns a driver for the status panel

func (*TUIDriver) Wait

func (d *TUIDriver) Wait() *TUIDriver

Wait waits for async operations and UI updates to complete

func (*TUIDriver) WaitFor

func (d *TUIDriver) WaitFor(duration time.Duration) *TUIDriver

WaitFor waits for a specific duration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL