Documentation
¶
Index ¶
- Constants
- func NewBodyError(msg string, args ...interface{}) error
- func NewBodyErrorWithCause(err error, msg string, args ...interface{}) error
- func NewDatabaseError(msg string, args ...interface{}) error
- func NewDatabaseErrorWithCause(err error, msg string, args ...interface{}) error
- func NewDatabaseErrorWithIdentifier(queryIndex int, msg string, args ...interface{}) error
- func NewHeaderError(msg string, args ...interface{}) error
- func NewMockError(msg string, args ...interface{}) error
- func NewMockErrorWithService(serviceName, msg string, args ...interface{}) error
- func NewStatusCodeError(expected, actual int) error
- type AllureLabel
- type AllureLink
- type AllureMetadata
- type AllureParameter
- type CheckError
- type DatabaseCheck
- type DatabaseResult
- type ErrorCategory
- type Fixture
- type FixturesMultiDb
- type Form
- type GrpcProtoSource
- type Result
- type Summary
- type TestInterface
Constants ¶
View Source
const ( GrpcProtoSourceTypeReflection = "reflection" GrpcProtoSourceTypeProtoset = "protoset" )
Variables ¶
This section is empty.
Functions ¶
func NewBodyError ¶
func NewBodyErrorWithCause ¶
func NewDatabaseError ¶
func NewHeaderError ¶
func NewMockError ¶
func NewMockErrorWithService ¶
func NewStatusCodeError ¶
Types ¶
type AllureLabel ¶
type AllureLink ¶
type AllureMetadata ¶
type AllureMetadata struct {
Links []AllureLink `json:"links" yaml:"links"`
Labels []AllureLabel `json:"labels" yaml:"labels"`
Parameters []AllureParameter `json:"parameters" yaml:"parameters"`
}
AllureMetadata contains metadata for Allure 2 reports and TMS integration
type AllureParameter ¶
type CheckError ¶
type CheckError struct {
Category ErrorCategory
Identifier string
Message string
Err error
}
CheckError represents a typed error from a specific check
func (*CheckError) Error ¶
func (e *CheckError) Error() string
func (*CheckError) GetCategory ¶
func (e *CheckError) GetCategory() ErrorCategory
func (*CheckError) GetIdentifier ¶
func (e *CheckError) GetIdentifier() string
func (*CheckError) Unwrap ¶
func (e *CheckError) Unwrap() error
type DatabaseCheck ¶
type DatabaseResult ¶
DatabaseResult holds the result of a single database query check.
type ErrorCategory ¶
type ErrorCategory string
ErrorCategory defines the type of check that failed
const ( ErrorCategoryStatusCode ErrorCategory = "status_code" ErrorCategoryResponseBody ErrorCategory = "body" ErrorCategoryResponseHeader ErrorCategory = "header" ErrorCategoryDatabase ErrorCategory = "database" ErrorCategoryMock ErrorCategory = "mock" )
type FixturesMultiDb ¶
type FixturesMultiDb []Fixture
type GrpcProtoSource ¶
type GrpcProtoSource struct {
// Type is the source type: "reflection" or "protoset".
Type string `json:"type" yaml:"type"`
// ProtosetFile is the path to the .protoset file (used when Type is "protoset").
ProtosetFile string `json:"protoset_file" yaml:"protoset_file"`
}
GrpcProtoSource describes the proto-schema source for schema discovery.
type Result ¶
type Result struct {
Path string // TODO: remove
Query string // TODO: remove
RequestBody string
ResponseStatusCode int
ResponseStatus string
ResponseContentType string
ResponseBody string
ResponseHeaders map[string][]string
GrpcStatusCode int
GrpcStatusMessage string
GrpcTrailers map[string][]string
Errors []error
Test TestInterface
DatabaseResult []DatabaseResult
}
Result of test execution
func (*Result) AllureStatus ¶
type TestInterface ¶
type TestInterface interface {
ToQuery() string
GetRequest() string
ToJSON() ([]byte, error)
GetMethod() string
Path() string
GetResponses() map[int]string
GetResponse(code int) (string, bool)
GetResponseHeaders(code int) (map[string]string, bool)
GetName() string
GetDescription() string
GetStatus() string
SetStatus(string)
Fixtures() []string
FixturesMultiDb() FixturesMultiDb
ServiceMocks() map[string]interface{}
GrpcServiceMocks() map[string]interface{}
Pause() int
BeforeScriptPath() string
BeforeScriptTimeout() int
AfterRequestScriptPath() string
AfterRequestScriptTimeout() int
Cookies() map[string]string
Headers() map[string]string
ContentType() string
GetForm() *Form
DbNameString() string
DbQueryString() string
DbResponseJson() []string
GetVariables() map[string]string
GetCombinedVariables() map[string]string
GetVariablesToSet() map[int]map[string]string
GetDatabaseChecks() []DatabaseCheck
SetDatabaseChecks([]DatabaseCheck)
GetFileName() string
// setters
SetQuery(string)
SetMethod(string)
SetPath(string)
SetRequest(string)
SetForm(form *Form)
SetResponses(map[int]string)
SetHeaders(map[string]string)
SetDbQueryString(string)
SetDbResponseJson([]string)
// comparison properties
NeedsCheckingValues() bool
IgnoreArraysOrdering() bool
DisallowExtraFields() bool
IgnoreDbOrdering() bool
// Clone returns copy of current object
Clone() TestInterface
// gRPC transport methods
GetTransport() string
GetProtoSource() *GrpcProtoSource
// Allure metadata for TMS integration
GetAllureMetadata() *AllureMetadata
}
Common Test interface
Click to show internal directories.
Click to hide internal directories.