mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-07 22:53:46 +08:00
feat: convertTestCase
This commit is contained in:
@@ -96,3 +96,19 @@ func TestDumpAndLoadYAML(t *testing.T) {
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadJSONAndRun(t *testing.T) {
|
||||
jsonPath := "demo.json"
|
||||
tc, err := loadFromJSON(jsonPath)
|
||||
if !assert.NoError(t, err) {
|
||||
t.Fail()
|
||||
}
|
||||
testcase, err := convertTestCase(tc)
|
||||
if !assert.NoError(t, err) {
|
||||
t.Fail()
|
||||
}
|
||||
err = Test(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user