make variables in testcase template compatible with mapping style:

new mapping style:
"variables": {
    "a": 1,
    "b": 2
}

Also, the former list style is still valid:
"variables": [
    {"a": 1},
    {"b": 2}
]
This commit is contained in:
httprunner
2018-11-28 12:11:50 +08:00
parent a4ce29e656
commit 9a62f778fb
20 changed files with 141 additions and 142 deletions

View File

@@ -9,7 +9,7 @@ import sys
import yaml import yaml
from httprunner import exceptions, logger, parser, utils, validator from httprunner import exceptions, logger, parser, utils, validator
from httprunner.compat import OrderedDict
############################################################################### ###############################################################################
## file loader ## file loader

View File

@@ -3,7 +3,6 @@
import ast import ast
import os import os
import re import re
from collections import OrderedDict
from httprunner import exceptions, utils from httprunner import exceptions, utils
from httprunner.compat import basestring, builtin_str, numeric_types, str from httprunner.compat import basestring, builtin_str, numeric_types, str
@@ -524,7 +523,7 @@ def parse_data(content, variables_mapping=None, functions_mapping=None):
for item in content for item in content
] ]
if isinstance(content, (dict, OrderedDict)): if isinstance(content, dict):
parsed_content = {} parsed_content = {}
for key, value in content.items(): for key, value in content.items():
parsed_key = parse_data(key, variables_mapping, functions_mapping) parsed_key = parse_data(key, variables_mapping, functions_mapping)

View File

@@ -11,7 +11,7 @@ import string
from datetime import datetime from datetime import datetime
from httprunner import exceptions, logger from httprunner import exceptions, logger
from httprunner.compat import OrderedDict, basestring, is_py2 from httprunner.compat import basestring, is_py2
from httprunner.exceptions import ParamsError from httprunner.exceptions import ParamsError
absolute_http_url_regexp = re.compile(r"^https?://", re.I) absolute_http_url_regexp = re.compile(r"^https?://", re.I)
@@ -265,10 +265,10 @@ def ensure_mapping_format(variables):
""" ensure variables are in mapping format. """ ensure variables are in mapping format.
Args: Args:
variables (list/dict/OrderedDict): original variables variables (list/dict): original variables
Returns: Returns:
OrderedDict: ensured variables in OrderedDict dict: ensured variables in dict format
Examples: Examples:
>>> variables = [ >>> variables = [
@@ -276,19 +276,17 @@ def ensure_mapping_format(variables):
{"b": 2} {"b": 2}
] ]
>>> print(ensure_mapping_format(variables)) >>> print(ensure_mapping_format(variables))
OrderDict( {
{ "a": 1,
"a": 1, "b": 2
"b": 2 }
}
)
""" """
if isinstance(variables, list): if isinstance(variables, list):
variables_ordered_dict = OrderedDict() variables_ordered_dict = {}
for map_dict in variables: for map_dict in variables:
variables_ordered_dict.update(map_dict) variables_ordered_dict.update(map_dict)
elif isinstance(variables, (OrderedDict, dict)): elif isinstance(variables, dict):
variables_ordered_dict = variables variables_ordered_dict = variables
else: else:
raise exceptions.ParamsError("variables format error!") raise exceptions.ParamsError("variables format error!")
@@ -377,17 +375,17 @@ def extend_variables(raw_variables, override_variables):
override_variables (list): override_variables (list):
Returns: Returns:
OrderedDict: extended variables mapping dict: extended variables mapping
Examples: Examples:
>>> raw_variables = [{"var1": "val1"}, {"var2": "val2"}] >>> raw_variables = [{"var1": "val1"}, {"var2": "val2"}]
>>> override_variables = [{"var1": "val111"}, {"var3": "val3"}] >>> override_variables = [{"var1": "val111"}, {"var3": "val3"}]
>>> extend_variables(raw_variables, override_variables) >>> extend_variables(raw_variables, override_variables)
OrderedDict([ {
('var1', 'val111'), 'var1', 'val111',
('var2', 'val2'), 'var2', 'val2',
('var3', 'val3') 'var3', 'val3'
]) }
""" """
if not raw_variables: if not raw_variables:

View File

