*** Settings *** Library DatabaseLibrary Library RequestsLibrary Library Collections Library urllib3 *** Variables *** &{cloudfactory_supplierfocus_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier_focus} ${uecclient} https://api-client-uec-test.qniao.cn ${yytclient} https://api-client-yyt-test.qniao.cn *** Test Cases *** operate_save_virtual_supplier Disable Warnings Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${virtual_supplier_name} Set Variable autotest_virtualsupplier_name ${virtual_supplier_details} Set Variable autotest_virtual_supplier_details ${virtual_supplier_contactname} Set Variable autotest_virtual_supplier_contactname ${virtual_supplier_contactmoblie} Set Variable 13800138000 ${virtual_supplier_provinceid} Set Variable 440000 ${virtual_supplier_cityid} Set Variable 440100 ${virtual_supplier_districtid} Set Variable 440106 ${virtual_supplier_streetid} Set Variable 440106003 ${virtual_supplier_provincename} Set Variable 广东省 ${virtual_supplier_cityname} Set Variable 广州市 ${virtual_supplier_districtname} Set Variable 天河区 ${virtual_supplier_streetname} Set Variable 车陂街道 ${body} Set Variable {"name":"${virtual_supplier_name}","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 yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/save ${body.encode("utf8")} 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"]} Should Be Equal As Strings ${virtual_supplier_name} ${response.json()["data"]["name"]} sleep 1 operate_get_virtual_supplier_list Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${response} Get On Session yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/page 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_paper_id} Get From Dictionary ${response.json()["data"]["records"][0]} id Set Global Variable ${supplier_paper_id} operate_update_virtual_supplier_status_deactivate Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${body} Set Variable {"id":"${supplier_paper_id}","status":0} #虚拟供应商状态 0禁用 1启用 ${response} POST On Session yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/updatestatus ${body.encode("utf8")} 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"]} operate_update_virtual_supplier_status_enable Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${body} Set Variable {"id":"${supplier_paper_id}","status":1} #虚拟供应商状态 0禁用 1启用 ${response} POST On Session yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/updatestatus ${body.encode("utf8")} 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"]} operate_create_enterprise_with_supplier_paper Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${supplier_paper_name} Set Variable autotest_supplier_paper_name ${supplier_paper_type} Set Variable 2 #企业类型 1云印客户 2印刷包装厂 3造纸厂 4打包厂 5原纸供应商 6设备供应商 7其他 ${supplier_paper_uniformSocialCreditCode} Set Variable autotest91440101MA59F2J10M ${supplier_paper_legalPersonName} Set Variable autotest_legalperson ${supplier_paper_legalPersonIdCardNo} Set Variable autotest_legalpersonidcardno ${supplier_paper_paperSettlementIntervalTypeId} Set Variable 1 #结算周期 1现结 2月结20天 3月结45天 4月结60天 5月结75天 6月结90天 ${supplier_paper_locProvinceId} Set Variable 440000 ${supplier_paper_locCityId} Set Variable 440100 ${supplier_paper_locDistrictId} Set Variable 440106 ${supplier_paper_locStreetId} Set Variable 440106003 ${supplier_paper_locDetail} Set Variable autotest_supplier_paper_details ${supplier_paper_legalPersonIdCardFrontImg} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg ${supplier_paper_legalPersonIdCardBackImg} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg ${supplier_paper_businessLicenseImg} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg ${supplier_paper_contactsname} Set Variable autotest_contactsname ${supplier_paper_mobilePhone} Set Variable autotest_mobilePhone ${supplier_paper_telephone} Set Variable autotest_telephone ${supplier_paper_email} Set Variable autotest_email ${supplier_paper_wechatAccount} Set Variable autotest_wechatAccount ${supplier_paper_remark} Set Variable autotest_remark ${supplier_paper_bankAccountName} Set Variable autotest_bankAccountName ${supplier_paper_bankAccount} Set Variable autotest_bankAccount ${supplier_paper_bankName} Set Variable autotest_bankName ${supplier_paper_accountOpeningBranch} Set Variable autotest_accountOpeningBranch ${supplier_paper_locationBank} Set Variable autotest_locationBank ${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 yytclient /cloud-print-user-center/create/enterprise/with/supplier ${body.encode("utf8")} Set Global Variable ${supplier_paper_name} 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"]} sleep 1 operate_get_virtual_supplier_search Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${param} Set Variable name=${virtual_supplier_name} ${response} Get On Session yytclient /cloud-print-user-center/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_get_supplier_paper_detail Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${response} Get On Session yytclient /cloud-print-user-center/get/enterprise/detail/${supplier_enterprise_id} 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"]} Should Be Equal As Strings ${supplier_enterprise_id} ${response.json()["data"]["enterprise"]["id"]} operate_save_supplier_paper_detail Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${supplier_paper_name} Set Variable autotest_supplier_paper_name ${supplier_paper_type} Set Variable 2 #企业类型 1云印客户 2印刷包装厂 3造纸厂 4打包厂 5原纸供应商 6设备供应商 7其他 ${supplier_paper_uniformSocialCreditCode} Set Variable autotest91440101MA59F2J10M ${supplier_paper_legalPersonName} Set Variable autotest_legalperson ${supplier_paper_legalPersonIdCardNo} Set Variable autotest_legalpersonidcardno ${supplier_paper_paperSettlementIntervalTypeId} Set Variable 1 #结算周期 1现结 2月结20天 3月结45天 4月结60天 5月结75天 6月结90天 ${supplier_paper_locProvinceId} Set Variable 440000 ${supplier_paper_locCityId} Set Variable 440100 ${supplier_paper_locDistrictId} Set Variable 440106 ${supplier_paper_locStreetId} Set Variable 440106003 ${supplier_paper_locDetail} Set Variable autotest_supplier_paper_details ${supplier_paper_legalPersonIdCardFrontImg} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg ${supplier_paper_legalPersonIdCardBackImg} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg ${supplier_paper_businessLicenseImg} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg ${supplier_paper_contactsname} Set Variable autotest_contactsname ${supplier_paper_mobilePhone} Set Variable autotest_mobilePhone ${supplier_paper_telephone} Set Variable autotest_telephone ${supplier_paper_email} Set Variable autotest_email ${supplier_paper_wechatAccount} Set Variable autotest_wechatAccount ${supplier_paper_remark} Set Variable autotest_remark ${supplier_paper_bankAccountName} Set Variable autotest_bankAccountName ${supplier_paper_bankAccount} Set Variable autotest_bankAccount ${supplier_paper_bankName} Set Variable autotest_bankName ${supplier_paper_accountOpeningBranch} Set Variable autotest_accountOpeningBranch ${supplier_paper_locationBank} Set Variable autotest_locationBank ${body} Set Variable {"supplierId":"${supplier_paper_id}","enterprise":{"id": "${supplier_enterprise_id}","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 yytclient /cloud-print-user-center/save/enterprise/detail ${body.encode("utf8")} 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"]} sleep 1 operate_supplier_paper_add_enterprise_administrator Disable Warnings Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${supplier_paper_realname} Set Variable autotest_name_supplier ${supplier_paper_mobile} Set Variable 13123456789 ${body} Set Variable {"supplierEnterpriseId":"${supplier_enterprise_id}","realName":"${supplier_paper_realname}","mobile":"${supplier_paper_mobile}"} ${response} POST On Session yytclient /cloud-print-user-center/add/enterprise-administrator ${body.encode("utf8")} Set Suite Variable ${supplier_paper_mobile} Set Suite Variable ${supplier_paper_realname} 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"]} sleep 1 operate_get_supplier_paper_employee_list Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${param} Set Variable supplierEnterpriseId=${supplier_enterprise_id} ${response} Get On Session yytclient /cloud-print-user-center/get/employee-list 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"]} Should Be Equal As Strings ${supplier_paper_mobile} ${response.json()["data"]["records"][0]["mobile"]} Should Be Equal As Strings ${supplier_paper_realname} ${response.json()["data"]["records"][0]["realName"]}