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.
 
 
 

37 lines
2.3 KiB

*** 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订单管理-蓝纸列表