@@ -2,10 +2,11 @@
id: get_token id: get_token
name: get token name: get token
variables: variables:
- user_agent: XXX
- device_sn: API_XXX user_agent: XXX
- os_platform: XXX device_sn: API_XXX
- app_version: XXX os_platform: XXX
app_version: XXX
request: request:
url: /api/get-token url: /api/get-token
method: POST method: POST
@@ -26,10 +27,10 @@
- api: - api:
id: create_user id: create_user
variables: variables:
- user_name: user0 user_name: user0
- user_password: "000000" user_password: "000000"
- uid: 9000 uid: 9000
- token: XXX token: XXX
request: request:
url: /api/users/$uid url: /api/users/$uid
method: POST method: POST
@@ -46,8 +47,8 @@
- api: - api:
id: get_user id: get_user
variables: variables:
- uid: 9000 uid: 9000
- token: XXX token: XXX
request: request:
url: /api/users/$uid url: /api/users/$uid
method: GET method: GET
@@ -61,10 +62,10 @@
- api: - api:
id: update_user id: update_user
variables: variables:
- user_name: user0 user_name: user0
- user_password: "000000" user_password: "000000"
- uid: 9000 uid: 9000
- token: XXX token: XXX
request: request:
url: /api/users/$uid url: /api/users/$uid
method: PUT method: PUT
@@ -81,8 +82,8 @@
- api: - api:
id: delete_user id: delete_user
variables: variables:
- uid: 9000 uid: 9000
- token: XXX token: XXX
request: request:
url: /api/users/$uid url: /api/users/$uid
method: DELETE method: DELETE
@@ -96,7 +97,7 @@
- api: - api:
id: get_users id: get_users
variables: variables:
- token: XXX token: XXX
request: request:
url: /api/users url: /api/users
method: GET method: GET
@@ -110,7 +111,7 @@
- api: - api:
id: reset_all id: reset_all
variables: variables:
- token: XXX token: XXX
request: request:
url: /api/reset-all url: /api/reset-all
method: GET method: GET
@@ -125,7 +126,7 @@
- api: - api:
id: get_headers id: get_headers
variables: variables:
- n_secs: 1 n_secs: 1
request: request:
url: /headers url: /headers
headers: headers:

View File

@@ -2,10 +2,10 @@
- config: - config:
name: "user management testcase." name: "user management testcase."
variables: variables:
- user_agent: 'iOS/10.3' user_agent: 'iOS/10.3'
- device_sn: ${gen_random_string(15)} device_sn: ${gen_random_string(15)}
- os_platform: 'ios' os_platform: 'ios'
- app_version: '2.8.6' app_version: '2.8.6'
parameters: parameters:
- user_agent: ['iOS', 'android'] - user_agent: ['iOS', 'android']
request: request:

View File

@@ -1,10 +1,10 @@
bind_variables: bind_variables:
variables: variables:
- TOKEN: "debugtalk" TOKEN: "debugtalk"
- token: $TOKEN token: $TOKEN
builtin_functions: builtin_functions:
variables: variables:
- length: ${len(debugtalk)} length: ${len(debugtalk)}
- smallest: ${min(2, 3, 8)} smallest: ${min(2, 3, 8)}
- largest: ${max(2, 3, 8)} largest: ${max(2, 3, 8)}

View File

@@ -1,16 +1,16 @@
- config: - config:
name: "user management testcase." name: "user management 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"]
- username-password: username-password:
- ["test1","111111"] - ["test1","111111"]
- ["test2","222222"] - ["test2","222222"]
variables: variables:
- username: test1 username: test1
- user_agent: "iOS/10.1" user_agent: "iOS/10.1"
- device_sn: ${gen_random_string(15)} device_sn: ${gen_random_string(15)}
- os_platform: 'ios' os_platform: 'ios'
- app_version: 2.8.5 app_version: 2.8.5
base_url: ${get_base_url()} base_url: ${get_base_url()}
output: output:
- token - token

View File

@@ -1,9 +1,9 @@
- config: - config:
name: "123$var_a" name: "123$var_a"
variables: variables:
- var_a: 0 var_a: 0
- var_c: "${sum_two(1, 2)}" var_c: "${sum_two(1, 2)}"
- PROJECT_KEY: ${ENV(PROJECT_KEY)} PROJECT_KEY: ${ENV(PROJECT_KEY)}
# parameters: # parameters:
# - "var_a-var_b": # - "var_a-var_b":
# - [11, 21] # - [11, 21]

