mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 02:21:29 +08:00
refactor: rename API
This commit is contained in:
@@ -20,7 +20,7 @@ HttpBoomer is a golang implementation of [HttpRunner]. Ideally, HttpBoomer will
|
||||
- [x] Supports `variables`/`extract`/`validate`/`hooks` mechanisms to create extremely complex test scenarios.
|
||||
- [ ] Built-in integration of rich functions, and you can also use [`go plugin`][plugin] to create and call custom functions.
|
||||
- [x] Inherit all powerful features of [`Boomer`][Boomer] and [`locust`][locust], you can run `load test` without extra work.
|
||||
- [ ] Use it as a `CLI tool` or as a `library` are both supported.
|
||||
- [x] Use it as a `CLI tool` or as a `library` are both supported.
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -35,7 +35,6 @@ $ go get -u github.com/httprunner/httpboomer
|
||||
This is an example of HttpBoomer testcase. You can find more in the [`examples`][examples] directory.
|
||||
|
||||
```go
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
@@ -86,7 +85,7 @@ func TestCaseDemo(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"github.com/myzhan/boomer"
|
||||
)
|
||||
|
||||
func Run(testcases ...ITestCase) {
|
||||
func Boom(testcases ...ITestCase) {
|
||||
NewBoomer().Run(testcases...)
|
||||
}
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ func TestLoadJSONAndRun(t *testing.T) {
|
||||
if !assert.NoError(t, err) {
|
||||
t.Fail()
|
||||
}
|
||||
err = Test(t, testcase)
|
||||
err = Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestCaseDemo(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ func TestCaseExtractStepSingle(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
@@ -82,7 +82,7 @@ func TestCaseExtractStepAssociation(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestCaseCallFunction(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ func TestCaseBasicRequest(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ func TestCaseValidateStep(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ func TestCaseConfigVariables(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
@@ -66,7 +66,7 @@ func TestCaseStepVariables(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
@@ -104,7 +104,7 @@ func TestCaseOverrideConfigVariables(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
@@ -151,7 +151,7 @@ func TestCaseParseVariables(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := httpboomer.Test(t, testcase)
|
||||
err := httpboomer.Run(t, testcase)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/imroc/req"
|
||||
)
|
||||
|
||||
func Test(t *testing.T, testcases ...ITestCase) error {
|
||||
func Run(t *testing.T, testcases ...ITestCase) error {
|
||||
return NewRunner().WithTestingT(t).SetDebug(true).Run(testcases...)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ func TestHttpRunner(t *testing.T) {
|
||||
}
|
||||
testcase3 := &TestCasePath{demoTestCaseJSONPath}
|
||||
|
||||
err := Test(t, testcase1, testcase2, testcase3)
|
||||
err := Run(t, testcase1, testcase2, testcase3)
|
||||
if err != nil {
|
||||
t.Fatalf("run testcase error: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user