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.
 
 
 

154 lines
8.5 KiB

*** Settings ***
Library urllib3
Library String
Library Collections
Library RequestsLibrary
Library DatabaseLibrary
*** Keywords ***
查询${dating}征婚人的资料信息
#通过userid获取征婚人的资料
FOR ${userId} ${client_header} IN ZIP ${userid_list} ${Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${reps} GET On Session dating /dating-agency-service/user/get/marriage/information/details params=userId=${userId}
${miId} Get From Dictionary ${reps.json()['data']} id #获取资料id
${nickName} Get From Dictionary ${reps.json()['data']} nickName #获取用户名称
${miId_list} Create List
${genderCode} Get From Dictionary ${reps.json()['data']} genderCode #用户性别
${message} Get From Dictionary ${reps.json()} message
Append To List ${miId_list} ${miId}
log ${miId_list}
Should Be Equal As Strings ${message} successful
END
Set Global Variable ${nickName}
Set Global Variable ${miId_list}
Set Global Variable ${genderCode}
查询${dating}征婚人资料
#通过miId查询征婚人资料
FOR ${miId} ${client_header} IN ZIP ${miId_list} ${Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${reps} GET On Session dating dating-agency-service/user/get/marriage/information/details/byid params=miId=${miId}
${age} Get From Dictionary ${reps.json()['data']} age #年龄
${height} Get From Dictionary ${reps.json()['data']} height #获取征婚人身高
${cityCode} Get From Dictionary ${reps.json()['data']} cityCode #现居市编码
${cityName} Get From Dictionary ${reps.json()['data']} cityName #现居市名称
${birthYear} Get From Dictionary ${reps.json()['data']} birthYear #出生年份
${education} Get From Dictionary ${reps.json()['data']} education #学历名称
${genderCode} Get From Dictionary ${reps.json()['data']} genderCode #性别
${provinceCode} Get From Dictionary ${reps.json()['data']} provinceCode #现居省编码
${provinceName} Get From Dictionary ${reps.json()['data']} provinceName #现居省名称
${educationCode} Get From Dictionary ${reps.json()['data']} educationCode #学历编码
END
Set Global Variable ${age}
Set Global Variable ${height}
Set Global Variable ${cityCode}
Set Global Variable ${cityName}
Set Global Variable ${birthYear}
Set Global Variable ${education}
Set Global Variable ${genderCode}
Set Global Variable ${provinceCode}
Set Global Variable ${provinceName}
Set Global Variable ${educationCode}
查看${dating}平台相亲列表
#相亲推荐页
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${reps} GET On Session dating dating-agency-service/user/get/marriage/recommendation/page params=queryType=0&pageNum=1&pageSize=30
${records} Get From Dictionary ${reps.json()['data']} records #推荐列表
${userData} Evaluate random.choice(${records}) random
${miId} Get From Dictionary ${userData} miId #资料id
Set Global Variable ${miId}
END
用户标记${dating}资料like
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${data} Set Variable {"miId":"${miId}"}
${reps} POST On Session dating dating-agency-service/user/like/his ${data.encode('utf-8')}
${data} Get From Dictionary ${reps.json()} data
${message} Get From Dictionary ${reps.json()} message
Should Be Equal As Strings ${message} successful
log 标记喜欢成功
END
用户查询${dating}我喜欢列表
#查询我喜欢列表
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${reps} GET On Session dating /dating-agency-service/user/get/user/mutual/attention/page params=pageNum=1&pageSize=10&attentionType=0
${records} Get From Dictionary ${reps.json()['data']} records
${Data} Evaluate random.choice(${records}) random
${miIdData} Get From Dictionary ${Data} miId
Exit For Loop If ${miIdData}==${miId}
END
Set Global Variable ${miIdData}
用户标记${dating}资料no like
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${data} Set Variable {"miId":"${miIdData}"}
${reps} POST On Session dating dating-agency-service/user/cancel/like ${data.encode('utf-8')}
${data} Get From Dictionary ${reps.json()} data #标记id
${message} Get From Dictionary ${reps.json()} message
Should Be Equal As Strings ${message} successful
log 标记不喜欢成功
END
用户查询${dating}高级搜索列表-户口所在地
#户口所在地查询
region固定省市-汕头
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${reps} GET On Session dating dating-agency-service/user/get/marriage/recommendation/page params=advancedQuery=true&queryType=1&minAge=18&maxAge=80&minHeight=0&maxHeight=207&minimumIncome=0&maximumIncome=10000000&domicilePlaceProvinceCode=${provinceCode}&domicilePlaceProvinceName=${provinceName}&domicilePlaceCityCode=${cityCode}&domicilePlaceCityName=${cityName}&unlock=2&pageNum=1&pageSize=100
${total} Get From Dictionary ${reps.json()['data']} total
${records} Get From Dictionary ${reps.json()['data']} records
Set Global Variable ${records}
log ${records}
遍历搜索结果
END
Set Global Variable ${total}
遍历搜索结果
FOR ${data} IN @{records}
${miId} Get From Dictionary ${data} miId
Exit For Loop If ${miId}==965354767578697728 #就是不吃饭:965354767578697728
END
Set Global Variable ${miId}
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}
查看${dating}征婚人详情
FOR ${client_header} IN @{Cheader_list}
Create Session dating ${${dating}.dating域名} ${client_header}
${reps} GET On Session dating dating-agency-service/user/get/marriage/recommendation/details params=miId=${miId}&freeCharge=1
${message} Get From Dictionary ${reps.json()} message
Should Be Equal As Strings ${message} successful
END