View File

@@ -12,8 +12,8 @@
json: json:
sign: f1219719911caae89ccc301679857ebfda115ca2 sign: f1219719911caae89ccc301679857ebfda115ca2
variables: variables:
- expect_status_code: 200 expect_status_code: 200
- token_len: 16 token_len: 16
extract: extract:
- token: content.token - token: content.token
validate: validate:

View File

@@ -1,10 +1,10 @@
- config: - config:
name: "create user testcases." name: "create user testcases."
variables: variables:
- user_agent: 'iOS/10.3' user_agent: 'iOS/10.3'
- device_sn: ${gen_random_string(15)} device_sn: ${gen_random_string(15)}
- os_platform: 'ios' os_platform: 'ios'
- app_version: '2.8.6' app_version: '2.8.6'
base_url: ${get_base_url()} base_url: ${get_base_url()}
- test: - test:
@@ -28,8 +28,8 @@
- test: - test:
name: create user which does not exist name: create user which does not exist
variables: variables:
- user_name: "user1" user_name: "user1"
- user_password: "123456" user_password: "123456"
request: request:
url: /api/users/1000 url: /api/users/1000
method: POST method: POST

View File

@@ -12,8 +12,8 @@
json: json:
sign: f1219719911caae89ccc301679857ebfda115ca2 sign: f1219719911caae89ccc301679857ebfda115ca2
variables: variables:
- expect_status_code: 200 expect_status_code: 200
- token_len: 16 token_len: 16
extract: extract:
- token: content.token - token: content.token
validate: validate:

View File

@@ -1,10 +1,10 @@
- config: - config:
name: "user management testcase." name: "user management testcase."
variables: variables:
- user_agent: 'iOS/10.3' user_agent: 'iOS/10.3'
- device_sn: ${gen_random_string(15)} device_sn: ${gen_random_string(15)}
- os_platform: 'ios' os_platform: 'ios'
- app_version: '2.8.6' app_version: '2.8.6'
base_url: ${get_base_url()} base_url: ${get_base_url()}
output: output:
- token - token
@@ -23,7 +23,7 @@
name: reset all users name: reset all users
api: reset_all api: reset_all
variables: variables:
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true} - {"check": "content.success", "expect": true}
@@ -32,8 +32,8 @@
name: get user that does not exist name: get user that does not exist
api: get_user api: get_user
variables: variables:
- uid: 1000 uid: 1000
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 404} - {"check": "status_code", "expect": 404}
- {"check": "content.success", "expect": false} - {"check": "content.success", "expect": false}
@@ -41,10 +41,10 @@
- test: - test:
name: create user which does not exist name: create user which does not exist
variables: variables:
- uid: 1000 uid: 1000
- user_name: "user1" user_name: "user1"
- user_password: "123456" user_password: "123456"
- token: $token token: $token
api: create_user api: create_user
validate: validate:
- {"check": "status_code", "expect": 201} - {"check": "status_code", "expect": 201}
@@ -54,8 +54,8 @@
name: get user that has been created name: get user that has been created
api: get_user api: get_user
variables: variables:
- uid: 1000 uid: 1000
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true} - {"check": "content.success", "expect": true}
@@ -64,10 +64,10 @@
- test: - test:
name: create user which exists name: create user which exists
variables: variables:
- uid: 1000 uid: 1000
- user_name: "user1" user_name: "user1"
- user_password: "123456" user_password: "123456"
- token: $token token: $token
api: create_user api: create_user
validate: validate:
- {"check": "status_code", "expect": 500} - {"check": "status_code", "expect": 500}
@@ -76,10 +76,10 @@
- test: - test:
name: update user which exists name: update user which exists
variables: variables:
- uid: 1000 uid: 1000
- user_name: "user1" user_name: "user1"
- user_password: "654321" user_password: "654321"
- token: $token token: $token
api: update_user api: update_user
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
@@ -89,8 +89,8 @@
name: get user that has been updated name: get user that has been updated
api: get_user api: get_user
variables: variables:
- uid: 1000 uid: 1000
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true} - {"check": "content.success", "expect": true}
@@ -100,7 +100,7 @@
name: get users name: get users
api: get_users api: get_users
variables: variables:
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
- {"check": "content.count", "expect": 1} - {"check": "content.count", "expect": 1}
@@ -109,8 +109,8 @@
name: delete user that exists name: delete user that exists
api: delete_user api: delete_user
variables: variables:
- uid: 1000 uid: 1000
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
- {"check": "content.success", "expect": true} - {"check": "content.success", "expect": true}
@@ -119,7 +119,7 @@
name: get users name: get users
api: get_users api: get_users
variables: variables:
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
- {"check": "content.count", "expect": 0} - {"check": "content.count", "expect": 0}
@@ -127,10 +127,10 @@
- test: - test:
name: create user which has been deleted name: create user which has been deleted
variables: variables:
- uid: 1000 uid: 1000
- user_name: "user1" user_name: "user1"
- user_password: "123456" user_password: "123456"
- token: $token token: $token
api: create_user api: create_user
validate: validate:
- {"check": "status_code", "expect": 201} - {"check": "status_code", "expect": 201}
@@ -140,7 +140,7 @@
name: get users name: get users
api: get_users api: get_users
variables: variables:
- token: $token token: $token
validate: validate:
- {"check": "status_code", "expect": 200} - {"check": "status_code", "expect": 200}
- {"check": "content.count", "expect": 1} - {"check": "content.count", "expect": 1}

