云印通原纸商城
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.7 KiB

*** 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_customer} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号
#${account_customer} Set Variable 13012345678
${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"]}
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"]}
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"]}