package ugh

// Expect records a screen expectation using the given Matcher and returns
// an *Expectation for attaching actions via Do or further chaining.
func (c *Console) Expect(m Matcher) *Expectation {
	c.steps = append(c.steps, &expectMatcherStep{matcher: m, timeout: c.timeout})
	return &Expectation{console: c, text: m.String()}
}

// Send records a step that sends a single key's ANSI byte sequence
// to the application's stdin. Returns *Console for chaining.
func (c *Console) Send(key Key) *Console {
	c.steps = append(c.steps, &sendStep{key: key})
	return c
}

// SendText records a step that types text as individual characters
// with an inter-key delay. Returns *Console for chaining.
func (c *Console) SendText(text string) *Console {
	c.steps = append(c.steps, &sendTextStep{text: text})
	return c
}
