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

194 lines
16 KiB

*** Settings ***
Library DatabaseLibrary
Library RequestsLibrary
Library Collections
Library urllib3
*** Test Cases ***
operate_save_virtual_supplier
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${body} Set Variable {"name":"${virtual_supplier_name}","shortName":"${virtual_supplier_shortName}","details":"${virtual_supplier_details}","contactName":"${virtual_supplier_contactname}","contactMoblie":"${virtual_supplier_contactmoblie}","provinceName":"${virtual_supplier_provincename}","cityName":"${virtual_supplier_cityname}","districtName":"${virtual_supplier_districtname}","streetName":"${virtual_supplier_streetname}","provinceId":${virtual_supplier_provinceid},"cityId":${virtual_supplier_cityid},"districtId":${virtual_supplier_districtid},"streetId":${virtual_supplier_streetid}}
Set Suite Variable ${virtual_supplier_name}
${response} POST On Session yytops /cloud-print-user-center/admin/supplier/directsalestore/virtual-supplier/save ${body.encode("utf8")}
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 ${virtual_supplier_name} ${response.json()["data"]["name"]}
sleep 1
operate_get_virtual_supplier_list
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${response} Get On Session yytops /trading-center/admin/supplier/directsalestore/virtual-supplier/page
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
${supplier_paper_id} Get From Dictionary ${response.json()["data"]["records"][0]} id
Set Global Variable ${supplier_paper_id}
operate_update_virtual_supplier_status
Disable Warnings
Create Session yytops ${yytops} headers=${operation_backend_header}
${body} Set Variable {"id":"${supplier_paper_id}","status":1} #虚拟供应商状态 0禁用 1启用
${response} POST On Session yytops /cloud-print-user-center/admin/supplier/directsalestore/virtual-supplier/updatestatus ${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_create_enterprise_with_supplier_paper
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${body} Set Variable {"supplierId":"${supplier_paper_id}","enterprise":{"name":"${supplier_paper_name}","locDetail":"${supplier_paper_locDetail}","type":${supplier_paper_type},"uniformSocialCreditCode":"${supplier_paper_uniformSocialCreditCode}","legalPersonIdCardNo":"${supplier_paper_legalPersonIdCardNo}","legalPersonName":"${supplier_paper_legalPersonName}","paperSettlementIntervalTypeId":"${supplier_paper_paperSettlementIntervalTypeId}","locProvinceId":${supplier_paper_locProvinceId},"locCityId":${supplier_paper_locCityId},"locDistrictId":${supplier_paper_locDistrictId},"locStreetId":${supplier_paper_locStreetId},"legalPersonIdCardFrontImg":"${supplier_paper_legalPersonIdCardFrontImg}","legalPersonIdCardBackImg":"${supplier_paper_legalPersonIdCardBackImg}","businessLicenseImg":"${supplier_paper_businessLicenseImg}"},"enterpriseContacts":{"name":"${supplier_paper_contactsname}","mobilePhone":"${supplier_paper_mobilePhone}","telephone":"${supplier_paper_telephone}","email":"${supplier_paper_email}","wechatAccount":"${supplier_paper_wechatAccount}","remark":"${supplier_paper_remark}"},"enterpriseCorporateAccount":{"bankAccountName":"${supplier_paper_bankAccountName}","bankAccount":"${supplier_paper_bankAccount}","bankName":"${supplier_paper_bankName}","accountOpeningBranch":"${supplier_paper_accountOpeningBranch}","locationBank":"${supplier_paper_locationBank}"}}
${response} POST On Session yytops /cloud-print-user-center/admin/create/enterprise/with/supplier ${body.encode("utf8")}
Set Global Variable ${supplier_paper_name}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
sleep 1
operate_get_virtual_supplier_search
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${param} Set Variable name=${virtual_supplier_name}
${response} Get On Session yytops /trading-center/admin/supplier/directsalestore/virtual-supplier/page params=${param}
Log ${response.status_code}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
${supplier_enterprise_id} Get From Dictionary ${response.json()["data"]["records"][0]} enterpriseId
Set Global Variable ${supplier_enterprise_id}
operate_supplier_paper_save_base_info
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${body} Set Variable {"id":"${supplier_enterprise_id}","createTime":null,"updateTime":"${current_date_second}","name":"${supplier_paper_base_info_name}","shortName":"${supplier_paper_base_info_shortName}","receiptRequirement":null,"legalPersonName":"${supplier_paper_base_info_legalPersonName}","legalPersonIdCardNo":"${supplier_paper_base_info_legalPersonIdCardNo}","legalPersonMobile":"${supplier_paper_base_info_legalPersonMobile}","type":${supplier_paper_base_info_type},"registeredCapital":999,"regAddrLongitude":null,"regAddrLatitude":null,"supplierId":null,"annualTurnover":100,"uniformSocialCreditCode":"${supplier_paper_base_info_uniformSocialCreditCode}","locProvinceId":${supplier_paper_base_info_locProvinceId},"locProvinceName":"${supplier_paper_base_info_locprovincename}","locCityId":${supplier_paper_base_info_locCityId},"locCityName":"${supplier_paper_base_info_loccityname}","locDistrictId":${supplier_paper_base_info_locDistrictId},"locDistrictName":"${supplier_paper_base_info_locdistrictname}","locStreetId":${supplier_paper_base_info_locStreetId},"locStreetName":"${supplier_paper_base_info_locstreetname}","locDetail":"${supplier_paper_base_info_locDetail}","businessLicenseImg":"${supplier_paper_base_info_businessLicenseImg}","legalPersonIdCardFrontImg":"${supplier_paper_base_info_legalPersonIdCardFrontImg}","legalPersonIdCardBackImg":"${supplier_paper_base_info_legalPersonIdCardBackImg}"}
${response} POST On Session yytops /cloud-print-user-center/admin/save/supplier/base-info ${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
operate_supplier_paper_save_main_products
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${body} Set Variable {"enterpriseId":"${supplier_enterprise_id}","mainCategoryBrandId":"599233095564136448","mainCategoryId":"638458876659896320","mainProducts":"638458876659896320"}
${response} POST On Session yytops /cloud-print-user-center/admin/save/supplier/main-products ${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_supplier_paper_save_factory_list
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${body} Set Variable {"enterpriseId":"${supplier_enterprise_id}","factoryList":[{"locProvinceName":"${supplier_factory_locprovincename}","locCityName":"${supplier_factory_loccityname}","locDistrictName":"${supplier_factory_locdistrictname}","locStreetName":"${supplier_factory_locstreetname}","locDetail":"${supplier_factory_locDetail}","locProvinceId":${supplier_factory_locProvinceId},"locCityId":${supplier_factory_locCityId},"locDistrictId":${supplier_factory_locDistrictId},"locStreetId":${supplier_factory_locStreetId},"leaseContractImg":"${supplier_factory_leaseContractImg}","factoryPhotos":"${supplier_factory_factoryPhotos}"}]}
${response} POST On Session yytops /cloud-print-user-center/admin/save/factory-list ${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
operate_supplier_paper_save_private_account
Disable Warnings
Create Session uecops ${uecops} headers=${operationbackend_header}
${body} Set Variable {"enterpriseId":"${supplier_enterprise_id}","list":[{"cardholderName":"${supplier_private_account_cardholderName} ","bankCardNumber":"${supplier_private_account_bankCardNumber}","openingBank":"${supplier_private_account_openingBank} "}]}
${response} POST On Session uecops /uec/admin/save/enterprise/private-account ${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_supplier_paper_add_pc_machine
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${body} Set Variable {"enterpriseId":"${supplier_enterprise_id}","id":null,"name":"${supplier_machine_name}","machineType":"${supplier_machineType}"}
${response} POST On Session yytops /capacity-market/add/pc-machine ${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_supplier_paper_add_enterprise_administrator
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${body} Set Variable {"enterpriseId":"${supplier_enterprise_id}","realName":"${supplier_enterprise_administrator_realname}","mobile":${supplier_enterprise_administrator_mobile},"position":"${supplier_enterprise_administrator_position}"}
${response} POST On Session yytops /cloud-print-user-center/admin/save/user/to/enterprise ${body.encode("utf8")}
Set Global Variable ${supplier_enterprise_administrator_mobile}
Set Suite Variable ${supplier_enterprise_administrator_realname}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
operate_get_supplier_paper_base_info
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${response} Get On Session yytops /cloud-print-user-center/admin/get/supplier/base-info/${supplier_enterprise_id}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
operate_get_supplier_paper_settlement_account_info
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${response} Get On Session yytops /cloud-print-user-center/admin/get/supplier/settlement-account-info/${supplier_enterprise_id}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
operate_get_supplier_paper_employee_list
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${param} Set Variable supplierEnterpriseId=${supplier_enterprise_id}
${response} Get On Session yytops /cloud-print-user-center/get/employee-list params=${param}
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_enterprise_administrator_mobile} ${response.json()["data"]["records"][0]["mobile"]}
Should Be Equal As Strings ${supplier_enterprise_administrator_realname} ${response.json()["data"]["records"][0]["realName"]}
operate_get_supplier_paper_machine_list
Disable Warnings
Create Session yytops ${yytops} headers=${operation_backend_header}
${param} Set Variable enterpriseId=${supplier_enterprise_id}
${response} Get On Session yytops /cloud-print-user-center/get/supplier/machine/page 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_supplier_paper_purchase_order_list
Disable Warnings
Create Session yytops ${yytops} headers=${operationbackend_header}
${param} Set Variable enterpriseId=${supplier_enterprise_id}
${response} Get On Session yytops /trading-center/admin/get/purchase-order-list/in/supplier-detail params=${param}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
supplier_phone
Disable Warnings
Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_header}
${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号
${account} Set Variable 13123456789
${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"}
${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 Suite Variable ${gettoken_supplier}
${userid_supplier} Get From Dictionary ${response.json()["data"]} userId
Set Suite Variable ${userid_supplier}
#&{cloudfactorysupplierheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${gettoken_supplier}
#Set Suite Variable ${cloudfactorysupplierheader}
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}