View File

@@ -1,16 +1,16 @@
- config: - config:
name: "create user testcases." name: "create user testcases."
variables: variables:
- device_sn: 'HZfFBh6tU59EdXJ' device_sn: 'HZfFBh6tU59EdXJ'
base_url: ${get_base_url()} base_url: ${get_base_url()}
- test: - test:
name: get token name: get token
variables: variables:
- user_agent: 'iOS/10.3' user_agent: 'iOS/10.3'
- os_platform: 'ios' os_platform: 'ios'
- app_version: '2.8.6' app_version: '2.8.6'
- sign: f1219719911caae89ccc301679857ebfda115ca2 sign: f1219719911caae89ccc301679857ebfda115ca2
request: request:
url: /api/get-token url: /api/get-token
method: POST method: POST
@@ -31,8 +31,8 @@
- test: - test:
name: create user which does not exist name: create user which does not exist
variables: variables:
- user_name: "user1" user_name: "user1"
- user_password: "123456" user_password: "123456"
request: request:
url: /api/users/1000 url: /api/users/1000
method: POST method: POST

View File

@@ -5,10 +5,10 @@
- test: - test:
name: upload file name: upload file
variables: variables:
- field_name: "file" field_name: "file"
- file_path: "LICENSE" file_path: "LICENSE"
- file_type: "text/html" file_type: "text/html"
- multipart_encoder: ${multipart_encoder($field_name, $file_path, $file_type)} multipart_encoder: ${multipart_encoder($field_name, $file_path, $file_type)}
request: request:
url: /post url: /post
method: POST method: POST

View File

@@ -419,7 +419,7 @@ class TestApi(ApiServerUnittest):
self.assertEqual(len(testcase_tests), 2) self.assertEqual(len(testcase_tests), 2)
self.assertIn("api", testcase_tests[0]) self.assertIn("api", testcase_tests[0])
self.assertEqual(testcase_tests[0]["name"], "get token (setup)") self.assertEqual(testcase_tests[0]["name"], "get token (setup)")
self.assertIsInstance(testcase_tests[0]["variables"], list) self.assertIsInstance(testcase_tests[0]["variables"], dict)
self.assertIn("api_def", testcase_tests[0]) self.assertIn("api_def", testcase_tests[0])
self.assertEqual(testcase_tests[0]["api_def"]["request"]["url"], "/api/get-token") self.assertEqual(testcase_tests[0]["api_def"]["request"]["url"], "/api/get-token")

View File

