Browse Source

批量填写基础资料数据

master
LG_lai 1 year ago
parent
commit
ef9c339a4c
7 changed files with 1512 additions and 730 deletions
  1. 43
      0-Login/LoginResource.robot
  2. 302
      1-Applet/2-Homepage/MarriageInfo/Authentication.robot
  3. 8
      1-Applet/3-Customer/EquityResource.robot
  4. 10
      output/log.html
  5. 1867
      output/output.xml
  6. 10
      output/report.html
  7. 2
      资料/男生图片.txt

43
0-Login/LoginResource.robot

@ -21,10 +21,13 @@ Library ImageHorizonLibrary
Set Global Variable ${id}
生成随机手机号
${phoneList} Create List
${phoneList} Create List
${num} Evaluate random.choice(["139","188","185","136","158","151","132","156","189","187","135","134"]) random
${number} Evaluate "".join(random.sample("01234567897",8)) random,string
${phone} Evaluate ${num}${number}
Set Global Variable ${phone}
Append To List ${phoneList} ${phone}
Set Global Variable ${phoneList}
写入数据到txt文件
${file_path} Set Variable ${EXECDIR}\\Phone.txt
@ -111,6 +114,7 @@ Library ImageHorizonLibrary
${userid_list} Create List
${Cheader_list} Create List
${Aheader_list} Create List
${phoneList} Create List
FOR ${account} IN @{id}
Disable Warnings
Create Session dating ${${dating}.dating域名} ${${dating}.AHeader}
@ -125,11 +129,11 @@ Library ImageHorizonLibrary
Append To List ${userid_list} ${userId}
Append To List ${Cheader_list} ${client_header}
Append To List ${Aheader_list} ${login_header}
Append To List ${phoneList} ${account}
Run Keyword If ${code}==0 Should Be Equal As Strings ${message} successful
... ELSE Should Be Equal As Strings ${message} 验证码错误或无效验证码,请重试!
END
${phone} Set Variable ${account}
Set Global Variable ${phone}
Set Global Variable ${phoneList}
Set Global Variable ${userid_list}
Set Global Variable ${Aheader_list}
Set Global Variable ${Cheader_list}
@ -141,21 +145,26 @@ Library ImageHorizonLibrary
${userid_list} Create List
${Cheader_list} Create List
${Aheader_list} Create List
${phoneList} Create List
Disable Warnings
Create Session dating ${${dating}.dating域名} ${${dating}.AHeader}
${data} Set Variable { \ \ "account":"${phone}", \ \ "accountType":2, \ \ "captcha":888888 } #手机号验证码登录参数
${reps} POST On Session dating /dating-agency-uec/authorize/by-captcha ${data.encode('utf-8')}
${code} Get From Dictionary ${reps.json()} code #获取相应状态码
${token} Get From Dictionary ${reps.json()['data']} token #获取token
${userId} Get From Dictionary ${reps.json()['data']} userId #获取用户id
${message} Get From Dictionary ${reps.json()} message
${login_header} Set Variable {'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT ${token}','X-Organization-Id':'963432943739605555'} #更新header
${client_header} Set Variable {'Content-Type':'application/json','X-APP-ID':'50325897884795880','Authorization':'QNT ${token}'}
Append To List ${userid_list} ${userId}
Append To List ${Cheader_list} ${client_header}
Append To List ${Aheader_list} ${login_header}
Run Keyword If ${code}==0 Should Be Equal As Strings ${message} successful
... ELSE Should Be Equal As Strings ${message} 验证码错误或无效验证码,请重试!
FOR ${phone} IN @{phoneList}
Create Session dating ${${dating}.dating域名} ${${dating}.AHeader}
${data} Set Variable { \ \ "account":"${phone}", \ \ "accountType":2, \ \ "captcha":888888 } #手机号验证码登录参数
${reps} POST On Session dating /dating-agency-uec/authorize/by-captcha ${data.encode('utf-8')}
${code} Get From Dictionary ${reps.json()} code #获取相应状态码
${token} Get From Dictionary ${reps.json()['data']} token #获取token
${userId} Get From Dictionary ${reps.json()['data']} userId #获取用户id
${message} Get From Dictionary ${reps.json()} message
${login_header} Set Variable {'Content-Type':'application/json','X-APP-ID':'50325897884795881','Authorization':'QNT ${token}','X-Organization-Id':'963432943739605555'} #更新header
${client_header} Set Variable {'Content-Type':'application/json','X-APP-ID':'50325897884795880','Authorization':'QNT ${token}'}
Append To List ${userid_list} ${userId}
Append To List ${Cheader_list} ${client_header}
Append To List ${Aheader_list} ${login_header}
Append To List ${phoneList} ${phone}
Run Keyword If ${code}==0 Should Be Equal As Strings ${message} successful
... ELSE Should Be Equal As Strings ${message} 验证码错误或无效验证码,请重试!
END
Set Global Variable ${phoneList}
Set Global Variable ${userid_list}
Set Global Variable ${Aheader_list}
Set Global Variable ${Cheader_list}

