纸通宝新交易版
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.
 
 

112 lines
7.3 KiB

*** Settings ***
Library ExcelLibrary
Library Collections
Library RequestsLibrary
Library urllib3
*** Variables ***
*** Test Cases ***
Papermill_Login
#纸厂web端登录
#验证码登录
Disable Warnings
Create Session papermill ${uecclient} ${ztbsc_papermill_login_header}
${Data} Set Variable { \ \ \ \ "account":"${papermill_account}", \ \ \ \ "accountType":2, \ \ \ \ "captcha":"${papermill_password}", \ \ \ \ "$loginType":"telphone", \ \ \ \ "$isNextAutoLogin":true }
${reps} POST On Session papermill uec/authorize/by-captcha ${Data.encode('utf-8')}
${papermill_token} Get From Dictionary ${reps.json()['data']} token #获取uectoken
Set Global Variable ${papermill_token}
#转换业务token
Create Session ZTBT ${ztbclient} ${ztbsc_papermill_login_header}
${loginToken} Set Variable { \ \ \ \ "loginToken":"${papermill_token}", \ \ \ \ "$configs":{ \ \ \ \ \ \ \ \ "$isBizFailedNotToast":true \ \ \ \ } }
${reps} Post On Session ZTBT ztb-user-enterprise-service/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')}
${PM_userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
${PM_token} Get From Dictionary ${reps.json()["data"]} token #获取token
Set Global Variable ${PM_userId}
Set Global Variable ${PM_token}
#Execl写入数据
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls
Put String To Cell ztbsc 3 20 {'Content-Type':'application/json','Authorization':'QNT ${PM_token}','X-APP-ID':'503258978847966406'} #写入纸厂端请求头数据
Save Excel Datadriven.xls
#数据驱动
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\Datadriven.xls
${ztbsc_papermill_header} Read Cell Data By Name ztbsc D21 #纸厂端header
Set Global Variable ${ztbsc_papermill_header}
sleep 0.5
#获取用户组织信息
Create Session ZTBT ${ztbclient} ${ztbsc_papermill_header}
${reps} GET On Session ZTBT ztb-supply-chain-service/get/paper-mill/user-base-info
${paperMillOrgInfoList} Get From Dictionary ${reps.json()['data']} paperMillOrgInfoList #用户纸厂类型组织列表
FOR ${items} IN @{paperMillOrgInfoList}
${papermill_orgId} Get From Dictionary ${items} orgId #纸厂组织id
${papermill_name} Get From Dictionary ${items} name #纸厂组织名称
Exit For Loop If '${papermill_name}'=='516测试613'
END
Set Global Variable ${papermill_name}
#Execl写入数据
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls
Put String To Cell ztbsc 3 20 {'Content-Type':'application/json','Authorization':'QNT ${PM_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'${papermill_orgId}'} #写入纸厂端请求头数据
Save Excel DatadrivenP.xls
#数据驱动
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenP.xls
${ztbsc_papermill_header} Read Cell Data By Name ztbsc D21 #纸厂端header
Set Global Variable ${ztbsc_papermill_header}
sleep 0.5
Factoring_Login
#保理web端登录
#验证码登录
Disable Warnings
Create Session factoring ${uecclient} ${ztbsc_factoring_login_header}
${Data} Set Variable { \ \ \ \ "account":"${papermill_account}", \ \ \ \ "accountType":2, \ \ \ \ "captcha":"${papermill_password}", \ \ \ \ "$loginType":"telphone", \ \ \ \ "$isNextAutoLogin":true }
${reps} POST On Session factoring uec/authorize/by-captcha ${Data.encode('utf-8')}
${factoring_token} Get From Dictionary ${reps.json()['data']} token #获取uectoken
Set Global Variable ${factoring_token}
#转换业务token
Create Session ZTBT ${uecclient} ${ztbsc_factoring_login_header}
${loginToken} Set Variable { \ \ \ \ "loginToken":"${factoring_token}", \ \ \ \ "$configs":{ \ \ \ \ \ \ \ \ "$isBizFailedNotToast":true \ \ \ \ } }
${reps} Post On Session ZTBT factoring/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')}
${F_userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
${F_token} Get From Dictionary ${reps.json()["data"]} token #获取token
Set Global Variable ${F_userId}
Set Global Variable ${F_token}
#Execl写入数据
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls
Put String To Cell ztbsc 3 24 {'Content-Type':'application/json','Authorization':'QNT ${F_token}','X-APP-ID':'503258978847966410','X-ORGANIZATION-ID':'710132392618233856'} #写入保理商端请求头数据
Save Excel DatadrivenF.xls
#数据驱动
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenF.xls
${ztbsc_factoring_header} Read Cell Data By Name ztbsc D25 #保理商端header
${ztbsc_factoring_login_header} Read Cell Data By Name ztbsc D23 #保理商端登录header
Set Global Variable ${ztbsc_factoring_header}
Set Global Variable ${ztbsc_factoring_login_header}
sleep 0.5
Traders_Login
#代理商web端登录
#验证码登录
Disable Warnings
Create Session traders ${uecclient} ${ztbsc_traders_login_header}
${Data} Set Variable { \ \ \ \ "account":"${papermill_account}", \ \ \ \ "accountType":2, \ \ \ \ "captcha":"${papermill_password}", \ \ \ \ "$loginType":"telphone", \ \ \ \ "$isNextAutoLogin":true }
${reps} POST On Session traders uec/authorize/by-captcha ${Data.encode('utf-8')}
${traders_token} Get From Dictionary ${reps.json()['data']} token #获取uectoken
Set Global Variable ${traders_token}
#转换业务token
Create Session ZTBT ${ztbclient} ${ztbsc_traders_login_header}
${loginToken} Set Variable { \ \ \ \ "loginToken":"${traders_token}", \ \ \ \ "$configs":{ \ \ \ \ \ \ \ \ "$isBizFailedNotToast":true \ \ \ \ } }
${reps} Post On Session ZTBT ztb-user-enterprise-service/authorize/get/product-line-token/by/login-token ${loginToken.encode('utf-8')}
${T_userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
${T_token} Get From Dictionary ${reps.json()["data"]} token #获取token
Set Global Variable ${T_userId}
Set Global Variable ${T_token}
#Execl写入数据
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\数据驱动.xls
Put String To Cell ztbsc 3 17 {'Content-Type':'application/json','Authorization':'QNT ${T_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'721760754042277888'} #写入代理商端请求头数据
Save Excel DatadrivenT.xls
#数据驱动
Open Excel D:\\LYL\\Study\\Robot_framework\\New_Trading\\DatadrivenF.xls
${ztbsc_traders_header} Read Cell Data By Name ztbsc D18 #代理商端header
${ztbsc_traders_login_header} Read Cell Data By Name ztbsc D16 #代理商端登录header
Set Global Variable ${ztbsc_traders_header}
Set Global Variable ${ztbsc_traders_login_header}
sleep 0.5