diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index d5dd03b6..348ffe51 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -17,6 +17,16 @@ Please complete the following information: - OS: [e.g. macos, Linux, Windows] - Python [e.g. 3.6] - HttpRunner [e.g. 2.1.2] +- **Device ID**: [e.g. 190070690681122] + +How to get device ID? + +In Python interactive shell, execute the following command: + +```bash +>>> import uuid; print(uuid.getnode()) +190070690681122 +``` ## Traceback diff --git a/.github/ISSUE_TEMPLATE/bug_report_zh.md b/.github/ISSUE_TEMPLATE/bug_report_zh.md index 3cb953f2..7099691a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report_zh.md +++ b/.github/ISSUE_TEMPLATE/bug_report_zh.md @@ -17,6 +17,16 @@ assignees: debugtalk - 操作系统类型: [e.g. macos, Linux, Windows] - Python 版本 [e.g. 3.6] - HttpRunner 版本 [e.g. 2.1.2] + - **设备 ID**: [e.g. 190070690681122] + +获取方式: + +在 Python 交互式 shell 中输入如下命令进行获取: + +```bash +>>> import uuid; print(uuid.getnode()) +190070690681122 +``` ## 项目文件内容(非必须) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4a712bbd..058025a2 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +## 2.5.3 (2020-01-03) + +**Fixed** + +- fix json schema: variables maybe in string type, e.g. '${prepare_variables()}' +- fix json schema: post json maybe in string type, e.g. '${prepare_post_data()}', '$post_data' + ## 2.5.2 (2020-01-02) **Fixed** diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 75a512bb..7774739f 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.5.2" +__version__ = "2.5.3" __description__ = "One-stop solution for HTTP(S) testing." __all__ = ["__version__", "__description__"] diff --git a/httprunner/loader/schemas/common.schema.json b/httprunner/loader/schemas/common.schema.json index 0cbf6038..ce5a33e4 100644 --- a/httprunner/loader/schemas/common.schema.json +++ b/httprunner/loader/schemas/common.schema.json @@ -23,6 +23,14 @@ "maxProperties": 1, "minProperties": 1 } + }, + { + "type": "string", + "pattern": "^\\$.*", + "examples": [ + "${prepare_variables()}", + "${prepare_variables($a, $b)}" + ] } ] }, @@ -110,8 +118,21 @@ ] }, "json": { - "description": "request body in json format", - "type": "object" + "oneOf": [ + { + "description": "request body in json format", + "type": "object" + }, + { + "description": "request body in string format, e.g. '${prepare_json($a, $b)}'", + "type": "string", + "pattern": "^\\$.*", + "examples": [ + "$post_data", + "${prepare_post_data($a, $b)}" + ] + } + ] }, "headers": { "description": "request headers", diff --git a/pyproject.toml b/pyproject.toml index 39fec7ec..be0c6f14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "2.5.2" +version = "2.5.3" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md"