mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-25 01:59:52 +08:00
fix: udpate examples
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
# Release History
|
# Release History
|
||||||
|
|
||||||
|
## 3.0.4 (2020-05-18)
|
||||||
|
|
||||||
|
**Fixed**
|
||||||
|
|
||||||
|
- fix: extract response cookies
|
||||||
|
|
||||||
## 3.0.3 (2020-05-17)
|
## 3.0.3 (2020-05-17)
|
||||||
|
|
||||||
**Fixed**
|
**Fixed**
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ teststeps:
|
|||||||
method: GET
|
method: GET
|
||||||
validate:
|
validate:
|
||||||
- eq: ["status_code", 200]
|
- eq: ["status_code", 200]
|
||||||
# - startswith: [body.user-agent, "python-requests"]
|
- startswith: [body."user-agent", "python-requests"]
|
||||||
|
|
||||||
-
|
-
|
||||||
name: get without params
|
name: get without params
|
||||||
@@ -58,7 +58,7 @@ teststeps:
|
|||||||
method: GET
|
method: GET
|
||||||
validate:
|
validate:
|
||||||
- eq: ["status_code", 200]
|
- eq: ["status_code", 200]
|
||||||
# - eq: [cookies.name, "value"]
|
- eq: [body.cookies.name, "value"]
|
||||||
|
|
||||||
-
|
-
|
||||||
name: extract cookie
|
name: extract cookie
|
||||||
@@ -67,7 +67,7 @@ teststeps:
|
|||||||
method: GET
|
method: GET
|
||||||
validate:
|
validate:
|
||||||
- eq: ["status_code", 200]
|
- eq: ["status_code", 200]
|
||||||
# - eq: [cookies.name, "value"]
|
- eq: [body.cookies.name, "value"]
|
||||||
|
|
||||||
-
|
-
|
||||||
name: post data
|
name: post data
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ class TestCaseBasic(HttpRunner):
|
|||||||
**{
|
**{
|
||||||
"name": "user-agent",
|
"name": "user-agent",
|
||||||
"request": {"url": "/user-agent", "method": "GET"},
|
"request": {"url": "/user-agent", "method": "GET"},
|
||||||
"validate": [{"eq": ["status_code", 200]}],
|
"validate": [
|
||||||
|
{"eq": ["status_code", 200]},
|
||||||
|
{"startswith": ['body."user-agent"', "python-requests"]},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
TStep(
|
TStep(
|
||||||
@@ -61,14 +64,20 @@ class TestCaseBasic(HttpRunner):
|
|||||||
**{
|
**{
|
||||||
"name": "set cookie",
|
"name": "set cookie",
|
||||||
"request": {"url": "/cookies/set?name=value", "method": "GET"},
|
"request": {"url": "/cookies/set?name=value", "method": "GET"},
|
||||||
"validate": [{"eq": ["status_code", 200]}],
|
"validate": [
|
||||||
|
{"eq": ["status_code", 200]},
|
||||||
|
{"eq": ["body.cookies.name", "value"]},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
TStep(
|
TStep(
|
||||||
**{
|
**{
|
||||||
"name": "extract cookie",
|
"name": "extract cookie",
|
||||||
"request": {"url": "/cookies", "method": "GET"},
|
"request": {"url": "/cookies", "method": "GET"},
|
||||||
"validate": [{"eq": ["status_code", 200]}],
|
"validate": [
|
||||||
|
{"eq": ["status_code", 200]},
|
||||||
|
{"eq": ["body.cookies.name", "value"]},
|
||||||
|
],
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
TStep(
|
TStep(
|
||||||
|
|||||||
@@ -32,5 +32,6 @@ teststeps:
|
|||||||
- ${alter_response($response)}
|
- ${alter_response($response)}
|
||||||
validate:
|
validate:
|
||||||
- eq: ["status_code", 200]
|
- eq: ["status_code", 200]
|
||||||
# - eq: ["headers.content-type", "html/text"]
|
# TODO: implement hooks
|
||||||
|
# - eq: [body.headers."Content-Type", "html/text"]
|
||||||
- eq: [body.headers.Host, "httpbin.org"]
|
- eq: [body.headers.Host, "httpbin.org"]
|
||||||
|
|||||||
Reference in New Issue
Block a user