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.
 
 
 

128 lines
6.7 KiB

*** Settings ***
Library urllib3
Library String
Library demjson
Library Collections
Library JSONLibrary
Library RequestsLibrary
*** Keywords ***
用户首次填写${dating}资料
Disable Warnings
#获取首次婚介资料信息
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
${reps} GET On Session dating /dating-agency-service/user/get/first/fill/marriage/information/details
${Data} Get From Dictionary ${reps.json()} data
#${Data} Replace String ${Data} "None" null #将所有None改为null
${id} Get From Dictionary ${reps.json()['data']} id #资料id
${height} Get From Dictionary ${reps.json()['data']} height #证婚人身高
${nickName} Get From Dictionary ${reps.json()['data']} nickName #证婚人昵称
${cityCode} Get From Dictionary ${reps.json()['data']} cityCode #市编号
${cityName} Get From Dictionary ${reps.json()['data']} cityName #市名称
${birthYear} Get From Dictionary ${reps.json()['data']} birthYear #证婚人出生年份
${genderCode} Get From Dictionary ${reps.json()['data']} genderCode #证婚人性别
${incomeCode} Get From Dictionary ${reps.json()['data']} incomeCode #证婚人月收入
${districtCode} Get From Dictionary ${reps.json()['data']} districtCode #区编码
${districtName} Get From Dictionary ${reps.json()['data']} districtName #区名称
${provinceCode} Get From Dictionary ${reps.json()['data']} provinceCode #省编码
${provinceName} Get From Dictionary ${reps.json()['data']} provinceName #省名称
${educationCode} Get From Dictionary ${reps.json()['data']} educationCode #证婚人学历编码
${fillSerialNumber} Get From Dictionary ${reps.json()['data']} fillSerialNumber
${maritalStatusCode} Get From Dictionary ${reps.json()['data']} maritalStatusCode #证婚人婚姻状况,0:未婚,1:离异,2:丧偶的 0:未婚,1:离异,2:丧偶的
#${Information} Create Dictionary
Set Global Variable ${id}
Set Global Variable ${Data}
Set Global Variable ${height}
Set Global Variable ${nickName}
Set Global Variable ${cityCode}
Set Global Variable ${cityName}
Set Global Variable ${birthYear}
Set Global Variable ${genderCode}
Set Global Variable ${incomeCode}
Set Global Variable ${districtCode}
Set Global Variable ${districtName}
Set Global Variable ${provinceCode}
Set Global Variable ${provinceName}
Set Global Variable ${educationCode}
Set Global Variable ${fillSerialNumber}
Set Global Variable ${maritalStatusCode}
检查首次填写${dating}资料序号
#检查首次填写序号
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
${reps} GET On Session dating /dating-agency-service/user/check/first/fill/marriage/information/sn
${fillSerialNumber} Get From Dictionary ${reps.json()['data']} fillSerialNumber #填写序号
Set Global Variable ${fillSerialNumber}
选择${dating}性别资料
#选择性别
Log To Console ${CURDIR}
Disable Warnings
#用户首次填写婚介资料
${SexCode} Evaluate 1 #男:0,女:1
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
${Data} Update Value To Json ${Data} $.genderCode ${SexCode}
${Data} Evaluate demjson.encode(${DATA}) demjson
${Data} Replace String ${Data} "None" null
${reps} POST On Session dating /dating-agency-service/user/save/first/fill/marriage/Information ${Data.encode('utf-8')}
${DataId} Get From Dictionary ${reps.json()} data #获取证婚人资料id
Set Global Variable ${DataId}
#检查首次填写婚介资料序号
选择${dating}证婚人的城市
#选择城市
#获取省市区
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}
#选择证婚人地区资料
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
${Data} Update Value To Json ${Data} $.id ${DataId}
${Data} Update Value To Json ${Data} $.fillSerialNumber ${fillSerialNumber}
${Data} Update Value To Json ${Data} $.cityCode ${cityCode}
${Data} Update Value To Json ${Data} $.cityName ${cityName}
${Data} Update Value To Json ${Data} $.districtCode ${districtCode}
${Data} Update Value To Json ${Data} $.districtName ${districtName}
${Data} Update Value To Json ${Data} $.provinceCode ${provinceCode}
${Data} Update Value To Json ${Data} $.provinceName ${provinceName}
${Data} Evaluate demjson.encode(${DATA}) demjson
${Data} Replace String ${Data} "None" null
${reps} POST On Session dating /dating-agency-service/user/save/first/fill/marriage/Information ${Data.encode('utf-8')}
#检查首次填写婚介资料序号
出生年份
身高
学历
婚姻状况
月收入
昵称
返回上一步