mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
26 lines
640 B
Go
26 lines
640 B
Go
package examples
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/httprunner/hrp"
|
|
)
|
|
|
|
// generated by examples/har/demo.har using HttpRunner v3.1.6
|
|
const demoHttpRunnerJSONPath = "demo_httprunner.json"
|
|
const demoHttpRunnerYAMLPath = "demo_httprunner.yaml"
|
|
|
|
func TestCompatTestCase(t *testing.T) {
|
|
testcaseFromJSON := &hrp.TestCasePath{Path: demoHttpRunnerJSONPath}
|
|
err := hrp.NewRunner(t).Run(testcaseFromJSON)
|
|
if err != nil {
|
|
t.Fatalf("run testcase error: %v", err)
|
|
}
|
|
|
|
testcaseFromYAML := &hrp.TestCasePath{Path: demoHttpRunnerYAMLPath}
|
|
err = hrp.NewRunner(t).Run(testcaseFromYAML)
|
|
if err != nil {
|
|
t.Fatalf("run testcase error: %v", err)
|
|
}
|
|
}
|