@@ -247,11 +247,11 @@ class TestModuleLoader(unittest.TestCase):
tests_mapping["project_mapping"]["functions"] tests_mapping["project_mapping"]["functions"]
) )
self.assertEqual( self.assertEqual(
testcases[0]["config"]["variables"][1]["var_c"], testcases[0]["config"]["variables"]["var_c"],
"${sum_two(1, 2)}" "${sum_two(1, 2)}"
) )
self.assertEqual( self.assertEqual(
testcases[0]["config"]["variables"][2]["PROJECT_KEY"], testcases[0]["config"]["variables"]["PROJECT_KEY"],
"${ENV(PROJECT_KEY)}" "${ENV(PROJECT_KEY)}"
) )
@@ -287,7 +287,7 @@ class TestSuiteLoader(unittest.TestCase):
raw_testcase = loader.load_file("tests/testsuites/create_users.yml") raw_testcase = loader.load_file("tests/testsuites/create_users.yml")
testcase = loader.load_testcase(raw_testcase) testcase = loader.load_testcase(raw_testcase)
self.assertEqual(testcase["config"]["name"], "create users with uid") self.assertEqual(testcase["config"]["name"], "create users with uid")
self.assertIn("device_sn", testcase["config"]["variables"][0]) self.assertIn("device_sn", testcase["config"]["variables"])
self.assertEqual(len(testcase["tests"]), 2) self.assertEqual(len(testcase["tests"]), 2)
self.assertEqual(testcase["tests"][0]["name"], "create user 1000 and check result.") self.assertEqual(testcase["tests"][0]["name"], "create user 1000 and check result.")
self.assertEqual(testcase["tests"][0]["testcase_def"]["config"]["name"], "create user and check result.") self.assertEqual(testcase["tests"][0]["testcase_def"]["config"]["name"], "create user and check result.")
@@ -378,7 +378,7 @@ class TestSuiteLoader(unittest.TestCase):
tests_mapping = loader.load_tests(path) tests_mapping = loader.load_tests(path)
project_mapping = tests_mapping["project_mapping"] project_mapping = tests_mapping["project_mapping"]
testcases_list = tests_mapping["testcases"] testcases_list = tests_mapping["testcases"]
self.assertIn({'device_sn': '${gen_random_string(15)}'}, testcases_list[0]["config"]["variables"]) self.assertIn('device_sn', testcases_list[0]["config"]["variables"])
self.assertIn("gen_md5", project_mapping["functions"]) self.assertIn("gen_md5", project_mapping["functions"])
self.assertIn("base_url", testcases_list[0]["config"]) self.assertIn("base_url", testcases_list[0]["config"])
test_dict0 = testcases_list[0]["tests"][0] test_dict0 = testcases_list[0]["tests"][0]
@@ -405,7 +405,7 @@ class TestSuiteLoader(unittest.TestCase):
) )
self.assertEqual( self.assertEqual(
{'device_sn': '${gen_random_string(15)}'}, {'device_sn': '${gen_random_string(15)}'},
testcases_list[0]["config"]["variables"][0] testcases_list[0]["config"]["variables"]
) )
testcase0 = testcases_list[0]["tests"][0] testcase0 = testcases_list[0]["tests"][0]
self.assertEqual( self.assertEqual(
@@ -424,7 +424,7 @@ class TestSuiteLoader(unittest.TestCase):
) )
self.assertEqual( self.assertEqual(
{'uid': 1001}, {'uid': 1001},
testcase1["variables"][0] testcase1["variables"]
) )
def test_load_folder_content(self): def test_load_folder_content(self):

View File

@@ -435,11 +435,11 @@ class TestParser(unittest.TestCase):
tests_mapping = loader.load_tests(testcase_file_path) tests_mapping = loader.load_tests(testcase_file_path)
testcases = tests_mapping["testcases"] testcases = tests_mapping["testcases"]
self.assertEqual( self.assertEqual(
testcases[0]["config"]["variables"][1]["var_c"], testcases[0]["config"]["variables"]["var_c"],
"${sum_two(1, 2)}" "${sum_two(1, 2)}"
) )
self.assertEqual( self.assertEqual(
testcases[0]["config"]["variables"][2]["PROJECT_KEY"], testcases[0]["config"]["variables"]["PROJECT_KEY"],
"${ENV(PROJECT_KEY)}" "${ENV(PROJECT_KEY)}"
) )
parser.parse_tests(tests_mapping) parser.parse_tests(tests_mapping)
@@ -478,6 +478,7 @@ class TestParser(unittest.TestCase):
} }
parser.parse_tests(tests_mapping) parser.parse_tests(tests_mapping)
test_dict1_variables = tests_mapping["testcases"][0]["tests"][0]["variables"] test_dict1_variables = tests_mapping["testcases"][0]["tests"][0]["variables"]
self.assertEqual(test_dict1_variables["creator"], "user_test_001")
self.assertEqual(test_dict1_variables["username"], "user_test_001") self.assertEqual(test_dict1_variables["username"], "user_test_001")
def test_parse_environ(self): def test_parse_environ(self):

