scriptHelper

package
v0.0.0-...-a97389e Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDir

func AddDir(pth string, moduleId int, moduleName string, parent *serverDomain.TestAsset) (dirNode *serverDomain.TestAsset)

func AddScript

func AddScript(moduleId, caseId int, pth string, caseNameInZentao, displayBy string, showZentaoCaseWithNoScript bool, parent *serverDomain.TestAsset)

func CheckFileContentIsScript

func CheckFileContentIsScript(content string) bool

func CheckFileIsScript

func CheckFileIsScript(path string) bool

func Extract

func Extract(scriptPaths []string) (done bool, err error)

func GenEmptyScript

func GenEmptyScript(name, lang, pth string, productId int)

func GenSuite

func GenSuite(cases []string, targetDir string)

func GenerateScript

func GenerateScript(cs commDomain.ZtfCase, langType string, independentFile bool, caseIds *[]string,
	targetDir string, byModule bool) (scriptPath string, err error)

func GenerateScripts

func GenerateScripts(cases []commDomain.ZtfCase, langType string, independentFile bool,
	byModule bool, targetDir string) (pths []string, realPath string, err error)

func GetAllScriptsInDir

func GetAllScriptsInDir(path string, files *[]string) error

func GetCaseByDirAndFile

func GetCaseByDirAndFile(files []string) []string

func GetCaseByListInMap

func GetCaseByListInMap(caseIds []int, mp map[int]string) (cases []string)

func GetCaseIdsInSuiteFile

func GetCaseIdsInSuiteFile(name string, ids *[]int)

func GetCaseInfo

func GetCaseInfo(file string) (pass bool, caseId, productId int, title string, timeout int64)

func GetDependentExpect

func GetDependentExpect(file string) (bool, string)

func GetExpectMapFromIndependentFile

func GetExpectMapFromIndependentFile(steps *[]commDomain.ZentaoCaseStep, content string, withEmptyExpect bool)

func GetFailedCasesDirectlyFromTestResult

func GetFailedCasesDirectlyFromTestResult(resultFile string) []string

func GetScriptByIdsInDir

func GetScriptByIdsInDir(dirPth string, idMap *map[int]string) error

func GetScriptContent

func GetScriptContent(pth string, workspaceId int) (script serverDomain.TestScript, err error)

func GetScriptType

func GetScriptType(scripts []string) []string

func GetStepAndExpectMap

func GetStepAndExpectMap(file string) (steps []commDomain.ZentaoCaseStep)

func GetStepAndExpectMapInOldFormat

func GetStepAndExpectMapInOldFormat(checkpoints, file string) (steps []commDomain.ZentaoCaseStep)

func LoadScriptByWorkspace

func LoadScriptByWorkspace(workspacePath string) (scriptFiles []string)

func LoadScriptListInDir

func LoadScriptListInDir(path string, files *[]string, level int) error

for command only

func LoadScriptTreeByDir

func LoadScriptTreeByDir(workspace model.Workspace, scriptIdsFromZentao map[int]string) (asset serverDomain.TestAsset, err error)

func ReadCaseId

func ReadCaseId(content string) string

func ReadCaseInfoInOldFormat

func ReadCaseInfoInOldFormat(content, lang string) (info, checkpoints string)

func ReadExpectIndependentArr

func ReadExpectIndependentArr(content string) [][]string

func ReadLogArr

func ReadLogArr(content string) (isSkip bool, ret [][]string)

func ReadLogArrOld

func ReadLogArrOld(content string) (isSkip bool, ret [][]string)

func ReadTitleAndStepsInNewFormat

func ReadTitleAndStepsInNewFormat(content, lang string) (caseId int, title string, steps []commDomain.ZentaoCaseStep)

func ReplaceCaseDesc

func ReplaceCaseDesc(desc, file string)

func ScriptToExpectName

func ScriptToExpectName(file string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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