mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-06 16:29:37 +08:00
restore headers.Content-Type validate
Change-Id: I6fdf2291bdf953f19ee6e9474020a2ab72186acf
This commit is contained in:
@@ -39,10 +39,12 @@ func TestCaseValidateStep(t *testing.T) {
|
|||||||
WithHeaders(map[string]string{"User-Agent": "$agent"}).
|
WithHeaders(map[string]string{"User-Agent": "$agent"}).
|
||||||
Extract().
|
Extract().
|
||||||
WithJmesPath("status_code", "statusCode").
|
WithJmesPath("status_code", "statusCode").
|
||||||
|
WithJmesPath("headers.\"Content-Type\"", "contentType").
|
||||||
Validate().
|
Validate().
|
||||||
AssertEqual("$statusCode", 200, "check status code"). // assert with extracted variable from current step
|
AssertEqual("$statusCode", 200, "check status code"). // assert with extracted variable from current step
|
||||||
AssertEqual("$varFoo1", "bar1", "check args foo1"). // assert with extracted variable from previous step
|
AssertEqual("$contentType", "application/json; charset=utf-8", "check header Content-Type"). // assert with extracted variable from current step
|
||||||
AssertEqual("body.args.foo2", "bar2", "check args foo2"), // assert response json body with jmespath
|
AssertEqual("$varFoo1", "bar1", "check args foo1"). // assert with extracted variable from previous step
|
||||||
|
AssertEqual("body.args.foo2", "bar2", "check args foo2"), // assert response json body with jmespath
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user