mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 18:11:21 +08:00
new feature: support parameters and data driven
This commit is contained in:
4
tests/data/app_version.csv
Normal file
4
tests/data/app_version.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
app_version
|
||||
2.8.5
|
||||
2.8.6
|
||||
|
||||
|
26
tests/data/demo_parameters.yml
Normal file
26
tests/data/demo_parameters.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
- config:
|
||||
name: "user management testset."
|
||||
parameters:
|
||||
- user_agent: Random
|
||||
- app_version: Sequential
|
||||
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:
|
||||
Content-Type: application/json
|
||||
device_sn: $device_sn
|
||||
output:
|
||||
- token
|
||||
|
||||
- test:
|
||||
name: get token with $user_agent and $app_version
|
||||
api: get_token($user_agent, $device_sn, $os_platform, $app_version)
|
||||
extract:
|
||||
- token: content.token
|
||||
validate:
|
||||
- "eq": ["status_code", 200]
|
||||
- "len_eq": ["content.token", 16]
|
||||
4
tests/data/user_agent.csv
Normal file
4
tests/data/user_agent.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
user_agent
|
||||
iOS/10.1
|
||||
iOS/10.2
|
||||
iOS/10.3
|
||||
|
4
tests/data/username-password.csv
Normal file
4
tests/data/username-password.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
username,password
|
||||
test1,111111
|
||||
test2,222222
|
||||
test3,333333
|
||||
|
Reference in New Issue
Block a user