Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Assertion ¶
type Assertion struct {
Type string `yaml:"type"` // status_code, json_path, content_type, header
Expected any `yaml:"expected,omitempty"`
Path string `yaml:"path,omitempty"`
Name string `yaml:"name,omitempty"` // Header name for header assertions
Exists bool `yaml:"exists,omitempty"`
Equals string `yaml:"equals,omitempty"`
Contains string `yaml:"contains,omitempty"`
Empty bool `yaml:"empty,omitempty"` // Check if array/object is empty
}
Assertion defines a validation rule for the response
type FileUpload ¶
type FileUpload struct {
Field string `yaml:"field"` // Form field name
Path string `yaml:"path"` // Path to the file
}
FileUpload defines a file to be uploaded
type MultipartFile ¶ added in v1.4.0
type MultipartFile struct {
File string `yaml:"file"`
}
MultipartFile defines a file reference within a multipart upload
type Request ¶
type Request struct {
Method string `yaml:"method"`
Endpoint string `yaml:"endpoint"`
Headers map[string]string `yaml:"headers,omitempty"`
Body map[string]any `yaml:"body,omitempty"`
File *FileUpload `yaml:"file,omitempty"`
Multipart map[string]*MultipartFile `yaml:"multipart,omitempty"`
}
Request defines an HTTP request to be made
type Runner ¶
type Runner struct {
TotalTests int
PassedTests int
FailedTests int
// contains filtered or unexported fields
}
Runner executes test scenarios
func (*Runner) CheckServer ¶
CheckServer verifies the server is reachable
func (*Runner) GetSummary ¶
GetSummary returns test execution summary
type Scenario ¶
type Scenario struct {
Name string `yaml:"name"`
BaseURL string `yaml:"base_url"`
Steps []Step `yaml:"scenarios"`
}
Scenario represents a complete test scenario loaded from YAML
func LoadScenario ¶
LoadScenario loads and parses a YAML scenario file
type State ¶
type State struct {
// contains filtered or unexported fields
}
State manages variables that can be substituted in requests
func (*State) Substitute ¶
Substitute replaces {{variable}} placeholders in a string
func (*State) SubstituteMap ¶
SubstituteMap replaces variables in a map[string]any (for request bodies)
Click to show internal directories.
Click to hide internal directories.