fix: unittest

This commit is contained in:
xucong053
2022-05-27 16:40:17 +08:00
parent f2a9e653df
commit 2bf916deb3
47 changed files with 87 additions and 1366 deletions

View File

@@ -3,9 +3,9 @@
"name": "demo with complex mechanisms",
"base_url": "https://postman-echo.com",
"variables": {
"a": "${Sum(10, 2.3)}",
"a": "${sum(10, 2.3)}",
"b": 3.45,
"n": "${SumInts(1, 2, 2)}",
"n": "${sum_ints(1, 2, 2)}",
"varFoo1": "${gen_random_string($n)}",
"varFoo2": "${max($a, $b)}"
}
@@ -38,10 +38,10 @@
"varFoo2": "${max($a, $b)}"
},
"setup_hooks": [
"${SetupHookExample($name)}"
"${setup_hook_example($name)}"
],
"teardown_hooks": [
"${TeardownHookExample($name)}"
"${teardown_hook_example($name)}"
],
"extract": {
"varFoo1": "body.args.foo1"

View File

@@ -24,7 +24,7 @@ teststeps:
method: POST
url: /post
headers:
User-Agent: funplugin/${GetVersion()}
User-Agent: funplugin/${get_version()}
Content-Type: "application/x-www-form-urlencoded"
body: "foo1=$foo1&foo2=$foo3"
validate:

View File

@@ -19,7 +19,7 @@
"variables": {
"foo1": "${ENV(USERNAME)}",
"foo2": "bar21",
"sum_v": "${SumTwoInt(1, 2)}"
"sum_v": "${sum_two_int(1, 2)}"
},
"request": {
"method": "GET",
@@ -30,7 +30,7 @@
"sum_v": "$sum_v"
},
"headers": {
"User-Agent": "funplugin/${GetVersion()}"
"User-Agent": "funplugin/${get_version()}"
}
},
"extract": {
@@ -73,7 +73,7 @@
"method": "POST",
"url": "/post",
"headers": {
"User-Agent": "funplugin/${GetVersion()}",
"User-Agent": "funplugin/${get_version()}",
"Content-Type": "text/plain"
},
"body": "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
@@ -102,7 +102,7 @@
"method": "POST",
"url": "/post",
"headers": {
"User-Agent": "funplugin/${GetVersion()}",
"User-Agent": "funplugin/${get_version()}",
"Content-Type": "application/x-www-form-urlencoded"
},
"body": "foo1=$foo1&foo2=$foo2&foo3=$foo3"

View File

@@ -14,7 +14,7 @@ teststeps:
variables:
foo1: ${ENV(USERNAME)}
foo2: bar21
sum_v: "${SumTwoInt(1, 2)}"
sum_v: "${sum_two_int(1, 2)}"
request:
method: GET
url: $base_url/get
@@ -23,7 +23,7 @@ teststeps:
foo2: $foo2
sum_v: $sum_v
headers:
User-Agent: funplugin/${GetVersion()}
User-Agent: funplugin/${get_version()}
extract:
foo3: "body.args.foo2"
validate:
@@ -40,7 +40,7 @@ teststeps:
method: POST
url: $base_url/post
headers:
User-Agent: funplugin/${GetVersion()}
User-Agent: funplugin/${get_version()}
Content-Type: "text/plain"
body: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
validate:
@@ -54,7 +54,7 @@ teststeps:
method: POST
url: $base_url/post
headers:
User-Agent: funplugin/${GetVersion()}
User-Agent: funplugin/${get_version()}
Content-Type: "application/x-www-form-urlencoded"
body: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
validate: