mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 10:49:43 +08:00
refactor: post data with body
This commit is contained in:
@@ -32,7 +32,7 @@ func TestCaseCallFunction(t *testing.T) {
|
||||
httpboomer.Step("post json data with functions").
|
||||
POST("/post").
|
||||
WithHeaders(map[string]string{"User-Agent": "HttpBoomer"}).
|
||||
WithJSON(map[string]interface{}{"foo1": "${gen_random_string($n)}", "foo2": "${max($a, $b)}"}).
|
||||
WithBody(map[string]interface{}{"foo1": "${gen_random_string($n)}", "foo2": "${max($a, $b)}"}).
|
||||
Validate().
|
||||
AssertEqual("status_code", 200, "check status code").
|
||||
AssertLengthEqual("body.json.foo1", 5, "check args foo1").
|
||||
|
||||
Reference in New Issue
Block a user