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

120 lines
7.5 KiB

*** Settings ***
Test Teardown Run Keyword If Test Failed Fatal Error
Library DatabaseLibrary
Library RequestsLibrary
Library Collections
Library urllib3
*** Test Cases ***
customer_phone_captcha
Disable Warnings
Create Session uecclient ${uecclient} headers=${cloud_factory_customer_header}
${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}
customerclue_customer
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header}
#${customer_enterprisetype} Set Variable 2 #企业类型 1云印客户 2印刷包装厂 3造纸厂 4打包厂 5原纸供应商 6设备供应商 7其他
${body} Set Variable {"companyName": "${customer_companyname}","enterpriseType": ${customer_enterprisetype},"job": "${customer_job}","name": "${customer_name}"}
${response} POST On Session yytclient /cloud-print-user-center/save/customerclue ${body.encode("utf8")}
Log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
sleep 1
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_customerclue_customer
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header}
${response} Get On Session yytclient /cloud-print-user-center/get/my/customerclue
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 Strings ${customer_companyname} ${response.json()["data"]["companyName"]}
Should Be Equal As Numbers ${customer_enterprisetype} ${response.json()["data"]["enterpriseType"]}
Should Be Equal As Strings ${customer_job} ${response.json()["data"]["job"]}
Should Be Equal As Strings ${customer_name} ${response.json()["data"]["name"]}
Should Be Equal As Strings ${account_customer} ${response.json()["data"]["mobile"]}
customerclue_verify_have_join_customer
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header}
${response} POST On Session yytclient /cloud-print-user-center/verify/have-join-and-fill
log ${response.json()}
Should Be Equal As Strings False ${response.json()["data"]} #是否加入企业 False未加入 True已加入
customerclue_uploadpictures_customer
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header}
#${customerclue_type} Set Variable 1 #线索类型 1企业认证 2授信申请
${body} Set Variable {"businessLicense": "${customer_businesslicense}","idCardBack": "${customer_idcardback}","idCardFront": "${customer_idcardfront}","type": ${customerclue_type}}
${response} POST On Session yytclient /cloud-print-user-center/customerclue/upload-pictures ${body.encode("utf8")}
Log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
operate_get_user_register_list
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${response} Get On Session yytops /cloud-print-user-center/admin/user/get/user-list
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
operate_get_user_register_search
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${param} Set Variable mobile=${account_customer}
${response} Get On Session yytops /cloud-print-user-center/admin/user/get/user-list params=${param}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
operate_get_customerclue_list
Create Session yytops ${yytops} headers=${operationbackend_header}
${response} Get On Session yytops /cloud-print-user-center/admin/get/customerclue/page
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
operate_get_customerclue_search
Create Session yytops ${yytops} headers=${operationbackend_header}
${param} Set Variable status=1 #客户线索状态 1待处理 2已处理
${response} Get On Session yytops /cloud-print-user-center/admin/get/customerclue/page params=${param}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
${customerclue_id} Get From Dictionary ${response.json()["data"]["records"][0]} id
Set Global Variable ${customerclue_id}
operate_handle_customerclue
Create Session yytops ${yytops} headers=${operationbackend_header}
${customerclue_remark} Set Variable autotest_customerclue_remark
${body} Set Variable {"id":"${customerclue_id}","adminId":"${operate_adminid}","name":"${operate_adminname}","remark":"${customerclue_remark}"}
${response} POST On Session yytops /cloud-print-user-center/admin/handle/customerclue ${body.encode("utf8")}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}