Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
// Init is called once before any actions/assertions.
Init(config map[string]string) error
// Action executes a named action with arguments.
Action(name string, args json.RawMessage) (*Response, error)
// Assert checks an assertion against the system under test.
Assert(property string, locator string, expected json.RawMessage) (*Response, error)
// Close cleans up resources.
Close() error
}
Adapter is the interface any plugin adapter must implement.
type HTTPAdapter ¶
type HTTPAdapter struct {
BaseURL string
// contains filtered or unexported fields
}
HTTPAdapter is the built-in adapter for testing HTTP APIs.
func NewHTTPAdapter ¶
func NewHTTPAdapter() *HTTPAdapter
func (*HTTPAdapter) Action ¶
func (a *HTTPAdapter) Action(name string, args json.RawMessage) (*Response, error)
func (*HTTPAdapter) Assert ¶
func (a *HTTPAdapter) Assert( property string, _ string, expected json.RawMessage, ) (*Response, error)
func (*HTTPAdapter) Close ¶
func (*HTTPAdapter) Close() error
type ProcessAdapter ¶
type ProcessAdapter struct {
Command string
// contains filtered or unexported fields
}
ProcessAdapter is the built-in adapter for testing subprocesses.
func NewProcessAdapter ¶
func NewProcessAdapter() *ProcessAdapter
func (*ProcessAdapter) Action ¶
func (a *ProcessAdapter) Action(name string, args json.RawMessage) (*Response, error)
func (*ProcessAdapter) Assert ¶
func (a *ProcessAdapter) Assert( property string, _ string, expected json.RawMessage, ) (*Response, error)
func (*ProcessAdapter) Close ¶
func (*ProcessAdapter) Close() error
type Request ¶
type Request struct {
Type string `json:"type"` // "action" or "assert"
Name string `json:"name,omitempty"` // action/assertion name
Args json.RawMessage `json:"args,omitempty"` // action arguments
Locator string `json:"locator,omitempty"` // for UI assertions
Property string `json:"property,omitempty"` // assertion property
Expected json.RawMessage `json:"expected,omitempty"` // expected value
}
Request is sent from the runtime to an adapter.
Click to show internal directories.
Click to hide internal directories.