mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
bump version to v4.0.0
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
## 核心特性
|
## 核心特性
|
||||||
|
|
||||||
- 网络协议:完整支持 HTTP(S)/1.1 和 HTTP/2,可扩展支持 WebSocket/TCP/RPC 等更多协议
|
- 网络协议:完整支持 HTTP(S)/HTTP2/WebSocket,可扩展支持 TCP/UDP/RPC 等更多协议
|
||||||
- 多格式可选:测试用例支持 YAML/JSON/go test/pytest 格式,并且支持格式互相转换
|
- 多格式可选:测试用例支持 YAML/JSON/go test/pytest 格式,并且支持格式互相转换
|
||||||
- 双执行引擎:同时支持 golang/python 两个执行引擎,兼具 go 的高性能和 [pytest] 的丰富生态
|
- 双执行引擎:同时支持 golang/python 两个执行引擎,兼具 go 的高性能和 [pytest] 的丰富生态
|
||||||
- 录制 & 生成:可使用 [HAR]/Postman/Swagger/curl 等生成测试用例;基于链式调用的方法提示也可快速编写测试用例
|
- 录制 & 生成:可使用 [HAR]/Postman/Swagger/curl 等生成测试用例;基于链式调用的方法提示也可快速编写测试用例
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
# Release History
|
# Release History
|
||||||
|
|
||||||
## v4.0.0-beta2 (2022-04-25)
|
## v4.0.0 (2022-05-03)
|
||||||
|
|
||||||
**go version**
|
**go version**
|
||||||
|
|
||||||
- feat: add builtin function `environ`/`ENV`
|
- feat: add builtin function `environ`/`ENV`
|
||||||
- fix: demo function compatibility
|
- fix: demo function compatibility
|
||||||
- fix #1240: losing host port in har2case
|
- fix #1240: losing host port in har2case
|
||||||
|
- fix: concurrent map write in parameterize
|
||||||
- change: get hrp version from aliyun OSS file when installing
|
- change: get hrp version from aliyun OSS file when installing
|
||||||
|
- change: report more load testing metrics to prometheus
|
||||||
|
|
||||||
## v4.0.0-beta (2022-04-24)
|
## v4.0.0-beta (2022-04-24)
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,4 @@ Copyright 2017 debugtalk
|
|||||||
* [hrp run](hrp_run.md) - run API test with go engine
|
* [hrp run](hrp_run.md) - run API test with go engine
|
||||||
* [hrp startproject](hrp_startproject.md) - create a scaffold project
|
* [hrp startproject](hrp_startproject.md) - create a scaffold project
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 24-Apr-2022
|
###### Auto generated by spf13/cobra on 3-May-2022
|
||||||
|
|||||||
@@ -41,4 +41,4 @@ hrp boom [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 24-Apr-2022
|
###### Auto generated by spf13/cobra on 3-May-2022
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ hrp convert $path... [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 24-Apr-2022
|
###### Auto generated by spf13/cobra on 3-May-2022
|
||||||
|
|||||||
@@ -24,4 +24,4 @@ hrp har2case $har_path... [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 24-Apr-2022
|
###### Auto generated by spf13/cobra on 3-May-2022
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ hrp pytest $path ... [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 24-Apr-2022
|
###### Auto generated by spf13/cobra on 3-May-2022
|
||||||
|
|||||||
@@ -34,4 +34,4 @@ hrp run $path... [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 24-Apr-2022
|
###### Auto generated by spf13/cobra on 3-May-2022
|
||||||
|
|||||||
@@ -20,4 +20,4 @@ hrp startproject $project_name [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 24-Apr-2022
|
###### Auto generated by spf13/cobra on 3-May-2022
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: a-b.c/1.yml
|
# FROM: a-b.c/1.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: a-b.c/2 3.yml
|
# FROM: a-b.c/2 3.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ func TeardownHookExample(args string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetVersion() string {
|
func GetVersion() string {
|
||||||
return "v4.0.0-beta"
|
return fungo.Version
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fungo.Register("get_httprunner_version", GetVersion)
|
fungo.Register("get_version", GetVersion)
|
||||||
fungo.Register("sum_ints", SumInts)
|
fungo.Register("sum_ints", SumInts)
|
||||||
fungo.Register("sum_two_int", SumTwoInt)
|
fungo.Register("sum_two_int", SumTwoInt)
|
||||||
fungo.Register("sum_two", SumTwoInt)
|
fungo.Register("sum_two", SumTwoInt)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "application/x-www-form-urlencoded"
|
Content-Type: "application/x-www-form-urlencoded"
|
||||||
data: "foo1=$foo1&foo2=$foo3"
|
data: "foo1=$foo1&foo2=$foo3"
|
||||||
validate:
|
validate:
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ teststeps:
|
|||||||
foo2: $foo2
|
foo2: $foo2
|
||||||
sum_v: $sum_v
|
sum_v: $sum_v
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
extract:
|
extract:
|
||||||
foo3: "body.args.foo2"
|
foo3: "body.args.foo2"
|
||||||
validate:
|
validate:
|
||||||
@@ -41,7 +41,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "text/plain"
|
Content-Type: "text/plain"
|
||||||
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
||||||
validate:
|
validate:
|
||||||
@@ -55,7 +55,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "application/x-www-form-urlencoded"
|
Content-Type: "application/x-www-form-urlencoded"
|
||||||
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
||||||
validate:
|
validate:
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ from typing import List
|
|||||||
import funppy
|
import funppy
|
||||||
|
|
||||||
|
|
||||||
def get_httprunner_version():
|
def get_version():
|
||||||
return "v4.0.0-beta"
|
return funppy.__version__
|
||||||
|
|
||||||
|
|
||||||
def sleep(n_secs):
|
def sleep(n_secs):
|
||||||
@@ -60,7 +60,7 @@ def teardown_hook_example(name):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
funppy.register("get_httprunner_version", get_httprunner_version)
|
funppy.register("get_version", get_version)
|
||||||
funppy.register("sum", sum)
|
funppy.register("sum", sum)
|
||||||
funppy.register("sum_ints", sum_ints)
|
funppy.register("sum_ints", sum_ints)
|
||||||
funppy.register("concatenate", concatenate)
|
funppy.register("concatenate", concatenate)
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
# NOTICE: Generated By HttpRunner. DO NOT EDIT!
|
|
||||||
@@ -24,7 +24,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "application/x-www-form-urlencoded"
|
Content-Type: "application/x-www-form-urlencoded"
|
||||||
data: "foo1=$foo1&foo2=$foo3"
|
data: "foo1=$foo1&foo2=$foo3"
|
||||||
validate:
|
validate:
|
||||||
|
|||||||
@@ -1,60 +0,0 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.11
|
|
||||||
# FROM: testcases/demo_ref_testcase.yml
|
|
||||||
|
|
||||||
|
|
||||||
import sys
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
||||||
|
|
||||||
|
|
||||||
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase
|
|
||||||
|
|
||||||
from testcases.demo_requests_test import TestCaseDemoRequests as DemoRequests
|
|
||||||
|
|
||||||
|
|
||||||
class TestCaseDemoRefTestcase(HttpRunner):
|
|
||||||
|
|
||||||
config = (
|
|
||||||
Config("request methods testcase: reference testcase")
|
|
||||||
.variables(
|
|
||||||
**{
|
|
||||||
"foo1": "testsuite_config_bar1",
|
|
||||||
"expect_foo1": "testsuite_config_bar1",
|
|
||||||
"expect_foo2": "config_bar2",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.base_url("https://postman-echo.com")
|
|
||||||
.verify(False)
|
|
||||||
)
|
|
||||||
|
|
||||||
teststeps = [
|
|
||||||
Step(
|
|
||||||
RunTestCase("request with functions")
|
|
||||||
.with_variables(
|
|
||||||
**{"foo1": "testcase_ref_bar1", "expect_foo1": "testcase_ref_bar1"}
|
|
||||||
)
|
|
||||||
.call(DemoRequests)
|
|
||||||
.export(*["foo3"])
|
|
||||||
),
|
|
||||||
Step(
|
|
||||||
RunRequest("post form data")
|
|
||||||
.with_variables(**{"foo1": "bar1"})
|
|
||||||
.post("/post")
|
|
||||||
.with_headers(
|
|
||||||
**{
|
|
||||||
"User-Agent": "HttpRunner/${get_httprunner_version()}",
|
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.with_data("foo1=$foo1&foo2=$foo3")
|
|
||||||
.validate()
|
|
||||||
.assert_equal("status_code", 200)
|
|
||||||
.assert_equal("body.form.foo1", "bar1")
|
|
||||||
.assert_equal("body.form.foo2", "bar21")
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
TestCaseDemoRefTestcase().test_start()
|
|
||||||
@@ -24,7 +24,7 @@ teststeps:
|
|||||||
foo2: $foo2
|
foo2: $foo2
|
||||||
sum_v: $sum_v
|
sum_v: $sum_v
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
extract:
|
extract:
|
||||||
foo3: "body.args.foo2"
|
foo3: "body.args.foo2"
|
||||||
validate:
|
validate:
|
||||||
@@ -41,7 +41,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "text/plain"
|
Content-Type: "text/plain"
|
||||||
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
||||||
validate:
|
validate:
|
||||||
@@ -55,7 +55,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "application/x-www-form-urlencoded"
|
Content-Type: "application/x-www-form-urlencoded"
|
||||||
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
||||||
validate:
|
validate:
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.11
|
|
||||||
# FROM: testcases/demo_requests.yml
|
|
||||||
|
|
||||||
|
|
||||||
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase
|
|
||||||
|
|
||||||
|
|
||||||
class TestCaseDemoRequests(HttpRunner):
|
|
||||||
|
|
||||||
config = (
|
|
||||||
Config("request methods testcase with functions")
|
|
||||||
.variables(
|
|
||||||
**{
|
|
||||||
"foo1": "config_bar1",
|
|
||||||
"foo2": "config_bar2",
|
|
||||||
"expect_foo1": "config_bar1",
|
|
||||||
"expect_foo2": "config_bar2",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.base_url("https://postman-echo.com")
|
|
||||||
.verify(False)
|
|
||||||
.export(*["foo3"])
|
|
||||||
)
|
|
||||||
|
|
||||||
teststeps = [
|
|
||||||
Step(
|
|
||||||
RunRequest("get with params")
|
|
||||||
.with_variables(
|
|
||||||
**{"foo1": "bar11", "foo2": "bar21", "sum_v": "${sum_two_int(1, 2)}"}
|
|
||||||
)
|
|
||||||
.get("/get")
|
|
||||||
.with_params(**{"foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v"})
|
|
||||||
.with_headers(**{"User-Agent": "HttpRunner/${get_httprunner_version()}"})
|
|
||||||
.extract()
|
|
||||||
.with_jmespath("body.args.foo2", "foo3")
|
|
||||||
.validate()
|
|
||||||
.assert_equal("status_code", 200)
|
|
||||||
.assert_equal("body.args.foo1", "bar11")
|
|
||||||
.assert_equal("body.args.sum_v", "3")
|
|
||||||
.assert_equal("body.args.foo2", "bar21")
|
|
||||||
),
|
|
||||||
Step(
|
|
||||||
RunRequest("post raw text")
|
|
||||||
.with_variables(**{"foo1": "bar12", "foo3": "bar32"})
|
|
||||||
.post("/post")
|
|
||||||
.with_headers(
|
|
||||||
**{
|
|
||||||
"User-Agent": "HttpRunner/${get_httprunner_version()}",
|
|
||||||
"Content-Type": "text/plain",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.with_data(
|
|
||||||
"This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
|
||||||
)
|
|
||||||
.validate()
|
|
||||||
.assert_equal("status_code", 200)
|
|
||||||
.assert_equal(
|
|
||||||
"body.data",
|
|
||||||
"This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32.",
|
|
||||||
)
|
|
||||||
),
|
|
||||||
Step(
|
|
||||||
RunRequest("post form data")
|
|
||||||
.with_variables(**{"foo2": "bar23"})
|
|
||||||
.post("/post")
|
|
||||||
.with_headers(
|
|
||||||
**{
|
|
||||||
"User-Agent": "HttpRunner/${get_httprunner_version()}",
|
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.with_data("foo1=$foo1&foo2=$foo2&foo3=$foo3")
|
|
||||||
.validate()
|
|
||||||
.assert_equal("status_code", 200)
|
|
||||||
.assert_equal("body.form.foo1", "$expect_foo1")
|
|
||||||
.assert_equal("body.form.foo2", "bar23")
|
|
||||||
.assert_equal("body.form.foo3", "bar21")
|
|
||||||
),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
TestCaseDemoRequests().test_start()
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: basic.yml
|
# FROM: basic.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: hooks.yml
|
# FROM: hooks.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: load_image.yml
|
# FROM: load_image.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: upload.yml
|
# FROM: upload.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: validate.yml
|
# FROM: validate.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: cookie_manipulation/hardcode.yml
|
# FROM: cookie_manipulation/hardcode.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: cookie_manipulation/set_delete_cookies.yml
|
# FROM: cookie_manipulation/set_delete_cookies.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: request_methods/hardcode.yml
|
# FROM: request_methods/hardcode.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: request_methods/request_with_functions.yml
|
# FROM: request_methods/request_with_functions.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: request_methods/request_with_parameters.yml
|
# FROM: request_methods/request_with_parameters.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: request_methods/request_with_testcase_reference.yml
|
# FROM: request_methods/request_with_testcase_reference.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: request_methods/request_with_variables.yml
|
# FROM: request_methods/request_with_variables.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: request_methods/validate_with_functions.yml
|
# FROM: request_methods/validate_with_functions.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: request_methods/validate_with_variables.yml
|
# FROM: request_methods/validate_with_variables.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ func TeardownHookExample(args string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetVersion() string {
|
func GetVersion() string {
|
||||||
return "v4.0.0-beta"
|
return fungo.Version
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
fungo.Register("get_httprunner_version", GetVersion)
|
fungo.Register("get_version", GetVersion)
|
||||||
fungo.Register("sum_ints", SumInts)
|
fungo.Register("sum_ints", SumInts)
|
||||||
fungo.Register("sum_two_int", SumTwoInt)
|
fungo.Register("sum_two_int", SumTwoInt)
|
||||||
fungo.Register("sum_two", SumTwoInt)
|
fungo.Register("sum_two", SumTwoInt)
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ from typing import List
|
|||||||
import funppy
|
import funppy
|
||||||
|
|
||||||
|
|
||||||
def get_httprunner_version():
|
def get_version():
|
||||||
return "v4.0.0-beta"
|
return funppy.__version__
|
||||||
|
|
||||||
|
|
||||||
def sleep(n_secs):
|
def sleep(n_secs):
|
||||||
@@ -60,7 +60,7 @@ def teardown_hook_example(name):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
funppy.register("get_httprunner_version", get_httprunner_version)
|
funppy.register("get_version", get_version)
|
||||||
funppy.register("sum", sum)
|
funppy.register("sum", sum)
|
||||||
funppy.register("sum_ints", sum_ints)
|
funppy.register("sum_ints", sum_ints)
|
||||||
funppy.register("concatenate", concatenate)
|
funppy.register("concatenate", concatenate)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "application/x-www-form-urlencoded"
|
Content-Type: "application/x-www-form-urlencoded"
|
||||||
data: "foo1=$foo1&foo2=$foo3"
|
data: "foo1=$foo1&foo2=$foo3"
|
||||||
validate:
|
validate:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: testcases/demo_ref_testcase.yml
|
# FROM: testcases/demo_ref_testcase.yml
|
||||||
|
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ class TestCaseDemoRefTestcase(HttpRunner):
|
|||||||
.post("/post")
|
.post("/post")
|
||||||
.with_headers(
|
.with_headers(
|
||||||
**{
|
**{
|
||||||
"User-Agent": "HttpRunner/${get_httprunner_version()}",
|
"User-Agent": "funplugin/${get_version()}",
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ teststeps:
|
|||||||
foo2: $foo2
|
foo2: $foo2
|
||||||
sum_v: $sum_v
|
sum_v: $sum_v
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
extract:
|
extract:
|
||||||
foo3: "body.args.foo2"
|
foo3: "body.args.foo2"
|
||||||
validate:
|
validate:
|
||||||
@@ -41,7 +41,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "text/plain"
|
Content-Type: "text/plain"
|
||||||
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
|
||||||
validate:
|
validate:
|
||||||
@@ -55,7 +55,7 @@ teststeps:
|
|||||||
method: POST
|
method: POST
|
||||||
url: /post
|
url: /post
|
||||||
headers:
|
headers:
|
||||||
User-Agent: HttpRunner/${get_httprunner_version()}
|
User-Agent: funplugin/${get_version()}
|
||||||
Content-Type: "application/x-www-form-urlencoded"
|
Content-Type: "application/x-www-form-urlencoded"
|
||||||
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
|
||||||
validate:
|
validate:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v4.0.0-beta
|
# NOTE: Generated By HttpRunner v4.0.0
|
||||||
# FROM: testcases/demo_requests.yml
|
# FROM: testcases/demo_requests.yml
|
||||||
|
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ class TestCaseDemoRequests(HttpRunner):
|
|||||||
)
|
)
|
||||||
.get("/get")
|
.get("/get")
|
||||||
.with_params(**{"foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v"})
|
.with_params(**{"foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v"})
|
||||||
.with_headers(**{"User-Agent": "HttpRunner/${get_httprunner_version()}"})
|
.with_headers(**{"User-Agent": "funplugin/${get_version()}"})
|
||||||
.extract()
|
.extract()
|
||||||
.with_jmespath("body.args.foo2", "foo3")
|
.with_jmespath("body.args.foo2", "foo3")
|
||||||
.validate()
|
.validate()
|
||||||
@@ -45,7 +45,7 @@ class TestCaseDemoRequests(HttpRunner):
|
|||||||
.post("/post")
|
.post("/post")
|
||||||
.with_headers(
|
.with_headers(
|
||||||
**{
|
**{
|
||||||
"User-Agent": "HttpRunner/${get_httprunner_version()}",
|
"User-Agent": "funplugin/${get_version()}",
|
||||||
"Content-Type": "text/plain",
|
"Content-Type": "text/plain",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -65,7 +65,7 @@ class TestCaseDemoRequests(HttpRunner):
|
|||||||
.post("/post")
|
.post("/post")
|
||||||
.with_headers(
|
.with_headers(
|
||||||
**{
|
**{
|
||||||
"User-Agent": "HttpRunner/${get_httprunner_version()}",
|
"User-Agent": "funplugin/${get_version()}",
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
v4.0.0-beta
|
v4.0.0
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
__version__ = "v4.0.0-beta"
|
__version__ = "v4.0.0"
|
||||||
__description__ = "One-stop solution for HTTP(S) testing."
|
__description__ = "One-stop solution for HTTP(S) testing."
|
||||||
|
|
||||||
from httprunner.config import Config
|
from httprunner.config import Config
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ pytest_files_made_cache_mapping: Dict[Text, Text] = {}
|
|||||||
pytest_files_run_set: Set = set()
|
pytest_files_run_set: Set = set()
|
||||||
|
|
||||||
__TEMPLATE__ = jinja2.Template(
|
__TEMPLATE__ = jinja2.Template(
|
||||||
"""# NOTE: Generated By HttpRunner v{{ version }}
|
"""# NOTE: Generated By HttpRunner {{ version }}
|
||||||
# FROM: {{ testcase_path }}
|
# FROM: {{ testcase_path }}
|
||||||
|
|
||||||
{% if imports_list and diff_levels > 0 %}
|
{% if imports_list and diff_levels > 0 %}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "httprunner"
|
name = "httprunner"
|
||||||
version = "v4.0.0-beta"
|
version = "v4.0.0"
|
||||||
description = "One-stop solution for HTTP(S) testing."
|
description = "One-stop solution for HTTP(S) testing."
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user