(t *testing.T)
| 61 | } |
| 62 | |
| 63 | func assertRunTestCases(t *testing.T) { |
| 64 | refCase := TestCasePath(demoTestCaseWithPluginJSONPath) |
| 65 | testcase1 := &TestCase{ |
| 66 | Config: NewConfig("TestCase1"). |
| 67 | SetBaseURL("https://postman-echo.com"), |
| 68 | TestSteps: []IStep{ |
| 69 | NewStep("testcase1-step1"). |
| 70 | GET("/headers"). |
| 71 | Validate(). |
| 72 | AssertEqual("status_code", 200, "check status code"). |
| 73 | AssertEqual("headers.\"Content-Type\"", "application/json; charset=utf-8", "check http response Content-Type"), |
| 74 | NewStep("testcase1-step2").CallRefCase( |
| 75 | &TestCase{ |
| 76 | Config: NewConfig("testcase1-step3-ref-case").SetBaseURL("https://postman-echo.com"), |
| 77 | TestSteps: []IStep{ |
| 78 | NewStep("ip"). |
| 79 | GET("/ip"). |
| 80 | Validate(). |
| 81 | AssertEqual("status_code", 200, "check status code"). |
| 82 | AssertEqual("headers.\"Content-Type\"", "application/json; charset=utf-8", "check http response Content-Type"), |
| 83 | }, |
| 84 | }, |
| 85 | ), |
| 86 | NewStep("testcase1-step3").CallRefCase(&refCase), |
| 87 | }, |
| 88 | } |
| 89 | testcase2 := &TestCase{ |
| 90 | Config: NewConfig("TestCase2").SetWeight(3), |
| 91 | } |
| 92 | |
| 93 | r := NewRunner(t) |
| 94 | r.SetPluginLogOn() |
| 95 | err := r.Run(testcase1, testcase2) |
| 96 | if err != nil { |
| 97 | t.Fatalf("run testcase error: %v", err) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | func TestRunCaseWithThinkTime(t *testing.T) { |
| 102 | buildHashicorpGoPlugin() |
no test coverage detected