diff --git a/Login/Login.robot b/Login/Login.robot index eee3455..fdb394b 100644 --- a/Login/Login.robot +++ b/Login/Login.robot @@ -16,4 +16,5 @@ Plogin WLogin Given 用户打开小程序 + Then 重新进入小程序 #Then 微信一键登录 diff --git a/Login/LoginResource.robot b/Login/LoginResource.robot index d17a65a..6cd159e 100644 --- a/Login/LoginResource.robot +++ b/Login/LoginResource.robot @@ -14,11 +14,18 @@ Library AppiumLibrary Input Text xpath=//android.widget.EditText[@resource-id='com.tencent.mm:id/bxz'] 盒版拼拼 #文本框输入:盒版拼拼 Click Element xpath=//android.widget.TextView[@text='盒版拼拼'] #点击搜索的结果 sleep 1 - Close Application + #Close Application 微信一键登录 - 用户打开小程序 输入手机号获取验证码 登录 + +重新进入小程序 + #重新进入小程序 + Click Element xpath=//android.widget.ImageButton[@content-desc='更多'] #点击“...” + sleep 1 + Click Element xpath=//android.support.v7.widget.RecyclerView[@resource-id='com.tencent.mm:id/ab8']/android.widget.LinearLayout[4]/android.widget.RelativeLayout[1]/android.widget.ImageView[2] #重新进入小程序 + sleep 1 + Close Application diff --git a/Opr-Center-RF-Api/000Login/LoginCase.robot b/Opr-Center-RF-Api/000Login/LoginCase.robot new file mode 100644 index 0000000..18705b2 --- /dev/null +++ b/Opr-Center-RF-Api/000Login/LoginCase.robot @@ -0,0 +1,10 @@ +*** Settings *** +Suite Setup Import Variables D:\\LYL\\Study\\Robot_framework\\space\\Opr-Center-RF-Api\\000Login\\login.yaml +Resource LoginResource.robot + +*** Test Cases *** +WebLogin + [Template] ${user}手机验证码登录opr运营端并查看订单管理-蓝纸 + 用户1 + 用户2 + 用户3 diff --git a/Opr-Center-RF-Api/000Login/LoginResource.robot b/Opr-Center-RF-Api/000Login/LoginResource.robot new file mode 100644 index 0000000..1ba2181 --- /dev/null +++ b/Opr-Center-RF-Api/000Login/LoginResource.robot @@ -0,0 +1,37 @@ +*** Settings *** +Library urllib3 +Library String +Library Collections +Library RequestsLibrary + +*** Keywords *** +用户${user}使用手机验证码登录${Web_site}运营端 + #登录UEC + Disable Warnings + Create Session opr-center ${${Web_site}.UEC域名} ${${Web_site}.Header} + ${Data} Set Variable { \ \ \ \ \ \ \ \ \ \ "account": \ "${${user}.手机号}", \ \ \ \ \ \ \ \ \ \ "accountType": \ 2, \ \ \ \ \ \ \ \ \ \ "captcha": \ "${${user}.验证码}" } + ${reps} POST On Session opr-center uec/authorize/by-captcha ${Data.encode('utf-8')} + Sleep 1 + ${token} Get From Dictionary ${reps.json()['data']} token #获取UECtoken + ${message} Get From Dictionary ${reps.json()} message #获取返回的message + Set Global Variable ${token} + #转换业务线token + Create Session opr-center ${${Web_site}.Client域名} ${${Web_site}.Header} + ${LoginToken} Set Variable { \ \ \ \ \ \ \ \ \ \ "loginToken": \ "${token}" } + ${reps} POST On Session opr-center cloud-print-user-center/authorize/get/product-line-token/by/login-token ${LoginToken.encode('utf-8')} + ${Token} Get From Dictionary ${reps.json()} data + #${Login_Header} Set Variable {'Content-Type':'application/json','X-APP-ID':'503258978847966425','Authorization':'QNT ${Token}'} + ${Base_Header} Set Variable {'Content-Type':'application/json','X-APP-ID':'503258978847966425','Authorization':'QNT ${Token}','X-Enterprise-Id':'723635193163943936','X-Factory-Id':'546450842056790018','X-Organization-Id':'723635193096835072'} + #Set Global Variable ${Login_Header} + Set Global Variable ${Base_Header} + #获取用户基本信息 + #${reps} GET On Session opr-center yyt-uec/get/base-info + +用户${user}查看${Web_site}订单管理-蓝纸列表 + #用户查看订单管理页面 + Create Session opr-center ${${Web_site}.Client域名} ${Base_Header} + ${reps} GET On Session opr-center printing-packaging-factory-service/user/page/product/batch/sales params=status=4&pageNum=1&pageSize=10 + +${user}手机验证码登录opr运营端并查看订单管理-蓝纸 + Given 用户${user}使用手机验证码登录opr运营端 + Then 用户${user}查看opr订单管理-蓝纸列表 diff --git a/Opr-Center-RF-Api/000Login/__init__.robot b/Opr-Center-RF-Api/000Login/__init__.robot new file mode 100644 index 0000000..e69de29 diff --git a/Opr-Center-RF-Api/000Login/login.yaml b/Opr-Center-RF-Api/000Login/login.yaml new file mode 100644 index 0000000..3eb0202 --- /dev/null +++ b/Opr-Center-RF-Api/000Login/login.yaml @@ -0,0 +1,17 @@ +opr: + UEC域名: https://api-client-uec-test.qniao.cn + Client域名: https://api-client-yyt-test.qniao.cn + Header: {'Content-Type':'application/json','X-APP-ID':'503258978847966425'} + + +用户1: + 手机号: 15014242835 + 验证码: 888888 + +用户2: + 手机号: 19128859944 + 验证码: 888888 + +用户3: + 手机号: 18814092561 + 验证码: 888888 \ No newline at end of file diff --git a/Opr-Center-RF-Api/000Login/新建 文本文档.txt b/Opr-Center-RF-Api/000Login/新建 文本文档.txt new file mode 100644 index 0000000..6a252e3 --- /dev/null +++ b/Opr-Center-RF-Api/000Login/新建 文本文档.txt @@ -0,0 +1,14 @@ +opr-center: + 登录页URL: https://opr-center-test.qniao.cn/#/user/login + +用户1: + 手机号: 15014242835 + 验证码: 888888 + +用户2: + 手机号: 15014242835 + 验证码: 666666 + +用户3: + 手机号: 10000000000 + 验证码: 888888 \ No newline at end of file diff --git a/WriteInfo/InfoResource.robot b/WriteInfo/InfoResource.robot new file mode 100644 index 0000000..c48cf64 --- /dev/null +++ b/WriteInfo/InfoResource.robot @@ -0,0 +1,24 @@ +*** Settings *** +Library urllib3 +Library String +Library Collections +Library RequestsLibrary + +*** Keywords *** +性别 + +城市 + +出生年份 + +身高 + +学历 + +婚姻状况 + +月收入 + +昵称 + +返回上一步 diff --git a/WriteInfo/Infomation.robot b/WriteInfo/Infomation.robot new file mode 100644 index 0000000..909f6e5 --- /dev/null +++ b/WriteInfo/Infomation.robot @@ -0,0 +1,66 @@ +*** Settings *** +Suite Setup Import Variables D:\LYL\Study\Robot_framework\space\Dating-agency\DA_data.yaml +Resource InfoResource.robot +Resource ../Login/LoginResource.robot +Library Collections +Library RequestsLibrary + +*** Test Cases *** +Info + Given 用户打开小程序 + Then 性别 + And 城市 + And 出生年份 + And 身高 + And 学历 + And 婚姻状况 + And 月收入 + And 昵称 + +sex_info + #选择性别 + Given 用户打开小程序 + Then 性别 + And 重新进入小程序 + +city_info + #选择推荐城市 + Given 用户打开小程序 + Then 城市 + And 返回上一步 + And 重新进入小程序 + +age_info + #选择出生年份 + Given 用户打开小程序 + Then 出生年份 + And 返回上一步 + And 重新进入小程序 + +hight_info + #选择身高 + Given 用户打开小程序 + Then 身高 + And 返回上一步 + And 重新进入小程序 + +edu_info + #选择学历 + Given 用户打开小程序 + Then 学历 + And 返回上一步 + And 重新进入小程序 + +marry_info + #选择婚姻状况 + Given 用户打开小程序 + Then 婚姻状况 + And 返回上一步 + And 重新进入小程序 + +money_info + #选择月收入 + Given 用户打开小程序 + Then 月收入 + And 返回上一步 + And 重新进入小程序 diff --git a/WriteInfo/__init__.robot b/WriteInfo/__init__.robot new file mode 100644 index 0000000..a69b32d --- /dev/null +++ b/WriteInfo/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Suite Setup