diff --git a/2-Web/SiteActivity/SiteActivityResources.robot b/2-Web/SiteActivity/SiteActivityResources.robot index 6b42210..b0c2ac0 100644 --- a/2-Web/SiteActivity/SiteActivityResources.robot +++ b/2-Web/SiteActivity/SiteActivityResources.robot @@ -172,7 +172,7 @@ Library DatabaseLibrary ${numberParticipants} Evaluate ${numberWoman}+${numberMan} #总人数=女士人数+男士人数 ${activityType} Evaluate "".join(random.sample("01",1)) random,string #活动类型,1线上,0线下 ${realNameSwitch} Set Variable false #参与活动是否需要实名 - ${AvtivityData} Set Variable If ${activityType}==0 {"realNameSwitch":${realNameSwitch},"applyStartTime":"${realNameSwitch}","chargeType":0,"vipActivityId":"${vipActivityId}","goodsName":"${goodsName}","name":"${goodsName}","activityType":${activityType},"applyEndTime":"${applyEndTime}","beginTime":"${beginTime}","endTime":"${endTime}","detailedAddress":"报名后拉群发详细地址","imgList":[{"url":"https://dating-agency-test.oss-accelerate.aliyuncs.com/cloudprint_b9daff2e-eb00-47c7-b4d0-3067c66247e9.png"}],"depict":"${DateTime}测试活动","provinceCode":${provinceCode},"cityCode":${cityCode},"districtCode":${districtCode},"provinceName":"${provinceName}","cityName":"${cityName}","districtName":"${districtName}","mutualAssistanceLimit":0,"numberParticipants":${numberParticipants},"numberMan":${numberMan},"numberWoman":${numberWoman},"id":"","participationAllocations":${participationAllocations}} {"applyStartTime":"${applyStartTime}","name":"${DateTime}测试活动","activityType":${activityType},"applyEndTime":"${applyEndTime}","beginTime":"${beginTime}","endTime":"${endTime}","detailedAddress":"","communityId":"${communityId}","communityName":"${communityName}","imgList":[{"url":"https://dating-agency-test.oss-accelerate.aliyuncs.com/微信图片_20240412144009.png"}],"depict":"${DateTime}测试活动","contactPictureUrl":"${contactPictureUrl}","communityQrCodeUrl":"${communityQrCodeUrl}","mutualAssistanceLimit":0,"numberParticipants":${numberParticipants},"numberMan":${numberMan},"numberWoman":${numberWoman},"participationAllocations":${participationAllocations},"realNameSwitch":${realNameSwitch},"chargeType":0} #活动数据 + ${AvtivityData} Set Variable If ${activityType}==0 {"realNameSwitch":${realNameSwitch},"applyStartTime":"${applyStartTime}","chargeType":0,"vipActivityId":"${vipActivityId}","goodsName":"${goodsName}","name":"${goodsName}","activityType":${activityType},"applyEndTime":"${applyEndTime}","beginTime":"${beginTime}","endTime":"${endTime}","detailedAddress":"报名后拉群发详细地址","imgList":[{"url":"https://dating-agency-test.oss-accelerate.aliyuncs.com/cloudprint_b9daff2e-eb00-47c7-b4d0-3067c66247e9.png"}],"depict":"${DateTime}测试活动","provinceCode":${provinceCode},"cityCode":${cityCode},"districtCode":${districtCode},"provinceName":"${provinceName}","cityName":"${cityName}","districtName":"${districtName}","mutualAssistanceLimit":0,"numberParticipants":${numberParticipants},"numberMan":${numberMan},"numberWoman":${numberWoman},"id":"","participationAllocations":${participationAllocations}} {"applyStartTime":"${applyStartTime}","name":"${DateTime}测试活动","activityType":${activityType},"applyEndTime":"${applyEndTime}","beginTime":"${beginTime}","endTime":"${endTime}","detailedAddress":"","communityId":"${communityId}","communityName":"${communityName}","imgList":[{"url":"https://dating-agency-test.oss-accelerate.aliyuncs.com/微信图片_20240412144009.png"}],"depict":"${DateTime}测试活动","contactPictureUrl":"${contactPictureUrl}","communityQrCodeUrl":"${communityQrCodeUrl}","mutualAssistanceLimit":0,"numberParticipants":${numberParticipants},"numberMan":${numberMan},"numberWoman":${numberWoman},"participationAllocations":${participationAllocations},"realNameSwitch":${realNameSwitch},"chargeType":0} #活动数据 ${reps} POST On Session dating dating-agency-service/user/save/site/activity ${AvtivityData.encode('utf-8')} ${AvtivityId} Get From Dictionary ${reps.json()} data #活动id Set Global Variable ${AvtivityId} diff --git a/LoginUI/Login.robot b/LoginUI/Login.robot index 231ce35..7f8cbe9 100644 --- a/LoginUI/Login.robot +++ b/LoginUI/Login.robot @@ -9,16 +9,15 @@ LoginTest sleep 10 Close Application -Plogin - Given 用户打开小程序 - When 输入手机号获取验证码 - Then 登录 - WLogin Given 用户打开小程序 - Then 重新进入小程序 + #Then 重新进入小程序 #Then 微信一键登录 open Given 读取TXT文件 #Then 数据库操作 + +趣招亲小程序 + Given 小程序UI自动化 + #用户打开小程序 diff --git a/LoginUI/LoginResource.robot b/LoginUI/LoginResource.robot index aa32ff2..b6a4273 100644 --- a/LoginUI/LoginResource.robot +++ b/LoginUI/LoginResource.robot @@ -10,24 +10,18 @@ Library String 用户打开小程序 #UI自动化,连接设备 #用户已登录过,打开小程序直接进入 - Open Application http://127.0.0.1:4723/wd/hub platformName=Android platformVersion=7.1.2 deviceName=127.0.0.1:5555 + Open Application http://127.0.0.1:4723/wd/hub platformName=Android platformVersion=12 deviceName=2MH0224529003183 #... appPackage=com.tencent.mm appActivity=ui.LauncherUI #打开微信 - Click Element xpath=//android.widget.TextView[@text='微信' and @content-desc='微信'] #打开微信 - sleep 2 - Click Element xpath=//android.widget.ImageView[@resource-id='com.tencent.mm:id/he6'] #点击搜索 + #Click Element xpath=//android.widget.TextView[@text='微信' and @content-desc='微信'] #打开微信 + #sleep 2 + #Click Element xpath=//android.widget.ImageView[@resource-id='com.tencent.mm:id/he6'] #点击搜索 #Click Element xpath=//android.widget.EditText[@resource-id='com.tencent.mm:id/bxz'] #点击文本输入框 - sleep 1 - Input Text xpath=//android.widget.EditText[@resource-id='com.tencent.mm:id/bxz'] 盒版拼拼 #文本框输入:盒版拼拼 - sleep 1 - Click Element xpath=//android.widget.TextView[@resource-id='com.tencent.mm:id/ir3' and @text='盒版拼拼'] #点击搜索的结果 - sleep 1 - #Close Application - -微信一键登录 - -输入手机号获取验证码 - -登录 + #sleep 1 + #Input Text xpath=//android.widget.EditText[@resource-id='com.tencent.mm:id/bxz'] 盒版拼拼 #文本框输入:盒版拼拼 + #sleep 1 + #Click Element xpath=//android.widget.TextView[@resource-id='com.tencent.mm:id/ir3' and @text='盒版拼拼'] #点击搜索的结果 + #sleep 1 + Close Application 重新进入小程序 #重新进入小程序 @@ -60,3 +54,26 @@ Library String Disconnect From Database END BuiltIn.Set Global Variable ${userid} + +小程序UI自动化 + #小程序UI自动化 + Open Application http://127.0.0.1:4723/wd/hub platformName=Android platformVersion=9 deviceName=emulator-5554 automationName=uiautomator2 + ${Ysize} Get Window Height #获取屏幕高度 + ${Xsize} Get Window Width #获取屏幕宽度 + ${X1} BuiltIn.Evaluate ${Xsize}*0.5 + ${Y1} BuiltIn.Evaluate ${Ysize}*0.25 + ${Y2} BuiltIn.Evaluate ${Ysize}*0.5 + Swipe ${X1} ${Y1} ${X1} ${Y2} #模拟下拉操作 + Wait Until Page Contains 趣招亲 3 #等待页面出现指定的文本 + Click Element xpath=//android.widget.RelativeLayout[@content-desc=\"趣招亲,\"]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1] #点击“趣招亲”小程序(已登录) + BuiltIn.Sleep 1 + Click Element xpath=//android.view.View[@text=\"我的\"] #进入小程序后点击"我的" + BuiltIn.Sleep 1 + Click Element xpath=//android.view.View[@text=\"微信用户\"] #登录趣招亲 + Wait Until Page Contains 一键登录 3 #等待页面出现指定的文本 + Click Element xpath=//*[@text="我已阅读并同意"] #勾选协议 + Click Element xpath=//*[@text="一键登录"] #一键登录 + Click Element xpath=//android.view.View[@text=\"180****4975\"] #确认手机号登录 + #Wait Until Page Contains 立即完善 3 #等待页面出现指定的文本 + #Click Element xpath=//android.webkit.WebView/android.view.View[2]/android.view.View[1] #立即完善资料 + Close Application diff --git a/Phone.txt b/Phone.txt index d87b2d1..1eff7f6 100644 --- a/Phone.txt +++ b/Phone.txt @@ -126,3 +126,11 @@ 15194265787,888888 15637620489,888888 15157871630,888888 +13276745389,888888 +18747125073,888888 +13467574983,888888 +13679816324,888888 +15174793086,888888 +18996173270,888888 +18539584026,888888 +15873907256,888888 diff --git a/output/log.html b/output/log.html index 8416731..7438d29 100644 --- a/output/log.html +++ b/output/log.html @@ -1806,25 +1806,25 @@ function stopPropagation(event) { window.output = {};