mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 11:29:48 +08:00
update templates/testcases
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"project_name": "demo-with-go-plugin",
|
||||
"project_path": "/Users/xxxxx/go/src/github.com/httprunner/httprunner/examples/demo-with-go-plugin",
|
||||
"create_time": "2022-05-26T22:08:10.455301+08:00",
|
||||
"create_time": "2022-05-27T11:34:23.903959+08:00",
|
||||
"hrp_version": "v4.1.0-beta"
|
||||
}
|
||||
@@ -28,15 +28,6 @@ teststeps:
|
||||
Content-Type: "application/x-www-form-urlencoded"
|
||||
body: "foo1=$foo1&foo2=$foo3"
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.form.foo1
|
||||
assert: equal
|
||||
expect: bar1
|
||||
msg: check body.form.foo1
|
||||
- check: body.form.foo2
|
||||
assert: equal
|
||||
expect: bar21
|
||||
msg: check body.form.foo2
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.form.foo1", "bar1"]
|
||||
- eq: ["body.form.foo2", "bar21"]
|
||||
@@ -27,22 +27,10 @@ teststeps:
|
||||
extract:
|
||||
foo3: "body.args.foo2"
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.args.foo1
|
||||
assert: equal
|
||||
expect: debugtalk
|
||||
msg: check body.args.foo1
|
||||
- check: body.args.sum_v
|
||||
assert: equal
|
||||
expect: "3"
|
||||
msg: check body.args.sum_v
|
||||
- check: body.args.foo2
|
||||
assert: equal
|
||||
expect: bar21
|
||||
msg: check body.args.foo2
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.args.foo1", "debugtalk"]
|
||||
- eq: ["body.args.sum_v", "3"]
|
||||
- eq: ["body.args.foo2", "bar21"]
|
||||
-
|
||||
name: post raw text
|
||||
variables:
|
||||
@@ -56,14 +44,8 @@ teststeps:
|
||||
Content-Type: "text/plain"
|
||||
body: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.data
|
||||
assert: equal
|
||||
expect: "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."
|
||||
msg: check body.data
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.data", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."]
|
||||
-
|
||||
name: post form data
|
||||
variables:
|
||||
@@ -76,19 +58,7 @@ teststeps:
|
||||
Content-Type: "application/x-www-form-urlencoded"
|
||||
body: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.form.foo1
|
||||
assert: equal
|
||||
expect: $expect_foo1
|
||||
msg: check body.form.foo1
|
||||
- check: body.form.foo2
|
||||
assert: equal
|
||||
expect: bar23
|
||||
msg: check body.form.foo2
|
||||
- check: body.form.foo3
|
||||
assert: equal
|
||||
expect: bar21
|
||||
msg: check body.form.foo3
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.form.foo1", "$expect_foo1"]
|
||||
- eq: ["body.form.foo2", "bar23"]
|
||||
- eq: ["body.form.foo3", "bar21"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"project_name": "demo-with-py-plugin",
|
||||
"project_path": "/Users/xxxxx/go/src/github.com/httprunner/httprunner/examples/demo-with-py-plugin",
|
||||
"create_time": "2022-05-26T22:08:18.580462+08:00",
|
||||
"create_time": "2022-05-27T11:34:31.852589+08:00",
|
||||
"hrp_version": "v4.1.0-beta"
|
||||
}
|
||||
@@ -28,15 +28,6 @@ teststeps:
|
||||
Content-Type: "application/x-www-form-urlencoded"
|
||||
body: "foo1=$foo1&foo2=$foo3"
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.form.foo1
|
||||
assert: equal
|
||||
expect: bar1
|
||||
msg: check body.form.foo1
|
||||
- check: body.form.foo2
|
||||
assert: equal
|
||||
expect: bar21
|
||||
msg: check body.form.foo2
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.form.foo1", "bar1"]
|
||||
- eq: ["body.form.foo2", "bar21"]
|
||||
@@ -27,22 +27,10 @@ teststeps:
|
||||
extract:
|
||||
foo3: "body.args.foo2"
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.args.foo1
|
||||
assert: equal
|
||||
expect: debugtalk
|
||||
msg: check body.args.foo1
|
||||
- check: body.args.sum_v
|
||||
assert: equal
|
||||
expect: "3"
|
||||
msg: check body.args.sum_v
|
||||
- check: body.args.foo2
|
||||
assert: equal
|
||||
expect: bar21
|
||||
msg: check body.args.foo2
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.args.foo1", "debugtalk"]
|
||||
- eq: ["body.args.sum_v", "3"]
|
||||
- eq: ["body.args.foo2", "bar21"]
|
||||
-
|
||||
name: post raw text
|
||||
variables:
|
||||
@@ -56,14 +44,8 @@ teststeps:
|
||||
Content-Type: "text/plain"
|
||||
body: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.data
|
||||
assert: equal
|
||||
expect: "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."
|
||||
msg: check body.data
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.data", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."]
|
||||
-
|
||||
name: post form data
|
||||
variables:
|
||||
@@ -76,19 +58,7 @@ teststeps:
|
||||
Content-Type: "application/x-www-form-urlencoded"
|
||||
body: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
||||
validate:
|
||||
- check: status_code
|
||||
assert: equal
|
||||
expect: 200
|
||||
msg: check status_code
|
||||
- check: body.form.foo1
|
||||
assert: equal
|
||||
expect: $expect_foo1
|
||||
msg: check body.form.foo1
|
||||
- check: body.form.foo2
|
||||
assert: equal
|
||||
expect: bar23
|
||||
msg: check body.form.foo2
|
||||
- check: body.form.foo3
|
||||
assert: equal
|
||||
expect: bar21
|
||||
msg: check body.form.foo3
|
||||
- eq: ["status_code", 200]
|
||||
- eq: ["body.form.foo1", "$expect_foo1"]
|
||||
- eq: ["body.form.foo2", "bar23"]
|
||||
- eq: ["body.form.foo3", "bar21"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"project_name": "demo-without-plugin",
|
||||
"project_path": "/Users/xxxxx/go/src/github.com/httprunner/httprunner/examples/demo-without-plugin",
|
||||
"create_time": "2022-05-26T22:08:19.331271+08:00",
|
||||
"create_time": "2022-05-27T11:34:32.548637+08:00",
|
||||
"hrp_version": "v4.1.0-beta"
|
||||
}
|
||||
Reference in New Issue
Block a user