mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
bump version 3.1.4
This commit is contained in:
@@ -6,6 +6,11 @@
|
|||||||
|
|
||||||
- change: override variables strategy, step variables > extracted variables from previous steps
|
- change: override variables strategy, step variables > extracted variables from previous steps
|
||||||
|
|
||||||
|
**Fixed**
|
||||||
|
|
||||||
|
- fix: parameters feature with custom functions
|
||||||
|
- fix: request json field with variable reference
|
||||||
|
|
||||||
## 3.1.3 (2020-07-06)
|
## 3.1.3 (2020-07-06)
|
||||||
|
|
||||||
**Added**
|
**Added**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: basic.yml
|
# FROM: basic.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: hooks.yml
|
# FROM: hooks.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: load_image.yml
|
# FROM: load_image.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: upload.yml
|
# FROM: upload.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: validate.yml
|
# FROM: validate.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
64
examples/postman_echo/conftest.py
Normal file
64
examples/postman_echo/conftest.py
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
# NOTICE: Generated By HttpRunner.
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
|
from httprunner.utils import get_platform, ExtendJSONEncoder
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
|
def session_fixture(request):
|
||||||
|
"""setup and teardown each task"""
|
||||||
|
logger.info(f"start running testcases ...")
|
||||||
|
|
||||||
|
start_at = time.time()
|
||||||
|
|
||||||
|
yield
|
||||||
|
|
||||||
|
logger.info(f"task finished, generate task summary for --save-tests")
|
||||||
|
|
||||||
|
summary = {
|
||||||
|
"success": True,
|
||||||
|
"stat": {
|
||||||
|
"testcases": {"total": 0, "success": 0, "fail": 0},
|
||||||
|
"teststeps": {"total": 0, "failures": 0, "successes": 0},
|
||||||
|
},
|
||||||
|
"time": {"start_at": start_at, "duration": time.time() - start_at},
|
||||||
|
"platform": get_platform(),
|
||||||
|
"details": [],
|
||||||
|
}
|
||||||
|
|
||||||
|
for item in request.node.items:
|
||||||
|
testcase_summary = item.instance.get_summary()
|
||||||
|
summary["success"] &= testcase_summary.success
|
||||||
|
|
||||||
|
summary["stat"]["testcases"]["total"] += 1
|
||||||
|
summary["stat"]["teststeps"]["total"] += len(testcase_summary.step_datas)
|
||||||
|
if testcase_summary.success:
|
||||||
|
summary["stat"]["testcases"]["success"] += 1
|
||||||
|
summary["stat"]["teststeps"]["successes"] += len(
|
||||||
|
testcase_summary.step_datas
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
summary["stat"]["testcases"]["fail"] += 1
|
||||||
|
summary["stat"]["teststeps"]["successes"] += (
|
||||||
|
len(testcase_summary.step_datas) - 1
|
||||||
|
)
|
||||||
|
summary["stat"]["teststeps"]["failures"] += 1
|
||||||
|
|
||||||
|
testcase_summary_json = testcase_summary.dict()
|
||||||
|
testcase_summary_json["records"] = testcase_summary_json.pop("step_datas")
|
||||||
|
summary["details"].append(testcase_summary_json)
|
||||||
|
|
||||||
|
summary_path = "/Users/debugtalk/MyProjects/HttpRunner-dev/HttpRunner/examples/postman_echo/logs/request_methods/hardcode.summary.json"
|
||||||
|
summary_dir = os.path.dirname(summary_path)
|
||||||
|
os.makedirs(summary_dir, exist_ok=True)
|
||||||
|
|
||||||
|
with open(summary_path, "w", encoding="utf-8") as f:
|
||||||
|
json.dump(summary, f, indent=4, ensure_ascii=False, cls=ExtendJSONEncoder)
|
||||||
|
|
||||||
|
logger.info(f"generated task summary: {summary_path}")
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/request_with_functions.yml
|
# FROM: request_methods/request_with_functions.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/request_with_testcase_reference.yml
|
# FROM: request_methods/request_with_testcase_reference.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/hardcode.yml
|
# FROM: request_methods/hardcode.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/request_with_functions.yml
|
# FROM: request_methods/request_with_functions.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/request_with_parameters.yml
|
# FROM: request_methods/request_with_parameters.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/request_with_testcase_reference.yml
|
# FROM: request_methods/request_with_testcase_reference.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods\request_with_variables.yml
|
# FROM: request_methods/request_with_variables.yml
|
||||||
|
|
||||||
|
|
||||||
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase
|
from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/validate_with_functions.yml
|
# FROM: request_methods/validate_with_functions.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By HttpRunner v3.1.3
|
# NOTE: Generated By HttpRunner v3.1.4
|
||||||
# FROM: request_methods/validate_with_variables.yml
|
# FROM: request_methods/validate_with_variables.yml
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
__version__ = "3.1.3"
|
__version__ = "3.1.4"
|
||||||
__description__ = "One-stop solution for HTTP(S) testing."
|
__description__ = "One-stop solution for HTTP(S) testing."
|
||||||
|
|
||||||
# import firstly for monkey patch if needed
|
# import firstly for monkey patch if needed
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "httprunner"
|
name = "httprunner"
|
||||||
version = "3.1.3"
|
version = "3.1.4"
|
||||||
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