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

62 lines
3.5 KiB

*** Settings ***
Documentation \#登录客户端
Test Setup
Library urllib3
Library Collections
Library RequestsLibrary
*** Test Cases ***
user_login
#验证码登录
Disable Warnings
Create Session ZTBT ${uecclient} ${client_login_header}
${data} Create Dictionary account=${client_account} captcha=${client_password} accountType=2
${respones} POST On Session ZTBT uec/authorize/by-captcha json=${data}
${token} Get From Dictionary ${respones.json()['data']} token
Set Global Variable ${token}
login_token
#转换业务token
Create Session ZTBT ${ztbclient} ${client_login_header}
${token1} Create Dictionary loginToken=${token}
${reps} Post On Session ZTBT ztb-user-enterprise-service/authorize/get/product-line-token/by/login-token json=${token1}
${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id
${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token
Set Global Variable ${userId}
Set Global Variable ${gettoken}
get_baseInfo
#获取用户基础信息
Create Session baseinfo ${ztbclient} ${client_firstlogin_header}
${reps} GET On Session baseinfo ztb-supply-chain-service/get/user/base-info
${realName} Get From Dictionary ${reps.json()['data']} realName #获取用户真实姓名
${organizationList} Get From Dictionary ${reps.json()['data']} organizationList #用户组织列表
FOR ${items} IN @{organizationList}
${orgId} Get From Dictionary ${items} id #组织id
${orgfullName} Get From Dictionary ${items} fullName #组织名称
${packerBaseInfo} Get From Dictionary ${items} packerBaseInfo #组织工厂信息
Exit For Loop If '${orgfullName}'=='长沙中联泵业股份有限公司'
END
${packerId} Get From Dictionary ${packerBaseInfo['scrapPaperPackingFactoryList'][0]} id #组织工厂id
${packerName} Get From Dictionary ${packerBaseInfo['scrapPaperPackingFactoryList'][0]} name #组织工厂名称
${client_headerT} Set Variable {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528','X-ORGANIZATION-ID':'${orgId}','X-PACKING-FACTORY-ID':'${packerId}'} #企业组织header
Set Global Variable ${orgId}
Set Global Variable ${realName}
Set Global Variable ${packerId}
Set Global Variable ${packerName}
Set Global Variable ${orgfullName}
Set Global Variable ${client_headerT}
get_Enterprise_baseInfo
#切换组织--企业
Create Session baseinfo ${ztbclient} ${client_headerT}
${reps} GET On Session baseinfo ztb-supply-chain-service/get/user/base-info
${organizationList} Get From Dictionary ${reps.json()['data']} organizationList #用户组织列表
FOR ${items} IN @{organizationList}
${orgfullName} Get From Dictionary ${items} fullName #组织名称
${enterpriseInfo} Get From Dictionary ${items} enterpriseInfo #组织企业信息
${qualificationType} Get From Dictionary ${items} qualificationType
Exit For Loop If '${orgfullName}'=='长沙中联泵业股份有限公司'
END
${salesTaxPoint} Get From Dictionary ${enterpriseInfo} salesTaxPoint
Set Global Variable ${salesTaxPoint}