mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-30 12:59:39 +08:00
feat: support api layer and global headers for testcase
This commit is contained in:
@@ -7,18 +7,18 @@ import (
|
||||
)
|
||||
|
||||
// generated by examples/har/demo.har using HttpRunner v3.1.6
|
||||
const demoHttpRunnerJSONPath = "demo_httprunner.json"
|
||||
const demoHttpRunnerYAMLPath = "demo_httprunner.yaml"
|
||||
var (
|
||||
demoHttpRunnerJSONPath hrp.TestCasePath = "demo_httprunner.json"
|
||||
demoHttpRunnerYAMLPath hrp.TestCasePath = "demo_httprunner.yaml"
|
||||
)
|
||||
|
||||
func TestCompatTestCase(t *testing.T) {
|
||||
testcaseFromJSON := &hrp.TestCasePath{Path: demoHttpRunnerJSONPath}
|
||||
err := hrp.NewRunner(t).Run(testcaseFromJSON)
|
||||
err := hrp.NewRunner(t).Run(&demoHttpRunnerJSONPath)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
testcaseFromYAML := &hrp.TestCasePath{Path: demoHttpRunnerYAMLPath}
|
||||
err = hrp.NewRunner(t).Run(testcaseFromYAML)
|
||||
err = hrp.NewRunner(t).Run(&demoHttpRunnerYAMLPath)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user