Documentation
¶
Overview ¶
Package testing provide the test case functions
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Clean ¶
type Clean struct {
CleanPrepare bool `yaml:"cleanPrepare"`
}
Clean represents the clean work after testing
type Prepare ¶
type Prepare struct {
Kubernetes []string `yaml:"kubernetes"`
}
Prepare does the prepare work
type Request ¶
type Request struct { API string `yaml:"api" json:"api"` Method string `yaml:"method,omitempty" json:"method,omitempty" jsonschema:"enum=GET,enum=POST,enum=PUT,enum=DELETE"` Query map[string]string `yaml:"query" json:"query,omitempty"` Header map[string]string `yaml:"header" json:"header,omitempty"` Form map[string]string `yaml:"form" json:"form,omitempty"` Body string `yaml:"body" json:"body,omitempty"` BodyFromFile string `yaml:"bodyFromFile" json:"bodyFromFile,omitempty"` }
Request represents a HTTP request
type Response ¶
type Response struct { StatusCode int `yaml:"statusCode" json:"bodyFromFile,omitempty"` Body string `yaml:"body" json:"body,omitempty"` Header map[string]string `yaml:"header" json:"header,omitempty"` BodyFieldsExpect map[string]interface{} `yaml:"bodyFieldsExpect" json:"bodyFieldsExpect,omitempty"` Verify []string `yaml:"verify" json:"verify,omitempty"` }
Response is the expected response
type TestCase ¶
type TestCase struct { Name string `yaml:"name" json:"name"` Group string Prepare Prepare `yaml:"prepare" json:"-"` Request Request `yaml:"request" json:"request"` Expect Response `yaml:"expect" json:"expect"` Clean Clean `yaml:"clean" json:"-"` }
TestCase represents a test case
func ParseTestCaseFromData ¶ added in v0.0.5
ParseTestCaseFromData parses the data to a test case
type TestSuite ¶ added in v0.0.2
type TestSuite struct { Name string `yaml:"name" json:"name"` API string `yaml:"api,omitempty" json:"api,omitempty"` Items []TestCase `yaml:"items" json:"items"` }
TestSuite represents a set of test cases
func ParseFromData ¶ added in v0.0.5
ParseFromData parses data and returns the test suite
Click to show internal directories.
Click to hide internal directories.