You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
3.9 KiB
75 lines
3.9 KiB
*** Settings ***
|
|
Library urllib3
|
|
Library String
|
|
Library DateTime
|
|
Library Collections
|
|
Library RequestsLibrary
|
|
Library DatabaseLibrary
|
|
|
|
*** Keywords ***
|
|
创建${dating}一级代理商
|
|
#创建一级代理商
|
|
FOR ${admin_header} IN @{Aheader_list}
|
|
${DateTime} Get Current Date result_format=%Y-%m-%d #获取当天日期
|
|
Create Session dating ${${dating}.dating域名} ${admin_header}
|
|
${orgName} Set Variable 招亲宝${DateTime}
|
|
${franchiseFee} Evaluate random.randrange(50000,100000,1000) random #获取随机正整数
|
|
${administratorName} Set Variable 招亲${DateTime}
|
|
${data} Set Variable {"orgName":"${orgName}","administratorName":"${administratorName}","franchiseFee":${franchiseFee}}
|
|
${reps} POST On Session dating dating-agency-uec/user/create/operation-center ${data.encode('utf-8')}
|
|
${message} Get From Dictionary ${reps.json()} message #接口响应信息
|
|
Should Be Equal As Strings ${message} successful #断言字段是否相同
|
|
END
|
|
Set Global Variable ${orgName}
|
|
Set Global Variable ${administratorName}
|
|
|
|
查询${dating}一级代理列表
|
|
#查询一级代理列表
|
|
FOR ${admin_header} IN @{Aheader_list}
|
|
Create Session dating ${${dating}.dating域名} ${admin_header}
|
|
${reps} GET On Session dating dating-agency-uec/user/page/operation-center params=pageSize=10&pageNum=1
|
|
${records} Get From Dictionary ${reps.json()['data']} records #一级代理商列表
|
|
Set Global Variable ${records}
|
|
遍历一级代理商列表
|
|
END
|
|
|
|
遍历一级代理商列表
|
|
FOR ${data} IN @{records}
|
|
${Id} Get From Dictionary ${data} id #一级代理商id
|
|
${OrgId} Get From Dictionary ${data} orgId #一级代理商组织id
|
|
${ORGName} Get From Dictionary ${data} orgName #代理商组织name
|
|
${AdministratorName} Get From Dictionary ${data} administratorName #代理人姓名
|
|
Exit For Loop If '${ORGName}'=='${orgName}'
|
|
Set Global Variable ${Id}
|
|
Set Global Variable ${OrgId}
|
|
Set Global Variable ${ORGName}
|
|
Set Global Variable ${AdministratorName}
|
|
END
|
|
|
|
region固定省市-广州
|
|
Disable Warnings
|
|
Create Session region http://qncloud.oss-cn-shenzhen.aliyuncs.com
|
|
${reps} GET On Session region address.json
|
|
${local_data} Get From Dictionary ${reps.json()} data
|
|
FOR ${province} IN @{local_data} #省列表数据
|
|
${provinceCode} Get From Dictionary ${province} value #获取省编码
|
|
${provinceName} Get From Dictionary ${province} label #获取省名称
|
|
Exit For Loop If '${provinceName}'=='广东省'
|
|
END
|
|
${city_data} Get From Dictionary ${province} children #广东省市列表数据
|
|
FOR ${city} IN @{city_data}
|
|
${cityCode} Get From Dictionary ${city} value #获取市编码
|
|
${cityName} Get From Dictionary ${city} label #获取市名称
|
|
Exit For Loop If '${cityName}'=='广州市'
|
|
END
|
|
${district_data} Get From Dictionary ${city} children #广州市列表数据
|
|
log ${district_data}
|
|
${district} Evaluate random.choice(${district_data}) random
|
|
${districtCode} Get From Dictionary ${district} value #随机获取广州市区编码
|
|
${districtName} Get From Dictionary ${district} label #随机获取广州市区名称
|
|
Set Global Variable ${cityCode}
|
|
Set Global Variable ${cityName}
|
|
Set Global Variable ${districtCode}
|
|
Set Global Variable ${districtName}
|
|
Set Global Variable ${provinceCode}
|
|
Set Global Variable ${provinceName}
|