MCPcopy
hub / github.com/httprunner/httprunner / ToTCase

Method ToTCase

hrp/testcase.go:39–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37}
38
39func (tc *TestCase) ToTCase() *TCase {
40 tCase := &TCase{
41 Config: tc.Config,
42 }
43 for _, step := range tc.TestSteps {
44 if step.Type() == stepTypeTestCase {
45 if testcase, ok := step.Struct().TestCase.(*TestCase); ok {
46 step.Struct().TestCase = testcase.ToTCase()
47 }
48 }
49 tCase.TestSteps = append(tCase.TestSteps, step.Struct())
50 }
51 return tCase
52}
53
54func (tc *TestCase) Dump2JSON(targetPath string) error {
55 tCase := tc.ToTCase()

Callers 5

Dump2JSONMethod · 0.95
Dump2YAMLMethod · 0.95
RunMethod · 0.45
ParseTestCasesMethod · 0.45
TestGenDemoTestCaseFunction · 0.45

Calls 2

TypeMethod · 0.65
StructMethod · 0.65

Tested by 1

TestGenDemoTestCaseFunction · 0.36