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.
73 lines
3.7 KiB
73 lines
3.7 KiB
*** Settings ***
|
|
Library urllib3
|
|
Library Collections
|
|
Library RequestsLibrary
|
|
|
|
*** 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}
|
|
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 #现居城市
|
|
${birthYear} Get From Dictionary ${reps.json()['data']} birthYear #出生年份
|
|
${genderCode} Get From Dictionary ${reps.json()['data']} genderCode #性别
|
|
END
|
|
Set Global Variable ${age}
|
|
Set Global Variable ${height}
|
|
Set Global Variable ${cityCode}
|
|
Set Global Variable ${birthYear}
|
|
Set Global Variable ${genderCode}
|
|
|
|
查看${dating}平台相亲列表
|
|
#相亲推荐页
|
|
${ageRange} Evaluate list(range(${age}-9,${age}+10,1)) #年龄范围
|
|
${heightRange} Evaluate list(range(${height}-20,${height}+15,1)) #身高范围
|
|
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 #推荐列表
|
|
Set Global Variable ${records}
|
|
遍历推荐列表
|
|
END
|
|
#判断年龄是否在范围内
|
|
FOR ${a} IN @{age_list}
|
|
Run Keyword If ${a} in ${ageRange} log ${a}存在于${ageRange}中
|
|
... ELSE log ${a}不存在于${ageRange}中
|
|
END
|
|
#判断身高是否在范围内
|
|
FOR ${h} IN @{height_list}
|
|
Run Keyword If ${h} in ${heightRange} log ${h}存在于${heightRange}中
|
|
... ELSE log ${h}不存在于${heightRange}中
|
|
END
|
|
|
|
遍历推荐列表
|
|
${age_list} Create List
|
|
${height_list} Create List
|
|
FOR ${data} IN @{records}
|
|
${age} Get From Dictionary ${data} age
|
|
${height} Get From Dictionary ${data} height
|
|
Append To List ${age_list} ${age}
|
|
Append To List ${height_list} ${height}
|
|
END
|
|
Set Global Variable ${age_list}
|
|
Set Global Variable ${height_list}
|