mirror of
https://github.com/httprunner/httprunner.git
synced 2026-06-03 23:09:36 +08:00
refactor parameterization:
parameter value now can be in three types: (1) data list (2) call built-in parameterize function (3) call custom function in debugtalk.py
This commit is contained in:
@@ -48,3 +48,15 @@ def skip_test_in_production_env():
|
||||
""" skip this test in production environment
|
||||
"""
|
||||
return os.environ["TEST_ENV"] == "PRODUCTION"
|
||||
|
||||
def gen_app_version():
|
||||
return [
|
||||
{"app_version": "2.8.5"},
|
||||
{"app_version": "2.8.6"}
|
||||
]
|
||||
|
||||
def get_account():
|
||||
return [
|
||||
{"username": "user1", "password": "111111"},
|
||||
{"username": "user2", "password": "222222"}
|
||||
]
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
- config:
|
||||
name: "user management testset."
|
||||
parameters:
|
||||
- user_agent: Random
|
||||
- app_version: Sequential
|
||||
- user_agent: ["iOS/10.1", "iOS/10.2", "iOS/10.3"]
|
||||
- app_version: ${gen_app_version()}
|
||||
- username: ${parameterize(account.csv)}
|
||||
variables:
|
||||
- user_agent: 'iOS/10.3'
|
||||
- device_sn: ${gen_random_string(15)}
|
||||
- os_platform: 'ios'
|
||||
- app_version: '2.8.6'
|
||||
request:
|
||||
base_url: $BASE_URL
|
||||
headers:
|
||||
@@ -17,7 +17,7 @@
|
||||
- token
|
||||
|
||||
- test:
|
||||
name: get token with $user_agent and $app_version
|
||||
name: get token with $user_agent and $app_version, username $username
|
||||
api: get_token($user_agent, $device_sn, $os_platform, $app_version)
|
||||
extract:
|
||||
- token: content.token
|
||||
|
||||
Reference in New Issue
Block a user