forked from httprunner/hrp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboomer_test.go
31 lines (28 loc) · 881 Bytes
/
boomer_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package hrp
import (
"testing"
"time"
)
func TestBoomerStandaloneRun(t *testing.T) {
testcase1 := &TestCase{
Config: NewConfig("TestCase1").SetBaseURL("http://httpbin.org"),
TestSteps: []IStep{
NewStep("headers").
GET("/headers").
Validate().
AssertEqual("status_code", 200, "check status code").
AssertEqual("headers.\"Content-Type\"", "application/json", "check http response Content-Type"),
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"),
NewStep("TestCase3").CallRefCase(&TestCase{Config: NewConfig("TestCase3")}),
},
}
testcase2 := &TestCasePath{demoTestCaseJSONPath}
b := NewBoomer(2, 1)
go b.Run(testcase1, testcase2)
time.Sleep(5 * time.Second)
b.Quit()
}