refactor: run step with runner

This commit is contained in:
debugtalk
2021-09-22 17:55:39 +08:00
parent e0d1c5d959
commit aee9b0c0b5
8 changed files with 266 additions and 228 deletions

View File

@@ -11,17 +11,17 @@ func TestHttpRunner(t *testing.T) {
BaseURL: "http://httpbin.org",
},
TestSteps: []IStep{
RunRequest("headers").
Step("headers").
GET("/headers").
Validate().
AssertEqual("status_code", 200, "check status code").
AssertEqual("headers.Host", "httpbin.org", "check http response host"),
RunRequest("user-agent").
Step("user-agent").
GET("/user-agent").
Validate().
AssertEqual("status_code", 200, "check status code").
AssertEqual("body.\"user-agent\"", "python-requests", "check User-Agent"),
RunTestCase("TestCase3").WithVariables(Variables{"var1": "value1"}),
Step("TestCase3").CallRefCase(&TestCase{}),
},
}
testcase2 := &TestCase{