mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-24 09:50:00 +08:00
change: use NewStep to construct a new test step
This commit is contained in:
@@ -11,17 +11,17 @@ func TestHttpRunner(t *testing.T) {
|
||||
BaseURL: "http://httpbin.org",
|
||||
},
|
||||
TestSteps: []IStep{
|
||||
Step("headers").
|
||||
NewStep("headers").
|
||||
GET("/headers").
|
||||
Validate().
|
||||
AssertEqual("status_code", 200, "check status code").
|
||||
AssertEqual("headers.\"Content-Type\"", "application/json", "check http response Content-Type"),
|
||||
Step("user-agent").
|
||||
NewStep("user-agent").
|
||||
GET("/user-agent").
|
||||
Validate().
|
||||
AssertEqual("status_code", 200, "check status code").
|
||||
AssertEqual("headers.\"Content-Type\"", "application/json", "check http response Content-Type"),
|
||||
Step("TestCase3").CallRefCase(&TestCase{Config: TConfig{Name: "TestCase3"}}),
|
||||
NewStep("TestCase3").CallRefCase(&TestCase{Config: TConfig{Name: "TestCase3"}}),
|
||||
},
|
||||
}
|
||||
testcase2 := &TestCase{
|
||||
|
||||
Reference in New Issue
Block a user