Documentation ¶
Index ¶
- Constants
- Variables
- func AppendGojaLogs(execUuid string, val string)
- func AppendGojaVariables(execUuid string, val domain.ExecVariable)
- func ClearCookie(processorId uint, cookieName string, execUuid string) (err error)
- func ClearExecContext(execUuid string)
- func ClearVariable(processorId uint, variableName string, execUuid string) (err error)
- func ComputerScopeHierarchy(processor *Processor, scopeHierarchyMap *map[uint]*[]uint)
- func CountInterfaceStat(execUuid string, result *agentDomain.ScenarioExecResult) agentDomain.InterfaceStat
- func CountScriptAssertionStat(execUuid string, output string, result *agentDomain.ScenarioExecResult) agentDomain.InterfaceStat
- func CountSkip(execUuid string, executedProcessorIds map[uint]bool, ...) agentDomain.InterfaceStat
- func DealwithCookies(req *domain.BaseRequest, processorId uint, execUuid string)
- func DealwithDatabaseCondition(condition domain.InterfaceExecCondition, ...)
- func DealwithDealwithCheckPointCondition(condition domain.InterfaceExecCondition, resp domain.DebugResponse, ...)
- func DealwithExtractorCondition(condition domain.InterfaceExecCondition, resp domain.DebugResponse, ...)
- func DealwithResponseDefineCondition(condition domain.InterfaceExecCondition, resp domain.DebugResponse, ...)
- func DealwithScriptCondition(condition domain.InterfaceExecCondition, resultStatus *consts.ResultStatus, ...)
- func DownloadUploadedFile(uri string, execUuid string) (ret string, err error)
- func EvaluateGovaluateExpressionByProcessorScope(expression string, scopeId uint, execUuid string) (ret interface{}, params domain.VarKeyValuePair, err error)
- func EvaluateGovaluateExpressionWithDebugVariables(expression string, execUuid string) (ret interface{}, params domain.VarKeyValuePair, err error)
- func EvaluateVariablePropExpressionValue(variable domain.ExecVariable, propExpression string) (ret domain.ExecVariable, ok bool)
- func ExecCheckPoint(checkpoint *domain.CheckpointBase, resp domain.DebugResponse, processorId uint, ...) (err error)
- func ExecDbOpt(opt *domain.DatabaseOptBase) (err error)
- func ExecExtract(extractor *domain.ExtractorBase, resp domain.DebugResponse) (err error)
- func ExecPostConditions(execObj *InterfaceExecObj, resp domain.DebugResponse, execUuid string) (resultStatus consts.ResultStatus, err error)
- func ExecPreConditions(execObj *InterfaceExecObj, execUuid string) (err error)
- func ExecResponseDefine(responseDefine *domain.ResponseDefineBase, res domain.DebugResponse) (err error)
- func ExecScript(scriptObj *domain.ScriptBase, tenantId consts.TenantId, projectId uint, ...) (err error)
- func GenRequestUrlWithBaseUrlAndPathParam(req *domain.BaseRequest, debugInterfaceId uint, baseUrl string, ...)
- func GetContentProps(req *domain.BaseRequest, resp *domain.DebugResponse)
- func GetCookie(processorId uint, cookieName, domain string, execUuid string) (cookie domain.ExecCookie)
- func GetCurrDebugInterfaceId(execUuid string) (ret uint)
- func GetCurrEnvironmentId(execUuid string) (id int)
- func GetCurrRequest(execUuid string) (ret domain.BaseRequest)
- func GetCurrResponse(execUuid string) (ret domain.DebugResponse)
- func GetCurrScenarioProcessorId(execUuid string) (ret uint)
- func GetDatapoolCursor(execUuid string) (ret map[string]int)
- func GetDemoSite() (ret string)
- func GetExecScene(execUuid string) (ret domain.ExecScene)
- func GetForceStopExec(execUuid string) (ret bool)
- func GetGojaLogs(execUuid string) (ret *[]string)
- func GetGojaVariables(execUuid string) (ret *[]domain.ExecVariable)
- func GetInterfaceStat(execUuid string) (ret *agentDomain.InterfaceStat)
- func GetIsRunning(execUuid string) (ret bool)
- func GetProcessorList(processor *Processor, list *[]*Processor)
- func GetReqValueFromGoja(execUuid string, tenantId consts.TenantId, projectId uint) (err error)
- func GetRequestProps(req *domain.BaseRequest)
- func GetRespValueFromGoja(execUuid string, tenantId consts.TenantId, projectId uint) (err error)
- func GetScopeHierarchy(execUuid string) (ret map[uint]*[]uint)
- func GetScopedCookies(execUuid string) (ret map[uint][]domain.ExecCookie)
- func GetScopedVariables(execUuid string) (ret map[uint][]domain.ExecVariable)
- func GetServerToken(execUuid string) (ret string)
- func GetServerUrl(execUuid string) (ret string)
- func GetValidScopeIds(processorId uint, execUuid string) (ret *[]uint)
- func GetVariable(processorId uint, nameOrExpr string, execUuid string) (ret domain.ExecVariable, err error)
- func GetVariableFromList(name string, list []domain.GlobalVar) (ret domain.ExecVariable, err error)
- func InitDebugExecContext(execUuid string) (variables []domain.ExecVariable)
- func InitJsRuntime(tenantId consts.TenantId, projectId uint, execUuid string)
- func InitScenarioExecContext(execObj *ScenarioExecObj) (variables []domain.ExecVariable)
- func InitUserExecContext(execUuid string)
- func Invoke(req *domain.BaseRequest) (resp domain.DebugResponse, err error)
- func ListScopeCookie(processorId uint, execUuid string) (cookies []domain.ExecCookie)
- func MergeGlobalParams(globalParams, selfGlobalParam []domain.GlobalParam) (ret []domain.GlobalParam)
- func OpenMySqlDb(opt *domain.DatabaseOptBase) (db *gorm.DB, err error)
- func OpenOracle(opt *domain.DatabaseOptBase) (db *sql.DB, err error)
- func OpenPostgreSQL(opt *domain.DatabaseOptBase) (db *gorm.DB, err error)
- func OpenSqlServer(opt *domain.DatabaseOptBase) (db *gorm.DB, err error)
- func ParseChaiAssertion(output string) (status, name, checkpoint string)
- func ReadDataFromExcel(url string) (ret []domain.VarKeyValuePair, err error)
- func ReadDataFromText(url, separator string) (ret []domain.VarKeyValuePair, err error)
- func ReplaceDatapoolVariInGovaluateExpress(expression string, execUuid string) (ret string)
- func ReplacePathParams(uri string, pathParams []domain.Param) (ret string)
- func ReplaceVariableValue(value string, execUuid string) (ret string)
- func ReplaceVariableValueInBody(value string, execUuid string) (ret string)
- func ReplaceVariables(req *domain.BaseRequest, execUuid string)
- func ResetGojaLogs(execUuid string)
- func ResetGojaVariables(execUuid string)
- func ResetStat(execUuid string)
- func SetCookie(processorId uint, cookieName string, cookieValue string, domainName string, ...) (err error)
- func SetCurrDebugInterfaceId(execUuid string, val uint)
- func SetCurrEnvironmentId(execUuid string, id int)
- func SetCurrRequest(execUuid string, val domain.BaseRequest)
- func SetCurrResponse(execUuid string, val domain.DebugResponse)
- func SetCurrScenarioProcessor(execUuid string, val *Processor)
- func SetCurrScenarioProcessorId(execUuid string, val uint)
- func SetDatapoolCursor(execUuid string, val map[string]int)
- func SetExecScene(execUuid string, val domain.ExecScene)
- func SetForceStopExec(execUuid string, val bool)
- func SetGojaLogs(execUuid string, val *[]string)
- func SetGojaVariables(execUuid string, val *[]domain.ExecVariable)
- func SetInterfaceStat(execUuid string, val *agentDomain.InterfaceStat)
- func SetIsRunning(execUuid string, val bool)
- func SetReqValueToGoja(req *domain.BaseRequest)
- func SetRespValueToGoja(resp *domain.DebugResponse)
- func SetScopeHierarchy(execUuid string, val map[uint]*[]uint)
- func SetScopedCookies(execUuid string, val map[uint][]domain.ExecCookie)
- func SetScopedVariables(execUuid string, val map[uint][]domain.ExecVariable)
- func SetServerToken(execUuid string, val string)
- func SetServerUrl(execUuid string, val string)
- func SetValueToGoja(name string, value interface{})
- func SetVariable(processorId uint, variableName string, variableValue interface{}, ...) (newVariable domain.ExecVariable, err error)
- type CaseExecProcessor
- type CasesExecReq
- type IProcessorEntity
- type InterfaceExecObj
- type MessageExecObj
- type MessageExecReq
- type PlanExecObj
- type PlanExecReq
- type Processor
- func (p *Processor) AddResultToParent() (err error)
- func (p *Processor) AppendNewChildProcessor(category consts.ProcessorCategory, typ consts.ProcessorType) (child Processor)
- func (p *Processor) Error(s *Session, err interface{})
- func (p *Processor) RestoreEntity() (err error)
- func (p *Processor) Run(s *Session) (err error)
- type ProcessorAssertion
- type ProcessorBase
- type ProcessorCookie
- type ProcessorCustomCode
- type ProcessorData
- type ProcessorEntityBase
- type ProcessorGroup
- type ProcessorInterface
- func (entity *ProcessorInterface) DealwithCheckpointCondition(condition domain.InterfaceExecCondition, interfaceStatus *consts.ResultStatus, ...)
- func (entity *ProcessorInterface) DealwithDatabaseOptCondition(condition domain.InterfaceExecCondition, processorId, parentId uint, ...)
- func (entity *ProcessorInterface) DealwithExtractorCondition(condition domain.InterfaceExecCondition, processorId, parentId uint, ...)
- func (entity *ProcessorInterface) DealwithResponseDefineCondition(condition domain.InterfaceExecCondition, interfaceStatus *consts.ResultStatus, ...)
- func (entity *ProcessorInterface) DealwithScriptCondition(condition domain.InterfaceExecCondition, interfaceStatus *consts.ResultStatus, ...)
- func (entity *ProcessorInterface) ExecPostConditions(processor *Processor, detail *map[string]interface{}, session *Session) (interfaceStatus consts.ResultStatus, err error)
- func (entity *ProcessorInterface) ExecPreConditions(processor *Processor, session *Session) (err error)
- func (entity *ProcessorInterface) GenResultFromResponse(processor *Processor, baseRequest domain.BaseRequest, ...) (ok bool)
- func (entity ProcessorInterface) Run(processor *Processor, session *Session) (err error)
- type ProcessorLogic
- type ProcessorLoop
- func (entity *ProcessorLoop) GenerateLoopList() (ret agentDomain.ExecIterator, err error)
- func (entity *ProcessorLoop) GenerateLoopRange() (ret agentDomain.ExecIterator, err error)
- func (entity *ProcessorLoop) GenerateLoopTimes() (ret agentDomain.ExecIterator, err error)
- func (entity *ProcessorLoop) GenerateLoopVariable(execUuid string) (ret agentDomain.ExecIterator, err error)
- func (entity ProcessorLoop) Run(processor *Processor, session *Session) (err error)
- type ProcessorMsg
- type ProcessorPrint
- type ProcessorRoot
- type ProcessorTimer
- type ProcessorVariable
- type Report
- type ScenarioExecObj
- type ScenarioExecObjBase
- type ScenarioExecObjMsg
- type ScenarioExecReq
- type Session
- type UserContext
Constants ¶
View Source
const (
ServerApiPath = "api/v1"
)
Variables ¶
View Source
var (
DemoTestSite = GetDemoSite()
)
View Source
var (
ExecContextStore sync.Map
)
View Source
var ( GovaluateFunctions = map[string]govaluate.ExpressionFunction{ "length": func(args ...interface{}) (interface{}, error) { length := len(args[0].(string)) return (float64)(length), nil }, "match": func(args ...interface{}) (interface{}, error) { str := args[0].(string) regx := regexp.MustCompile("args[1].(string)") ret := regx.MatchString(str) return ret, nil }, "uuid": func(args ...interface{}) (interface{}, error) { ret := _stringUtils.Uuid() return ret, nil }, } )
Functions ¶
func AppendGojaLogs ¶
func AppendGojaVariables ¶
func AppendGojaVariables(execUuid string, val domain.ExecVariable)
func ClearCookie ¶
func ClearExecContext ¶
func ClearExecContext(execUuid string)
func ClearVariable ¶
func ComputerScopeHierarchy ¶
func CountInterfaceStat ¶
func CountInterfaceStat(execUuid string, result *agentDomain.ScenarioExecResult) agentDomain.InterfaceStat
func CountScriptAssertionStat ¶
func CountScriptAssertionStat(execUuid string, output string, result *agentDomain.ScenarioExecResult) agentDomain.InterfaceStat
func CountSkip ¶
func CountSkip(execUuid string, executedProcessorIds map[uint]bool, skippedChildren []*Processor) agentDomain.InterfaceStat
func DealwithCookies ¶
func DealwithCookies(req *domain.BaseRequest, processorId uint, execUuid string)
func DealwithDatabaseCondition ¶
func DealwithDatabaseCondition(condition domain.InterfaceExecCondition, postConditions *[]domain.InterfaceExecCondition, execUuid string)
func DealwithDealwithCheckPointCondition ¶
func DealwithDealwithCheckPointCondition(condition domain.InterfaceExecCondition, resp domain.DebugResponse, status *consts.ResultStatus, postConditions *[]domain.InterfaceExecCondition, execUuid string)
func DealwithExtractorCondition ¶
func DealwithExtractorCondition(condition domain.InterfaceExecCondition, resp domain.DebugResponse, postConditions *[]domain.InterfaceExecCondition, execUuid string)
func DealwithResponseDefineCondition ¶
func DealwithResponseDefineCondition(condition domain.InterfaceExecCondition, resp domain.DebugResponse, resultStatus *consts.ResultStatus, postConditions *[]domain.InterfaceExecCondition)
func DealwithScriptCondition ¶
func DealwithScriptCondition(condition domain.InterfaceExecCondition, resultStatus *consts.ResultStatus, projectId uint, conditions *[]domain.InterfaceExecCondition, execUuid string, isPostCondition bool, tenantId consts.TenantId)
func DownloadUploadedFile ¶
func EvaluateGovaluateExpressionByProcessorScope ¶
func EvaluateGovaluateExpressionByProcessorScope(expression string, scopeId uint, execUuid string) (ret interface{}, params domain.VarKeyValuePair, err error)
called by agent processor interface
func EvaluateGovaluateExpressionWithDebugVariables ¶
func EvaluateGovaluateExpressionWithDebugVariables(expression string, execUuid string) (ret interface{}, params domain.VarKeyValuePair, err error)
called by checkpoint
func EvaluateVariablePropExpressionValue ¶
func EvaluateVariablePropExpressionValue(variable domain.ExecVariable, propExpression string) ( ret domain.ExecVariable, ok bool)
like {name.prop}
func ExecCheckPoint ¶
func ExecCheckPoint(checkpoint *domain.CheckpointBase, resp domain.DebugResponse, processorId uint, execUuid string) (err error)
func ExecDbOpt ¶
func ExecDbOpt(opt *domain.DatabaseOptBase) (err error)
func ExecExtract ¶
func ExecExtract(extractor *domain.ExtractorBase, resp domain.DebugResponse) (err error)
func ExecPostConditions ¶
func ExecPostConditions(execObj *InterfaceExecObj, resp domain.DebugResponse, execUuid string) (resultStatus consts.ResultStatus, err error)
func ExecPreConditions ¶
func ExecPreConditions(execObj *InterfaceExecObj, execUuid string) (err error)
func ExecResponseDefine ¶
func ExecResponseDefine(responseDefine *domain.ResponseDefineBase, res domain.DebugResponse) (err error)
func ExecScript ¶
func GenRequestUrlWithBaseUrlAndPathParam ¶
func GenRequestUrlWithBaseUrlAndPathParam(req *domain.BaseRequest, debugInterfaceId uint, baseUrl string, execUuid string)
func GetContentProps ¶
func GetContentProps(req *domain.BaseRequest, resp *domain.DebugResponse)
func GetCookie ¶
func GetCookie(processorId uint, cookieName, domain string, execUuid string) (cookie domain.ExecCookie)
func GetCurrDebugInterfaceId ¶
func GetCurrEnvironmentId ¶
func GetCurrRequest ¶
func GetCurrRequest(execUuid string) (ret domain.BaseRequest)
func GetCurrResponse ¶
func GetCurrResponse(execUuid string) (ret domain.DebugResponse)
func GetDatapoolCursor ¶
func GetDemoSite ¶
func GetDemoSite() (ret string)
func GetExecScene ¶
func GetForceStopExec ¶
func GetGojaLogs ¶
func GetGojaVariables ¶
func GetGojaVariables(execUuid string) (ret *[]domain.ExecVariable)
func GetInterfaceStat ¶
func GetInterfaceStat(execUuid string) (ret *agentDomain.InterfaceStat)
func GetIsRunning ¶
func GetProcessorList ¶
func GetReqValueFromGoja ¶
func GetRequestProps ¶
func GetRequestProps(req *domain.BaseRequest)
func GetRespValueFromGoja ¶
func GetScopeHierarchy ¶
func GetScopedCookies ¶
func GetScopedCookies(execUuid string) (ret map[uint][]domain.ExecCookie)
func GetScopedVariables ¶
func GetScopedVariables(execUuid string) (ret map[uint][]domain.ExecVariable)
func GetServerToken ¶
func GetServerUrl ¶
func GetValidScopeIds ¶
func GetVariable ¶
func GetVariable(processorId uint, nameOrExpr string, execUuid string) (ret domain.ExecVariable, err error)
GetVariable @Param processorId int true "Processor Id" @Param nameOrExpr string true "Variable name(email) or prop expression(address.city)"
func GetVariableFromList ¶
func InitDebugExecContext ¶
func InitDebugExecContext(execUuid string) (variables []domain.ExecVariable)
func InitScenarioExecContext ¶
func InitScenarioExecContext(execObj *ScenarioExecObj) (variables []domain.ExecVariable)
func InitUserExecContext ¶
func InitUserExecContext(execUuid string)
func Invoke ¶
func Invoke(req *domain.BaseRequest) (resp domain.DebugResponse, err error)
func ListScopeCookie ¶
func ListScopeCookie(processorId uint, execUuid string) (cookies []domain.ExecCookie)
func MergeGlobalParams ¶
func MergeGlobalParams(globalParams, selfGlobalParam []domain.GlobalParam) (ret []domain.GlobalParam)
func OpenMySqlDb ¶
func OpenMySqlDb(opt *domain.DatabaseOptBase) (db *gorm.DB, err error)
func OpenOracle ¶
func OpenOracle(opt *domain.DatabaseOptBase) (db *sql.DB, err error)
func OpenPostgreSQL ¶
func OpenPostgreSQL(opt *domain.DatabaseOptBase) (db *gorm.DB, err error)
func OpenSqlServer ¶
func OpenSqlServer(opt *domain.DatabaseOptBase) (db *gorm.DB, err error)
func ParseChaiAssertion ¶
func ReadDataFromExcel ¶
func ReadDataFromExcel(url string) (ret []domain.VarKeyValuePair, err error)
func ReadDataFromText ¶
func ReadDataFromText(url, separator string) (ret []domain.VarKeyValuePair, err error)
func ReplaceDatapoolVariInGovaluateExpress ¶
func ReplaceDatapoolVariInGovaluateExpress(expression string, execUuid string) (ret string)
func ReplaceVariableValue ¶
func ReplaceVariables ¶
func ReplaceVariables(req *domain.BaseRequest, execUuid string)
func ResetGojaLogs ¶
func ResetGojaLogs(execUuid string)
func ResetGojaVariables ¶
func ResetGojaVariables(execUuid string)
func SetCurrDebugInterfaceId ¶
func SetCurrEnvironmentId ¶
func SetCurrRequest ¶
func SetCurrRequest(execUuid string, val domain.BaseRequest)
func SetCurrResponse ¶
func SetCurrResponse(execUuid string, val domain.DebugResponse)
func SetDatapoolCursor ¶
func SetExecScene ¶
func SetForceStopExec ¶
func SetGojaLogs ¶
func SetGojaVariables ¶
func SetGojaVariables(execUuid string, val *[]domain.ExecVariable)
func SetInterfaceStat ¶
func SetInterfaceStat(execUuid string, val *agentDomain.InterfaceStat)
func SetIsRunning ¶
func SetReqValueToGoja ¶
func SetReqValueToGoja(req *domain.BaseRequest)
func SetRespValueToGoja ¶
func SetRespValueToGoja(resp *domain.DebugResponse)
func SetScopeHierarchy ¶
func SetScopedCookies ¶
func SetScopedCookies(execUuid string, val map[uint][]domain.ExecCookie)
func SetScopedVariables ¶
func SetScopedVariables(execUuid string, val map[uint][]domain.ExecVariable)
func SetServerToken ¶
func SetServerUrl ¶
func SetValueToGoja ¶
func SetValueToGoja(name string, value interface{})
func SetVariable ¶
func SetVariable(processorId uint, variableName string, variableValue interface{}, variableType consts.ExtractorResultType, scope consts.ExtractorScope, execUuid string) ( newVariable domain.ExecVariable, err error)
SetVariable @Param processorId int true "Processor Id, 0 if NOT executed by a scenario processor"
Types ¶
type CaseExecProcessor ¶
type CaseExecProcessor struct { Title string `json:"tile"` Key string `json:"key"` ExecUUid string `json:"execUUid"` Category string `json:"type"` Children []*CaseExecProcessor `json:"children"` Data *InterfaceExecObj `json:"data"` }
type CasesExecReq ¶
type CasesExecReq struct { ExecUuid string `json:"execUuid"` ServerUrl string `json:"serverUrl"` Token string `json:"token"` UserId uint `json:"projectId"` ProjectId uint `json:"projectId"` BaseCaseId uint `json:"baseCaseId"` UsedBy consts.UsedBy `json:"usedBy"` ExecObj casesHelper.AlternativeCase `json:"cases"` ExecType string `json:"type"` EnvironmentId uint `json:"environmentId"` TenantId consts.TenantId `json:"tenantId"` }
type IProcessorEntity ¶
type InterfaceExecObj ¶
type InterfaceExecObj struct { DebugData domain.DebugData `json:"debugData"` PreConditions []domain.InterfaceExecCondition `json:"preConditions"` PostConditions []domain.InterfaceExecCondition `json:"postConditions"` ExecScene domain.ExecScene `json:"execScene"` TenantId consts.TenantId `json:"tenantId"` }
type MessageExecObj ¶
type MessageExecObj struct {
Count uint `json:"count"`
}
type MessageExecReq ¶
type PlanExecObj ¶
type PlanExecObj struct { Name string `json:"name"` Scenarios []ScenarioExecObj `json:"scenarios"` ServerUrl string `json:"serverUrl"` Token string `json:"token"` }
type PlanExecReq ¶
type Processor ¶
type Processor struct { ProcessorBase Entity IProcessorEntity `json:"entity"` Disable bool `json:"disable"` }
func (*Processor) AddResultToParent ¶
func (*Processor) AppendNewChildProcessor ¶
func (p *Processor) AppendNewChildProcessor(category consts.ProcessorCategory, typ consts.ProcessorType) (child Processor)
func (*Processor) RestoreEntity ¶
type ProcessorAssertion ¶
type ProcessorAssertion struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase Expression string `json:"expression" yaml:"expression"` }
type ProcessorBase ¶
type ProcessorBase struct { ID uint `json:"id"` Name string `json:"name"` Comments string `json:"comments"` Method consts.HttpMethod `json:"method" yaml:"method"` ParentId uint `json:"parentId"` ScenarioId uint `json:"scenarioId"` ProjectId uint `json:"projectId"` UseID uint `json:"useId"` EntityCategory consts.ProcessorCategory `json:"entityCategory"` EntityType consts.ProcessorType `json:"entityType"` EntityId uint `json:"entityId"` EndpointInterfaceId uint `json:"endpointInterfaceId"` Ordr int `json:"ordr"` Children []*Processor `json:"children"` Slots iris.Map `json:"slots"` IsDir bool `json:"isDir"` EntityRaw json.RawMessage `json:"entityRaw"` Parent *Processor `json:"-"` Result *agentDomain.ScenarioExecResult `json:"result"` ProcessorInterfaceSrc consts.ProcessorInterfaceSrc `json:"processorInterfaceSrc"` Round string `json:"round"` Session Session `json:"-"` }
type ProcessorCookie ¶
type ProcessorCookie struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase CookieName string `json:"cookieName" yaml:"cookieName"` VariableName string `json:"variableName" yaml:"variableName"` RightValue string `json:"rightValue" yaml:"rightValue"` Domain string `json:"domain" yaml:"domain"` ExpireTime *time.Time `json:"expireTime" yaml:"expireTime"` Children []interface{} `json:"children" yaml:"children" gorm:"-"` }
type ProcessorCustomCode ¶
type ProcessorData ¶
type ProcessorData struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase Src consts.DataItSrc `json:"src" yaml:"src"` Type consts.DataItType `json:"type,omitempty" yaml:"type,omitempty"` Url string `json:"url,omitempty" yaml:"url,omitempty"` DatapoolId uint `json:"datapoolId,omitempty" yaml:"datapoolId,omitempty"` DatapoolName string `json:"datapoolName,omitempty" yaml:"datapoolName,omitempty"` Separator string `json:"separator,omitempty" yaml:"separator,omitempty"` RepeatTimes int `json:"repeatTimes,omitempty" yaml:"repeatTimes,omitempty"` IsLoop int `json:"isLoop,omitempty" yaml:"isLoop,omitempty"` IsRand bool `json:"isRand,omitempty" yaml:"isRand,omitempty"` IsOnce bool `json:"isOnce,omitempty" yaml:"isOnce,omitempty"` VariableName string `json:"variableName,omitempty" yaml:"variableName,omitempty"` }
func (*ProcessorData) GenerateLoopList ¶
func (entity *ProcessorData) GenerateLoopList(session *Session) (ret agentDomain.ExecIterator, err error)
type ProcessorEntityBase ¶
type ProcessorEntityBase struct { Name string `gorm:"-" json:"name"` Comments string `json:"comments"` Default string `json:"default"` ProcessorID uint `json:"processorID" yaml:"processorID"` ProcessorCategory consts.ProcessorCategory `json:"processorCategory" yaml:"processorCategory"` ProcessorType consts.ProcessorType `json:"processorType" yaml:"processorType"` ParentID uint `json:"parentID" yaml:"parentID"` }
type ProcessorGroup ¶
type ProcessorGroup struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase }
type ProcessorInterface ¶
type ProcessorInterface struct { ID uint `json:"id"` ProcessorEntityBase domain.BaseRequest Response domain.DebugResponse `json:"response"` BaseUrl string `json:"baseUrl"` PreConditions []domain.InterfaceExecCondition `json:"preConditions"` PostConditions []domain.InterfaceExecCondition `json:"postConditions"` }
func (*ProcessorInterface) DealwithCheckpointCondition ¶
func (entity *ProcessorInterface) DealwithCheckpointCondition(condition domain.InterfaceExecCondition, interfaceStatus *consts.ResultStatus, conditions *[]domain.InterfaceExecCondition, detail *map[string]interface{}, execUuid string)
func (*ProcessorInterface) DealwithDatabaseOptCondition ¶
func (entity *ProcessorInterface) DealwithDatabaseOptCondition(condition domain.InterfaceExecCondition, processorId, parentId uint, conditions *[]domain.InterfaceExecCondition, execUuid string)
func (*ProcessorInterface) DealwithExtractorCondition ¶
func (entity *ProcessorInterface) DealwithExtractorCondition(condition domain.InterfaceExecCondition, processorId, parentId uint, conditions *[]domain.InterfaceExecCondition, execUuid string)
func (*ProcessorInterface) DealwithResponseDefineCondition ¶
func (entity *ProcessorInterface) DealwithResponseDefineCondition(condition domain.InterfaceExecCondition, interfaceStatus *consts.ResultStatus, conditions *[]domain.InterfaceExecCondition, detail *map[string]interface{}, execUuid string)
func (*ProcessorInterface) DealwithScriptCondition ¶
func (entity *ProcessorInterface) DealwithScriptCondition(condition domain.InterfaceExecCondition, interfaceStatus *consts.ResultStatus, tenantId consts.TenantId, projectId uint, conditions *[]domain.InterfaceExecCondition, execUuid string, isPostCondition bool)
func (*ProcessorInterface) ExecPostConditions ¶
func (entity *ProcessorInterface) ExecPostConditions(processor *Processor, detail *map[string]interface{}, session *Session) ( interfaceStatus consts.ResultStatus, err error)
func (*ProcessorInterface) ExecPreConditions ¶
func (entity *ProcessorInterface) ExecPreConditions(processor *Processor, session *Session) (err error)
func (*ProcessorInterface) GenResultFromResponse ¶
func (entity *ProcessorInterface) GenResultFromResponse( processor *Processor, baseRequest domain.BaseRequest, requestEndTime, requestStartTime time.Time, detail *map[string]interface{}, session *Session, err error) (ok bool)
type ProcessorLogic ¶
type ProcessorLogic struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase Expression string `json:"expression" yaml:"expression"` }
type ProcessorLoop ¶
type ProcessorLoop struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase Times int `json:"times" yaml:"times"` // time Range string `json:"range" yaml:"range"` // range InType string `json:"inType" yaml:"inType"` // in Variable string `json:"variable" yaml:"variable"` // array List string `json:"list" yaml:"list"` // list Step string `json:"step" yaml:"step"` IsRand bool `json:"isRand" yaml:"isRand"` VariableName string `json:"variableName" yaml:"variableName"` UntilExpression string `json:"untilExpression" yaml:"untilExpression"` // until BreakIfExpression string `json:"breakIfExpression" yaml:"breakIfExpression"` }
func (*ProcessorLoop) GenerateLoopList ¶
func (entity *ProcessorLoop) GenerateLoopList() (ret agentDomain.ExecIterator, err error)
func (*ProcessorLoop) GenerateLoopRange ¶
func (entity *ProcessorLoop) GenerateLoopRange() (ret agentDomain.ExecIterator, err error)
func (*ProcessorLoop) GenerateLoopTimes ¶
func (entity *ProcessorLoop) GenerateLoopTimes() (ret agentDomain.ExecIterator, err error)
func (*ProcessorLoop) GenerateLoopVariable ¶
func (entity *ProcessorLoop) GenerateLoopVariable(execUuid string) (ret agentDomain.ExecIterator, err error)
type ProcessorMsg ¶
type ProcessorMsg struct {
ProcessorBase
}
type ProcessorPrint ¶
type ProcessorPrint struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase RightValue string `json:"rightValue" yaml:"rightValue"` }
type ProcessorRoot ¶
type ProcessorRoot struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase }
type ProcessorTimer ¶
type ProcessorTimer struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase SleepTime int `json:"sleepTime" yaml:"sleepTime"` }
type ProcessorVariable ¶
type ProcessorVariable struct { ID uint `json:"id" yaml:"id"` ProcessorEntityBase VariableName string `json:"variableName" yaml:"variableName"` Expression string `json:"expression" yaml:"expression"` }
type Report ¶
type Report struct { ID uint `json:"id"` Name string `json:"name"` Desc string `json:"desc"` ProgressStatus consts.ProgressStatus `json:"progressStatus"` ResultStatus consts.ResultStatus `json:"resultStatus"` StartTime *time.Time `json:"startTime"` EndTime *time.Time `json:"endTime"` Duration int64 `json:"duration"` // sec TotalInterfaceNum int `json:"totalInterfaceNum"` PassInterfaceNum int `json:"passInterfaceNum"` FailInterfaceNum int `json:"failInterfaceNum"` TotalRequestNum int `json:"totalRequestNum"` PassRequestNum int `json:"passRequestNum"` FailRequestNum int `json:"failRequestNum"` TotalAssertionNum int `json:"totalAssertionNum"` PassAssertionNum int `json:"passAssertionNum"` FailAssertionNum int `json:"failAssertionNum"` InterfaceStatusMap map[uint]map[consts.ResultStatus]int `json:"interfaceStatusMap"` Payload string `json:"payload"` ScenarioId uint `json:"scenarioId"` ProjectId uint `json:"projectId"` Logs []*agentDomain.ScenarioExecResult `json:"logs"` }
type ScenarioExecObj ¶
type ScenarioExecObj struct { ScenarioExecObjBase RootProcessor *Processor `json:"rootProcessor"` }
type ScenarioExecObjBase ¶
type ScenarioExecObjBase struct { ScenarioId uint `json:"scenarioId"` Name string `json:"name"` BaseUrl string `json:"baseUrl"` ExecScene domain.ExecScene `json:"execScene"` ExecUuid string `json:"execUuid"` ServerUrl string `json:"serverUrl"` Token string `json:"token"` TenantId consts.TenantId `json:"tenantId"` }
type ScenarioExecObjMsg ¶
type ScenarioExecObjMsg struct { ScenarioExecObjBase RootProcessor *ProcessorMsg `json:"rootProcessor"` }
type ScenarioExecReq ¶
type Session ¶
type Session struct { ExecUuid string ScenarioId uint Name string TenantId consts.TenantId `json:"tenantId"` HttpClient *http.Client Http2Client *http.Client Failfast bool RootProcessor *Processor Report *Report WsMsg *websocket.Message }
func NewSession ¶
func NewSession(req *ScenarioExecObj, failfast bool, wsMsg *websocket.Message) (ret *Session)
type UserContext ¶
type UserContext struct { IsRunning bool ForceStopExec bool ServerUrl string ServerToken string // used to exchange request and response data between goja and go CurrRequest domain.BaseRequest CurrResponse domain.DebugResponse CurrScenarioProcessor *Processor CurrScenarioProcessorId uint CurrDebugInterfaceId uint CurrEnvironmentId int ScopedVariables map[uint][]domain.ExecVariable // for scenario and debug ScopedCookies map[uint][]domain.ExecCookie // only for scenario ScopeHierarchy map[uint]*[]uint // only for scenario (processId -> ancestorProcessIds) ExecScene domain.ExecScene // for scenario and debug, from server DatapoolCursor map[string]int // only for scenario // for report data InterfaceStat *agentDomain.InterfaceStat // for goja js engine GojaVariables *[]domain.ExecVariable GojaLogs *[]string }
func GetUserExecContext ¶
func GetUserExecContext(execUuid string) (val *UserContext)
Source Files ¶
- condition-checkpoint.go
- condition-db-opt.go
- condition-exec.go
- condition-extractor.go
- condition-response-define.go
- condition-script.go
- consts.go
- context-cookie.go
- context-exec.go
- context.go
- data.go
- datapool.go
- environment.go
- expression.go
- message.go
- processor-assertion.go
- processor-base.go
- processor-cookie.go
- processor-custom-code.go
- processor-data.go
- processor-group.go
- processor-interface.go
- processor-logic.go
- processor-loop.go
- processor-print.go
- processor-root.go
- processor-timer.go
- processor-variable.go
- processor.go
- report.go
- request.go
- session.go
- stat.go
- to-cases.go
- to-interface.go
- to-plan.go
- to-scenario.go
- variable-find.go
- variable-opt.go
- variable-placeholder.go
Click to show internal directories.
Click to hide internal directories.