mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 22:44:05 +08:00
11
HISTORY.md
11
HISTORY.md
@@ -1,5 +1,16 @@
|
|||||||
# Release History
|
# Release History
|
||||||
|
|
||||||
|
## 2.0.6 (2019-03-18)
|
||||||
|
|
||||||
|
**Features**
|
||||||
|
|
||||||
|
- create .gitignore file when initializing new project
|
||||||
|
|
||||||
|
**Bugfixes**
|
||||||
|
|
||||||
|
- fix CSV relative path detection
|
||||||
|
- fix current validators displaying the former one when they are empty
|
||||||
|
|
||||||
## 2.0.5 (2019-03-04)
|
## 2.0.5 (2019-03-04)
|
||||||
|
|
||||||
**Features**
|
**Features**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
__title__ = 'HttpRunner'
|
__title__ = 'HttpRunner'
|
||||||
__description__ = 'One-stop solution for HTTP(S) testing.'
|
__description__ = 'One-stop solution for HTTP(S) testing.'
|
||||||
__url__ = 'https://github.com/HttpRunner/HttpRunner'
|
__url__ = 'https://github.com/HttpRunner/HttpRunner'
|
||||||
__version__ = '2.0.5'
|
__version__ = '2.0.6'
|
||||||
__author__ = 'debugtalk'
|
__author__ = 'debugtalk'
|
||||||
__author_email__ = 'mail@debugtalk.com'
|
__author_email__ = 'mail@debugtalk.com'
|
||||||
__license__ = 'Apache-2.0'
|
__license__ = 'Apache-2.0'
|
||||||
|
|||||||
@@ -50,6 +50,9 @@ class VariableNotFound(NotFoundError):
|
|||||||
class EnvNotFound(NotFoundError):
|
class EnvNotFound(NotFoundError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
class CSVNotFound(NotFoundError):
|
||||||
|
pass
|
||||||
|
|
||||||
class ApiNotFound(NotFoundError):
|
class ApiNotFound(NotFoundError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,15 @@ def load_csv_file(csv_file):
|
|||||||
]
|
]
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
if not os.path.isabs(csv_file):
|
||||||
|
project_working_directory = tests_def_mapping["PWD"] or os.getcwd()
|
||||||
|
# make compatible with Windows/Linux
|
||||||
|
csv_file = os.path.join(project_working_directory, *csv_file.split("/"))
|
||||||
|
|
||||||
|
if not os.path.isfile(csv_file):
|
||||||
|
# file path not exist
|
||||||
|
raise exceptions.CSVNotFound(csv_file)
|
||||||
|
|
||||||
csv_content_list = []
|
csv_content_list = []
|
||||||
|
|
||||||
with io.open(csv_file, encoding='utf-8') as csvfile:
|
with io.open(csv_file, encoding='utf-8') as csvfile:
|
||||||
|
|||||||
@@ -533,6 +533,12 @@ def create_scaffold(project_name):
|
|||||||
]
|
]
|
||||||
[create_path(p[0], p[1]) for p in path_list]
|
[create_path(p[0], p[1]) for p in path_list]
|
||||||
|
|
||||||
|
# create .gitignore file
|
||||||
|
ignore_file = os.path.join(project_name, ".gitignore")
|
||||||
|
ignore_content = ".env\nreports/*"
|
||||||
|
with open(ignore_file, "w") as f:
|
||||||
|
f.write(ignore_content)
|
||||||
|
|
||||||
|
|
||||||
def gen_cartesian_product(*args):
|
def gen_cartesian_product(*args):
|
||||||
""" generate cartesian product for lists
|
""" generate cartesian product for lists
|
||||||
|
|||||||
@@ -6,11 +6,6 @@
|
|||||||
var_d: "${gen_random_string(5)}"
|
var_d: "${gen_random_string(5)}"
|
||||||
var_e: $var_d
|
var_e: $var_d
|
||||||
PROJECT_KEY: ${ENV(PROJECT_KEY)}
|
PROJECT_KEY: ${ENV(PROJECT_KEY)}
|
||||||
# parameters:
|
|
||||||
# - "var_a-var_b":
|
|
||||||
# - [11, 21]
|
|
||||||
# - [12, 22]
|
|
||||||
# - "app_version": "${gen_app_version()}"
|
|
||||||
|
|
||||||
- test:
|
- test:
|
||||||
name: testcase1-$var_a
|
name: testcase1-$var_a
|
||||||
|
|||||||
@@ -407,9 +407,10 @@ class TestParser(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def test_parse_parameters_parameterize(self):
|
def test_parse_parameters_parameterize(self):
|
||||||
|
loader.load_project_tests(os.path.join(os.getcwd(), "tests"))
|
||||||
parameters = [
|
parameters = [
|
||||||
{"app_version": "${parameterize(tests/data/app_version.csv)}"},
|
{"app_version": "${parameterize(data/app_version.csv)}"},
|
||||||
{"username-password": "${parameterize(tests/data/account.csv)}"}
|
{"username-password": "${parameterize(data/account.csv)}"}
|
||||||
]
|
]
|
||||||
cartesian_product_parameters = parser.parse_parameters(parameters)
|
cartesian_product_parameters = parser.parse_parameters(parameters)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
@@ -424,7 +425,7 @@ class TestParser(unittest.TestCase):
|
|||||||
parameters = [
|
parameters = [
|
||||||
{"user_agent": ["iOS/10.1", "iOS/10.2", "iOS/10.3"]},
|
{"user_agent": ["iOS/10.1", "iOS/10.2", "iOS/10.3"]},
|
||||||
{"app_version": "${gen_app_version()}"},
|
{"app_version": "${gen_app_version()}"},
|
||||||
{"username-password": "${parameterize(tests/data/account.csv)}"}
|
{"username-password": "${parameterize(data/account.csv)}"}
|
||||||
]
|
]
|
||||||
cartesian_product_parameters = parser.parse_parameters(
|
cartesian_product_parameters = parser.parse_parameters(
|
||||||
parameters, functions_mapping=project_mapping["functions"])
|
parameters, functions_mapping=project_mapping["functions"])
|
||||||
@@ -453,8 +454,6 @@ class TestParser(unittest.TestCase):
|
|||||||
self.assertEqual(test_dict1["variables"]["var_c"], 3)
|
self.assertEqual(test_dict1["variables"]["var_c"], 3)
|
||||||
self.assertEqual(test_dict1["variables"]["PROJECT_KEY"], "ABCDEFGH")
|
self.assertEqual(test_dict1["variables"]["PROJECT_KEY"], "ABCDEFGH")
|
||||||
self.assertEqual(test_dict1["variables"]["var_d"], test_dict1["variables"]["var_e"])
|
self.assertEqual(test_dict1["variables"]["var_d"], test_dict1["variables"]["var_e"])
|
||||||
# TODO: parameters
|
|
||||||
# self.assertEqual(len(parsed_testcases), 2 * 2)
|
|
||||||
self.assertEqual(parsed_testcases[0]["config"]["name"], '1230')
|
self.assertEqual(parsed_testcases[0]["config"]["name"], '1230')
|
||||||
|
|
||||||
def test_parse_tests_override_variables(self):
|
def test_parse_tests_override_variables(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user