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

65 lines
3.7 KiB

*** Settings ***
Documentation \#登录客户端
Test Setup
Library urllib3
Library Collections
Library RequestsLibrary
Library ExcelLibrary
*** 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
${client_firstlogin_header} Set Variable {'Content-Type':'application/json','Authorization':'QNT ${gettoken}','X-APP-ID':'470236309865238528'} #移动端首次登录header
Set Global Variable ${userId}
Set Global Variable ${gettoken}
Set Global Variable ${client_firstlogin_header}
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_headerP} 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_headerP}
get_Personal_baseInfo
#切换组织--个人
Create Session baseinfo ${ztbclient} ${client_headerP}
${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} Set Variable 2051
Set Global Variable ${salesTaxPoint}