Documentation ¶
Index ¶
- func CreateSchemaFileFromStruct(path string, _b []byte) bool
- func DeepCopy(value interface{}) interface{}
- func GetExpectsFields(expects []map[string]interface{}) ([]string, []string)
- func GetLocalRepositoryRoot() string
- func GetResourceLocalRoot() string
- func GetRuntimeRepositoryRoot() string
- func GetYmlFilePathInRuntime(skip int) (string, error)
- func InferDataSetDir(skip int) (string, error)
- func InferRepository()
- func LoadDefaultReq(caseSelect string, request interface{}) (err error)
- func LoadFile(relPath string, target interface{}) error
- func PreInferRepositoryRoot()
- func ReplaceFields(s string, fieldsMap map[string]interface{})
- func SetResourceLocalRoot(v string)
- func TranslateCompilePath2RuntimePath(compilePath string) string
- func UnmarshalExpect(expect map[string]interface{}) *assert.Expect
- type Action
- type CaseData
- type CaseDataExpects
- type CaseDataHandleFunc
- type CaseDataLoadFunc
- type CaseDataSet
- type CaseOption
- type CaseProperties
- type FillExpectRequest
- type TRes
- type TTestCaseInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExpectsFields ¶
func GetLocalRepositoryRoot ¶
func GetLocalRepositoryRoot() string
Deprecated 请用GetRuntimeRepositoryRoot
func GetResourceLocalRoot ¶
func GetResourceLocalRoot() string
func GetRuntimeRepositoryRoot ¶
func GetRuntimeRepositoryRoot() string
func GetYmlFilePathInRuntime ¶
GetYmlFilePathInRuntime skip is the number of stack frames to ascend
func InferDataSetDir ¶
InferDataSetDir 返回 t 的用例数据文件绝对路径
func InferRepository ¶
func InferRepository()
func LoadDefaultReq ¶
func PreInferRepositoryRoot ¶
func PreInferRepositoryRoot()
func ReplaceFields ¶
func SetResourceLocalRoot ¶
func SetResourceLocalRoot(v string)
func UnmarshalExpect ¶
Types ¶
type CaseData ¶
type CaseData struct { // Properties include the basic properties of single case Properties CaseProperties `json:"properties"` // The Specific Input of case Input map[string]interface{} `json:"input" yaml:"input"` Actions map[string]interface{} `json:"actions"` // The expects of test method result Expects []assert.Expect `json:"expects" yaml:"expects"` SchemaFile string `json:"schema_file"` }
func (*CaseData) CaseActionMarshal ¶
func (*CaseData) InputMarshal ¶
type CaseDataExpects ¶
type CaseDataHandleFunc ¶
type CaseDataHandleFunc func(data *CaseData, args ...interface{})
type CaseDataLoadFunc ¶
type CaseDataLoadFunc func(dataSet *CaseDataSet) *CaseDataSet
type CaseDataSet ¶
type CaseDataSet struct { // GlobalOption takes effect when the option of single case is nil GlobalOption CaseOption `json:"global_option"` // CommonInput will be merged into the input of each single case CommonInput map[string]interface{} `json:"common_input"` CommonActions map[string]interface{} `json:"common_actions"` // Set is the actual case data definition Set []CaseData `json:"set"` }
CaseDataSet is the basic definition of data set file
func LoadCaseDataSetFromFile ¶
func LoadCaseDataSetFromFile(dir, common, tName string) *CaseDataSet
func (*CaseDataSet) FillDataFields ¶
func (dataSet *CaseDataSet) FillDataFields(fieldsMap map[string][]map[string]interface{})
type CaseOption ¶
func (*CaseOption) IsParallel ¶
func (opt *CaseOption) IsParallel() bool
func (*CaseOption) IsSkip ¶
func (opt *CaseOption) IsSkip() bool
func (*CaseOption) Merge ¶
func (opt *CaseOption) Merge(targetOpt CaseOption)
type CaseProperties ¶
type CaseProperties struct { Name string `json:"name"` Desc string `json:"desc"` Level string `json:"level"` Option CaseOption `json:"option"` Extra map[string]interface{} `json:"extra"` DataPathPreFix string `json:"data_path_pre_fix"` }
func (*CaseProperties) ConvertMap ¶
func (p *CaseProperties) ConvertMap() map[string]interface{}
func (*CaseProperties) ExtraProperties ¶
func (p *CaseProperties) ExtraProperties() *simplejson.Json
func (*CaseProperties) Merge ¶
func (p *CaseProperties) Merge(target map[string]interface{})
func (*CaseProperties) Unmarshal ¶
func (p *CaseProperties) Unmarshal(m map[string]interface{})
type FillExpectRequest ¶
type TTestCaseInfo ¶
type TTestCaseInfo struct { Id int64 `gorm:"column:id;primary_key" json:"id"` Name string `gorm:"column:name;unique" json:"name"` Desc string `gorm:"column:case_desc"json:"case_desc"` Level string `gorm:"column:level" json:"level"` Skip bool `gorm:"column:skip" json:"skip"` Parallel bool `gorm:"column:parallel" json:"parallel"` TestFunc string `gorm:"column:func_name" json:"func_name"` Input string `gorm:"column:input" json:"input"` Expects string `gorm:"column:expects" json:"expects"` UpdateBy string `gorm:"column:update_by" json:"update_by"` CreateTime time.Time `gorm:"column:create_time" json:"create_time"` UpdateTime time.Time `gorm:"column:update_time" json:"update_time"` }
func (TTestCaseInfo) TableName ¶
func (TTestCaseInfo) TableName() string
Click to show internal directories.
Click to hide internal directories.