bump version to v4.0.0

This commit is contained in:
debugtalk
2022-05-03 11:02:17 +08:00
parent 061d267246
commit 7c052770e5
44 changed files with 59 additions and 201 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -42,11 +42,11 @@ func TeardownHookExample(args string) string {
}
func GetVersion() string {
return "v4.0.0-beta"
return fungo.Version
}
func main() {
fungo.Register("get_httprunner_version", GetVersion)
fungo.Register("get_version", GetVersion)
fungo.Register("sum_ints", SumInts)
fungo.Register("sum_two_int", SumTwoInt)
fungo.Register("sum_two", SumTwoInt)

View File

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

View File

@@ -24,7 +24,7 @@ teststeps:
foo2: $foo2
sum_v: $sum_v
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
User-Agent: funplugin/${get_version()}
extract:
foo3: "body.args.foo2"
validate:
@@ -41,7 +41,7 @@ teststeps:
method: POST
url: /post
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
User-Agent: funplugin/${get_version()}
Content-Type: "text/plain"
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
validate:
@@ -55,7 +55,7 @@ teststeps:
method: POST
url: /post
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
User-Agent: funplugin/${get_version()}
Content-Type: "application/x-www-form-urlencoded"
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
validate:

View File

@@ -5,8 +5,8 @@ from typing import List
import funppy
def get_httprunner_version():
return "v4.0.0-beta"
def get_version():
return funppy.__version__
def sleep(n_secs):
@@ -60,7 +60,7 @@ def teardown_hook_example(name):
if __name__ == "__main__":
funppy.register("get_httprunner_version", get_httprunner_version)
funppy.register("get_version", get_version)
funppy.register("sum", sum)
funppy.register("sum_ints", sum_ints)
funppy.register("concatenate", concatenate)

View File

@@ -1 +0,0 @@
# NOTICE: Generated By HttpRunner. DO NOT EDIT!

View File

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

View File

@@ -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()

View File

@@ -24,7 +24,7 @@ teststeps:
foo2: $foo2
sum_v: $sum_v
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
User-Agent: funplugin/${get_version()}
extract:
foo3: "body.args.foo2"
validate:
@@ -41,7 +41,7 @@ teststeps:
method: POST
url: /post
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
User-Agent: funplugin/${get_version()}
Content-Type: "text/plain"
data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3."
validate:
@@ -55,7 +55,7 @@ teststeps:
method: POST
url: /post
headers:
User-Agent: HttpRunner/${get_httprunner_version()}
User-Agent: funplugin/${get_version()}
Content-Type: "application/x-www-form-urlencoded"
data: "foo1=$foo1&foo2=$foo2&foo3=$foo3"
validate:

View File

@@ -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()

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v4.0.0-beta
# NOTE: Generated By HttpRunner v4.0.0
# FROM: basic.yml

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v4.0.0-beta
# NOTE: Generated By HttpRunner v4.0.0
# FROM: hooks.yml

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v4.0.0-beta
# NOTE: Generated By HttpRunner v4.0.0
# FROM: load_image.yml

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v4.0.0-beta
# NOTE: Generated By HttpRunner v4.0.0
# FROM: upload.yml

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v4.0.0-beta
# NOTE: Generated By HttpRunner v4.0.0
# FROM: validate.yml

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v4.0.0-beta
# NOTE: Generated By HttpRunner v4.0.0
# FROM: cookie_manipulation/hardcode.yml

View File

@@ -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

View File

@@ -1,4 +1,4 @@
# NOTE: Generated By HttpRunner v4.0.0-beta
# NOTE: Generated By HttpRunner v4.0.0
# FROM: request_methods/hardcode.yml

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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