Documentation ¶
Index ¶
- func CallFunc(funcName string, funcParams_f interface{}) interface{}
- func ConvertCsvRowToMap(csvHeader []string, csvRow []interface{}) map[string]interface{}
- func DispatchApi(wg *sync.WaitGroup, resultsExeChan chan testcase.TestCaseExecutionInfo, ...)
- func GetFuncLeavesSlice(value interface{}) []g4json.FieldDetails
- func GetPayloadInfo(tcData *testcase.TestCaseDataInfo) (string, string, *strings.Reader, *bytes.Buffer, string)
- func IfValidHttp(tcData *testcase.TestCaseDataInfo) bool
- func OpenOutFileForAppend(logFile string) *os.File
- func PrepMultipart(reqPayload map[string]interface{}, path string) (*bytes.Buffer, string, error)
- func PrepPostFormPayload(reqPayload map[string]interface{}) *strings.Reader
- func PrepPostPayload(reqPayload map[string]interface{}) *strings.Reader
- func RunMongoDB(cmdStr string) (int, interface{}, string)
- func RunMsSql(tgtDb string, stmt string) (int, []string, []map[string]interface{}, string)
- func RunPgSql(tgtDb string, stmt string) (int, []string, []map[string]interface{}, string)
- func RunRedis(cmdStr string, cmdKey string, cmdValue string) (int, interface{}, string)
- func RunSql(tgtDb string, stmt string) (int, []string, []map[string]interface{}, string)
- func SaveHttpRespFile(actualBody []byte, outputsFile string)
- func SaveJsonToCsvFile(tcDataStore *TcDataStore, sources []string, sourcesFields []string, ...)
- func SaveJsonToExcelFile(tcDataStore *TcDataStore, sources []string, sourcesFields []string, ...)
- type TcDataStore
- func (tcDataStore *TcDataStore) CallHttp(baseUrl string)
- func (tcDataStore *TcDataStore) CommandGroup(cmdGroupOrigin []*testcase.CommandDetails) (string, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) Compare() (string, []*testcase.TestMessage)
- func (tcDataStore *TcDataStore) CompareHttpRespGroup(httpExpResp []map[string]interface{}) ([]bool, []*testcase.TestMessage)
- func (tcDataStore *TcDataStore) CompareRespGroup(cmdExpResp []map[string]interface{}) (bool, []*testcase.TestMessage)
- func (tcDataStore *TcDataStore) CompareRespGroupSingleAssertion(v map[string]interface{}) (bool, *testcase.TestMessage)
- func (tcDataStore *TcDataStore) EvaluateEmbeddedFunctions(value interface{}) interface{}
- func (tcDataStore *TcDataStore) EvaluateTcEmbeddedFunctions(path string, res interface{})
- func (tcDataStore *TcDataStore) GetContentByPath(res interface{}, jsonPath string) interface{}
- func (tcDataStore *TcDataStore) GetHeadersActualValue(key string) interface{}
- func (tcDataStore *TcDataStore) GetKeysCount(s string, jsonPath string) interface{}
- func (tcDataStore *TcDataStore) GetOutputsCsvData(outputsData map[string][]interface{}) ([]string, []string)
- func (tcDataStore *TcDataStore) GetOutputsDetailsDataForFieldSlice(valueSlice []interface{}) []interface{}
- func (tcDataStore *TcDataStore) GetOutputsDetailsDataForFieldString(valueSlice []interface{}) []string
- func (tcDataStore *TcDataStore) GetRedisActualValueByPath(searchPath string) interface{}
- func (tcDataStore *TcDataStore) GetRenderTcVariables(res string) string
- func (tcDataStore *TcDataStore) GetRes(s string, jsonPath string) interface{}
- func (tcDataStore *TcDataStore) GetResponseValue(searchPath string) interface{}
- func (tcDataStore *TcDataStore) GetStatusActualValue() interface{}
- func (tcDataStore *TcDataStore) GetVariableContent(s string) interface{}
- func (tcDataStore *TcDataStore) HandleCmdResultsForOut(i int)
- func (tcDataStore *TcDataStore) HandleCmdSource(i int) string
- func (tcDataStore *TcDataStore) HandleCmdStr(i int) string
- func (tcDataStore *TcDataStore) HandleHttpResultsForOut()
- func (tcDataStore *TcDataStore) HandleInitCmd(i int) ([]bool, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) HandleJsonFile(i int) ([]bool, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) HandleMongoDBCmd(i int) ([]bool, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) HandleOutFiles(expOutFiles []*testcase.OutFilesDetails)
- func (tcDataStore *TcDataStore) HandleRedisCmd(i int) ([]bool, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) HandleSingleCmdResult(i int) ([]bool, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) HandleSqlCmd(lc string, i int) ([]bool, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) IfCmdResultsPrimitive() bool
- func (tcDataStore *TcDataStore) IterateFuncs(jsonStr string, funcLeavesSlice []g4json.FieldDetails, maxLevel int) string
- func (tcDataStore *TcDataStore) MergeTestData() map[string]interface{}
- func (tcDataStore *TcDataStore) PrepEmbeddedFunctions(path string)
- func (tcDataStore *TcDataStore) ReWriteTcData(path string, res interface{}, jsonStr string)
- func (tcDataStore *TcDataStore) RenderExpresionA(source interface{}) string
- func (tcDataStore *TcDataStore) RenderExpresionB(source interface{}) interface{}
- func (tcDataStore *TcDataStore) RenderTcVariables(path string, res interface{})
- func (tcDataStore *TcDataStore) RunHttp(baseUrl string) (string, []*testcase.TestMessage)
- func (tcDataStore *TcDataStore) RunTcSetUp() (string, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) RunTcTearDown() (string, [][]*testcase.TestMessage)
- func (tcDataStore *TcDataStore) WriteOutGlobalVariables(expOutGlobalVariables map[string]interface{})
- func (tcDataStore *TcDataStore) WriteOutTcLocalVariables(expOutLocalVariables map[string]interface{})
- func (tcDataStore *TcDataStore) WriteOutputsDataToFile()
- func (tcDataStore *TcDataStore) WriteSession(expTcSession map[string]interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallFunc ¶
func CallFunc(funcName string, funcParams_f interface{}) interface{}
CallFunc for BuiltinFunc and User defined func (i.e. in js files)
func ConvertCsvRowToMap ¶
4. data file (*_dt) / data file (inputs)
func DispatchApi ¶
func DispatchApi(wg *sync.WaitGroup, resultsExeChan chan testcase.TestCaseExecutionInfo, baseUrl string, tcData *testcase.TestCaseDataInfo)
func GetFuncLeavesSlice ¶
func GetFuncLeavesSlice(value interface{}) []g4json.FieldDetails
func GetPayloadInfo ¶
func IfValidHttp ¶
func IfValidHttp(tcData *testcase.TestCaseDataInfo) bool
func OpenOutFileForAppend ¶
func PrepMultipart ¶
func PrepPostFormPayload ¶
func PrepPostPayload ¶
func RunMongoDB ¶
func SaveHttpRespFile ¶
func SaveJsonToCsvFile ¶
func SaveJsonToCsvFile(tcDataStore *TcDataStore, sources []string, sourcesFields []string, targetHeader []string, outputsFile string)
func SaveJsonToExcelFile ¶
func SaveJsonToExcelFile(tcDataStore *TcDataStore, sources []string, sourcesFields []string, targetHeader []string, outputsFile string)
Types ¶
type TcDataStore ¶
type TcDataStore struct { TcData *testcase.TestCaseDataInfo TcLocalVariables map[string]interface{} HttpExpStatus map[string]interface{} HttpExpHeader map[string]interface{} HttpExpBody map[string]interface{} HttpActualStatusCode int HttpActualHeader map[string][]string HttpActualBody []byte HttpUrl string CmdSection string // setUp, tearDown CmdGroupLength int CmdType string // sql, redis, init, etc. CmdExecStatus string CmdAffectedCount int CmdResults interface{} }
func InitTcDataStore ¶
func InitTcDataStore(tcData *testcase.TestCaseDataInfo) *TcDataStore
func (*TcDataStore) CallHttp ¶
func (tcDataStore *TcDataStore) CallHttp(baseUrl string)
func (*TcDataStore) CommandGroup ¶
func (tcDataStore *TcDataStore) CommandGroup(cmdGroupOrigin []*testcase.CommandDetails) (string, [][]*testcase.TestMessage)
func (*TcDataStore) Compare ¶
func (tcDataStore *TcDataStore) Compare() (string, []*testcase.TestMessage)
func (*TcDataStore) CompareHttpRespGroup ¶
func (tcDataStore *TcDataStore) CompareHttpRespGroup(httpExpResp []map[string]interface{}) ([]bool, []*testcase.TestMessage)
func (*TcDataStore) CompareRespGroup ¶
func (tcDataStore *TcDataStore) CompareRespGroup(cmdExpResp []map[string]interface{}) (bool, []*testcase.TestMessage)
for trial
func (*TcDataStore) CompareRespGroupSingleAssertion ¶
func (tcDataStore *TcDataStore) CompareRespGroupSingleAssertion(v map[string]interface{}) (bool, *testcase.TestMessage)
for trial
func (*TcDataStore) EvaluateEmbeddedFunctions ¶
func (tcDataStore *TcDataStore) EvaluateEmbeddedFunctions(value interface{}) interface{}
func (*TcDataStore) EvaluateTcEmbeddedFunctions ¶
func (tcDataStore *TcDataStore) EvaluateTcEmbeddedFunctions(path string, res interface{})
func (*TcDataStore) GetContentByPath ¶
func (tcDataStore *TcDataStore) GetContentByPath(res interface{}, jsonPath string) interface{}
------------------------
func (*TcDataStore) GetHeadersActualValue ¶
func (tcDataStore *TcDataStore) GetHeadersActualValue(key string) interface{}
http response headers
func (*TcDataStore) GetKeysCount ¶
func (tcDataStore *TcDataStore) GetKeysCount(s string, jsonPath string) interface{}
func (*TcDataStore) GetOutputsCsvData ¶
func (tcDataStore *TcDataStore) GetOutputsCsvData(outputsData map[string][]interface{}) ([]string, []string)
func (*TcDataStore) GetOutputsDetailsDataForFieldSlice ¶
func (tcDataStore *TcDataStore) GetOutputsDetailsDataForFieldSlice(valueSlice []interface{}) []interface{}
func (*TcDataStore) GetOutputsDetailsDataForFieldString ¶
func (tcDataStore *TcDataStore) GetOutputsDetailsDataForFieldString(valueSlice []interface{}) []string
func (*TcDataStore) GetRedisActualValueByPath ¶
func (tcDataStore *TcDataStore) GetRedisActualValueByPath(searchPath string) interface{}
redis
func (*TcDataStore) GetRenderTcVariables ¶
func (tcDataStore *TcDataStore) GetRenderTcVariables(res string) string
trial
func (*TcDataStore) GetRes ¶
func (tcDataStore *TcDataStore) GetRes(s string, jsonPath string) interface{}
func (*TcDataStore) GetResponseValue ¶
func (tcDataStore *TcDataStore) GetResponseValue(searchPath string) interface{}
func (*TcDataStore) GetStatusActualValue ¶
func (tcDataStore *TcDataStore) GetStatusActualValue() interface{}
http response status code
func (*TcDataStore) GetVariableContent ¶
func (tcDataStore *TcDataStore) GetVariableContent(s string) interface{}
----- Variable's Content, supports json path expression
func (*TcDataStore) HandleCmdResultsForOut ¶
func (tcDataStore *TcDataStore) HandleCmdResultsForOut(i int)
------
func (*TcDataStore) HandleCmdSource ¶
func (tcDataStore *TcDataStore) HandleCmdSource(i int) string
func (*TcDataStore) HandleCmdStr ¶
func (tcDataStore *TcDataStore) HandleCmdStr(i int) string
func (*TcDataStore) HandleHttpResultsForOut ¶
func (tcDataStore *TcDataStore) HandleHttpResultsForOut()
func (*TcDataStore) HandleInitCmd ¶
func (tcDataStore *TcDataStore) HandleInitCmd(i int) ([]bool, [][]*testcase.TestMessage)
init
func (*TcDataStore) HandleJsonFile ¶
func (tcDataStore *TcDataStore) HandleJsonFile(i int) ([]bool, [][]*testcase.TestMessage)
file
func (*TcDataStore) HandleMongoDBCmd ¶
func (tcDataStore *TcDataStore) HandleMongoDBCmd(i int) ([]bool, [][]*testcase.TestMessage)
mongodb
func (*TcDataStore) HandleOutFiles ¶
func (tcDataStore *TcDataStore) HandleOutFiles(expOutFiles []*testcase.OutFilesDetails)
func (*TcDataStore) HandleRedisCmd ¶
func (tcDataStore *TcDataStore) HandleRedisCmd(i int) ([]bool, [][]*testcase.TestMessage)
redis
func (*TcDataStore) HandleSingleCmdResult ¶
func (tcDataStore *TcDataStore) HandleSingleCmdResult(i int) ([]bool, [][]*testcase.TestMessage)
func (*TcDataStore) HandleSqlCmd ¶
func (tcDataStore *TcDataStore) HandleSqlCmd(lc string, i int) ([]bool, [][]*testcase.TestMessage)
mysql
func (*TcDataStore) IfCmdResultsPrimitive ¶
func (tcDataStore *TcDataStore) IfCmdResultsPrimitive() bool
func (*TcDataStore) IterateFuncs ¶
func (tcDataStore *TcDataStore) IterateFuncs(jsonStr string, funcLeavesSlice []g4json.FieldDetails, maxLevel int) string
func (*TcDataStore) MergeTestData ¶
func (tcDataStore *TcDataStore) MergeTestData() map[string]interface{}
Note: here may occur: fatal error: concurrent map iteration and map write, => need to fix
func (*TcDataStore) PrepEmbeddedFunctions ¶
func (tcDataStore *TcDataStore) PrepEmbeddedFunctions(path string)
for http: .request, .response, .session, .outGlobalVariables, .outLocalVariables, .outFiles for cmd (setUp, tearDown): .cmd, .cmdResponse, .session, .outGlobalVariables, .outLocalVariables, .outFiles
func (*TcDataStore) ReWriteTcData ¶
func (tcDataStore *TcDataStore) ReWriteTcData(path string, res interface{}, jsonStr string)
trial
func (*TcDataStore) RenderExpresionA ¶
func (tcDataStore *TcDataStore) RenderExpresionA(source interface{}) string
func (*TcDataStore) RenderExpresionB ¶
func (tcDataStore *TcDataStore) RenderExpresionB(source interface{}) interface{}
func (*TcDataStore) RenderTcVariables ¶
func (tcDataStore *TcDataStore) RenderTcVariables(path string, res interface{})
func (*TcDataStore) RunHttp ¶
func (tcDataStore *TcDataStore) RunHttp(baseUrl string) (string, []*testcase.TestMessage)
func (*TcDataStore) RunTcSetUp ¶
func (tcDataStore *TcDataStore) RunTcSetUp() (string, [][]*testcase.TestMessage)
Note: for each SetUp, TesrDown, it may have more than one Command (including sql) for each Command, it may have more than one assertion
func (*TcDataStore) RunTcTearDown ¶
func (tcDataStore *TcDataStore) RunTcTearDown() (string, [][]*testcase.TestMessage)
func (*TcDataStore) WriteOutGlobalVariables ¶
func (tcDataStore *TcDataStore) WriteOutGlobalVariables(expOutGlobalVariables map[string]interface{})
func (*TcDataStore) WriteOutTcLocalVariables ¶
func (tcDataStore *TcDataStore) WriteOutTcLocalVariables(expOutLocalVariables map[string]interface{})
func (*TcDataStore) WriteOutputsDataToFile ¶
func (tcDataStore *TcDataStore) WriteOutputsDataToFile()
func (*TcDataStore) WriteSession ¶
func (tcDataStore *TcDataStore) WriteSession(expTcSession map[string]interface{})