*** Settings *** Test Teardown Run Keyword If Test Failed Fatal Error Library RequestsLibrary Library Collections Library urllib3 *** Test Cases *** customer_phone Disable Warnings Create Session uecclient ${uecclient} headers=${cloud_factory_customer_header} ${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号 ${account} Set Variable 13012345678 ${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"} #${body} Set Variable {"accountType":${accounttype_customer},"account":"${account_customer}","captcha":"${captcha_customer}"} ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} Log ${response.json()} Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} ${gettoken_customer} Get From Dictionary ${response.json()["data"]} token Set Global Variable ${gettoken_customer} ${userid_customer} Get From Dictionary ${response.json()["data"]} userId Set Global Variable ${userid_customer} #&{cloudfactory_customer_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${gettoken_customer} #Set Global Variable ${cloudfactory_customer_header} customer_login_token Disable Warnings Create Session yytclient ${yytclient} headers=${cloud_factory_customer_header} ${body} Set Variable {"loginToken":"${gettoken_customer}"} ${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${body.encode("utf8")} Log ${response.json()} Should Be Equal As Numbers 200 ${response.status_code} #Should Be Equal As Strings successful ${response.json()["message"]} ${get_status} ${token} Run Keyword And Ignore Error Get From Dictionary ${response.json()} data ${getlogintoken_customer} Set Variable If "${get_status}"=="FAIL" ${gettoken_customer} "${token}"=="None" ${gettoken_customer} ${token} Set Global Variable ${getlogintoken_customer} &{cloudfactory_customer_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer} Set Global Variable ${cloudfactory_customer_header} get_customer_userinfo Disable Warnings Create Session uecclient ${uecclient} headers=${cloudfactory_customer_header} ${response} Get On Session uecclient /uec/get/user-info log ${response.json()} Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} Should Be Equal As Integers ${userid_customer} ${response.json()["data"]["userId"]} #Should Be Equal As Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 get_customer_baseinfo Disable Warnings Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} ${response} Get On Session yytclient cloud-print-user-center/get/base-info log ${response.json()} Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} #Should Be Equal As Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 get_customer_useridentity Disable Warnings Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} ${response} Get On Session yytclient cloud-print-user-center/get/user/identity log ${response.json()} Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} #Should Be Equal As Integers 3 ${response.json()["data"]["type"]} #身份 0无企业用户 1印包未开户 2印包已开户 3印包已授信 4原纸未开户 5原纸已开户 6原纸集采商