feat: create empty project by using hrp startproject #1280

This commit is contained in:
xucong053
2022-05-23 21:50:45 +08:00
parent fa3248b8ae
commit c59c859e73
17 changed files with 377 additions and 206 deletions

View File

@@ -1,6 +0,0 @@
{
"project_name": "demo-with-go-plugin",
"project_path": "/Users/debugtalk/MyProjects/HttpRunner-dev/httprunner/examples/demo-with-go-plugin",
"create_time": "2022-05-25T11:14:42.750876+08:00",
"hrp_version": "v4.1.0-beta"
}

View File

@@ -28,6 +28,15 @@ teststeps:
Content-Type: "application/x-www-form-urlencoded"
data: "foo1=$foo1&foo2=$foo3"
validate:
- eq: ["status_code", 200]
- eq: ["body.form.foo1", "bar1"]
- eq: ["body.form.foo2", "bar21"]
- 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

View File

@@ -38,28 +38,28 @@
},
"validate": [
{
"eq": [
"status_code",
200
]
"check": "status_code",
"assert": "equal",
"expect": 200,
"msg": "check status_code"
},
{
"eq": [
"body.args.foo1",
"debugtalk"
]
"check": "body.args.foo1",
"assert": "equal",
"expect": "debugtalk",
"msg": "check body.args.foo1"
},
{
"eq": [
"body.args.sum_v",
"3"
]
"check": "body.args.sum_v",
"assert": "equal",
"expect": "3",
"msg": "check body.args.sum_v"
},
{
"eq": [
"body.args.foo2",
"bar21"
]
"check": "body.args.foo2",
"assert": "equal",
"expect": "bar21",
"msg": "check body.args.foo2"
}
]
},
@@ -80,16 +80,16 @@
},
"validate": [
{
"eq": [
"status_code",
200
]
"check": "status_code",
"assert": "equal",
"expect": 200,
"msg": "check status_code"
},
{
"eq": [
"body.data",
"This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."
]
"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"
}
]
},
@@ -109,28 +109,28 @@
},
"validate": [
{
"eq": [
"status_code",
200
]
"check": "status_code",
"assert": "equal",
"expect": 200,
"msg": "check status_code"
},
{
"eq": [
"body.form.foo1",
"$expect_foo1"
]
"check": "body.form.foo1",
"assert": "equal",
"expect": "$expect_foo1",
"msg": "check body.form.foo1"
},
{
"eq": [
"body.form.foo2",
"bar23"
]
"check": "body.form.foo2",
"assert": "equal",
"expect": "bar23",
"msg": "check body.form.foo2"
},
{
"eq": [
"body.form.foo3",
"bar21"
]
"check": "body.form.foo3",
"assert": "equal",
"expect": "bar21",
"msg": "check body.form.foo3"
}
]
}

View File

@@ -27,10 +27,22 @@ teststeps:
extract:
foo3: "body.args.foo2"
validate:
- eq: ["status_code", 200]
- eq: ["body.args.foo1", "debugtalk"]
- eq: ["body.args.sum_v", "3"]
- eq: ["body.args.foo2", "bar21"]
- 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
-
name: post raw text
variables:
@@ -44,8 +56,14 @@ teststeps:
Content-Type: "text/plain"
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
validate:
- eq: ["status_code", 200]
- eq: ["body.data", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."]
- 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
-
name: post form data
variables:
@@ -58,7 +76,19 @@ teststeps:
Content-Type: "application/x-www-form-urlencoded"
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
validate:
- eq: ["status_code", 200]
- eq: ["body.form.foo1", "$expect_foo1"]
- eq: ["body.form.foo2", "bar23"]
- eq: ["body.form.foo3", "bar21"]
- 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

View File

@@ -1,6 +0,0 @@
{
"project_name": "demo-with-py-plugin",
"project_path": "/Users/debugtalk/MyProjects/HttpRunner-dev/httprunner/examples/demo-with-py-plugin",
"create_time": "2022-05-25T11:14:52.333942+08:00",
"hrp_version": "v4.1.0-beta"
}

View File

@@ -28,6 +28,15 @@ teststeps:
Content-Type: "application/x-www-form-urlencoded"
data: "foo1=$foo1&foo2=$foo3"
validate:
- eq: ["status_code", 200]
- eq: ["body.form.foo1", "bar1"]
- eq: ["body.form.foo2", "bar21"]
- 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

View File

@@ -38,28 +38,28 @@
},
"validate": [
{
"eq": [
"status_code",
200
]
"check": "status_code",
"assert": "equal",
"expect": 200,
"msg": "check status_code"
},
{
"eq": [
"body.args.foo1",
"debugtalk"
]
"check": "body.args.foo1",
"assert": "equal",
"expect": "debugtalk",
"msg": "check body.args.foo1"
},
{
"eq": [
"body.args.sum_v",
"3"
]
"check": "body.args.sum_v",
"assert": "equal",
"expect": "3",
"msg": "check body.args.sum_v"
},
{
"eq": [
"body.args.foo2",
"bar21"
]
"check": "body.args.foo2",
"assert": "equal",
"expect": "bar21",
"msg": "check body.args.foo2"
}
]
},
@@ -80,16 +80,16 @@
},
"validate": [
{
"eq": [
"status_code",
200
]
"check": "status_code",
"assert": "equal",
"expect": 200,
"msg": "check status_code"
},
{
"eq": [
"body.data",
"This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."
]
"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"
}
]
},
@@ -109,28 +109,28 @@
},
"validate": [
{
"eq": [
"status_code",
200
]
"check": "status_code",
"assert": "equal",
"expect": 200,
"msg": "check status_code"
},
{
"eq": [
"body.form.foo1",
"$expect_foo1"
]
"check": "body.form.foo1",
"assert": "equal",
"expect": "$expect_foo1",
"msg": "check body.form.foo1"
},
{
"eq": [
"body.form.foo2",
"bar23"
]
"check": "body.form.foo2",
"assert": "equal",
"expect": "bar23",
"msg": "check body.form.foo2"
},
{
"eq": [
"body.form.foo3",
"bar21"
]
"check": "body.form.foo3",
"assert": "equal",
"expect": "bar21",
"msg": "check body.form.foo3"
}
]
}

View File

@@ -27,10 +27,22 @@ teststeps:
extract:
foo3: "body.args.foo2"
validate:
- eq: ["status_code", 200]
- eq: ["body.args.foo1", "debugtalk"]
- eq: ["body.args.sum_v", "3"]
- eq: ["body.args.foo2", "bar21"]
- 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
-
name: post raw text
variables:
@@ -44,8 +56,14 @@ teststeps:
Content-Type: "text/plain"
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
validate:
- eq: ["status_code", 200]
- eq: ["body.data", "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32."]
- 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
-
name: post form data
variables:
@@ -58,7 +76,19 @@ teststeps:
Content-Type: "application/x-www-form-urlencoded"
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
validate:
- eq: ["status_code", 200]
- eq: ["body.form.foo1", "$expect_foo1"]
- eq: ["body.form.foo2", "bar23"]
- eq: ["body.form.foo3", "bar21"]
- 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

View File

@@ -1,6 +0,0 @@
{
"project_name": "demo-without-plugin",
"project_path": "/Users/debugtalk/MyProjects/HttpRunner-dev/httprunner/examples/demo-without-plugin",
"create_time": "2022-05-25T11:14:53.862348+08:00",
"hrp_version": "v4.1.0-beta"
}