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

125 lines
7.7 KiB

*** Settings ***
Test Teardown Run Keyword If Test Failed Fatal Error
Library DatabaseLibrary
Library RequestsLibrary
Library Collections
Library urllib3
*** Test Cases ***
supplier_phone_captcha
Disable Warnings
Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_header}
#${accounttype_supplier} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号
#${account_supplier} Set Variable 13123456789
${body} Set Variable {"accountType":${accounttype_supplier},"account":"${account_supplier}","captcha":"${captcha_supplier}"}
${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_supplier} Get From Dictionary ${response.json()["data"]} token
Set Global Variable ${gettoken_supplier}
${userid_supplier} Get From Dictionary ${response.json()["data"]} userId
Set Global Variable ${userid_supplier}
&{cloudfactory_supplier_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${gettoken_supplier}
Set Global Variable ${cloudfactory_supplier_header}
customerclue_supplier
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplier_header}
#${supplier_enterprisetype} Set Variable 5 #企业类型 1云印客户 2印刷包装厂 3造纸厂 4打包厂 5原纸供应商 6设备供应商 7其他
${body} Set Variable {"companyName": "${supplier_companyname}","enterpriseType": ${supplier_enterprisetype},"job": "${supplier_job}","name": "${supplier_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
supplier_login_token
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloud_factory_supplier_header}
${body} Set Variable {"loginToken":"${gettoken_supplier}"}
${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_supplier} Set Variable If "${get_status}"=="FAIL" ${gettoken_supplier} "${token}"=="None" ${gettoken_supplier} ${token}
Set Global Variable ${getlogintoken_supplier}
&{cloudfactory_supplier_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier}
Set Global Variable ${cloudfactory_supplier_header}
get_customerclue_supplier
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplier_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 ${supplier_companyname} ${response.json()["data"]["companyName"]}
Should Be Equal As Numbers ${supplier_enterprisetype} ${response.json()["data"]["enterpriseType"]}
Should Be Equal As Strings ${supplier_job} ${response.json()["data"]["job"]}
Should Be Equal As Strings ${supplier_name} ${response.json()["data"]["name"]}
Should Be Equal As Strings ${account_supplier} ${response.json()["data"]["mobile"]}
customerclue_verify_have_join_supplier
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplier_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_supplier
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplier_header}
#${customerclue_type} Set Variable 1 #线索类型 1企业认证 2授信申请
${body} Set Variable {"businessLicense": "${supplier_businesslicense}","idCardBack": "${supplier_idcardback}","idCardFront": "${supplier_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_supplier}
${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
Disable Warnings
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
Disable Warnings
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
Disable Warnings
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"]}