View File

@@ -3,8 +3,8 @@
name: "create user and check result." name: "create user and check result."
id: create_and_check id: create_and_check
variables: variables:
- uid: 9001 uid: 9001
- device_sn: "TESTCASE_CREATE_XXX" device_sn: "TESTCASE_CREATE_XXX"
base_url: "http://127.0.0.1:5000" base_url: "http://127.0.0.1:5000"
- test: - test:
@@ -17,8 +17,8 @@
name: make sure user $uid does not exist name: make sure user $uid does not exist
api: get_user api: get_user
variables: variables:
- uid: $uid uid: $uid
- token: $token token: $token
validate: validate:
- eq: ["status_code", 404] - eq: ["status_code", 404]
- eq: ["content.success", false] - eq: ["content.success", false]
@@ -27,10 +27,10 @@
name: create user $uid name: create user $uid
api: create_user api: create_user
variables: variables:
- user_name: "user1" user_name: "user1"
- user_password: "123456" user_password: "123456"
- uid: $uid uid: $uid
- token: $token token: $token
validate: validate:
- eq: ["status_code", 201] - eq: ["status_code", 201]
- eq: ["content.success", true] - eq: ["content.success", true]
@@ -39,8 +39,8 @@
name: check if user $uid exists name: check if user $uid exists
api: get_user api: get_user
variables: variables:
- uid: $uid uid: $uid
- token: $token token: $token
validate: validate:
- eq: ["status_code", 200] - eq: ["status_code", 200]
- eq: ["content.success", true] - eq: ["content.success", true]

View File

@@ -2,10 +2,10 @@
name: "setup and reset all." name: "setup and reset all."
id: setup_and_reset id: setup_and_reset
variables: variables:
- user_agent: 'iOS/10.3' user_agent: 'iOS/10.3'
- device_sn: "TESTCASE_SETUP_XXX" device_sn: "TESTCASE_SETUP_XXX"
- os_platform: 'ios' os_platform: 'ios'
- app_version: '2.8.6' app_version: '2.8.6'
base_url: "http://127.0.0.1:5000" base_url: "http://127.0.0.1:5000"
verify: False verify: False
output: output:
@@ -15,10 +15,10 @@
name: get token (setup) name: get token (setup)
api: get_token api: get_token
variables: variables:
- user_agent: 'iOS/10.3' user_agent: 'iOS/10.3'
- device_sn: $device_sn device_sn: $device_sn
- os_platform: 'ios' os_platform: 'ios'
- app_version: '2.8.6' app_version: '2.8.6'
extract: extract:
- token: content.token - token: content.token
validate: validate:
@@ -29,4 +29,4 @@
name: reset all users name: reset all users
api: reset_all api: reset_all
variables: variables:
- token: $token token: $token

View File

@@ -1,17 +1,17 @@
- config: - config:
name: create users with uid name: create users with uid
variables: variables:
- device_sn: ${gen_random_string(15)} device_sn: ${gen_random_string(15)}
base_url: "http://127.0.0.1:5000" base_url: "http://127.0.0.1:5000"
- test: - test:
name: create user 1000 and check result. name: create user 1000 and check result.
testcase: testcases/create_and_check.yml testcase: testcases/create_and_check.yml
variables: variables:
- uid: 1000 uid: 1000
- test: - test:
name: create user 1001 and check result. name: create user 1001 and check result.
testcase: testcases/create_and_check.yml testcase: testcases/create_and_check.yml
variables: variables:
- uid: 1001 uid: 1001