From b19ec9e99896fb77f558d56a2dd66afb5f4be840 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 5 Feb 2020 00:33:10 +0800 Subject: [PATCH 1/2] feat: save variables and export data to JSON files when specified --save-tests --- docs/CHANGELOG.md | 8 +++++++- httprunner/api.py | 3 +++ httprunner/cli.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b91541fb..64a14f70 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,12 @@ # Release History -## 2.5.5 (2020-01-06) +## 2.5.5 (2020-02-05) + +**Added** + +- feat: save variables and export data to JSON files when specified `--save-tests` + +## 2.5.4 (2020-01-06) **Fixed** diff --git a/httprunner/api.py b/httprunner/api.py index 8ca3aeaa..bc13fc81 100644 --- a/httprunner/api.py +++ b/httprunner/api.py @@ -221,6 +221,9 @@ class HttpRunner(object): if self.save_tests: utils.dump_logs(self._summary, project_mapping, "summary") + # save variables and export data + vars_out = self.get_vars_out() + utils.dump_logs(vars_out, project_mapping, "vars_out") return self._summary diff --git a/httprunner/cli.py b/httprunner/cli.py index 3d37589c..a3389955 100644 --- a/httprunner/cli.py +++ b/httprunner/cli.py @@ -49,7 +49,7 @@ def main(): help="Specify report file path, this has higher priority than specifying report dir.") parser.add_argument( '--save-tests', action='store_true', default=False, - help="Save loaded/parsed/summary json data to JSON files.") + help="Save loaded/parsed/vars_out/summary json data to JSON files.") parser.add_argument( '--failfast', action='store_true', default=False, help="Stop the test run on the first error or failure.") From 63646dc42b4330ef41f78e6023a9cead10157752 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Wed, 5 Feb 2020 00:38:10 +0800 Subject: [PATCH 2/2] fix: version --- docs/CHANGELOG.md | 4 ++-- httprunner/__init__.py | 2 +- pyproject.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 64a14f70..7caaa220 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,12 +1,12 @@ # Release History -## 2.5.5 (2020-02-05) +## 2.5.6 (2020-02-05) **Added** - feat: save variables and export data to JSON files when specified `--save-tests` -## 2.5.4 (2020-01-06) +## 2.5.5 (2020-01-06) **Fixed** diff --git a/httprunner/__init__.py b/httprunner/__init__.py index 97bfb536..b46ec9d4 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,4 +1,4 @@ -__version__ = "2.5.5" +__version__ = "2.5.6" __description__ = "One-stop solution for HTTP(S) testing." __all__ = ["__version__", "__description__"] diff --git a/pyproject.toml b/pyproject.toml index bdcec61b..f11315b9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "2.5.5" +version = "2.5.6" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md"