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.
225 lines
14 KiB
225 lines
14 KiB
*** Settings ***
|
|
Library urllib3
|
|
Library String
|
|
Library demjson
|
|
Library DateTime
|
|
Library Collections
|
|
Library JSONLibrary
|
|
Library RequestsLibrary
|
|
Library OperatingSystem
|
|
|
|
*** Keywords ***
|
|
用户首次填写${dating}资料
|
|
Disable Warnings
|
|
#获取首次婚介资料信息
|
|
Import Variables ${CURDIR}\\DA_data.yaml
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${reps} GET On Session dating /dating-agency-service/user/get/first/fill/marriage/information/details params=userId=8576
|
|
${Data} Get From Dictionary ${reps.json()} data
|
|
log ${Data}
|
|
${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:丧偶的
|
|
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 params=userId=808374438260248576
|
|
${fillSerialNumber} Get From Dictionary ${reps.json()['data']} fillSerialNumber #填写序号
|
|
Set Global Variable ${fillSerialNumber}
|
|
|
|
选择${dating}性别资料
|
|
#选择性别
|
|
Log To Console ${CURDIR}
|
|
Disable Warnings
|
|
#用户首次填写婚介资料
|
|
${sex-code} Create List 0 1
|
|
${SexCode} Evaluate random.choice(${sex-code}) random #随机获取男女序号
|
|
#${SexCode} Evaluate 1 #男:0,女:1
|
|
${Number} Evaluate 0 #0:"性别",1:"所在城市",2:"出生年份",3:"身高",4:"学历",5:"婚姻状态",6:"月收入",7:"昵称",8:"首次填写完成"
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${Data} Update Value To Json ${Data} $.genderCode ${SexCode}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${Data} Evaluate demjson.encode(${DATA}) demjson
|
|
${Data} Replace String ${Data} "None" null
|
|
log ${Data}
|
|
${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
|
|
${message} Get From Dictionary ${reps.json()} message
|
|
Should Be Equal As Strings ${message} successful
|
|
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}
|
|
#选择征婚人地区资料
|
|
${Number} Evaluate 1 #0:"性别",1:"所在城市",2:"出生年份",3:"身高",4:"学历",5:"婚姻状态",6:"月收入",7:"昵称",8:"首次填写完成"
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${Data} Update Value To Json ${Data} $.id ${DataId}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${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')}
|
|
${id} Get From Dictionary ${reps.json()} data
|
|
Should Be Equal ${id} ${DataId}
|
|
#检查首次填写婚介资料序号
|
|
#用户首次填写婚介资料
|
|
|
|
选择${dating}征婚人的出生年份
|
|
#选择征婚人出生年份
|
|
${get_year} Get Current Date result_format=%Y
|
|
${start-year} Evaluate 1950
|
|
${end-year} Evaluate ${get_year}-18
|
|
${year} Evaluate random.randint(${start-year},${end-year}) random #随机获取年份
|
|
${Number} Evaluate 2 #填写序号
|
|
${Data} Update Value To Json ${Data} $.id ${DataId}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${Data} Update Value To Json ${Data} $.birthYear ${year}
|
|
${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')}
|
|
${id} Get From Dictionary ${reps.json()} data
|
|
Should Be Equal ${id} ${DataId}
|
|
|
|
选择${dating}征婚人的身高
|
|
#选择征婚人身高
|
|
${low-height} Evaluate 120
|
|
${hight-height} Evaluate 207
|
|
${height} Evaluate random.randint(${low-height},${hight-height}) random
|
|
${Number} Evaluate 3
|
|
${Data} Update Value To Json ${Data} $.id ${DataId}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${Data} Update Value To Json ${Data} $.height ${height}
|
|
${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')}
|
|
${id} Get From Dictionary ${reps.json()} data
|
|
Should Be Equal ${id} ${DataId}
|
|
|
|
选择${dating}征婚人的学历
|
|
#选择征婚人的学历
|
|
${code} Create List 0 1 2 3 4 5 #0:高中及以下,1:中专,2:大专,3:大学本科,4:硕士,5:硕士
|
|
${educode} Evaluate random.choice(${code}) random #随机获取学历编码
|
|
${Number} Evaluate 4
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${Data} Update Value To Json ${Data} $.id ${DataId}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${Data} Update Value To Json ${Data} $.educationCode ${educode}
|
|
${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')}
|
|
${id} Get From Dictionary ${reps.json()} data
|
|
Should Be Equal ${id} ${DataId}
|
|
|
|
选择${dating}征婚人的婚姻状况
|
|
#选择征婚人的婚姻状况
|
|
${code} Create List 0 1 2 #0:未婚,1:离异,2:丧偶的
|
|
${maritalCode} Evaluate random.choice(${code}) random #随机获取婚姻状态编码
|
|
${Number} Evaluate 5
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${Data} Update Value To Json ${Data} $.id ${DataId}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${Data} Update Value To Json ${Data} $.maritalStatusCode ${maritalCode}
|
|
${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')}
|
|
${id} Get From Dictionary ${reps.json()} data
|
|
Should Be Equal ${id} ${DataId}
|
|
|
|
选择${dating}征婚人的月收入
|
|
#选择征婚人的月收入
|
|
${code} Create List 0 1 2 3 4 5 6 #0:3000以下,1:3001~5000,2:5001~8000,3:8001~12000,4:12001~20000,5:20001~50000,6:50000以上
|
|
${incomeCode} Evaluate random.choice(${code}) random #随机获取婚姻状态编码
|
|
${Number} Evaluate 6
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${Data} Update Value To Json ${Data} $.id ${DataId}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${Data} Update Value To Json ${Data} $.incomeCode ${incomeCode}
|
|
${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')}
|
|
${id} Get From Dictionary ${reps.json()} data
|
|
Should Be Equal ${id} ${DataId}
|
|
|
|
选择${dating}征婚人的昵称
|
|
#填写征婚人昵称
|
|
${num} Evaluate random.randint(1,999) random #随机获取一个数字
|
|
${nickName} Set Variable 寻伴用户${num}
|
|
${Number} Evaluate 7
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${Data} Update Value To Json ${Data} $.id ${DataId}
|
|
${Data} Update Value To Json ${Data} $.fillSerialNumber ${Number}
|
|
${Data} Update Value To Json ${Data} $.nickName ${nickName}
|
|
${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')}
|
|
${id} Get From Dictionary ${reps.json()} data
|
|
Should Be Equal ${id} ${DataId}
|
|
|
|
查询首次填写的${dating}资料信息
|
|
#获取用户首次填写的资料
|
|
Create Session dating ${${dating}.UEC域名} ${${dating}.Header}
|
|
${reps} GET On Session dating /dating-agency-service/user/get/first/fill/marriage/information/details params=userId=8576
|
|
${}
|