302
1-Applet/2-Homepage/MarriageInfo/Authentication.robot
File diff suppressed because it is too large
View File

8
1-Applet/3-Customer/EquityResource.robot

@ -9,20 +9,20 @@ Library DatabaseLibrary
*** Keywords ***
查询${dating}征婚人的资料信息
#通过userid获取征婚人的资料
${miId_list} Create List
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
Set Global Variable ${nickName}
Set Global Variable ${miId_list}
Set Global Variable ${genderCode}
END
Set Global Variable ${nickName}
Set Global Variable ${miId_list}
Set Global Variable ${genderCode}
查询${dating}权益列表
FOR ${client_header} IN @{Cheader_list}

10
output/log.html
File diff suppressed because it is too large
View File

1867
output/output.xml
File diff suppressed because it is too large
View File

10
output/report.html

@ -1629,22 +1629,22 @@ storage = function () {
window.output = {};
</script>
<script type="text/javascript">
window.output["suite"] = [1,2,3,0,[],[0,0,1505],[[4,5,6,7,[],[1,15,740],[[8,9,10,11,[],[1,15,740],[],[[12,0,0,[],[1,347,408],[]]],[],[1,1,0,0]]],[],[],[1,1,0,0]],[13,14,15,0,[],[0,755,750],[[16,17,18,0,[],[0,755,749],[[19,20,21,22,[],[0,755,744],[[23,24,25,26,[],[0,771,728],[],[[27,0,0,[],[0,831,668,28],[]]],[],[1,0,1,0]]],[],[],[1,0,1,0]]],[],[],[1,0,1,0]]],[],[],[1,0,1,0]]],[],[],[2,1,1,0]];
window.output["suite"] = [1,2,3,0,[],[1,0,1765],[[4,5,6,7,[],[1,16,739],[[8,9,10,11,[],[1,16,739],[],[[12,0,0,[],[1,362,393],[]]],[],[1,1,0,0]]],[],[],[1,1,0,0]],[13,14,15,0,[],[1,755,1010],[[16,17,18,0,[],[1,755,1010],[[19,20,21,22,[],[1,755,1010],[[23,24,25,26,[],[1,771,994],[],[[27,0,0,[],[1,828,432],[]],[28,0,0,[],[1,1260,505],[]]],[],[2,2,0,0]]],[],[],[2,2,0,0]]],[],[],[2,2,0,0]]],[],[],[2,2,0,0]]],[],[],[3,3,0,0]];
</script>
<script type="text/javascript">
window.output["strings"] = [];
</script>
<script type="text/javascript">
window.output["strings"] = window.output["strings"].concat(["*","*Dating-agency","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency","*..","*0-Login","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\0-Login","*../0-Login","*<p>用户登录婚介平台\x3c/p>","*Login-interface","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\0-Login\\Login-interface.robot","*../0-Login/Login-interface.robot","*<p>接口:短信验证码登录认证\x3c/p>","*手机号验证码登录-888888","*1-Applet","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet","*../1-Applet","*2-Homepage","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet\\2-Homepage","*../1-Applet/2-Homepage","*MarriageInfo","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet\\2-Homepage\\MarriageInfo","*../1-Applet/2-Homepage/MarriageInfo","*<p>征婚人资料\x3c/p>","*DataAuthentication","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet\\2-Homepage\\MarriageInfo\\DataAuthentication.robot","*../1-Applet/2-Homepage/MarriageInfo/DataAuthentication.robot","*<p>资料认证\x3c/p>","*提交征婚人头像审核信息-无审核中","*Resolving variable '${check[0][0]}' failed: IndexError: tuple index out of range"]);
window.output["strings"] = window.output["strings"].concat(["*","*Dating-agency","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency","*..","*0-Login","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\0-Login","*../0-Login","*<p>用户登录婚介平台\x3c/p>","*Login-interface","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\0-Login\\Login-interface.robot","*../0-Login/Login-interface.robot","*<p>接口:短信验证码登录认证\x3c/p>","*手机号验证码登录-888888","*1-Applet","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet","*../1-Applet","*2-Homepage","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet\\2-Homepage","*../1-Applet/2-Homepage","*MarriageInfo","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet\\2-Homepage\\MarriageInfo","*../1-Applet/2-Homepage/MarriageInfo","*<p>征婚人资料\x3c/p>","*DataAuthentication","*D:\\LYL\\Study\\Robot_framework\\space\\Dating-agency\\1-Applet\\2-Homepage\\MarriageInfo\\DataAuthentication.robot","*../1-Applet/2-Homepage/MarriageInfo/DataAuthentication.robot","*<p>资料认证\x3c/p>","*提交征婚人的收入信息","*提交征婚人的职业"]);
</script>
<script type="text/javascript">
window.output["stats"] = [[{"elapsed":"00:00:01","fail":1,"label":"All Tests","pass":1,"skip":0}],[],[{"elapsed":"00:00:02","fail":1,"id":"s1","label":"Dating-agency","name":"Dating-agency","pass":1,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s1","label":"Dating-agency.0-Login","name":"0-Login","pass":1,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s1-s1","label":"Dating-agency.0-Login.Login-interface","name":"Login-interface","pass":1,"skip":0},{"elapsed":"00:00:01","fail":1,"id":"s1-s2","label":"Dating-agency.1-Applet","name":"1-Applet","pass":0,"skip":0},{"elapsed":"00:00:01","fail":1,"id":"s1-s2-s1","label":"Dating-agency.1-Applet.2-Homepage","name":"2-Homepage","pass":0,"skip":0},{"elapsed":"00:00:01","fail":1,"id":"s1-s2-s1-s1","label":"Dating-agency.1-Applet.2-Homepage.MarriageInfo","name":"MarriageInfo","pass":0,"skip":0},{"elapsed":"00:00:01","fail":1,"id":"s1-s2-s1-s1-s1","label":"Dating-agency.1-Applet.2-Homepage.MarriageInfo.DataAuthentication","name":"DataAuthentication","pass":0,"skip":0}]];
window.output["stats"] = [[{"elapsed":"00:00:01","fail":0,"label":"All Tests","pass":3,"skip":0}],[],[{"elapsed":"00:00:02","fail":0,"id":"s1","label":"Dating-agency","name":"Dating-agency","pass":3,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s1","label":"Dating-agency.0-Login","name":"0-Login","pass":1,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s1-s1","label":"Dating-agency.0-Login.Login-interface","name":"Login-interface","pass":1,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s2","label":"Dating-agency.1-Applet","name":"1-Applet","pass":2,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s2-s1","label":"Dating-agency.1-Applet.2-Homepage","name":"2-Homepage","pass":2,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s2-s1-s1","label":"Dating-agency.1-Applet.2-Homepage.MarriageInfo","name":"MarriageInfo","pass":2,"skip":0},{"elapsed":"00:00:01","fail":0,"id":"s1-s2-s1-s1-s1","label":"Dating-agency.1-Applet.2-Homepage.MarriageInfo.DataAuthentication","name":"DataAuthentication","pass":2,"skip":0}]];
</script>
<script type="text/javascript">
window.output["baseMillis"] = 1713516100670;
window.output["baseMillis"] = 1713586089237;
</script>
<script type="text/javascript">
window.output["generated"] = 1524;
window.output["generated"] = 1821;
</script>
<script type="text/javascript">
window.output["expand_keywords"] = null;

2
资料/男生图片.txt
File diff suppressed because it is too large
View File

Loading…
Cancel
Save