refactor: TestCase/TestCaseDef/StepConfig models

This commit is contained in:
lilong.129
2024-11-09 20:15:40 +08:00
parent 2587bbee82
commit 8846e84d19
31 changed files with 621 additions and 563 deletions
+3 -3
View File
@@ -94,12 +94,12 @@ func init() {
}
// LoadCurlCase loads testcase from one or more curl commands in .txt file
func LoadCurlCase(path string) (*hrp.TestCase, error) {
func LoadCurlCase(path string) (*hrp.TestCaseDef, error) {
cmds, err := readFileLines(path)
if err != nil {
return nil, err
}
tCase := &hrp.TestCase{
tCase := &hrp.TestCaseDef{
Config: &hrp.TConfig{
Name: "testcase converted from curl command",
},
@@ -307,7 +307,7 @@ type stepFromCurl struct {
}
func (s *stepFromCurl) makeRequestName(c CaseCurl) error {
s.Name = c.Get(originCmdKey, 0)
s.StepName = c.Get(originCmdKey, 0)
return nil
}