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

48 lines
3.4 KiB

*** Settings ***
Library Collections
Library RequestsLibrary
Library DatabaseLibrary
Library urllib3
*** Test Cases ***
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
${ztbsc_traders_header} Set Variable {'Content-Type':'application/json','Authorization':'QNT ${T_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'721760754042277888'} #代理商端请求头数据
Set Global Variable ${T_userId}
Set Global Variable ${T_token}
Set Global Variable ${ztbsc_traders_header}
#获取用户组织信息
Create Session ZTBT ${ztbclient} ${ztbsc_traders_header}
${reps} GET On Session ZTBT ztb-supply-chain-service/get/agent/user-base-info
${TraderOrgInfoList} Get From Dictionary ${reps.json()['data']} agentOrgInfoList #用户代理商类型组织列表
FOR ${items} IN @{TraderOrgInfoList}
${trader_orgId} Get From Dictionary ${items} orgId #纸厂组织id
${trader_name} Get From Dictionary ${items} name #纸厂组织名称
Exit For Loop If '${trader_name}'=='${paperMillFinancialServiceProviderName}'
END
${ztbsc_traders_header} Set Variable {'Content-Type':'application/json','Authorization':'QNT ${T_token}','X-APP-ID':'503258978847966406','X-ORGANIZATION-ID':'${trader_orgId}'} #代理商端切换组织后请求头数据
Set Global Variable ${trader_name}
Set Global Variable ${ztbsc_traders_header}
Agent_collection_list
#代理商端收款管理
Create Session factoring ${ztbclient} ${ztbsc_traders_header}
${reps} GET On Session factoring ztb-supply-chain-service/user/get/receivable-order-page params=status=1&supplyChainInstanceId=${supplyChainInstanceId}&pageNum=1&pageSize=10
${recycleId} Get From Dictionary ${reps.json()['data']['records'][0]} id #代理商收款id
#代理商发起融资
${TraderData} Set Variable { \ \ \ \ "idList":[ \ \ \ \ \ \ \ \ "${recycleId}" \ \ \ \ ] }
${reps} POST On Session factoring ztb-supply-chain-service/user/apply/packer/factoring ${TraderData.encode('utf-8')}
Should Be Equal As Strings ${reps.json()['message']} successful