api

package
v0.71.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2020 License: MIT Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func ConvertCsvRowToMap(csvHeader []string, csvRow []interface{}) map[string]interface{}

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 IfValidHttp

func IfValidHttp(tcData *testcase.TestCaseDataInfo) bool

func OpenOutFileForAppend

func OpenOutFileForAppend(logFile string) *os.File

func PrepMultipart

func PrepMultipart(reqPayload map[string]interface{}, path string) (*bytes.Buffer, string, error)

func PrepPostFormPayload

func PrepPostFormPayload(reqPayload map[string]interface{}) *strings.Reader

func PrepPostPayload

func PrepPostPayload(reqPayload map[string]interface{}) *strings.Reader

func RunMongoDB added in v0.71.2

func RunMongoDB(cmdStr string) (int, interface{}, string)

func RunPgSql added in v0.71.2

func RunPgSql(tgtDb string, stmt string) (int, []string, []map[string]interface{}, string)

for postgresql

func RunRedis

func RunRedis(cmdStr string, cmdKey string, cmdValue string) (int, interface{}, string)

func RunSql

func RunSql(tgtDb string, stmt string) (int, []string, []map[string]interface{}, string)

for mysql

func SaveHttpRespFile

func SaveHttpRespFile(actualBody []byte, outputsFile string)

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 added in v0.71.2

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 added in v0.71.2

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 added in v0.71.2

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 added in v0.71.2

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 added in v0.71.2

func (tcDataStore *TcDataStore) GetRenderTcVariables(res string) string

trial

func (*TcDataStore) GetRes added in v0.71.2

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 added in v0.71.2

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) HandleHttpResultsForOut

func (tcDataStore *TcDataStore) HandleHttpResultsForOut()

func (*TcDataStore) HandleInitCmd

func (tcDataStore *TcDataStore) HandleInitCmd(i int) ([]bool, [][]*testcase.TestMessage)

init

func (*TcDataStore) HandleJsonFile added in v0.71.2

func (tcDataStore *TcDataStore) HandleJsonFile(i int) ([]bool, [][]*testcase.TestMessage)

file

func (*TcDataStore) HandleMongoDBCmd added in v0.71.2

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 added in v0.71.2

func (tcDataStore *TcDataStore) ReWriteTcData(path string, res interface{}, jsonStr string)

trial

func (*TcDataStore) RenderExpresionA added in v0.71.2

func (tcDataStore *TcDataStore) RenderExpresionA(source interface{}) string

func (*TcDataStore) RenderExpresionB added in v0.71.2

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{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL