Browse Source

优化活动社群

master
LG_lai 1 year ago
parent
commit
4a0661ea6f
1 changed files with 20 additions and 13 deletions
  1. 33
      2-Web/SiteActivity/SiteActivityResources.robot

33
2-Web/SiteActivity/SiteActivityResources.robot

@ -14,11 +14,8 @@ Library DatabaseLibrary
${reps} GET On Session dating dating-agency-service/user/get/association/page params=pageSize=100&enable=true&pageNum=1 ${reps} GET On Session dating dating-agency-service/user/get/association/page params=pageSize=100&enable=true&pageNum=1
${records} Get From Dictionary ${reps.json()['data']} records #社群数组 ${records} Get From Dictionary ${reps.json()['data']} records #社群数组
Set Global Variable ${records} #设置全局变量 Set Global Variable ${records} #设置全局变量
${communityData} Evaluate random.choice(${records}) random #随机获取一个社群
${communityId} Get From Dictionary ${communityData} id #社群id
${communityName} Get From Dictionary ${communityData} name #社群name
Set Global Variable ${communityId}
Set Global Variable ${communityName}
Run Keyword If ${records}==[] 创建婚介社群
... ELSE 随机获取社群信息
${reps} GET On Session dating dating-agency-service/user/get/association/detail params=id=${communityId} ${reps} GET On Session dating dating-agency-service/user/get/association/detail params=id=${communityId}
${contactPictureUrlList} Get From Dictionary ${reps.json()['data']} contactPictureUrlList #联系人图片列表 ${contactPictureUrlList} Get From Dictionary ${reps.json()['data']} contactPictureUrlList #联系人图片列表
${communityQrCodeUrlList} Get From Dictionary ${reps.json()['data']} communityQrCodeUrlList #社群二维码图片列表 ${communityQrCodeUrlList} Get From Dictionary ${reps.json()['data']} communityQrCodeUrlList #社群二维码图片列表
@ -28,16 +25,26 @@ Library DatabaseLibrary
Set Global Variable ${communityQrCodeUrl} Set Global Variable ${communityQrCodeUrl}
END END
遍历社群列表
FOR ${records} IN @{records}
${enable} Get From Dictionary ${records} enable #社群状态
${communityId} Get From Dictionary ${records} id #社群id
${communityName} Get From Dictionary ${records} name #社群name
Exit For Loop If ${communityId}==995313929934737408 and ${enable}==true #社群id和状态为启用
Set Global Variable ${communityId}
Set Global Variable ${communityName}
创建${dating}社群
#创建社群
FOR ${admin_header} IN @{Aheader_list}
Create Session dating ${${dating}.dating域名} ${admin_header}
${DateTime} Get Current Date result_format%Y-%m-%d #获取年月日
${Time} Get Current Date result_format%Y%m%d%H%M%S #获取时间戳
${data} Set Variable {"name":"测试社群${DateTime}","communityCode":"${Time}","depict":"测试社群${DateTime}","coverUrlList":["https://dating-agency-test.oss-accelerate.aliyuncs.com/cloudprint_b9daff2e-eb00-47c7-b4d0-3067c66247e9.png"],"communityQrCodeUrlList":["https://dating-agency-test.oss-accelerate.aliyuncs.com/fc1a3fd43fedbf527e344ef3e652e62.jpg"],"contactPictureUrlList":["https://dating-agency-test.oss-accelerate.aliyuncs.com/9c8c0fb5b9c22bf0124f12ff0120f22.jpg"]}
${reps} POST On Session dating dating-agency-service/user/create/association ${data.encode('utf-8')}
${message} Get From Dictionary ${reps.json()} message
Should Be Equal As Strings ${message} successful #断言
随机获取社群信息
END END
随机获取社群信息
${communityData} Evaluate random.choice(${records}) random #随机获取一个社群
${communityId} Get From Dictionary ${communityData} id #社群id
${communityName} Get From Dictionary ${communityData} name #社群name
Set Global Variable ${communityId}
Set Global Variable ${communityName}
查询${dating}平台商品定价列表 查询${dating}平台商品定价列表
#商品定价列表 #商品定价列表
FOR ${admin_header} IN @{Aheader_list} FOR ${admin_header} IN @{Aheader_list}

Loading…
Cancel
Save