From 21c4cce5698904843424997f371c8ea9f3afb379 Mon Sep 17 00:00:00 2001 From: "DESKTOP-74M199N\\qniao" Date: Thu, 9 Sep 2021 09:52:58 +0800 Subject: [PATCH] 2021-09-09 --- 0-Database.robot | 13 + 001.robot | 38 +- 1-Client/2-Createorder.robot | 63 - .../1-APPlogin(master).robot | 64 + .../1.1-APPlogin(Test).robot | 11 +- .../2.1-CreateRegularorder.robot | 123 + .../2.2createActiveorder-1.robot | 75 + .../2.3createActiveorder-2.robot | 74 + .../3-Withdrawal_application.robot | 17 +- .../3.1-Automatic withdrawal.robot | 18 + .../4-Real name authentication.robot | 0 .../5-Add_bank_card.robot | 0 .../6-Enterprise_certification.robot | 5 + 1-Client(Test)/7-Consignment_order.robot | 25 + 1-Client(Test)/__init__.robot | 2 + .../factory.robot | 0 .../New_paper_mill.robot | 77 - .../3-operation management/contract.robot | 18 - .../1-WebLogin}/weblogin.robot | 0 .../1.1-New_PaperMill/New_paper_mill.robot | 153 ++ .../1.2-enterprise_management}/__init__.robot | 0 .../1.2-enterprise_management/__init__.txt | 0 .../enterprise-management.robot | 50 + .../1.3-operation management/contract.robot | 80 + .../Consignment_activities.robot | 139 + .../1-appointment.robot | 39 +- .../2.1-RegularUpload-weightnote.robot | 68 +- .../2.2-RegularUpload-weightnote-1.robot | 205 ++ .../2.3-ActiveUpload-deliverynote.robot | 188 ++ .../3.1-Operation_audit.robot | 77 + .../3.2-Operation_audit.robot | 78 + .../3.3-Operation_audit.robot | 78 + .../4-Financial_audit.robot | 39 + .../5-Sales_receivables.robot | 33 + .../1-Automatic_receipt.robot | 15 +- .../2-Manual_receipt.robot | 2 +- .../2.3-ActiveUpload-weightnote.robot | 207 ++ .../3.3--Operation_audit.robot | 18 +- .../4.3-Financial_audit.robot | 7 +- .../5.3-sales_receivable.robot | 33 + .../4-Consignment_management/__init__.robot | 0 .../5-Consignment_order.robot | 55 + .../5-Data comparison/__init__.txt | 0 __init__.robot | 2 + log.html | 2125 ++++++++++++++ output.xml | 465 ++++ report.html | 2431 +++++++++++++++++ 47 files changed, 6992 insertions(+), 218 deletions(-) create mode 100644 0-Database.robot delete mode 100644 1-Client/2-Createorder.robot create mode 100644 1-Client(Test)/1-APPlogin(master).robot rename 1-Client/1-APPlogin.robot => 1-Client(Test)/1.1-APPlogin(Test).robot (82%) create mode 100644 1-Client(Test)/2.1-CreateRegularorder.robot create mode 100644 1-Client(Test)/2.2createActiveorder-1.robot create mode 100644 1-Client(Test)/2.3createActiveorder-2.robot rename {1-Client => 1-Client(Test)}/3-Withdrawal_application.robot (66%) create mode 100644 1-Client(Test)/3.1-Automatic withdrawal.robot rename {1-Client => 1-Client(Test)}/4-Real name authentication.robot (100%) rename {1-Client => 1-Client(Test)}/5-Add_bank_card.robot (100%) create mode 100644 1-Client(Test)/6-Enterprise_certification.robot create mode 100644 1-Client(Test)/7-Consignment_order.robot create mode 100644 1-Client(Test)/__init__.robot rename {1-Client => 1-Client(Test)}/factory.robot (100%) delete mode 100644 2-Background_system/1-Consignment management/New_paper_mill.robot delete mode 100644 2-Background_system/3-operation management/contract.robot rename {2-Background_system => 2-Background_system(Test)/1-WebLogin}/weblogin.robot (100%) create mode 100644 2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot rename {1-Client => 2-Background_system(Test)/1.2-enterprise_management}/__init__.robot (100%) create mode 100644 2-Background_system(Test)/1.2-enterprise_management/__init__.txt create mode 100644 2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot create mode 100644 2-Background_system(Test)/1.3-operation management/contract.robot create mode 100644 2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot rename {2-Background_system/1-Consignment management => 2-Background_system(Test)/2.1-Consignment management}/1-appointment.robot (63%) rename 2-Background_system/1-Consignment management/2-Upload-weightnote.robot => 2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot (63%) create mode 100644 2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot create mode 100644 2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot create mode 100644 2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot create mode 100644 2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot create mode 100644 2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot create mode 100644 2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot create mode 100644 2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot rename {2-Background_system/2-Withdrawal_application => 2-Background_system(Test)/3-Withdrawal_application}/Withdrawal application/1-Automatic_receipt.robot (64%) rename {2-Background_system/2-Withdrawal_application => 2-Background_system(Test)/3-Withdrawal_application}/Withdrawal application/2-Manual_receipt.robot (94%) create mode 100644 2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot rename 2-Background_system/1-Consignment management/3-Operation_audit.robot => 2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot (75%) rename 2-Background_system/2-Withdrawal_application/4-Financial_audit.robot => 2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot (89%) create mode 100644 2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot create mode 100644 2-Background_system(Test)/4-Consignment_management/__init__.robot create mode 100644 2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot create mode 100644 2-Background_system(Test)/5-Data comparison/__init__.txt create mode 100644 log.html create mode 100644 output.xml create mode 100644 report.html diff --git a/0-Database.robot b/0-Database.robot new file mode 100644 index 0000000..0c611e3 --- /dev/null +++ b/0-Database.robot @@ -0,0 +1,13 @@ +*** Settings *** +Library DatabaseLibrary + +*** Test Cases *** +Connect to database + #连接数据库 + Connect To Database Using Custom Params pymysql host='8.135.8.221',user='root', password='password', \ port=3306,database='ztb_recycle' #连接数据库 + ${username} Query SELECT * FROM `ztb_recycle`.`qn_user` WHERE `real_name` LIKE '%赖勇兰%' #查找数据库ztb_recycle,表qn_user中real_name是赖勇兰的所有数据 + log many ${username} + #Execute Sql String DELETE FROM `ztb_recycle`.`qn_user` WHERE `real_name` LIKE '%赖勇兰%' AND `id` = 584452885719420928 #删除数据 + #Execute Sql String UPDATE `ztb_recycle`.`qn_user` SET `nick_name` = 'GGG' WHERE `id` = 597492076942331904 #修改数据 + #Query SELECT * FROM `ztb_recycle`.`qn_user` WHERE `real_name` LIKE '%赖勇兰%' into outfile 'C:/Users/qniao/Desktop/测试.xls' + Disconnect From Database #断开数据库的连接 diff --git a/001.robot b/001.robot index 4f5a008..d75e3c8 100644 --- a/001.robot +++ b/001.robot @@ -1,6 +1,9 @@ *** Settings *** +Test Timeout 10 seconds Library RequestsLibrary Library Collections +Library DateTime +Library String *** Variables *** ${num} [1,2,3] @@ -13,8 +16,8 @@ ${list} [1,2,3,4,5] #log to console \nvalue: ${value} @{list} Set Variable A B C D FOR ${var} IN @{list} - Run Keyword If '${var}'==B Exit For Loop - log ${var} + Run Keyword If '${var}'==B Exit For Loop + log ${var} #Set Global Variable ${var} 图片base64加密 @@ -22,8 +25,39 @@ ${list} [1,2,3,4,5] ${pic_base64} Evaluate base64.b64encode(open('${filepath}','rb').read()).decode('utf-8') base64 log ${pic_base64} +生成多个随机数 + #获取列表内2个随机数 + ${rand_str} evaluate random.sample([0,1,2,3,4,5],2) random,string + +条件判断后赋值 + #条件判断后赋值 + ${a} Set Variable If 4 + ${a} Set Variable If '${a}'=='null' 1 2 + Set Global Variable ${a} + +数据断言 + ${data} Set Variable a + Should Be Equal ${data} a + +获取时间 + ${datatime} Get Current Date result_format=%Y-%m-%d + ${DT} Add Time To Date ${datatime} 7 days + ${str} Get Substring ${DT} 0 10 + #${time_stamp} Convert Date ${datatime} epoch + #log 年:${time_stamp.year} + #Should Be Equal As Integers ${DT} 2021 + *** Keywords *** list [Arguments] ${list} ${value} Evaluate random.choice(${num}) random log to console \nvalue: ${value} + +链接redis + #连接redis + ${redis_conn}= Connect To Redis 8.135.8.221 6379 2 qnredis + #Set To Redis ${redis_conn} PAPER_MILL_ID | 01234567890 ${data} + #${data} Get From Redis ${redis_conn} *PAPER_MILL_ID496656259144093696 + #${redis_data} Get From Redis ${redis_conn} PAPER_MILL_ID + ${key_list}= Get Dictionary From Redis Hash ${redis_conn} PAPER_MILL_ID* + ${key_list}= Get All Match Keys ${redis_conn} PAPER_MILL_ID* 50 diff --git a/1-Client/2-Createorder.robot b/1-Client/2-Createorder.robot deleted file mode 100644 index 597778e..0000000 --- a/1-Client/2-Createorder.robot +++ /dev/null @@ -1,63 +0,0 @@ -*** Settings *** -Documentation 创建常规订单 -Library RequestsLibrary -Library Collections -Library DateTime -Library RedisLibrary - -*** Variables *** -${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'} - -*** Test Cases *** -get-factorylist - #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} - Create Session factorylist http://api-client-ztb-test.qniao.cn ${header} - ${reps} Get On Session factorylist recycle-service/get/paper-mill-paper-category-price-list params=cityId=&enableSalesAgent=1&pageNum=1&pageSize=10&listType=0 - #log ${reps.json()} - #Set Global Variable ${reps} - Should Be Equal As Strings ${reps.json()["message"]} successful - log ${reps.json()["data"]["records"]} - ${categoryid} Get From Dictionary ${reps.json()["data"]["records"][0]["paperCategoryList"][1]} categoryId #纸厂品类id - ${unitPrice} Get From Dictionary ${reps.json()["data"]["records"][0]["paperCategoryList"][1]} unitPrice #纸厂品类价格 - ${cumulativeWeight} Get From Dictionary ${reps.json()["data"]["records"][0]} cumulativeWeight #累计已代卖吨数 - Set Global Variable ${categoryid} - Set Global Variable ${unitPrice} - -链接redis - #连接redis - ${redis_conn}= Connect To Redis 8.135.8.221 6379 2 qnredis - ${data} Get From Redis ${redis_conn} 1234567890 - ${redis_data} Get From Redis ${redis_conn} PAPER_MILL_ID - -get-carinfo - #获取使用过的车辆信息 - ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} - Create Session get-carinfo http://api-client-ztb-test.qniao.cn ${header} - ${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info - log ${reps.json()} - ${carNumber} Get From Dictionary ${reps.json()["data"]} records - ${plateNumber1} Evaluate random.choice(${carNumber}) random - log to console \nvalue:${plateNumber1} - ${plateNumber} Get From Dictionary ${plateNumber1} plateNumber #车辆信息 - Set Global Variable ${plateNumber} - -choose-factory - ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} - Create Session choose-factory https://api-client-ztb-test.qniao.cn ${header} - ${reps} Get On Session choose-factory recycle-service/get/paper-mill-paper-category-price-details/612629674392162304 - log ${reps.json()["data"]} - Should Be Equal As Strings ${reps.json()["message"]} successful - -createorder - #下单 - ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} - ${datatime} get current date result_format=%Y-%m-%d - log ${datatime} - ${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"${plateNumber}"}]} - log ${data} - Create Session createorder http://api-client-ztb-test.qniao.cn ${header} - ${reps} Post On Session createorder recycle-service/proxy-sell/create/order ${data.encode('utf-8')} - log ${reps.json()} - Should Be Equal As Strings ${reps.json()["message"]} successful - Set Global Variable ${datatime} - #sleep 10 diff --git a/1-Client(Test)/1-APPlogin(master).robot b/1-Client(Test)/1-APPlogin(master).robot new file mode 100644 index 0000000..34e23ba --- /dev/null +++ b/1-Client(Test)/1-APPlogin(master).robot @@ -0,0 +1,64 @@ +*** Settings *** +Suite Setup +Library RequestsLibrary +Library Collections +Library urllib3 +Library DatabaseLibrary + +*** Variables *** +${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'} +${url} http://api-client-ztb.qniao.cn + +*** Test Cases *** +Get_verification-code + #获取验证码 + Disable Warnings + ${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 + Create Session ZTBT https://api-client-uec.qniao.cn ${headers} + ${value} Set Variable {"verifiableAccount":"13168550964","verifiableAccountType":1,"purpose":1} + ${reps} Post On Session ZTBT uec/get/auth-captcha ${value.encode('utf-8')} + log ${reps.json()} + sleep 5 + +Connect to database + #正式环境数据库获取验证码 + Connect To Database Using Custom Params pymysql database='user_enterprise_center', host='rm-wz9it4fs5tk7n4tm1zo.mysql.rds.aliyuncs.com', user='uec_root', password='@qniaouecroot88', port=3306 #连接uec数据库 + ${Verification Code1} Query SELECT code FROM user_enterprise_center.qn_captcha WHERE verifiable_account LIKE '%13168550964%' ORDER BY id DESC LIMIT 0,1 + ${text_code} Set Variable ${Verification Code1[0][0]} + Set Global Variable ${text_code} + Disconnect From Database + +userlogin + [Setup] + #验证码登录 + Create Session ZTBT https://api-client-uec.qniao.cn ${header} + #${data} Create Dictionary account=13168550964 captcha=${text_code} accountType=2 + ${data} Set Variable {"accountType":2,"password":null,"account":"13168550964","captcha":"${text_code}"} + ${respones} POST On Session ZTBT uec/authorize/by-captcha ${data.encode('utf-8')} + log ${respones.status_code} + log ${respones.json()} + ${token} Get From Dictionary ${respones.json()["data"]} token + #log ${respones.json()["data"]["token"]} + Set Global Variable ${token} + [Teardown] + +login-token + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 + Create Session ZTBT ${url} ${header} + ${token1} Create Dictionary loginToken=${token} + ${reps} Post On Session ZTBT recycle-user-center/authorize/get/product-line-token/by/login-token json=${token1} + ${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token + ${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + log ${reps.json()["data"]["token"]} + Set Global Variable ${gettoken} + Set Global Variable ${userId} + +getuserinfo + #获取用户信息 + ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} + Create Session baseinfo ${url} ${header} + ${reps} Get On Session baseinfo recycle-service/user/get/base-info + ${realName} Get From Dictionary ${reps.json()["data"]} realName #获取实名 + ${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + Set Global Variable ${realName} + Set Global Variable ${userId} diff --git a/1-Client/1-APPlogin.robot b/1-Client(Test)/1.1-APPlogin(Test).robot similarity index 82% rename from 1-Client/1-APPlogin.robot rename to 1-Client(Test)/1.1-APPlogin(Test).robot index 6f2cab1..1073546 100644 --- a/1-Client/1-APPlogin.robot +++ b/1-Client(Test)/1.1-APPlogin(Test).robot @@ -1,7 +1,10 @@ *** Settings *** Suite Setup +Test Timeout Library RequestsLibrary Library Collections +Library urllib3 +Library DatabaseLibrary *** Variables *** ${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'} @@ -11,14 +14,14 @@ ${url} http://api-client-ztb-test.qniao.cn userlogin [Setup] #验证码登录 - #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 - Create Session ZTBT http://api-client-uec-test.qniao.cn ${header} + Disable Warnings + Create Session ZTBT https://api-client-uec-test.qniao.cn ${header} ${data} Create Dictionary account=15014242835 captcha=888888 accountType=2 - ${respones} POST On Session ZTBT /uec/authorize/by-captcha json=${data} + #${data} Set Variable {"accountType":2,"password":null,"account":"13168550964","captcha":"${text_code}"} + ${respones} POST On Session ZTBT uec/authorize/by-captcha json=${data} log ${respones.status_code} log ${respones.json()} ${token} Get From Dictionary ${respones.json()["data"]} token - #log ${respones.json()["data"]["token"]} Set Global Variable ${token} [Teardown] diff --git a/1-Client(Test)/2.1-CreateRegularorder.robot b/1-Client(Test)/2.1-CreateRegularorder.robot new file mode 100644 index 0000000..2f99243 --- /dev/null +++ b/1-Client(Test)/2.1-CreateRegularorder.robot @@ -0,0 +1,123 @@ +*** Settings *** +Documentation 创建常规订单 +Test Teardown Run Keyword If Test Failed Fatal Error +Test Timeout 10 seconds +Library RequestsLibrary +Library Collections +Library DateTime +Library RedisLibrary +Library urllib3 + +*** Variables *** +${header} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'} +${url} http://api-client-ztb-test.qniao.cn + +*** Test Cases *** +get-factorylist + #获取代卖列表 + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} + Create Session factorylist http://api-client-ztb-test.qniao.cn ${header} + ${reps} Get On Session factorylist recycle-service/get/paper-mill-paper-category-price-list params=cityId=&enableSalesAgent=1&pageNum=1&pageSize=10&listType=0 + Should Be Equal As Strings ${reps.json()["message"]} successful + ${records} Get From Dictionary ${reps.json()["data"]} records #获取代卖纸厂列表 + FOR ${item} IN @{records} + ${name} Get From Dictionary ${item} name #获取纸厂name + ${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类列表 + ${cumulativeWeight} Get From Dictionary ${item} cumulativeWeight #累计已代卖吨数 + ${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id + ${locProvinceName} Get From Dictionary ${item} locProvinceName #纸厂所在省 + ${locCityName} Get From Dictionary ${item} locCityName #纸厂所在市 + ${locDistrictName} Get From Dictionary ${item} locDistrictName #纸厂所在区 + Exit For Loop If '${name}'=='九一纸厂有限公司' + END + ${value} Evaluate random.choice(${paperCategoryList}) random + log to console \nvalue: ${value} + ${categoryid} Get From Dictionary ${value} categoryId #纸厂品类id + ${categoryName} Get From Dictionary ${value} categoryName #纸厂品类name + ${unitPrice} Get From Dictionary ${value} unitPrice #纸厂品类价格 + ${paperMillAddress} Catenate ${locProvinceName} ${locCityName} ${locDistrictName} + Set Global Variable ${categoryid} + Set Global Variable ${unitPrice} + Set Global Variable ${paperMillId} + Set Global Variable ${paperMillAddress} + Set Global Variable ${categoryName} + +paper-mill-paper-category-price-details + #获取纸厂详情信息 + Create Session ZTBT ${url} ${header} + ${reps} Get On Session ZTBT recycle-service/get/paper-mill-paper-category-price-details/${paperMillId} + log ${reps.json()} + +relation + #获取业务邀请码弹窗 + Create Session ZTBT ${url} ${header} + ${reps} get On Session ZTBT recycle-service/proxy-sell/get/relation + log ${reps,json()} + +relation_code + #填写业务人员邀请码 + Create Session ZTBT ${url} ${header} + ${data} Set Variable {"code":"9999"} + ${reps} Post On Session ZTBT recycle-service/proxy-sell/bind/relation ${data.encode('utf-8')} + log ${reps.json()} + +get-carinfo + #获取使用过的车辆信息 + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} + Create Session get-carinfo http://api-client-ztb-test.qniao.cn ${header} + ${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info + log ${reps.json()} + ${carNumber} Get From Dictionary ${reps.json()["data"]} records #获取车辆列表 + ${plateNumber1} Evaluate random.choice(${carNumber}) random + log to console \nvalue:${plateNumber1} + ${plateNumber} Get From Dictionary ${plateNumber1} plateNumber #车辆信息 + Set Global Variable ${plateNumber} + +choose-factory + #选择纸厂 + ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} + Create Session choose-factory https://api-client-ztb-test.qniao.cn ${header} + ${reps} Get On Session choose-factory recycle-service/get/paper-mill-paper-category-price-details/612629674392162304 + log ${reps.json()["data"]} + Should Be Equal As Strings ${reps.json()["message"]} successful + +save_factory-by-shipment-info + #填写发货信息 + #${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT d6SX3ESr8Jb2tYq/89Ft7ONlmJEiWUarjlNpFfW2lU9rgLvV1vzRLbb1Y4C5/b3g/PxwWTrvGmZUIarJEaEOkQ== + Disable Warnings + ${datatime} Get Current Date result_format=%Y-%m-%d + Create Session ZTBT https://api-client-ztb-test.qniao.cn ${header} + ${data} Set Variable {"packageFactoryName":"${datatime}打包站"} + ${reps} Post On Session ZTBT recycle-user-center/save/factory-by-shipment-info ${data.encode('utf-8')} + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful + +createorder + #创建下单 + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} + ${datatime} get current date result_format=%Y-%m-%d + log ${datatime} + ${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"${plateNumber}"}]} + log ${data} + Create Session createorder http://api-client-ztb-test.qniao.cn ${header} + ${reps} Post On Session createorder recycle-service/proxy-sell/create/order ${data.encode('utf-8')} + ${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号 + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${datatime} + Set Global Variable ${orderId} + +createorder-newcar + #创建下单(填写车辆信息) + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} + ${datatime} get current date result_format=%Y-%m-%d + log ${datatime} + ${data} Set Variable {"paperCategoryId":"${categoryid}" ,"unitPrice":${unitPrice},"totalEstimatedWeight":30000,"customerName":"赖勇兰","deliveryTime":"${datatime}","carInfos":[{"plateNumber":"宁G54321"}]} + log ${data} + Create Session createorder http://api-client-ztb-test.qniao.cn ${header} + ${reps} Post On Session createorder recycle-service/proxy-sell/create/order ${data.encode('utf-8')} + ${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号 + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${datatime} + Set Global Variable ${orderId} diff --git a/1-Client(Test)/2.2createActiveorder-1.robot b/1-Client(Test)/2.2createActiveorder-1.robot new file mode 100644 index 0000000..93ac30e --- /dev/null +++ b/1-Client(Test)/2.2createActiveorder-1.robot @@ -0,0 +1,75 @@ +*** Settings *** +Library DateTime +Library Collections +Library RequestsLibrary + +*** Variables *** +${url} http://api-client-ztb-test.qniao.cn +${headers} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'} + +*** Test Cases *** +proxy-sell-activity_list + #获取活动代卖列表 + Create Session ZTBT ${url} ${headers} + ${repsponse} Get On Session ZTBT recycle-service/proxy-sell-activity/list params=pageNum=1&pageSize=15 + ${records} Get From Dictionary ${repsponse.json()["data"]} records #获取代卖活动列表 + FOR ${item} IN @{records} + ${activityName} Get From Dictionary ${item} activityName #获取活动名称 + ${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类 + ${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id + ${activityId} Get From Dictionary ${item} activityId #获取活动id + Exit For Loop If '${activityName}'=='无账期活动一次' + END + ${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品列表 + log to console \nvalue: ${Category_value} + ${categoryId} Get From Dictionary ${Category_value} categoryId #获取纸品id + ${categoryName} Get From Dictionary ${Category_value} categoryName #获取纸品名称 + ${unitPrice} Get From Dictionary ${Category_value} unitPrice #获取纸品价格 + Set Global Variable ${paperMillId} + Set Global Variable ${activityId} + Set Global Variable ${categoryId} + Set Global Variable ${categoryName} + Set Global Variable ${unitPrice} + +get-carinfo + #获取使用过的车辆信息 + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} + Create Session get-carinfo ${url} ${headers} + ${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info + log ${reps.json()} + ${carNumber} Get From Dictionary ${reps.json()["data"]} records #车辆列表 + ${plateNumber_value} Evaluate random.sample(${carNumber},1) random + log to console \nvalue:${plateNumber_value} + ${plateNumber1} Get From Dictionary ${plateNumber_value[0]} plateNumber #车辆信息1 + #${plateNumber2} Get From Dictionary ${plateNumber_value[1]} plateNumber #车辆信息2 + Set Global Variable ${plateNumber1} + #Set Global Variable ${plateNumber2} + +get_paper-mill-paper-category-price-details + #获取纸厂详情 + Create Session ZTBT ${url} ${headers} + ${reps} Get On Session ZTBT recycle-service/get/paper-mill-paper-category-price-details/${paperMillId} + log ${reps.json()} + +get_relation + #创建用户和业务归属人关系 + Create Session ZTBT ${url} ${headers} + ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/relation + ${bizUserId} Get From Dictionary ${reps.json()["data"]} bizUserId #业务归属人id + ${cusormerId} Get From Dictionary ${reps.json()["data"]} cusormerId #用户id + ${customerName} Get From Dictionary ${reps.json()["data"]} customerName #用户名称 + Set Global Variable ${bizUserId} + Set Global Variable ${cusormerId} + Set Global Variable ${customerName} + +create_order + #创建代卖活动订单-1次付款 + Create Session ZTBT ${url} ${headers} + ${datatime} get current date result_format=%Y-%m-%d + ${order_data} Set Variable { \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "totalEstimatedWeight":30000, \ \ \ \ "activityId":"${activityId}", \ \ \ \ "customerName":"${customerName}", \ \ \ \ "deliveryTime":"${datatime}", \ \ \ \ "carInfos":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "plateNumber":"${plateNumber1}" \ \ \ \ \ \ \ \ } \ \ \ \ ] } + ${reps} Post On Session ZTBT recycle-service/proxy-sell/create/order ${order_data.encode('utf-8')} + log ${reps.json()} + ${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号 + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${orderId} + Set Global Variable ${datatime} diff --git a/1-Client(Test)/2.3createActiveorder-2.robot b/1-Client(Test)/2.3createActiveorder-2.robot new file mode 100644 index 0000000..5277e4c --- /dev/null +++ b/1-Client(Test)/2.3createActiveorder-2.robot @@ -0,0 +1,74 @@ +*** Settings *** +Library DateTime +Library Collections +Library RequestsLibrary + +*** Variables *** +${url} http://api-client-ztb-test.qniao.cn +${headers} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'} + +*** Test Cases *** +proxy-sell-activity_list + #获取活动代卖列表 + Create Session ZTBT ${url} ${headers} + ${repsponse} Get On Session ZTBT recycle-service/proxy-sell-activity/list params=pageNum=1&pageSize=15 + ${records} Get From Dictionary ${repsponse.json()["data"]} records #获取代卖活动列表 + FOR ${item} IN @{records} + ${activityName} Get From Dictionary ${item} activityName #获取活动名称 + ${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类 + ${paperMillId} Get From Dictionary ${item} paperMillId #获取纸厂id + ${activityId} Get From Dictionary ${item} activityId #获取活动id + Exit For Loop If '${activityName}'=='无账期九一(两次)' + END + ${Category_value} Evaluate random.choice(${paperCategoryList}) random #获取纸品 + log to console \nvalue: ${Category_value} + ${categoryId} Get From Dictionary ${Category_value} categoryId #获取纸品id + ${categoryName} Get From Dictionary ${Category_value} categoryName #获取纸品名称 + ${unitPrice} Get From Dictionary ${Category_value} unitPrice #获取纸品价格 + Set Global Variable ${paperMillId} + Set Global Variable ${activityId} + Set Global Variable ${categoryId} + Set Global Variable ${categoryName} + Set Global Variable ${unitPrice} + +get-carinfo + #获取使用过的车辆信息 + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} + Create Session get-carinfo ${url} ${headers} + ${reps} Get On Session get-carinfo recycle-service/proxy-sell/get/his-car-info + log ${reps.json()} + ${carNumber} Get From Dictionary ${reps.json()["data"]} records #车辆列表 + ${plateNumber_value} Evaluate random.sample(${carNumber},1) random + log to console \nvalue:${plateNumber_value} + ${plateNumber1} Get From Dictionary ${plateNumber_value[0]} plateNumber #车辆信息1 + #${plateNumber2} Get From Dictionary ${plateNumber_value[1]} plateNumber #车辆信息2 + Set Global Variable ${plateNumber1} + #Set Global Variable ${plateNumber2} + +get_paper-mill-paper-category-price-details + #获取纸厂详情 + Create Session ZTBT ${url} ${headers} + ${reps} Get On Session ZTBT recycle-service/get/paper-mill-paper-category-price-details/${paperMillId} + log ${reps.json()} + +get_relation + #创建用户和业务归属人关系 + Create Session ZTBT ${url} ${headers} + ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/relation + ${bizUserId} Get From Dictionary ${reps.json()["data"]} bizUserId #业务归属人id + ${cusormerId} Get From Dictionary ${reps.json()["data"]} cusormerId #用户id + ${customerName} Get From Dictionary ${reps.json()["data"]} customerName #用户名称 + Set Global Variable ${bizUserId} + Set Global Variable ${cusormerId} + Set Global Variable ${customerName} + +create_order + #创建代卖活动订单-2次付款 + Create Session ZTBT ${url} ${headers} + ${datatime} get current date result_format=%Y-%m-%d + ${order_data} Set Variable { \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "totalEstimatedWeight":30000, \ \ \ \ "activityId":"${activityId}", \ \ \ \ "customerName":"${customerName}", \ \ \ \ "deliveryTime":"${datatime}", \ \ \ \ "carInfos":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "plateNumber":"${plateNumber1}" \ \ \ \ \ \ \ \ } \ \ \ \ ] } + ${reps} Post On Session ZTBT recycle-service/proxy-sell/create/order ${order_data.encode('utf-8')} + log ${reps.json()} + ${orderId} Get From Dictionary ${reps.json()["data"]} orderId #获取订单编号 + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${orderId} diff --git a/1-Client/3-Withdrawal_application.robot b/1-Client(Test)/3-Withdrawal_application.robot similarity index 66% rename from 1-Client/3-Withdrawal_application.robot rename to 1-Client(Test)/3-Withdrawal_application.robot index 341af4d..3434b3b 100644 --- a/1-Client/3-Withdrawal_application.robot +++ b/1-Client(Test)/3-Withdrawal_application.robot @@ -18,12 +18,15 @@ get_order-withdrawal-list #获取可提现单列表 Create Session ZTBT ${URL} ${header} ${reps_data} Get On Session ZTBT payment-settlement-center/balance/get/order-withdrawal-list - log ${reps_data.json()} - ${tradeOrderId} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} tradeOrderId #交易订单号 - ${提现订单id} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} id #提现订单id - #${orderWithdrawalList} Get From Dictionary ${reps_data.json()["data"]} orderWithdrawalList - #${value} Evaluate random.choice(${orderWithdrawalList} ) random - #log to console \nvalue: ${value} + ${orderWithdrawalList} Get From Dictionary ${reps_data.json()["data"]} orderWithdrawalList #可提现单列表 + FOR ${item} IN @{orderWithdrawalList} + ${status} Get From Dictionary ${item} status #获取提现单状态 + ${tradeOrderId} Get From Dictionary ${item} tradeOrderId #获取提现单订单号 + ${提现订单id} Get From Dictionary ${item} id #获取提现单id + Exit For Loop If '${status}'=='1' + END + #${tradeOrderId} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} tradeOrderId #交易订单号 + #${提现订单id} Get From Dictionary ${reps_data.json()["data"]["orderWithdrawalList"][-1]} id #提现订单id Set Global Variable ${tradeOrderId} Set Global Variable ${提现订单id} @@ -41,7 +44,7 @@ getBankCardList order_withdraw #提交申请提现 Create Session ZTBT ${URL} ${header} - ${data} Set Variable {"bankId":"${银行卡id} ","ids":["${提现订单id} "]} + ${data} Set Variable {"bankId":"${银行卡id}","ids":["${提现订单id}"]} ${reps} Post On Session ZTBT payment-settlement-center/balance/order/withdraw ${data} #log ${reps.json()} ${markedWords} Get From Dictionary ${reps.json()["data"]} markedWords diff --git a/1-Client(Test)/3.1-Automatic withdrawal.robot b/1-Client(Test)/3.1-Automatic withdrawal.robot new file mode 100644 index 0000000..4d895cf --- /dev/null +++ b/1-Client(Test)/3.1-Automatic withdrawal.robot @@ -0,0 +1,18 @@ +*** Settings *** +Library RequestsLibrary +Library DateTime +Library urllib3 + +*** Test Cases *** +login + +Automatic withdrawal + #自动提现 + Disable Warnings + ${headers} Create Dictionary Content-Type=application/x-www-form-urlencoded + ${datatime} Get Current Date result_format=%Y-%m-%d + log ${datatime} + Create Session xxl-job http://xxl-job-admin-test.qniao.cn ${headers} + ${data} Create Dictionary id=2 executorParam={'datatime':'${datatime}','period':'0'} addressList= + ${reps} Post On Session xxl-job xxl-job-admin/jobinfo/trigger data=${data} + #log ${reps.json()} diff --git a/1-Client/4-Real name authentication.robot b/1-Client(Test)/4-Real name authentication.robot similarity index 100% rename from 1-Client/4-Real name authentication.robot rename to 1-Client(Test)/4-Real name authentication.robot diff --git a/1-Client/5-Add_bank_card.robot b/1-Client(Test)/5-Add_bank_card.robot similarity index 100% rename from 1-Client/5-Add_bank_card.robot rename to 1-Client(Test)/5-Add_bank_card.robot diff --git a/1-Client(Test)/6-Enterprise_certification.robot b/1-Client(Test)/6-Enterprise_certification.robot new file mode 100644 index 0000000..b9c214b --- /dev/null +++ b/1-Client(Test)/6-Enterprise_certification.robot @@ -0,0 +1,5 @@ +*** Settings *** +Library Collections +Library RequestsLibrary + +*** Test Cases *** diff --git a/1-Client(Test)/7-Consignment_order.robot b/1-Client(Test)/7-Consignment_order.robot new file mode 100644 index 0000000..6d99e1e --- /dev/null +++ b/1-Client(Test)/7-Consignment_order.robot @@ -0,0 +1,25 @@ +*** Settings *** +Documentation 查看代卖订单 +Library RequestsLibrary +Library Collections +Library DateTime +Library RedisLibrary +Library urllib3 + +*** Variables *** +${header} {'content-type':'application/json','X-APP-ID':'470236309865238528','Authorization':'QNT ${gettoken}'} +${url} http://api-client-ztb-test.qniao.cn + +*** Test Cases *** +get_proxy-order-list + Create Session ZTBT ${url} ${header} + ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order-list params=status=&pageNum=1&pageSize=15 + ${orderId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderId #获取代卖订单编号 + Set Global Variable ${orderId} + +get_proxy-order_details + Create Session ZTBT ${url} ${header} + ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order/${orderId} + ${data} Get From Dictionary ${reps.json()} data + Set Global Variable ${data} + Run Keyword If '${orderId}' in ${data} Log To Console ${data} diff --git a/1-Client(Test)/__init__.robot b/1-Client(Test)/__init__.robot new file mode 100644 index 0000000..4d46599 --- /dev/null +++ b/1-Client(Test)/__init__.robot @@ -0,0 +1,2 @@ +*** Settings *** +Test Setup diff --git a/1-Client/factory.robot b/1-Client(Test)/factory.robot similarity index 100% rename from 1-Client/factory.robot rename to 1-Client(Test)/factory.robot diff --git a/2-Background_system/1-Consignment management/New_paper_mill.robot b/2-Background_system/1-Consignment management/New_paper_mill.robot deleted file mode 100644 index 8bceddf..0000000 --- a/2-Background_system/1-Consignment management/New_paper_mill.robot +++ /dev/null @@ -1,77 +0,0 @@ -*** Settings *** -Library RequestsLibrary -Library Collections -Library requests - -*** Variables *** -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} -${URL} http://api-ops-ztb-test.qniao.cn - -*** Test Cases *** -get_paperMill_list - #获取纸厂列表 - Create Session ZTBT ${URL} ${header} - ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=20 - log ${reps} - Should Be Equal As Strings ${reps.json()["message"]} successful - -get_regions - #获取区域 - Create Session ZTBT http://api-ops-uec.qniao.cn ${header} - ${reps} Get On Session ZTBT uec/get/regions - log ${reps.json()} - ${省区域} Get From Dictionary ${reps.json()} data - log ${省区域} - ${value} Evaluate random.choice(${省区域}) random - log to console \nvalue: ${value} - ${市区域} Get From Dictionary ${value} children #区域省 - log ${市区域} - ${value1} Evaluate random.choice(${市区域}) random - log to console \nvalue: ${value1} - ${区区域} Get From Dictionary ${value1} children - log ${区区域} - ${value2} Evaluate random.choice(${区区域}) random - log to console \nvalue: ${value2} - ${区域id} Get From Dictionary ${value2} id #区区域id - ${区域name} Get From Dictionary ${value2} name #区区域名称 - Set Suite Variable ${区域id} - -paperMill_logo - #上传纸厂logo - #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg - #Create Session ZTBT ${URL} ${dict} - ${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') - ${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') - ${file} Create Dictionary filepath=${filepath} image=${image} - Create Session ZTBT ${URL} - log ${file} - ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} - ${pictures} Get From Dictionary ${result.json()} data - log ${result.content} - Set Global Variable ${pictures} #本地图片 - -get_employer-auditor-list - #获取渠道归属人 - Create Session ZTBT ${URL} ${header} - ${reps} Get On Session ZTBT recycle-service/admin/employer/get/employer-auditor-list params=name= - log ${reps} - ${归属人} Get From Dictionary ${reps.json()} data - ${value} Evaluate random.choice(${归属人}) random - log to console \nvalue: ${value} - ${adminId} Get From Dictionary ${value} adminId #归属人id - ${name} Get From Dictionary ${value} name #归属人名称 - Set Suite Variable ${adminId} - Set Suite Variable ${name} - -New_paper_mill - Create Session ZTBT ${URL} ${header} - ${data} Set Variable { \ \ \ \ "newTime":[ \ ], \ \ \ \ "name":"天河纸业有限公司", \ \ \ \ "locDistrictId":130204, \ \ \ \ "contacts":"", \ \ \ \ "mobile":"", \ \ \ \ "logoImg":"https://qncloudprintfile.oss-cn-shenzhen.aliyuncs.com/cloudprint/1628499726181.jpg", \ \ \ \ "millSupplierNameList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"天河1号" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"天河2号" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "locDetails":"", \ \ \ \ "attentionsReportCar":"", \ \ \ \ "attentionsLoadingCar":"", \ \ \ \ "attentionsArrival":"", \ \ \ \ "attentionsRegulations":"", \ \ \ \ "shortName":"天河纸业", \ \ \ \ "enableSalesAgent":"", \ \ \ \ "paperMillSettlementInfo":{ \ \ \ \ \ \ \ \ "invoicePoint":null, \ \ \ \ \ \ \ \ "invoiceType":null, \ \ \ \ \ \ \ \ "isInvoice":null, \ \ \ \ \ \ \ \ "paperMillId":null, \ \ \ \ \ \ \ \ "paybackIntever":"30" \ \ \ \ }, \ \ \ \ "operatingStrategy":{ \ \ \ \ \ \ \ \ "enableSalesAgent":null, \ \ \ \ \ \ \ \ "fundWarningPercentage":null, \ \ \ \ \ \ \ \ "weightWarningPercentage":null, \ \ \ \ \ \ \ \ "isOperations":null, \ \ \ \ \ \ \ \ "manageNotifyMessage":"该纸厂已暂停接单,请联系相关负责人!", \ \ \ \ \ \ \ \ "proxyPaySurcharge":0.015, \ \ \ \ \ \ \ \ "stopManageThreshold":null, \ \ \ \ \ \ \ \ "surplusFund":null, \ \ \ \ \ \ \ \ "surplusWeight":null, \ \ \ \ \ \ \ \ "adminIds":[ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ \ \ \ \ "paperMillBizAccount":{ \ \ \ \ \ \ \ \ \ \ \ \ "id":"619675947926425600", \ \ \ \ \ \ \ \ \ \ \ \ "name":"李雷刚" \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ "matCharges":null, \ \ \ \ "collectionCharges":null } - ${reps} Post On Session ZTBT recycle-service/admin/paperMill/add/paper-mill ${data.encode('utf-8')} - log ${reps.json()} - -update - Create Session ZTBT http://api-ops-uec.qniao.cn ${header} - ${reps} Get On Session ZTBT uec/get/application/update - Should Be Equal As Strings ${reps.json()["message"]} successful - -*** Keywords *** diff --git a/2-Background_system/3-operation management/contract.robot b/2-Background_system/3-operation management/contract.robot deleted file mode 100644 index acc0ab4..0000000 --- a/2-Background_system/3-operation management/contract.robot +++ /dev/null @@ -1,18 +0,0 @@ -*** Settings *** -Library DateTime -Library Collections -Library RequestsLibrary - -*** Variables *** -${URL} http://api-ops-ztb-test.qniao.cn -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} - -*** Test Cases *** -get_contract_list - #获取合同列表 - Create Session ZTBT ${URL} ${header} - ${response} Get On Session ZTBT recycle-service/admin/contract/get/page-list params=pageNum=1&pageSize=20&status=1 - log ${response.json()} - -get_contract_by_paperMilldName - #通过纸厂查找合同 diff --git a/2-Background_system/weblogin.robot b/2-Background_system(Test)/1-WebLogin/weblogin.robot similarity index 100% rename from 2-Background_system/weblogin.robot rename to 2-Background_system(Test)/1-WebLogin/weblogin.robot diff --git a/2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot b/2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot new file mode 100644 index 0000000..8ad9e40 --- /dev/null +++ b/2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot @@ -0,0 +1,153 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library requests +Library DateTime + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_paperMill_list + #获取纸厂列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=20 + log ${reps} + Should Be Equal As Strings ${reps.json()["message"]} successful + +get_regions + #获取区域 + Create Session ZTBT http://api-ops-uec.qniao.cn ${header} + ${reps} Get On Session ZTBT uec/get/regions + log ${reps.json()} + ${省区域} Get From Dictionary ${reps.json()} data + log ${省区域} + ${value} Evaluate random.choice(${省区域}) random + log to console \nvalue: ${value} + ${市区域} Get From Dictionary ${value} children #区域省 + log ${市区域} + ${value1} Evaluate random.choice(${市区域}) random + log to console \nvalue: ${value1} + ${区区域} Get From Dictionary ${value1} children + log ${区区域} + ${value2} Evaluate random.choice(${区区域}) random + log to console \nvalue: ${value2} + ${区域id} Get From Dictionary ${value2} id #区区域id + ${区域name} Get From Dictionary ${value2} name #区区域名称 + Set Suite Variable ${区域id} + +paperMill_logo + #上传纸厂logo + #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg + #Create Session ZTBT ${URL} ${dict} + ${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') + ${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session ZTBT ${URL} + log ${file} + ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${result.json()} data + log ${result.content} + Set Global Variable ${pictures} #本地图片 + +get_employer-auditor-list + #获取渠道归属人 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/employer/get/employer-auditor-list params=name= + log ${reps} + ${归属人} Get From Dictionary ${reps.json()} data + ${value} Evaluate random.choice(${归属人}) random + log to console \nvalue: ${value} + ${adminId} Get From Dictionary ${value} adminId #归属人id + ${name} Get From Dictionary ${value} name #归属人名称 + Set Suite Variable ${adminId} + Set Suite Variable ${name} + +New_paper_mill + #新建纸厂 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "newTime":[ \ ], \ \ \ \ "name":"宇茂纸业有限公司", \ \ \ \ "locDistrictId":"${区域id}", \ \ \ \ "contacts":"", \ \ \ \ "mobile":"", \ \ \ \ "logoImg":"https://qncloudprintfile.oss-cn-shenzhen.aliyuncs.com/cloudprint/1628499726181.jpg", \ \ \ \ "millSupplierNameList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"宇茂纸业1号" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "account":"宇茂纸业2号" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "locDetails":"", \ \ \ \ "attentionsReportCar":"", \ \ \ \ "attentionsLoadingCar":"", \ \ \ \ "attentionsArrival":"", \ \ \ \ "attentionsRegulations":"", \ \ \ \ "shortName":"宇茂纸业", \ \ \ \ "enableSalesAgent":"", \ \ \ \ "paperMillSettlementInfo":{ \ \ \ \ \ \ \ \ "invoicePoint":null, \ \ \ \ \ \ \ \ "invoiceType":null, \ \ \ \ \ \ \ \ "isInvoice":null, \ \ \ \ \ \ \ \ "paperMillId":null, \ \ \ \ \ \ \ \ "paybackIntever":"30" \ \ \ \ }, \ \ \ \ "operatingStrategy":{ \ \ \ \ \ \ \ \ "enableSalesAgent":1, \ \ \ \ \ \ \ \ "fundWarningPercentage":null, \ \ \ \ \ \ \ \ "weightWarningPercentage":null, \ \ \ \ \ \ \ \ "isOperations":1, \ \ \ \ \ \ \ \ "manageNotifyMessage":"该纸厂已暂停接单,请联系相关负责人!", \ \ \ \ \ \ \ \ "proxyPaySurcharge":0.015, \ \ \ \ \ \ \ \ "stopManageThreshold":null, \ \ \ \ \ \ \ \ "surplusFund":null, \ \ \ \ \ \ \ \ "surplusWeight":null, \ \ \ \ \ \ \ \ "adminIds":[ \ \ \ \ \ \ \ \ \ ], \ \ \ \ \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ \ \ \ \ "paperMillBizAccount":{ \ \ \ \ \ \ \ \ \ \ \ \ "id":"619675947926425600", \ \ \ \ \ \ \ \ \ \ \ \ "name":"李雷刚" \ \ \ \ \ \ \ \ } \ \ \ \ }, \ \ \ \ "paperMillBizId":"619675947926425600", \ \ \ \ "matCharges":null, \ \ \ \ "collectionCharges":null } + ${reps} Post On Session ZTBT recycle-service/admin/paperMill/add/paper-mill ${data.encode('utf-8')} + log ${reps.json()} + +update + Create Session ZTBT http://api-ops-uec.qniao.cn ${header} + ${reps} Get On Session ZTBT uec/get/application/update + Should Be Equal As Strings ${reps.json()["message"]} successful + +get_paperMill_list-1 + #获取纸厂列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=20 + ${paperMillId} Get From Dictionary ${reps.json()["data"]["records"][0]} id #纸厂信息 + ${paperMilld_name} Get From Dictionary ${reps.json()["data"]["records"][0]} name #纸厂name + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${paperMillId} + Set Global Variable ${paperMilld_name} + +get_paper-mill-category + #获取纸厂品类列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId} + log ${reps.json()} + +update_paper-mill-category + #更新纸品品类 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "paperMillCategories":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "categoryName":"1号", \ \ \ \ \ \ \ \ \ \ \ \ "inspectionNote":"" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "categoryName":"2号", \ \ \ \ \ \ \ \ \ \ \ \ "inspectionNote":"" \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "categoryName":"3号", \ \ \ \ \ \ \ \ \ \ \ \ "inspectionNote":"" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "id":"${paperMillId} " } + ${reps} Post On Session ZTBT recycle-service/admin/paperMill/update/paper-mill-category/${paperMillId} ${data.encode('utf-8')} + log ${reps.json()} + +get_paper-mill-category-list + #获取品类列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId} + ${data} Get From Dictionary ${reps.json()} data + ${List} Create List + FOR ${items} IN @{data} + ${paperMillCategoryId} Get From Dictionary ${items} paperMillCategoryId #纸品id + ${categoryName} Get From Dictionary ${items} categoryName #纸品name + Append To List ${List} ${paperMillCategoryId} + END + #${paperMillCategoryId1} Get From Dictionary ${reps.json()["data"][0]} paperMillCategoryId #获取品类1id + #${categoryName1} Get From Dictionary ${reps.json()["data"][0]} categoryName #品类1名称 + #Set Global Variable ${paperMillCategoryId} + #Set Global Variable ${categoryName} + ${List0} Get From List ${List} 0 + ${List1} Get From List ${List} 1 + ${List2} Get From List ${List} 2 + Set Global Variable ${List0} + Set Global Variable ${List1} + Set Global Variable ${List2} + +get_paper-mill-category-price-list + #获取报价列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMillCategory/get/paper-mill-category-price-list params=pageNum=1&pageSize=10&paperMillId=${paperMillId} + log ${reps.json()} + +get_paper-mill-category-price-last + #获取纸厂报价详情 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "paperMillId":"${paperMillId}" } + ${reps} Post On Session ZTBT recycle-service/admin/paperMillCategory/get/paper-mill-category-price-last ${data.encode('utf-8')} + log ${reps.json()} + +add_paper-mill-category-price + #发布最新报价 + Create Session ZTBT ${URL} ${header} + ${Datatime} Get Time + ${data} Set Variable { \ \ \ \ "publishDate":"${Datatime}", \ \ \ \ "paperMillCategoryDetailsEntries":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List0}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.52, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.005 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List1}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.32, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.01 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List2}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.55, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":null \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "paperMillId":"${paperMillId}", \ \ \ \ "time":"${Datatime}" } + ${reps} Post On Session ZTBT recycle-service/admin/paperMillCategory/add/paper-mill-category-price ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + +upadte_paper-mill-category-price + #更新最新报价 + Create Session ZTBT ${URL} ${header} + ${Datatime} Get Time + ${data} Set Variable { \ \ \ \ "publishDate":"${Datatime}", \ \ \ \ "paperMillCategoryDetailsEntries":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List0}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.53, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.005 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List1}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.32, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":0.01 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperCategoryId":"${List2}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":1.55, \ \ \ \ \ \ \ \ \ \ \ \ "publicSubsidies":null \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "paperMillId":"${paperMillId}", \ \ \ \ "time":"${Datatime}" } + ${reps} Post On Session ZTBT recycle-service/admin/paperMillCategory/update/paper-mill-category-price ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + +*** Keywords *** diff --git a/1-Client/__init__.robot b/2-Background_system(Test)/1.2-enterprise_management/__init__.robot similarity index 100% rename from 1-Client/__init__.robot rename to 2-Background_system(Test)/1.2-enterprise_management/__init__.robot diff --git a/2-Background_system(Test)/1.2-enterprise_management/__init__.txt b/2-Background_system(Test)/1.2-enterprise_management/__init__.txt new file mode 100644 index 0000000..e69de29 diff --git a/2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot b/2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot new file mode 100644 index 0000000..6713385 --- /dev/null +++ b/2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot @@ -0,0 +1,50 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library DateTime +Library urllib3 + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} https://api-ops-uec-test.qniao.cn + +*** Test Cases *** +Find_enterprise + #查找企业基本信息 + Disable Warnings + Create Session ZTBT https://api-ops-ztb-test.qniao.cn ${header} + ${reps} Get On Session ZTBT recycle-user-center/admin/get/enterprise-profile-list params=pageNum=1&pageSize=10 + ${records} Get From Dictionary ${reps.json()["data"]} records #企业列表 + FOR ${items} IN @{records} + ${enterpriseName} Get From Dictionary ${items} enterpriseName #企业名称 + ${enterpriseId} Get From Dictionary ${items} enterpriseId #企业id + Exit For Loop If '${enterpriseName}'=='${paperMilld_name}' + END + Set Global Variable ${enterpriseId} + Set Global Variable ${enterpriseName} + +get_enterprise-profile-list + #获取企业列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-user-center/admin/get/enterprise-profile-list pageNum=1&pageSize=10 + log ${reps.json()} + +get_user-list + #获取关联用户信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT uec/admin/get/user/user-list pageNum=1&pageSize=30&keyword=133 + log ${reps.json()} + +Upload_pictures + #上传图片 + #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg + #Create Session ZTBT ${URL} ${dict} + ${filepath} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb') + ${image} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session ZTBT ${URL} + log ${file} + ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${result.json()} data + log ${result.content} + Set Global Variable ${pictures} diff --git a/2-Background_system(Test)/1.3-operation management/contract.robot b/2-Background_system(Test)/1.3-operation management/contract.robot new file mode 100644 index 0000000..0c6cb20 --- /dev/null +++ b/2-Background_system(Test)/1.3-operation management/contract.robot @@ -0,0 +1,80 @@ +*** Settings *** +Library DateTime +Library Collections +Library RequestsLibrary +Library String + +*** Variables *** +${URL} http://api-ops-ztb-test.qniao.cn +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${psc_url} http://api-ops-psc-test.qniao.cn + +*** Test Cases *** +get_contract_list + #获取生效中的合同列表 + Create Session ZTBT ${URL} ${header} + ${response} Get On Session ZTBT recycle-service/admin/contract/get/page-list params=pageNum=1&pageSize=10&status=1 + log ${response.json()} + +get_contract_by_paperMilldName + #通过纸厂查找合同 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/contract/get/page-list params=pageNum=1&pageSize=10&status=1&buyerEnterpriseId=${enterpriseId} + log ${reps.json()} + +Seller_enterprise-list + #获取卖方企业列表 + Create Session ZTBT ${psc_url} ${header} + ${reps} Get On Session ZTBT payment-settlement-center/admin/supplier/get/enterprise-list/serarch-by-name-and-type + log ${reps.json()} + ${data} Get From Dictionary ${reps.json()} data #获取企业列表 + FOR ${items} IN @{data} + ${sellerEnterpriseName} Get From Dictionary ${items} enterpriseName #卖方企业名称 + ${sellerEnterpriseId} Get From Dictionary ${items} enterpriseId #卖方企业id + ${seller_id} Get From Dictionary ${items} id #企业标识符 + Exit For Loop If '${enterpriseName}'=='企业' + END + Set Global Variable ${seller_id} + Set Global Variable ${sellerEnterpriseName} + Set Global Variable ${sellerEnterpriseId} + +Buyer_enterprise-list + #获取买方企业列表 + Create Session ZTBT ${psc_url} ${header} + ${reps} Get On Session ZTBT payment-settlement-center/admin/supplier/get/enterprise-list/serarch-by-name-and-type + log ${reps.json()} + ${data} Get From Dictionary ${reps.json()} data #获取企业列表 + FOR ${items} IN @{data} + ${buyerEnterpriseName} Get From Dictionary ${items} enterpriseName #买方企业名称 + ${buyerEnterpriseId} Get From Dictionary ${items} enterpriseId #买方企业id + ${buyer_id} Get From Dictionary ${items} id #企业标识符 + Exit For Loop If '${enterpriseName}'=='${paperMilld_name}' + END + Set Global Variable ${buyer_id} + Set Global Variable ${buyerEnterpriseName} + Set Global Variable ${buyerEnterpriseId} + +buyer-paper-mill-categories_list + #买方纸厂品类 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/contract/get/buyer-paper-mill-categories/list params=enterpriseId=${enterpriseId} + log ${reps.json()} + ${category_data} Get From Dictionary ${reps.json()} data #获取纸厂所有品类 + ${category_value} Evaluate random.choice(${category_data}) random #获取随机品类信息 + log to console \nvalue: ${category_value} + ${categoryId} Get From Dictionary ${category_value} categoryId #获取品类id + ${categoryName} Get From Dictionary ${category_value} categoryName #品类名称 + ${paperMillId} Get From Dictionary ${category_value} paperMillId #纸厂id + Set Global Variable ${categoryId} + Set Global Variable ${categoryName} + Set Global Variable ${paperMillId} + +create_contract + #创建纸厂合同 + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d + ${New_DataTime} Add Time To Date ${datatime} 10 days + ${str_time} Get Substring ${New_DataTime} 0 10 + ${data} Set Variable { \ \ \ \ "contractCategories":[ \ \ \ \ \ ], \ \ \ \ "limitLine":null, \ \ \ \ "accountPeriod":[ \ \ \ \ \ \ \ \ 30 \ \ \ \ ], \ \ \ \ "settleRules":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "settlePriceIncludeTaxSettleRules":0, \ \ \ \ "contractType":"0", \ \ \ \ "contractNo":"${datatime}合同", \ \ \ \ "accountPeriodType":0, \ \ \ \ "sellerEnterpriseId":"${sellerEnterpriseId}", \ \ \ \ "buyerEnterpriseId":"${buyerEnterpriseId}", \ \ \ \ "hasInvoice":1, \ \ \ \ "taxRefundRate":6.5, \ \ \ \ "startDate":"${datatime}", \ \ \ \ "endDate":"${str_time}", \ \ \ \ "signDateStart":"${datatime}", \ \ \ \ "signDateEnd":"${str_time}", \ \ \ \ "buyerEnterpriseName":"${buyerEnterpriseName}", \ \ \ \ "sellerEnterpriseName":"${sellerEnterpriseName}", \ \ \ \ "hasSubsidiesTax":0 } + ${reps} Post On Session ZTBT recycle-service/admin/contract/create ${data.encode('utf-8')} + log ${reps.json()} diff --git a/2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot b/2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot new file mode 100644 index 0000000..9bb846d --- /dev/null +++ b/2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot @@ -0,0 +1,139 @@ +*** Settings *** +Library DateTime +Library Collections +Library RequestsLibrary +Library String + +*** Variables *** +${URL} http://api-ops-ztb-test.qniao.cn +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} + +*** Test Cases *** +proxy-sell-activity_list + #代卖活动列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell-activity/list params=pageNum=1&pageSize=10&status=1 + ${records} Get From Dictionary ${reps.json()["data"]} records #代卖活动列表 + ${value} Evaluate random.choice(${records}) random + log to console \nvalue: ${value} + ${settlementModes} Get From Dictionary ${value} settlementModes #代卖活动结算方式 + ${settlementMode} Set Variable If '${settlementModes}'=='1' 1 0 + Set Global Variable ${settlementMode} + +get_paper-mill-list + #获取纸厂列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-list params=pageNum=1&pageSize=30&enableSalesAgent=1 + ${records} Get From Dictionary ${reps.json()["data"]} records #获取纸厂列表 + FOR ${items} IN @{records} + ${shortName} Get From Dictionary ${items} shortName #纸厂简称 + ${PaperMillId} Get From Dictionary ${items} id #纸厂id + Exit For Loop If '${shortName}'=='宇茂纸业' + END + Set Global Variable ${shortName} + Set Global Variable ${PaperMillId} + +factory-licence-list + #纸厂企业对照表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-user-center/admin/get/factory-licence-list params=pageNum=1&pageSize=30 + +get-Transaction subject + #获取交易主体 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/list + ${交易数据} Get From Dictionary ${reps.json()} data + #随机获取交易主体 + ${交易信息} Evaluate random.choice(${交易数据}) random + log to console \nvalue:${交易信息} + ${交易主体id} Get From Dictionary ${交易信息} id #交易主体id + ${交易主体name} Get From Dictionary ${交易信息} name #交易主体name + Set Global Variable ${交易主体id} + Set Global Variable ${交易主体name} + +user_search + #参与用户 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell-activity/user/search + ${data} Get From Dictionary ${reps.json()} data #用户列表 + FOR ${items} IN @{data} + ${userId} Get From Dictionary ${items} userId #用户id + ${phone} Get From Dictionary ${items} phone #用户手机号 + Exit For Loop If '${phone}'=='15014242835' + END + Set Global Variable ${userId} + +get_paper-mill-category + #获取纸厂品类 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${PaperMillId} + ${data} Get From Dictionary ${reps.json()} data #纸厂品类列表 + ${value} Evaluate random.choice(${data}) random + log to console \nvalue: ${value} + ${categoryName} Get From Dictionary ${value} categoryName #品类名称 + ${paperMillCategoryId} Get From Dictionary ${value} paperMillCategoryId #品类id + Set Global Variable ${categoryName} + Set Global Variable ${paperMillCategoryId} + +get_mill-supplier-list + #获取纸厂供应商列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/get/mill-supplier-list/${PaperMillId} + ${data} Get From Dictionary ${reps.json()} data #供应商列表 + ${supplier_value} Evaluate random.choice(${data}) random + log to console \nvalue: ${supplier_value} + ${account} Get From Dictionary ${supplier_value} account #供应商名称 + ${merchantAccountId} Get From Dictionary ${supplier_value} merchantAccountId #供应商id + Set Global Variable ${account} + Set Global Variable ${merchantAccountId} + +Upload_pictures + #上传本地图片 + #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg + #Create Session ZTBT ${URL} ${dict} + ${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') + ${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session ZTBT ${URL} + log ${file} + ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${result.json()} data + log ${result.content} + Set Global Variable ${pictures} + +saveOrUpdate-2 + #新增代卖活动(2次) + Create Session ZTBT ${URL} ${header} + ${datatime} Get Time + ${DT} Add Time To Date ${datatime} 2 days + ${DT_str} Get Substring ${DT} 0 19 + ${activity_data} Set Variable { \ \ \ \ "id":null, \ \ \ \ "activityName":"${shortName}-两次", \ \ \ \ "paperMillId":"${PaperMillId}", \ \ \ \ "millSupplierId":"${merchantAccountId}", \ \ \ \ "settlementModes":1, \ \ \ \ "tradeOwnerName":"${交易主体name}", \ \ \ \ "tradeOwnerId":"${交易主体id}", \ \ \ \ "isEntire":0, \ \ \ \ "agreedDeliveryWeight":100000, \ \ \ \ "ruleUrl":"${pictures}", \ \ \ \ "paperMillPaperCategoriesList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryId":"${paperMillCategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryPrice":1.23, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategorySubsidyPrice":0.01 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "activityId":null, \ \ \ \ "users":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "userId":"${userId}", \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":1, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0.015 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "factorys":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "factoryId":null, \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":0, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "startTime":"${datatime}", \ \ \ \ "endTime":"${DT_str}" } + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell-activity/saveOrUpdate ${activity_data.encode('utf-8')} + +saveOrUpdate-1 + #新增代卖活动(1次) + Create Session ZTBT ${URL} ${header} + ${datatime} Get Time + ${DT} Add Time To Date ${datatime} 2 days + ${DT_str} Get Substring ${DT} 0 19 + ${activity_data} Set Variable { \ \ \ \ "id":null, \ \ \ \ "activityName":"${shortName}-一次", \ \ \ \ "paperMillId":"${PaperMillId}", \ \ \ \ "millSupplierId":"${merchantAccountId}", \ \ \ \ "settlementModes":0, \ \ \ \ "tradeOwnerName":"${交易主体name}", \ \ \ \ "tradeOwnerId":"${交易主体id}", \ \ \ \ "isEntire":0, \ \ \ \ "agreedDeliveryWeight":100000, \ \ \ \ "ruleUrl":"${pictures}", \ \ \ \ "paperMillPaperCategoriesList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryId":"${paperMillCategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategoryPrice":1.33, \ \ \ \ \ \ \ \ \ \ \ \ "paperMillPaperCategorySubsidyPrice":0.015 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "activityId":null, \ \ \ \ "users":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "userId":"${userId}", \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":1, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0.02 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "factorys":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "factoryId":null, \ \ \ \ \ \ \ \ \ \ \ \ "paymentModes":0, \ \ \ \ \ \ \ \ \ \ \ \ "surcharge":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "startTime":"${datatime}", \ \ \ \ "endTime":"${DT_str}" } + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell-activity/saveOrUpdate ${activity_data.encode('utf-8')} + +proxy-sell-activity_list1 + #代卖活动列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell-activity/list params=pageNum=1&pageSize=10&status=1 + ${records} Get From Dictionary ${reps.json()["data"]} records #活动列表 + FOR ${items} IN @{records} + ${Activity_id} Get From Dictionary ${items} id #获取活动id + ${activityName} Get From Dictionary ${items} activityName #获取活动名称 + Exit For Loop If '${activityName}'=='${shortName}-一次' + END + Set Global Variable ${Activity_id} + +shutActivity + #结束活动 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable {"activityId":"${Activity_id}"} + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell-activity/shutActivity ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system/1-Consignment management/1-appointment.robot b/2-Background_system(Test)/2.1-Consignment management/1-appointment.robot similarity index 63% rename from 2-Background_system/1-Consignment management/1-appointment.robot rename to 2-Background_system(Test)/2.1-Consignment management/1-appointment.robot index 6ae4d05..b50b42f 100644 --- a/2-Background_system/1-Consignment management/1-appointment.robot +++ b/2-Background_system(Test)/2.1-Consignment management/1-appointment.robot @@ -1,25 +1,50 @@ *** Settings *** +Documentation 预约送货 Library RequestsLibrary Library Collections Library DateTime *** Variables *** -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${URL} http://api-ops-ztb-test.qniao.cn *** Test Cases *** +get_paper-mill-order-reservation-list + Create Session ZTBT ${URL} ${header} + ${reps_data} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-order-reservation-list params=pageNum=1&pageSize=10&status=&orderId=${orderId} + log ${reps_data.json()} + #获取订单编号${orderId}、纸厂id${paperMillId}、订单类型${orderType} + ${orderId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderId #订单编号 + ${paperMillId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillId #纸厂id + ${id} Get From Dictionary ${reps_data.json()["data"]["records"][0]} id #预约id + ${orderType} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderType #订单类型 + ${carNoList} Get From Dictionary ${reps_data.json()["data"]["records"][0]} carNoList #车辆信息列表 + ${paperMillName} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillName #纸厂名称 + ${sellerReservationDate} Get From Dictionary ${reps_data.json()["data"]["records"][0]} sellerReservationDate #送货时间 + #随机获取车辆信息 + ${carList} Evaluate random.choice(${carNoList}) random + log to console \nvalue:${carList} + Should Be Equal As Strings ${reps_data.json()["message"]} successful + Set Global Variable ${orderId} + Set Global Variable ${paperMillId} + Set Global Variable ${id} + Set Global Variable ${paperMillName} + Set Global Variable ${sellerReservationDate} + Set Global Variable ${orderType} + Set Global Variable ${carList} + reservation-list #${header} Create Dictionary X-APP-ID=470236309865238555 Authorization=Token 6b08add42d6bcf73abb935b2adf83525 #获取预约列表信息 - Create Session ZTBT http://api-ops-ztb-test.qniao.cn ${header} - ${reps_data} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-order-reservation-list params=pageNum=1&pageSize=20&status= + Create Session ZTBT ${URL} ${header} + ${reps_data} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-order-reservation-list params=pageNum=1&pageSize=10&status= log ${reps_data.json()} #获取订单编号${orderId}、纸厂id${paperMillId}、订单类型${orderType} ${orderId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderId #订单编号 ${paperMillId} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillId #纸厂id ${id} Get From Dictionary ${reps_data.json()["data"]["records"][0]} id #预约id ${orderType} Get From Dictionary ${reps_data.json()["data"]["records"][0]} orderType #订单类型 - ${carNoList} Get From Dictionary ${reps_data.json()["data"]["records"][0]} carNoList #车辆信息 + ${carNoList} Get From Dictionary ${reps_data.json()["data"]["records"][0]} carNoList #车辆信息列表 ${paperMillName} Get From Dictionary ${reps_data.json()["data"]["records"][0]} paperMillName #纸厂名称 ${sellerReservationDate} Get From Dictionary ${reps_data.json()["data"]["records"][0]} sellerReservationDate #送货时间 #随机获取车辆信息 @@ -51,15 +76,15 @@ get-supplier log to console \nvalue: ${value} ${supplier_id} Get From Dictionary ${value} id #供应商id ${millSupplierName} Get From Dictionary ${value} name #供应商名称 - Set Suite Variable ${supplier_id} - Set Suite Variable ${millSupplierName} + Set Global Variable ${supplier_id} + Set Global Variable ${millSupplierName} Submit-appointment #${headers} Create Dictionary Content-Type=application/json X-APP-ID=470236309865238555 Authorization=Token 6b08add42d6bcf73abb935b2adf83525 #提交预约信息 Create Session ZTBT ${URL} ${header} ${datatime} get current date result_format=%Y-%m-%d - ${data} Set Variable {"attention":"${orderId}","buyerReservationDate":"${datatime}", "id":"${id}","millDeliveryOrderId":"${orderId}","millSupplierId":"${supplier_id}","millSupplierName":"${millSupplierName}","proxySellerSettleType":1,"scrapeOrderId":"${orderId}"} + ${data} Set Variable {"attention":"${orderId}","buyerReservationDate":"${datatime}", "id":"${id}","millDeliveryOrderId":"${orderId}","millSupplierId":"${supplier_id}","millSupplierName":"${millSupplierName}","proxySellerSettleType":0,"scrapeOrderId":"${orderId}"} log ${data} ${reps} Post On Session ZTBT recycle-service/admin/customer-service/update/reservation ${data.encode('utf-8')} Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system/1-Consignment management/2-Upload-weightnote.robot b/2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot similarity index 63% rename from 2-Background_system/1-Consignment management/2-Upload-weightnote.robot rename to 2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot index 8def54a..8c6a80d 100644 --- a/2-Background_system/1-Consignment management/2-Upload-weightnote.robot +++ b/2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot @@ -1,23 +1,26 @@ *** Settings *** +Documentation 上传磅单-常规 +Test Timeout 10 seconds Library Collections Library RequestsLibrary Library DateTime Library requests *** Variables *** -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${URL} http://api-ops-ztb-test.qniao.cn -${filepath} E:\lyl\图片\ChMkKWCUz0SIX9MmADmjEvANMxkAAOa3QAAAAAAOaMq795.jpg *** Test Cases *** get-order-item-list - #查找预约的订单列表 + #查找预约的订单项列表 Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId} log ${reps.json()} ${orderItemId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderItemId #订单项编号 + ${bizOwnerName} Get From Dictionary ${reps.json()["data"]["records"][0]} bizOwnerName #业务归属人name + ${bizOwnerId} Get From Dictionary ${reps.json()["data"]["records"][0]} bizOwnerId #业务归属人id Set Global Variable ${orderItemId} - Should Be Equal As Strings ${reps.json()["data"]["records"][0]["orderId"]} ${orderId} + Should Be Equal ${reps.json()["data"]["records"][0]["orderId"]} ${orderId} get-order-item-details #查看订单列表详情 @@ -32,14 +35,15 @@ get-order-item-details ${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴 ${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID ${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称 - ${settleUtiPrice} Evaluate ${unitPrice}+${publicSubsidies} #结算单价 + ${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies} + ${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价 + ${unitSurcharge} Set Variable If '${unitSurcharge}'=='${None}' 0 ${unitSurcharge} ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id log ${contractId} Set Global Variable ${contractId} Set Global Variable ${unitSurcharge} Set Global Variable ${paperCategoryId} Set Global Variable ${settleUtiPrice} - log ${reps.json()} Set Global Variable ${unitPrice} Set Global Variable ${publicSubsidies} Set Global Variable ${millSupplierId} @@ -50,12 +54,15 @@ get-order-item-details get-Transaction subject #获取交易主体 Create Session ZTBT ${URL} ${header} - ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/list/name - ${交易} Get From Dictionary ${reps.json()} data + ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/list + ${交易数据} Get From Dictionary ${reps.json()} data #随机获取交易主体 - ${交易主体} Evaluate random.choice(${交易}) random - log to console \nvalue:${交易主体} - Set Global Variable ${交易主体} + ${交易信息} Evaluate random.choice(${交易数据}) random + log to console \nvalue:${交易信息} + ${交易主体id} Get From Dictionary ${交易信息} id #交易主体id + ${交易主体name} Get From Dictionary ${交易信息} name #交易主体name + Set Global Variable ${交易主体id} + Set Global Variable ${交易主体name} get-Warehouse #获取所属仓库 @@ -72,16 +79,16 @@ get-Source of funds Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list log ${reps.json()} - #@{data} Get From Dictionary ${reps.json()} data - ${name} Get From Dictionary ${reps.json()["data"][5]} name #资金来源名称 - ${id} Get From Dictionary ${reps.json()["data"][5]} id #资金来源id + ${data} Get From Dictionary ${reps.json()} data + FOR ${item} IN @{data} + log ${item} + ${isDefault} Get From Dictionary ${item} isDefault #获取启用状态 + ${name} Get From Dictionary ${item} name #获取name + ${id} Get From Dictionary ${item} id #获取id + Exit For Loop If '${isDefault}'=='1' + END Set Global Variable ${name} Set Global Variable ${id} - #FOR ${isDefault} IN @{data} - #${isDefault} Set Variable 1 - #Run Keyword If ${isDefault}==1 log ${reps.json()["data"][5]["name"]} - #Set Global Variable ${isDefault} - #\ Run Keyword If '${isDefault}'==5 log @{data} get-contract-list #获取订单纸厂的所有合同信息 @@ -130,6 +137,8 @@ get_contract_by_id ${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税 ${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则 ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 + ${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund} + ${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge} Set Global Variable ${advanceFund} Set Global Variable ${buyerEnterpriseId} Set Global Variable ${taxRefundRate} @@ -159,18 +168,29 @@ Upload_pictures get_repeat_proxy-order #获取重复订单信息 Create Session ZTBT ${URL} ${header} - #${datatime} - ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=13550&weighingDate=${datatime}&orderType=${orderType} - log ${reps.json()} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=17550&weighingDate=${datatime}&orderType=${orderType}&settlePrice= 41953.05 + ${records} Get From Dictionary ${reps.json()["data"]} records #获取重复订单列表 + ${orderItemId_list} Create List + #sleep 0.5 + FOR ${items} IN @{records} + ${orderItemId} Get From Dictionary ${items} orderItemId #重复订单项编号 + Append To List ${orderItemId_list} '''${orderItemId}''' + END Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${orderItemId_list} + +repeat_proxy-order + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "remark":"${datatime}", \ \ \ \ "repeatOrderItem":${orderItemId_list} } + ${reps} Post On Session ZTBT recycle-service/admin/customer-service/confirm/repeat/proxy-order ${data.encode('utf-8')} weightnote #提交磅单 Create Session ZTBT ${URL} ${header} ${datatime} Get Current Date result_format=%Y-%m-%d - ${data} Set Variable { \ \ \ \ "deductedPoint":9.666666666666666, \ \ \ \ "imageUrl":["${pictures}"], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "millSupplierId":"${millSupplierId}", \ \ \ \ "millSupplierName":"${paperMillSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":2.2677065, \ \ \ \ "settleUtiPriceIncludeTaxType":1, \ \ \ \ "receivableAdjustMoney":"10", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"30", \ \ \ \ "collectionCharges":0, \ \ \ \ "advanceFund":0, \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"2021年8月9号", \ \ \ \ "plateNumber":"${carList}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":15000, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[], \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "isSubsidyAndDeductIncludeTax":1, \ \ \ \ "orderId":"621039556547973120", \ \ \ \ "settleWeight":13550, \ \ \ \ "deductedWeight":1.45, \ \ \ \ "orderType":"${orderType}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ] \ } + ${data} Set Variable { \ \ \ \ "deductedPoint":0, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":2.04012, \ \ \ \ "settleUtiPriceIncludeTaxType":1, \ \ \ \ "receivableAdjustMoney":"30", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"0", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${carList}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":18000, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "isSubsidyAndDeductIncludeTax":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleWeight":17550, \ \ \ \ "deductedWeight":2, \ \ \ \ "orderType":"${orderType}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ] } log ${data} - ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/weightnote data=${data.encode('utf-8')} + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/weightnote ${data.encode('utf-8')} log ${reps.json()["data"]} ${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId Set Global Variable ${weightNoteId} diff --git a/2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot b/2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot new file mode 100644 index 0000000..38792c7 --- /dev/null +++ b/2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot @@ -0,0 +1,205 @@ +*** Settings *** +Documentation 上传磅单-一次付款活动 +Library DateTime +Library RequestsLibrary +Library Collections +Library requests + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get-order-item-list + #查找预约的订单项列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId} + log ${reps.json()} + ${records} Get From Dictionary ${reps.json()["data"]} records #获取订单列表 + ${orderItemId_value} Evaluate random.choice(${records}) random #随机获取订单信息 + log to console \nvalue: ${orderItemId_value} + ${orderItemId} Get From Dictionary ${orderItemId_value} orderItemId #订单项编号 + Set Global Variable ${orderItemId} + #Should Be Equal As Strings ${reps.json()["data"]["records"][0]} orderId=${orderId} + +get-order-item-details + #获取订单详情信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId} &orderItemId=${orderItemId} + ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id + ${paperMillId} Get From Dictionary ${reps.json()["data"]} paperMillId #纸厂id + ${paperCategoryPrice} Get From Dictionary ${reps.json()["data"]} paperCategoryPrice #品类价格 + ${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴 + ${activitySettleType} Get From Dictionary ${reps.json()["data"]} activitySettleType #活动订单结算方式 + ${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式 + ${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id + ${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name + ${unitSurcharge} Get From Dictionary ${reps.json()["data"]} unitSurcharge #代卖费单价 + ${settleUtiPriceIncludeTaxType} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} settleUtiPriceIncludeTaxType #含税补贴类型 + ${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies} + ${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价 + ${unitSurcharge} Set Variable If '${unitSurcharge}'=='${None}' 0 ${unitSurcharge} + Set Global Variable ${contractId} + Set Global Variable ${paperMillId} + Set Global Variable ${paperCategoryPrice} + Set Global Variable ${publicSubsidies} + Set Global Variable ${activitySettleType} + Set Global Variable ${proxySellerSettleType} + Set Global Variable ${settleUtiPrice} + Set Global Variable ${交易主体id} + Set Global Variable ${交易主体name} + Set Global Variable ${unitSurcharge} + Set Global Variable ${settleUtiPriceIncludeTaxType} + +get_delivery-info + #获取订单名片信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId} + log ${reps.json()} + ${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号 + ${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价 + Set Global Variable ${plateNumber} + Set Global Variable ${settleUtiPrice} + +get_contract_by_id + #获取下单时绑定的合同 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/contract/get/detail-by-id params=id=${contractId} + log ${reps.json()} + #获取垫资费、企业ID、应收金额结算规则、含税结算单价结算规则 + ${advanceFund} Get From Dictionary ${reps.json()["data"]} advanceFund #垫资费 + ${accountPeriod} Get From Dictionary ${reps.json()["data"]} accountPeriod #账期 + ${buyerEnterpriseId} Get From Dictionary ${reps.json()["data"]} buyerEnterpriseId #企业id + ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 + ${taxRefundRate} Get From Dictionary ${reps.json()["data"]} taxRefundRate #税点 + ${proxyPaySurcharge} Get From Dictionary ${reps.json()["data"]} proxyPaySurcharge #代收费 + ${hasInvoice} Get From Dictionary ${reps.json()["data"]} hasInvoice #是否开票 + ${accountPeriodType} Get From Dictionary ${reps.json()["data"]} accountPeriodType #账期类型 + ${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税 + ${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则 + ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 + ${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund} + ${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge} + Set Global Variable ${advanceFund} + Set Global Variable ${accountPeriod} + Set Global Variable ${buyerEnterpriseId} + Set Global Variable ${taxRefundRate} + Set Global Variable ${proxyPaySurcharge} + Set Global Variable ${hasInvoice} + Set Global Variable ${accountPeriodType} + Set Global Variable ${settlePriceIncludeTaxSettleRules} + Set Global Variable ${isSubsidyAndDeductIncludeTax} + Set Global Variable ${receivableSettlementRules} + Set Global Variable ${settlePriceIncludeTaxSettleRules} + +get-contract-list + #获取订单纸厂的所有合同信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT /recycle-service/admin/contract/get/selectable-contract-list params=orderItemId=${orderItemId} + log ${reps.json()} + +get-supplier + #获取纸厂供应商 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-merchant/${paperMillId} params=paperMillId=${paperMillId} + log ${reps.json()} + +get-Source of funds + #获取资金来源 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list + log ${reps.json()} + ${data} Get From Dictionary ${reps.json()} data + FOR ${item} IN @{data} + log ${item} + ${isDefault} Get From Dictionary ${item} isDefault #获取启用状态 + ${name} Get From Dictionary ${item} name #获取name + ${id} Get From Dictionary ${item} id #获取id + Exit For Loop If '${isDefault}'=='1' + END + Set Global Variable ${name} + Set Global Variable ${id} + +get-Warehouse + #获取所属仓库 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/get/warehouse-name + ${仓库} Get From Dictionary ${reps.json()} data + #随机获取仓库 + ${所属仓库} Evaluate random.choice(${仓库}) random + log to console \nvalue:${所属仓库} + Set Global Variable ${所属仓库} + +get_proxy-order_delivery-info + #获取订单名片信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId} + log ${reps.json()} + ${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号 + ${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价 + Set Global Variable ${plateNumber} + Set Global Variable ${settleUtiPrice} + +get_paper-mill-category + #获取当前纸厂的所有纸品品类 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId} + log ${reps.json()} + +Upload_pictures + #上传图片 + #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg + #Create Session ZTBT ${URL} ${dict} + ${filepath} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb') + ${image} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session ZTBT ${URL} + log ${file} + ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${result.json()} data + log ${result.content} + Set Global Variable ${pictures} + +get_repeat_proxy-order + #获取重复订单信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=14800&weighingDate=${datatime}&orderType=${orderType}&settlePrice=29466.6 + ${records} Get From Dictionary ${reps.json()["data"]} records #获取重复订单列表 + ${orderItemId_list} Create List + #sleep 0.5 + FOR ${items} IN @{records} + ${orderItemId} Get From Dictionary ${items} orderItemId + Append To List ${orderItemId_list} '''${orderItemId}''' + END + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${orderItemId_list} + +repeat_proxy-order + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "remark":"${datatime}", \ \ \ \ "repeatOrderItem":${orderItemId_list} } + ${reps} Post On Session ZTBT recycle-service/admin/customer-service/confirm/repeat/proxy-order ${data.encode('utf-8')} + +weightnote + #提交磅单 + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d + ${data} Set Variable { \ \ \ \ "deductedPoint":0, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "scrapeOrderId":"", \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "unitPrice":"${paperCategoryPrice}", \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "settleUtiPriceIncludeTax":1.6608157894736841, \ \ \ \ "settleUtiPriceIncludeTaxType":"${settleUtiPriceIncludeTaxType}", \ \ \ \ "receivableAdjustMoney":"30", \ \ \ \ "refundSubsidy":0.002, \ \ \ \ "adjustMoney":"20", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":15800, \ \ \ \ "activitySettleType":null, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "deliveryImageUrls":[ \ \ \ \ \ ], \ \ \ \ "publicSubsidies":0, \ \ \ \ "orderId":"${orderId}", \ \ \ \ "nonStandardPenalty_car":"", \ \ \ \ "settleWeight":14800, \ \ \ \ "deductedWeight":0, \ \ \ \ "orderType":1, \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":2, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":15, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ] } + log ${data} + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/weightnote ${data.encode('utf-8')} + log ${reps.json()} + ${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId #磅单编号 + Set Global Variable ${weightNoteId} + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${datatime} + +audit_weightnote + #磅单审核接口 + Create Session ZTBT ${URL} ${header} + ${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId} + log ${repsonse.json()} + +get_proxy-order + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId} + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot b/2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot new file mode 100644 index 0000000..a435e55 --- /dev/null +++ b/2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot @@ -0,0 +1,188 @@ +*** Settings *** +Documentation 上次送货单-两次付款活动 +Library DateTime +Library RequestsLibrary +Library Collections +Library requests + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get-order-item-list + #查找预约的订单项列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=orderType=${orderType} &pageNum=1&pageSize=10&status=51&orderId=${orderId} + log ${reps.json()} + ${records} Get From Dictionary ${reps.json()["data"]} records #获取订单列表 + ${orderItemId_value} Evaluate random.choice(${records}) random #随机获取订单信息 + log to console \nvalue: ${orderItemId_value} + ${orderItemId} Get From Dictionary ${orderItemId_value} orderItemId #订单项编号 + Set Global Variable ${orderItemId} + #Should Be Equal As Strings ${reps.json()["data"]["records"][0]} orderId=${orderId} + +get-order-item-details + #获取订单详情信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId} &orderItemId=${orderItemId} + ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id + ${paperMillId} Get From Dictionary ${reps.json()["data"]} paperMillId #纸厂id + ${paperCategoryPrice} Get From Dictionary ${reps.json()["data"]} paperCategoryPrice #品类价格 + ${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴 + ${activitySettleType} Get From Dictionary ${reps.json()["data"]} activitySettleType #活动订单结算方式 + ${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式 + ${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id + ${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name + ${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies} + ${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价 + ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id + Set Global Variable ${contractId} + Set Global Variable ${paperMillId} + Set Global Variable ${paperCategoryPrice} + Set Global Variable ${publicSubsidies} + Set Global Variable ${activitySettleType} + Set Global Variable ${proxySellerSettleType} + Set Global Variable ${settleUtiPrice} + Set Global Variable ${交易主体id} + Set Global Variable ${交易主体name} + +get_delivery-info + #获取订单名片信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId} + log ${reps.json()} + ${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号 + ${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价 + Set Global Variable ${plateNumber} + Set Global Variable ${settleUtiPrice} + +get_contract_by_id + #获取下单时绑定的合同 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/contract/get/detail-by-id params=id=${contractId} + log ${reps.json()} + #获取垫资费、企业ID、应收金额结算规则、含税结算单价结算规则 + ${advanceFund} Get From Dictionary ${reps.json()["data"]} advanceFund #垫资费 + ${accountPeriod} Get From Dictionary ${reps.json()["data"]} accountPeriod #账期 + ${buyerEnterpriseId} Get From Dictionary ${reps.json()["data"]} buyerEnterpriseId #企业id + ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 + ${taxRefundRate} Get From Dictionary ${reps.json()["data"]} taxRefundRate #税点 + ${proxyPaySurcharge} Get From Dictionary ${reps.json()["data"]} proxyPaySurcharge #代收费 + ${hasInvoice} Get From Dictionary ${reps.json()["data"]} hasInvoice #是否开票 + ${accountPeriodType} Get From Dictionary ${reps.json()["data"]} accountPeriodType #账期类型 + ${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税 + ${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则 + ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 + ${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund} + ${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge} + Set Global Variable ${advanceFund} + Set Global Variable ${accountPeriod} + Set Global Variable ${buyerEnterpriseId} + Set Global Variable ${taxRefundRate} + Set Global Variable ${proxyPaySurcharge} + Set Global Variable ${hasInvoice} + Set Global Variable ${accountPeriodType} + Set Global Variable ${settlePriceIncludeTaxSettleRules} + Set Global Variable ${isSubsidyAndDeductIncludeTax} + Set Global Variable ${receivableSettlementRules} + Set Global Variable ${settlePriceIncludeTaxSettleRules} + +get-contract-list + #获取订单纸厂的所有合同信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT /recycle-service/admin/contract/get/selectable-contract-list params=orderItemId=${orderItemId} + log ${reps.json()} + +get-supplier + #获取纸厂供应商 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-merchant/${paperMillId} params=paperMillId=${paperMillId} + log ${reps.json()} + +get-Source of funds + #获取资金来源 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list + log ${reps.json()} + ${data} Get From Dictionary ${reps.json()} data + FOR ${item} IN @{data} + log ${item} + ${isDefault} Get From Dictionary ${item} isDefault #获取启用状态 + ${name} Get From Dictionary ${item} name #获取name + ${id} Get From Dictionary ${item} id #获取id + Exit For Loop If '${isDefault}'=='1' + END + Set Global Variable ${name} + Set Global Variable ${id} + +get-Warehouse + #获取所属仓库 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/get/warehouse-name + ${仓库} Get From Dictionary ${reps.json()} data + #随机获取仓库 + ${所属仓库} Evaluate random.choice(${仓库}) random + log to console \nvalue:${所属仓库} + Set Global Variable ${所属仓库} + +get_proxy-order_delivery-info + #获取订单名片信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId} + log ${reps.json()} + ${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号 + ${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价 + Set Global Variable ${plateNumber} + Set Global Variable ${settleUtiPrice} + +get_paper-mill-category + #获取当前纸厂的所有纸品品类 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId} + log ${reps.json()} + +Upload_pictures + #上传图片 + #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg + #Create Session ZTBT ${URL} ${dict} + ${filepath} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb') + ${image} Evaluate open('E:/lyl/图片/16pic_6879381_b.jpg','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session ZTBT ${URL} + log ${file} + ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${result.json()} data + log ${result.content} + Set Global Variable ${pictures} + +get_repeat/proxy-order + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId} &plateNumber=${plateNumber} &netWeight=30000&weighingDate=${datatime}&orderType=3 + log ${reps.json()} + +weightnote + #提交磅单 + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d + ${data} Set Variable { \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "netWeight":13000, \ \ \ \ "settleWeight":null, \ \ \ \ "unitSurcharge":0.02, \ \ \ \ "transactionMainEnterpriseId":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "activitySettleType":"${activitySettleType}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "remark":null, \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settlePrice":0, \ \ \ \ "contractId":"${contractId}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "orderType":"${orderType}", \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "otherAmountList":[ \ \ \ \ \ ], \ \ \ \ "unitPrice":"${paperCategoryPrice}" } + log ${data} + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/save/weightnote ${data.encode('utf-8')} + log ${reps.json()} + ${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId #磅单编号 + Set Global Variable ${weightNoteId} + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${datatime} + +audit_weightnote + #磅单审核接口 + Create Session ZTBT ${URL} ${header} + ${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId} + log ${repsonse.json()} + +get_proxy-order + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId} + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot b/2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot new file mode 100644 index 0000000..31b1c80 --- /dev/null +++ b/2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot @@ -0,0 +1,77 @@ +*** Settings *** +Documentation 运营审核-常规 +Library DateTime +Library Collections +Library RequestsLibrary + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_operation_list + #获取运营审核列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0 + log ${reps.json()} + +get_paper-mill-order-by-orderItemId + #根据订单编号获取运营审核单 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=${orderItemId} + log ${reps.json()} + ${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId #获取审核id + ${weightNoteId} Get From Dictionary ${reps.json()["data"]["records"][0]} weightNoteId #获取磅单id + Set Global Variable ${auditRequestId} + Set Global Variable ${weightNoteId} + +get_order-log-detail + #获取订单日志 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} + log ${reps.json()} + +get_order-receipt-audit-details + #查看运营审核详情 + Create Session ZTBT ${URL} ${header} + ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} + log ${reps.json()} + ${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id + ${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称 + ${paperCategoryId} Get From Dictionary ${reps.json()["data"]["items"][0]} paperCategoryId #纸厂品类id + ${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重 + ${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期 + ${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号 + ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 + ${surcharge} Set Variable If '${proxySellerSettleType}'=='0' '${unitSurcharge}'*'${netWeight}' '${unitSurcharge}'*'${settleWeight}' #代卖费总额 + ${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期 + Set Global Variable ${auditRequestItemId} + Set Global Variable ${categoryName} + Set Global Variable ${netWeight} + Set Global Variable ${paperMillPayAt} + Set Global Variable ${plateNumber} + Set Global Variable ${settleWeight} + Set Global Variable ${paperCategoryId} + Set Global Variable ${surcharge} + +order-receipt-audit-details + #b保存磅单信息 + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d #获取当前时间 + ${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":null, \ \ \ \ "paperMillPayAt":${paperMillPayAt}, \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + +get_order-log-detail2 + #运营审核驳回操作日志 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} &operationStatus=2 + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful + +operation_audit + #运营审核确认通过 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot b/2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot new file mode 100644 index 0000000..2cd0b70 --- /dev/null +++ b/2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot @@ -0,0 +1,78 @@ +*** Settings *** +Documentation 运用审核-一次付款活动 +Library RequestsLibrary +Library Collections +Library DateTime + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_operation_list + #获取运营审核列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0 + log ${reps.json()} + +get_paper-mill-order-by-orderItemId + #根据订单编号获取运营审核单 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=${orderItemId} + log ${reps.json()} + ${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId #获取审核id + ${weightNoteId} Get From Dictionary ${reps.json()["data"]["records"][0]} weightNoteId #获取磅单id + Set Global Variable ${auditRequestId} + Set Global Variable ${weightNoteId} + +get_order-log-detail + #获取订单日志 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} + log ${reps.json()} + +get_order-receipt-audit-details + #查看运营审核详情 + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d + ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} + log ${reps.json()} + ${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id + ${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称 + ${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类id + ${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重 + ${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期 + ${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号 + ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 + ${surcharge} Set Variable If '${proxySellerSettleType}'=='0' '${unitSurcharge}'*'${netWeight}' '${unitSurcharge}'*'${settleWeight}' #代卖费总额 + ${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期 + Set Global Variable ${auditRequestItemId} + Set Global Variable ${categoryName} + Set Global Variable ${netWeight} + Set Global Variable ${paperMillPayAt} + Set Global Variable ${plateNumber} + Set Global Variable ${settleWeight} + Set Global Variable ${paperCategoryId} + Set Global Variable ${datatime} + +order-receipt-audit-details + #b保存磅单信息 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + +get_order-log-detail2 + #运营审核驳回操作日志 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} &operationStatus=2 + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful + +operation_audit + #运营审核确认通过 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + sleep 1 diff --git a/2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot b/2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot new file mode 100644 index 0000000..943c8c1 --- /dev/null +++ b/2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot @@ -0,0 +1,78 @@ +*** Settings *** +Documentation 运营审核-两次付款活动 +Library RequestsLibrary +Library Collections +Library DateTime + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_operation_list + #获取运营审核列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0 + log ${reps.json()} + +get_paper-mill-order-by-orderItemId + #根据订单编号获取运营审核单 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-mill-order-receipt-audit params=pageNum=1&pageSize=10&status=0&orderItemId=${orderItemId} + log ${reps.json()} + ${auditRequestId} Get From Dictionary ${reps.json()["data"]["records"][0]} auditRequestId #获取审核id + ${weightNoteId} Get From Dictionary ${reps.json()["data"]["records"][0]} weightNoteId #获取磅单id + Set Global Variable ${auditRequestId} + Set Global Variable ${weightNoteId} + +get_order-log-detail + #获取订单日志 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} + log ${reps.json()} + +get_order-receipt-audit-details + #查看运营审核详情 + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d + ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} + log ${reps.json()} + ${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id + ${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称 + ${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类id + ${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重 + ${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期 + ${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号 + ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 + ${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期 + ${settleWeight} Set Variable If '${settleWeight}'=='None' 0 ${settleWeight} #纸厂账期 + Set Global Variable ${auditRequestItemId} + Set Global Variable ${categoryName} + Set Global Variable ${netWeight} + Set Global Variable ${paperMillPayAt} + Set Global Variable ${plateNumber} + Set Global Variable ${settleWeight} + Set Global Variable ${paperCategoryId} + Set Global Variable ${datatime} + +order-receipt-audit-details + #b保存磅单信息 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":"${publicSubsidies}", \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "fundSourceName":"${name}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + +get_order-log-detail2 + #运营审核驳回操作日志 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId} &operationStatus=2 + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful + +operation_audit + #运营审核确认通过 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful + sleep 1 diff --git a/2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot b/2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot new file mode 100644 index 0000000..a51e2a2 --- /dev/null +++ b/2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot @@ -0,0 +1,39 @@ +*** Settings *** +Documentation 代卖应付 +Library RequestsLibrary +Library Collections + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${url} http://api-ops-psc-test.qniao.cn +${URL1} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_list + #获取财务审核列表 + Create Session ZTBT ${url} ${header} + ${reps} Get On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/get/list params=pageNum=1&pageSize=10&status=&orderId=&orderItemId=${orderItemId} + ${auditedTime} Get From Dictionary ${reps.json()["data"]["records"][0]} auditedTime #财务第一次确认结算时间 + log ${auditedTime.year} + Should Be Equal As Strings ${reps.json()["message"]} successful + Set Global Variable ${auditedTime} + +get_order-log-detail + #财务审核驳回操作记录 + Create Session ZTBT ${URL1} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/order-log-detail params=orderId=${orderId}&weightNoteId=${weightNoteId}&operationStatus=3 + +paper-mill-order-receipt-proof-request_audit + #财务审核确认通过 + Create Session ZTBT ${url} ${header} + ${data} Set Variable {"auditRequestId":"${auditRequestId}","adminId":null,"isPass":1,"remark":"${datatime}" } + ${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/audit ${data.encode('utf-8')} + log ${reps.json()} + sleep 1 + +paper-mill-order-receipt-proof-request_settle + #确认结算 + Create Session ZTBT ${url} ${header} + ${data} Set Variable { \ \ \ \ "id":"${auditRequestId}", \ \ \ \ "adminId":null } + ${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/settle ${data.encode('utf-8')} + sleep 1 diff --git a/2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot b/2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot new file mode 100644 index 0000000..f876a69 --- /dev/null +++ b/2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation 代卖应收 +Library RequestsLibrary +Library Collections + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_paper-payment-order-list + #通过订单编号获取代卖应收列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-payment-order-list params=pageNum=1&pageSize=10&orderId=${orderId} + ${paymentOrderId} Get From Dictionary ${reps.json()["data"]["records"][0]} id #回款单号 + log ${reps.json()} + Set Global Variable ${paymentOrderId} + +get_order-receipt-audit-details + #代卖应收详情 + Create Session ZTBT ${URL} ${header} + ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} + ${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax #获取应收金额 + ${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #未回款金额 + Set Global Variable ${receivablePriceIncludeTax} + Set Global Variable ${noReceivablePrice} + +update_payment-order-status + #确认回款操作 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "paymentOrderId":"${paymentOrderId}", \ \ \ \ "receivablePrice":"${receivablePriceIncludeTax}", \ \ \ \ "paidPrice":"${receivablePriceIncludeTax}", \ \ \ \ "noReceiveblePrice":"${noReceivablePrice}", \ \ \ \ "bankFlowNo":null, \ \ \ \ "paymentAdjustmentFee":null, \ \ \ \ "returnPayDate":"${datatime}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/update/payment-order-status ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system/2-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot b/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot similarity index 64% rename from 2-Background_system/2-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot rename to 2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot index dfe1363..91bc7bc 100644 --- a/2-Background_system/2-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot +++ b/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot @@ -4,7 +4,7 @@ Library RequestsLibrary *** Variables *** ${URL} http://api-ops-psc-test.qniao.cn -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} *** Test Cases *** get_withdraw-list @@ -12,16 +12,17 @@ get_withdraw-list Create Session ZTBT ${URL} ${header} ${reps} Get On Session ZTBT payment-settlement-center/admin/settlement/get/withdraw-list params=pageNum=1&pageSize=10&isAutoHandle=1&status=&money=&orderId=${tradeOrderId} log ${reps.json()} - ${records} Get From Dictionary ${reps.json()["data"]} records #提现单列表 - ${value} Evaluate random.choice(${records} ) random - log to console \nvalue: ${value} - ${提现id} Get From Dictionary ${value} id #提现id - Set Global Variable ${提现id} + #${records} Get From Dictionary ${reps.json()["data"]} records #提现单列表 + #${value} Evaluate random.choice(${records} ) random + #log to console \nvalue: ${value} + #${id} Get From Dictionary ${value} id #提现id + ${id} Get From Dictionary ${reps.json()["data"]["records"][0]} id #提现id + Set Global Variable ${id} withdraw_{id} #提现审核 Create Session ZTBT ${URL} ${header} ${data} Set Variable { \ \ "billType": 0, \ \ "remark": "string", \ \ "status": 1 } - ${reps} Post On Session ZTBT payment-settlement-center/admin/settlement/verify/withdraw/${提现id} ${data} + ${reps} Post On Session ZTBT payment-settlement-center/admin/settlement/verify/withdraw/${id} ${data} log ${reps.json()} Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system/2-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot b/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot similarity index 94% rename from 2-Background_system/2-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot rename to 2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot index 1a96b54..bc3aac5 100644 --- a/2-Background_system/2-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot +++ b/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot @@ -4,7 +4,7 @@ Library Collections *** Variables *** ${URL} http://api-ops-psc-test.qniao.cn -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} *** Test Cases *** get_withdraw-list diff --git a/2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot b/2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot new file mode 100644 index 0000000..f02bc4b --- /dev/null +++ b/2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot @@ -0,0 +1,207 @@ +*** Settings *** +Library requests +Library Collections +Library RequestsLibrary +Library DateTime + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_proxy-order-item-list + #查找预约的订单项列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order-item-list params=pageNum=1&pageSize=10&orderType=2&status=51&weightNoteType=2&orderItemId=${orderItemId} + log ${reps.json()} + ${orderItemId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderItemId #订单项编号 + Set Global Variable ${orderItemId} + Should Be Equal As Strings ${reps.json()["data"]["records"][0]["orderId"]} ${orderId} + +get_proxy-order-details + #查看订单详情 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId} + ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #当前订单下单时的合同id + ${unitSurcharge} Get From Dictionary ${reps.json()["data"]} unitSurcharge #代卖费 + ${proxySellerSettleType} Get From Dictionary ${reps.json()["data"]} proxySellerSettleType #代卖费结算方式 + ${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类ID + ${unitPrice} Get From Dictionary ${reps.json()["data"]} paperCategoryPrice #品类单价 + ${publicSubsidies} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} publicSubsidies #公开补贴 + ${millSupplierId} Get From Dictionary ${reps.json()["data"]} millSupplierId #纸厂供应商ID + ${paperMillSupplierName} Get From Dictionary ${reps.json()["data"]} paperMillSupplierName #纸厂供应商名称 + ${surcharge} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} surcharge #代卖费总额 + ${contractId} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} contractId #合同id + ${paymentType} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} paymentType #支付类型 + ${activityNoteStatus} Get From Dictionary ${reps.json()["data"]["orderItems"][0]} activityNoteStatus #活动状态 + ${交易主体id} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseId #交易主体id + ${交易主体name} Get From Dictionary ${reps.json()["data"]} transactionMainEnterpriseName #交易主体name + ${publicSubsidies} Set Variable If '${publicSubsidies}'=='${null}' 0 ${publicSubsidies} + ${settleUtiPrice}= Evaluate ${unitPrice}+${publicSubsidies} #结算单价 + log ${contractId} + Set Global Variable ${contractId} + Set Global Variable ${unitSurcharge} + Set Global Variable ${paperCategoryId} + Set Global Variable ${settleUtiPrice} + Set Global Variable ${unitPrice} + Set Global Variable ${publicSubsidies} + Set Global Variable ${millSupplierId} + Set Global Variable ${paperMillSupplierName} + Set Global Variable ${proxySellerSettleType} + Set Global Variable ${contractId} + Set Global Variable ${surcharge} + Set Global Variable ${paymentType} + Set Global Variable ${activityNoteStatus} + Set Global Variable ${交易主体name} + Set Global Variable ${交易主体id} + +get_delivery-info + #获取订单名片信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get/proxy-order/delivery-info/${orderItemId} + log ${reps.json()} + ${plateNumber} Get From Dictionary ${reps.json()["data"]} plateNumber #车牌号 + ${settleUtiPrice} Get From Dictionary ${reps.json()["data"]} settleUtiPrice #结算单价 + ${settleUtiPriceIncludeTaxType} Get From Dictionary ${reps.json()["data"]} settleUtiPriceIncludeTaxType #含税补贴价类型 + ${netWeight} Get From Dictionary ${reps.json()["data"]} netWeight #净重 + Set Global Variable ${plateNumber} + Set Global Variable ${settleUtiPrice} + Set Global Variable ${settleUtiPriceIncludeTaxType} + Set Global Variable ${netWeight} + +get-contract-list + #获取订单纸厂的所有合同信息 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT /recycle-service/admin/contract/get/selectable-contract-list params=orderItemId=${orderItemId} + log ${reps.json()} + +get_weightnote + Create Session ZTBT ${URL} ${header} + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/get/weightnote/${weightnoteId} + log ${reps.json()} + +get_paperMill-supplier + #获取纸厂供应商 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/paper-mill-merchant/${paperMillId} params=paperMillId=${paperMillId} + log ${reps.json()} + +get-Warehouse + #获取所属仓库 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/transaction-main-enterprise/get/warehouse-name + ${仓库} Get From Dictionary ${reps.json()} data + #随机获取仓库 + ${所属仓库} Evaluate random.choice(${仓库}) random + log to console \nvalue:${所属仓库} + Set Global Variable ${所属仓库} + +get-Source of funds + #获取资金来源 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/fund-source/get/list + log ${reps.json()} + ${data} Get From Dictionary ${reps.json()} data + FOR ${item} IN @{data} + log ${item} + ${isDefault} Get From Dictionary ${item} isDefault #获取启用状态 + ${name} Get From Dictionary ${item} name #获取name + ${id} Get From Dictionary ${item} id #获取id + Exit For Loop If '${isDefault}'=='1' + END + Set Global Variable ${name} + Set Global Variable ${id} + +get_paper-mill-category + #获取当前纸厂的所有纸品品类 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/paperMill/get/paper-mill-category/${paperMillId} params=id=${paperMillId} + log ${reps.json()} + +get_contract_by_id + #获取下单时绑定的合同 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/contract/get/detail-by-id params=id=${contractId} + log ${reps.json()} + #获取垫资费、企业ID、应收金额结算规则、含税结算单价结算规则 + ${advanceFund} Get From Dictionary ${reps.json()["data"]} advanceFund #垫资费 + ${buyerEnterpriseId} Get From Dictionary ${reps.json()["data"]} buyerEnterpriseId #企业id + ${settleRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则 + ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 + ${taxRefundRate} Get From Dictionary ${reps.json()["data"]} taxRefundRate #税点 + ${proxyPaySurcharge} Get From Dictionary ${reps.json()["data"]} proxyPaySurcharge #代收费 + ${hasInvoice} Get From Dictionary ${reps.json()["data"]} hasInvoice #是否开票 + ${accountPeriodType} Get From Dictionary ${reps.json()["data"]} accountPeriodType #账期类型 + ${isSubsidyAndDeductIncludeTax} Get From Dictionary ${reps.json()["data"]} isSubsidyAndDeductIncludeTax #纸厂补贴是否含税 + ${receivableSettlementRules} Get From Dictionary ${reps.json()["data"]} settleRules #应收金额结算规则 + ${settlePriceIncludeTaxSettleRules} Get From Dictionary ${reps.json()["data"]} settlePriceIncludeTaxSettleRules #含税结算单价结算规则 + ${advanceFund} Set Variable If '${advanceFund}'=='${None}' 0 ${advanceFund} + ${proxyPaySurcharge} Set Variable If '${proxyPaySurcharge}'=='${None}' 0 ${proxyPaySurcharge} + Set Global Variable ${advanceFund} + Set Global Variable ${buyerEnterpriseId} + Set Global Variable ${taxRefundRate} + Set Global Variable ${proxyPaySurcharge} + Set Global Variable ${hasInvoice} + Set Global Variable ${accountPeriodType} + Set Global Variable ${settleRules} + Set Global Variable ${settlePriceIncludeTaxSettleRules} + Set Global Variable ${isSubsidyAndDeductIncludeTax} + Set Global Variable ${receivableSettlementRules} + Set Global Variable ${settlePriceIncludeTaxSettleRules} + +get-category price + #获取下单品类,上传磅单时的价格 + Create Session ZTBT ${URL} ${header} + ${dataTime} Get Current Date result_format=%Y-%m-%d + ${reps} Get On Session ZTBT recycle-service/admin/proxy-sell/get-category-price-by-date params=orderItemId=${orderItemId}&weightDay=${dataTime} + log ${reps.json()} + ${price} Get From Dictionary ${reps.json()["data"][0]} price #下单品类价格 + ${publicSubsidies} Get From Dictionary ${reps.json()["data"][0]} publicSubsidies #下单品类公开补贴 + Set Global Variable ${price} + Set Global Variable ${publicSubsidies} + Set Global Variable ${dataTime} + +Upload_pictures + #上传图片 + #${dict} Create Dictionary Content-Type=image/jpeg filename=20210803.jpg + #Create Session ZTBT ${URL} ${dict} + ${filepath} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') + ${image} Evaluate open('E:/lyl/图片/21042217001449712.png','rb') + ${file} Create Dictionary filepath=${filepath} image=${image} + Create Session ZTBT ${URL} + log ${file} + ${result} Post On Session ZTBT recycle-user-center/upload/image files=${file} + ${pictures} Get From Dictionary ${result.json()} data + log ${result.content} + Set Global Variable ${pictures} + +get_repeat_proxy-order + #获取重复订单信息 + Create Session ZTBT ${URL} ${header} + #${datatime} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/repeat/proxy-order params=orderItemId=${orderItemId}&plateNumber=${carList}&settleWeight=13550&weighingDate=${datatime}&orderType=${orderType} + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful + +weightnote + #提交磅单 + Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d + ${data} Set Variable { \ \ \ \ "id":"${weightNoteId}", \ \ \ \ "orderId":"${orderId}", \ \ \ \ "orderItemId":"${orderItemId}", \ \ \ \ "type":null, \ \ \ \ "weightDay":"${datatime}", \ \ \ \ "settleDay":"${datatime}", \ \ \ \ "settleUtiPrice":"${settleUtiPrice}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "settleWeight":12500, \ \ \ \ "deductedPoint":7.5, \ \ \ \ "unitSurcharge":"${unitSurcharge}", \ \ \ \ "surcharge":"${surcharge}", \ \ \ \ "adjustMoney":"20", \ \ \ \ "remark":"${datatime}", \ \ \ \ "imageUrls":null, \ \ \ \ "transactionMainEnterpriseid":"${交易主体id}", \ \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "warehouseName":"${所属仓库}", \ \ \ \ "settlePrice":22585.5, \ \ \ \ "activitySettleType":"${activitySettleType}", \ \ \ \ "proxySellerSettleType":"${proxySellerSettleType}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "remarkImgs":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "otherAmountList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"freightSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.001, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherSubsidies", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":1 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":1, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":0.002, \ \ \ \ \ \ \ \ \ \ \ \ "title":"contrabandPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":2, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":20, \ \ \ \ \ \ \ \ \ \ \ \ "title":"nonStandardPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ }, \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "unitType":2, \ \ \ \ \ \ \ \ \ \ \ \ "unitAmount":10, \ \ \ \ \ \ \ \ \ \ \ \ "title":"otherPenalty", \ \ \ \ \ \ \ \ \ \ \ \ "isSubsidies":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "receivableSettlementRules":"${receivableSettlementRules}", \ \ \ \ "refundSubsidy":0.003, \ \ \ \ "receivableAdjustMoney":"20", \ \ \ \ "settleUtiPriceIncludeTax":1.337448648648649, \ \ \ \ "settleUtiPriceIncludeTaxType":"${settleUtiPriceIncludeTaxType}", \ \ \ \ "collectionCharges":"${proxyPaySurcharge}", \ \ \ \ "advanceFund":"${advanceFund}", \ \ \ \ "millSupplierId":"${supplier_id}", \ \ \ \ "millSupplierName":"${millSupplierName}", \ \ \ \ "contractId":"${contractId}", \ \ \ \ "settlePriceIncludeTaxSettleRules":"${settlePriceIncludeTaxSettleRules}", \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "deductionNotes":"${datatime}", \ \ \ \ "imageUrl":[ \ \ \ \ \ \ \ \ "${pictures}" \ \ \ \ ], \ \ \ \ "deductedWeight":1.5, \ \ \ \ "orderType":"${orderType}" } + log ${data} + ${reps} Post On Session ZTBT recycle-service/admin/proxy-sell/update/weightnote ${data.encode('utf-8')} + log ${reps.json()["data"]} + ${weightNoteId} Get From Dictionary ${reps.json()["data"]} weightNoteId + Set Global Variable ${weightNoteId} + Should Be Equal As Strings ${reps.json()["message"]} successful + +audit_weightnote + Create Session ZTBT ${URL} ${header} + ${repsonse} Post On Session ZTBT recycle-service/admin/customer-service/audit/weightnote/${weightNoteId} + log ${repsonse.json()} + +get_proxy-order + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/customer-service/get/proxy-order/${orderId} params=orderId=${orderId}&orderItemId=${orderItemId} + log ${reps.json()} + Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system/1-Consignment management/3-Operation_audit.robot b/2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot similarity index 75% rename from 2-Background_system/1-Consignment management/3-Operation_audit.robot rename to 2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot index bff4d8f..7c65492 100644 --- a/2-Background_system/1-Consignment management/3-Operation_audit.robot +++ b/2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot @@ -1,10 +1,10 @@ *** Settings *** -Library DateTime -Library Collections Library RequestsLibrary +Library Collections +Library DateTime *** Variables *** -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${URL} http://api-ops-ztb-test.qniao.cn *** Test Cases *** @@ -33,25 +33,32 @@ get_order-log-detail get_order-receipt-audit-details #查看运营审核详情 Create Session ZTBT ${URL} ${header} + ${datatime} Get Current Date result_format=%Y-%m-%d ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} log ${reps.json()} ${auditRequestItemId} Get From Dictionary ${reps.json()["data"]["items"][0]} auditRequestItemId #审核项id ${categoryName} Get From Dictionary ${reps.json()["data"]["items"][0]} categoryName #纸品品类名称 + ${paperCategoryId} Get From Dictionary ${reps.json()["data"]} paperCategoryId #纸厂品类id ${netWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} netWeight #净重 + ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 ${paperMillPayAt} Get From Dictionary ${reps.json()["data"]["items"][0]} paperMillPayAt #计划回款日期 ${plateNumber} Get From Dictionary ${reps.json()["data"]["items"][0]} plateNumber #车牌号 ${settleWeight} Get From Dictionary ${reps.json()["data"]["items"][0]} settleWeight #结算重量 + ${paperMillPayAt} Set Variable If '${paperMillPayAt}'=='无账期' null ${paperMillPayAt} #纸厂账期 Set Global Variable ${auditRequestItemId} Set Global Variable ${categoryName} Set Global Variable ${netWeight} Set Global Variable ${paperMillPayAt} Set Global Variable ${plateNumber} Set Global Variable ${settleWeight} + Set Global Variable ${paperCategoryId} + Set Global Variable ${datatime} + Set Global Variable ${settleWeight} order-receipt-audit-details #b保存磅单信息 Create Session ZTBT ${URL} ${header} - ${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":${netWeight}, \ \ \ \ "paperCategoryId":null, \ \ \ \ "paperMillPayAt":"${paperMillPayAt}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "receivablePrice":29186.7, \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":${settleWeight}, \ \ \ \ "isInvoice":${hasInvoice}, \ \ \ \ "fundSourceId":${id}, \ \ \ \ "transactionMainEnterpriseName":"${交易主体}", \ \ \ \ "invoicePoint":${taxRefundRate}, \ \ \ \ "publicSubsidies":${publicSubsidies}, \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":${settleUtiPrice}, \ \ \ \ "settleUnitPriceIncludeTax":2.281517, \ \ \ \ "fundSourceName":"${name}" } + ${data} Set Variable { \ \ \ \ "auditRequestItemId":"${auditRequestItemId}", \ \ \ \ "categoryName":"${categoryName}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "paperCategoryId":"${paperCategoryId}", \ \ \ \ "paperMillPayAt":null, \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "receivablePrice":5550, \ \ \ \ "settlementDate":"${datatime}", \ \ \ \ "weighingDate":"${datatime}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "isInvoice":"${hasInvoice}", \ \ \ \ "fundSourceId":"${id}", \ \ \ \ "transactionMainEnterpriseName":"${交易主体name}", \ \ \ \ "invoicePoint":"${taxRefundRate}", \ \ \ \ "publicSubsidies":0, \ \ \ \ "publicSubsidiesIncludeTax":0, \ \ \ \ "settleUnitPrice":"${settleUtiPrice}", \ \ \ \ "settleUnitPriceIncludeTax":1.337449, \ \ \ \ "fundSourceName":"${name}" } ${reps} Post On Session ZTBT recycle-service/admin/operation/edit/order-receipt-audit-details ${data.encode('utf-8')} Should Be Equal As Strings ${reps.json()["message"]} successful @@ -65,6 +72,7 @@ get_order-log-detail2 operation_audit #运营审核确认通过 Create Session ZTBT ${URL} ${header} - ${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"2021年8月10号" } + ${data} Set Variable { \ "auditRequestId":"${auditRequestId}", \ \ \ \ "isPass":1, \ \ \ \ "remark":"${datatime}" } ${reps} Post On Session ZTBT recycle-service/admin/operation/operation/audit ${data.encode('utf-8')} Should Be Equal As Strings ${reps.json()["message"]} successful + sleep 2 diff --git a/2-Background_system/2-Withdrawal_application/4-Financial_audit.robot b/2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot similarity index 89% rename from 2-Background_system/2-Withdrawal_application/4-Financial_audit.robot rename to 2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot index 628d361..b94fc2c 100644 --- a/2-Background_system/2-Withdrawal_application/4-Financial_audit.robot +++ b/2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot @@ -3,14 +3,14 @@ Library RequestsLibrary Library Collections *** Variables *** -${header} {'X-APP-ID':'470236309865238555','Authorization':'Token 6b08add42d6bcf73abb935b2adf83525','Content-Type':'application/json'} +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} ${url} http://api-ops-psc-test.qniao.cn ${URL1} http://api-ops-ztb-test.qniao.cn *** Test Cases *** get_list #获取财务审核列表 - Create Session ZTBT ${URL} ${header} + Create Session ZTBT ${url} ${header} ${reps} Get On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/get/list params=pageNum=1&pageSize=10&status=&orderId=&orderItemId=${orderItemId} log ${reps.json()} Should Be Equal As Strings ${reps.json()["message"]} successful @@ -23,9 +23,10 @@ get_order-log-detail paper-mill-order-receipt-proof-request_audit #财务审核确认通过 Create Session ZTBT ${url} ${header} - ${data} Set Variable {"auditRequestId":"${auditRequestId}","adminId":null,"isPass":1,"remark":"2021年8月10号" } + ${data} Set Variable {"auditRequestId":"${auditRequestId}","adminId":null,"isPass":1,"remark":"${datatime}" } ${reps} Post On Session ZTBT payment-settlement-center/admin/paper-mill-order-receipt-proof-request/audit ${data.encode('utf-8')} log ${reps.json()} + sleep 1 paper-mill-order-receipt-proof-request_settle #确认结算 diff --git a/2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot b/2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot new file mode 100644 index 0000000..f876a69 --- /dev/null +++ b/2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot @@ -0,0 +1,33 @@ +*** Settings *** +Documentation 代卖应收 +Library RequestsLibrary +Library Collections + +*** Variables *** +${header} {'X-APP-ID':'470236309865238555','Authorization':'${gettoken}','Content-Type':'application/json'} +${URL} http://api-ops-ztb-test.qniao.cn + +*** Test Cases *** +get_paper-payment-order-list + #通过订单编号获取代卖应收列表 + Create Session ZTBT ${URL} ${header} + ${reps} Get On Session ZTBT recycle-service/admin/operation/get/paper-payment-order-list params=pageNum=1&pageSize=10&orderId=${orderId} + ${paymentOrderId} Get From Dictionary ${reps.json()["data"]["records"][0]} id #回款单号 + log ${reps.json()} + Set Global Variable ${paymentOrderId} + +get_order-receipt-audit-details + #代卖应收详情 + Create Session ZTBT ${URL} ${header} + ${reps} Post On Session ZTBT recycle-service/admin/operation/get/order-receipt-audit-details/${auditRequestId}/${weightNoteId} + ${receivablePriceIncludeTax} Get From Dictionary ${reps.json()["data"]["items"][0]} receivablePriceIncludeTax #获取应收金额 + ${noReceivablePrice} Get From Dictionary ${reps.json()["data"]["items"][0]} noReceivablePrice #未回款金额 + Set Global Variable ${receivablePriceIncludeTax} + Set Global Variable ${noReceivablePrice} + +update_payment-order-status + #确认回款操作 + Create Session ZTBT ${URL} ${header} + ${data} Set Variable { \ \ \ \ "paymentOrderId":"${paymentOrderId}", \ \ \ \ "receivablePrice":"${receivablePriceIncludeTax}", \ \ \ \ "paidPrice":"${receivablePriceIncludeTax}", \ \ \ \ "noReceiveblePrice":"${noReceivablePrice}", \ \ \ \ "bankFlowNo":null, \ \ \ \ "paymentAdjustmentFee":null, \ \ \ \ "returnPayDate":"${datatime}" } + ${reps} Post On Session ZTBT recycle-service/admin/operation/update/payment-order-status ${data.encode('utf-8')} + Should Be Equal As Strings ${reps.json()["message"]} successful diff --git a/2-Background_system(Test)/4-Consignment_management/__init__.robot b/2-Background_system(Test)/4-Consignment_management/__init__.robot new file mode 100644 index 0000000..e69de29 diff --git a/2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot b/2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot new file mode 100644 index 0000000..b7f69e0 --- /dev/null +++ b/2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot @@ -0,0 +1,55 @@ +*** Settings *** +Documentation 查看代卖订单(数据对比) +Library RequestsLibrary +Library Collections +Library DateTime +Library RedisLibrary +Library urllib3 + +*** Variables *** +${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'} +${url} http://api-client-ztb-test.qniao.cn + +*** Test Cases *** +userlogin + [Setup] + #验证码登录 + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 + Create Session ZTBT http://api-client-uec-test.qniao.cn ${header} + ${data} Create Dictionary account=15014242835 captcha=888888 accountType=2 + ${respones} POST On Session ZTBT /uec/authorize/by-captcha json=${data} + log ${respones.status_code} + log ${respones.json()} + ${token} Get From Dictionary ${respones.json()["data"]} token + #log ${respones.json()["data"]["token"]} + Set Global Variable ${token} + [Teardown] + +login-token + #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 + Create Session ZTBT ${url} ${header} + ${token1} Create Dictionary loginToken=${token} + ${reps} Post On Session ZTBT recycle-user-center/authorize/get/product-line-token/by/login-token json=${token1} + ${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token + ${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + log ${reps.json()["data"]["token"]} + Set Global Variable ${gettoken} + Set Global Variable ${userId} + +get_proxy-order-list + #获取代卖订单列表 + ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} + Create Session ZTBT http://api-client-ztb-test.qniao.cn ${header} + ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order-list params=status=&pageNum=1&pageSize=15 + ${orderId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderId #获取代卖订单编号 + Set Global Variable ${orderId} + +get_proxy-order_details + #获取代卖订单详情 + ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} + Create Session ZTBT http://api-client-ztb-test.qniao.cn ${header} + ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order/${orderId} + ${data} Get From Dictionary ${reps.json()} data + ${data_value} Set Variable + #Run Keyword If '${orderId}' in ${data} Log To Console ${data} + Should Be Equal ${data} ${data_value} diff --git a/2-Background_system(Test)/5-Data comparison/__init__.txt b/2-Background_system(Test)/5-Data comparison/__init__.txt new file mode 100644 index 0000000..e69de29 diff --git a/__init__.robot b/__init__.robot index 41dd6ca..f19be0c 100644 --- a/__init__.robot +++ b/__init__.robot @@ -1,3 +1,5 @@ *** Settings *** Suite Setup Library RequestsLibrary +Library SeleniumLibrary +Library AppiumLibrary diff --git a/log.html b/log.html new file mode 100644 index 0000000..c6584a7 --- /dev/null +++ b/log.html @@ -0,0 +1,2125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework log failed

+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/output.xml b/output.xml new file mode 100644 index 0000000..de9e47b --- /dev/null +++ b/output.xml @@ -0,0 +1,465 @@ + + + + + + +Create Session: create a HTTP session to a server + +ZTBT +http://api-client-uec-test.qniao.cn +${header} + +Creating Session using : alias=ZTBT, url=http://api-client-uec-test.qniao.cn, headers={'content-type': 'application/json', 'X-APP-ID': '470236309865238528'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 + + + +Creates and returns a dictionary based on the given ``items``. + +account=15014242835 +captcha=888888 +accountType=2 + + +${data} + +${data} = {'account': '15014242835', 'captcha': '888888', 'accountType': '2'} + + + +Sends a POST request on a previously created HTTP Session. + +ZTBT +/uec/authorize/by-captcha +json=${data} + + +${respones} + +POST Request : url=http://api-client-uec-test.qniao.cn/uec/authorize/by-captcha + path_url=/uec/authorize/by-captcha + headers={'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'content-type': 'application/json', 'X-APP-ID': '470236309865238528', 'Content-Length': '67'} + body=b'{"account": "15014242835", "captcha": "888888", "accountType": "2"}' + +POST Response : url=http://api-client-uec-test.qniao.cn/uec/authorize/by-captcha + status=200, reason= + headers={'Server': 'nginx/1.16.1', 'Date': 'Fri, 20 Aug 2021 07:53:42 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers'} + body={"code":0,"message":"successful","data":{"token":"d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ==","userId":"625059637024133120"}} + +${respones} = <Response [200]> + + + +Logs the given message with the given level. + +${respones.status_code} + +200 + + + +Logs the given message with the given level. + +${respones.json()} + +{'code': 0, 'message': 'successful', 'data': {'token': 'd6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ==', 'userId': '625059637024133120'}} + + + +Returns a value from the given ``dictionary`` based on the given ``key``. + +${respones.json()["data"]} +token + + +${token} + +${token} = d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ== + + + +Makes a variable available globally in all tests and suites. + +${token} + +${token} = d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ== + + + + + + +Create Session: create a HTTP session to a server + +ZTBT +${url} +${header} + +Creating Session using : alias=ZTBT, url=http://api-client-ztb-test.qniao.cn, headers={'content-type': 'application/json', 'X-APP-ID': '470236309865238528'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 + + + +Creates and returns a dictionary based on the given ``items``. + +loginToken=${token} + + +${token1} + +${token1} = {'loginToken': 'd6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ=='} + + + +Sends a POST request on a previously created HTTP Session. + +ZTBT +recycle-user-center/authorize/get/product-line-token/by/login-token +json=${token1} + + +${reps} + +POST Request : url=http://api-client-ztb-test.qniao.cn/recycle-user-center/authorize/get/product-line-token/by/login-token + path_url=/recycle-user-center/authorize/get/product-line-token/by/login-token + headers={'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'content-type': 'application/json', 'X-APP-ID': '470236309865238528', 'Content-Length': '106'} + body=b'{"loginToken": "d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ=="}' + +POST Response : url=http://api-client-ztb-test.qniao.cn/recycle-user-center/authorize/get/product-line-token/by/login-token + status=200, reason= + headers={'Server': 'nginx/1.16.1', 'Date': 'Fri, 20 Aug 2021 07:53:42 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive'} + body={"code":0,"message":"successful","data":{"token":"d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ==","userToken":null,"userId":"625059637024133120"}} + +${reps} = <Response [200]> + + + +Returns a value from the given ``dictionary`` based on the given ``key``. + +${reps.json()["data"]} +token + + +${gettoken} + +${gettoken} = d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ== + + + +Returns a value from the given ``dictionary`` based on the given ``key``. + +${reps.json()["data"]} +userId + + +${userId} + +${userId} = 625059637024133120 + + + +Logs the given message with the given level. + +${reps.json()["data"]["token"]} + +d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ== + + + +Makes a variable available globally in all tests and suites. + +${gettoken} + +${gettoken} = d6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ== + + + +Makes a variable available globally in all tests and suites. + +${userId} + +${userId} = 625059637024133120 + + + + + + +Creates and returns a dictionary based on the given ``items``. + +content-type=application/json +X-APP-ID=470236309865238528 +Authorization=${gettoken} + + +${header} + +${header} = {'content-type': 'application/json', 'X-APP-ID': '470236309865238528', 'Authorization': 'd6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ=='} + + + +Create Session: create a HTTP session to a server + +baseinfo +${url} +${header} + +Creating Session using : alias=baseinfo, url=http://api-client-ztb-test.qniao.cn, headers={'content-type': 'application/json', 'X-APP-ID': '470236309865238528', 'Authorization': 'd6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ=='}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 + + + +Sends a GET request on a previously created HTTP Session. + +baseinfo +recycle-service/user/get/base-info + + +${reps} + +GET Request : url=http://api-client-ztb-test.qniao.cn/recycle-service/user/get/base-info + path_url=/recycle-service/user/get/base-info + headers={'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'content-type': 'application/json', 'X-APP-ID': '470236309865238528', 'Authorization': 'd6SX3ESr8Jb2tYq/89Ft7DCUbCHSVTrMJgH552nvTQBP5fSS/wGhBgupf5aKZt8T8mZbZ33PYMwf4dvKYDstQQ=='} + body=None + +GET Response : url=http://api-client-ztb-test.qniao.cn/recycle-service/user/get/base-info + status=200, reason= + headers={'Server': 'nginx/1.16.1', 'Date': 'Fri, 20 Aug 2021 07:53:42 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive'} + body={"code":0,"message":"successful","data":{"userId":"625059637024133120","realName":"赖勇兰","mobile":"15014242835","avatarUrl":"http://medou.oss-cn-shenzhen.aliyuncs.com/saas/20200623160820.png","isAuth":1,"isVIP":0,"isSetPassword":0,"hasStore":0,"balance":211326.3700,"memberExpiredAt":null,"nickname":"KERN8658","memberRewardPoint":100,"isAccountancyUser":0,"hasShowedLoginTag":false,"isSetProxyTag":false,"identityTag":"打包厂","locateCityTag":{"provinceId":140000,"provinceName":"山西省","cityId":140200,"cityName":"大同市","districtId":null,"districtName":null},"experienceTag":"5-10年","numberOfPurchaseCategoriesTag":"0个","numberOfProxyCategoriesTag":"0个","packageFactoryName":"21","packageFactoryArea":27000,"numberOfEmployee":2600,"numberOfPackageMachine":262,"businessLicenseUrl":"https://qncloudtest.oss-cn-shenzhen.aliyuncs.com/common/18130734326537453.jpg","shipmentPerMonth":"1000-2000吨","storeOverview":{"storeId":null,"margin":null,"todayMargin":null,"todayMarginNum":null,"hasStore":0,"status":null},"accountBalance":{"accountMoney":211326.3700,"frozenMoney":28788.7900},"bizUserId":"564535103942955008","bizUserName":"郭腾彬","status":0,"bizUserCode":"8888","hasShipmentsInfo":1,"isEnterpriseAuth":1}} + +${reps} = <Response [200]> + + + +Returns a value from the given ``dictionary`` based on the given ``key``. + +${reps.json()["data"]} +realName + + +${realName} + +${realName} = 赖勇兰 + + + +Returns a value from the given ``dictionary`` based on the given ``key``. + +${reps.json()["data"]} +userId + + +${userId} + +${userId} = 625059637024133120 + + + +Makes a variable available globally in all tests and suites. + +${realName} + +${realName} = 赖勇兰 + + + +Makes a variable available globally in all tests and suites. + +${userId} + +${userId} = 625059637024133120 + + + + + + + + + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/x-www-form-urlencoded +X-APP-ID=470236309865238555 + + +${header} + +${header} = {'Content-Type': 'application/x-www-form-urlencoded', 'X-APP-ID': '470236309865238555'} + + + +Create Session: create a HTTP session to a server + +ZTBT +http://api-ops-ztb-test.qniao.cn +${header} + +Creating Session using : alias=ZTBT, url=http://api-ops-ztb-test.qniao.cn, headers={'Content-Type': 'application/x-www-form-urlencoded', 'X-APP-ID': '470236309865238555'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 + + + +Creates and returns a dictionary based on the given ``items``. + +username=laiyonglan@qniao.cn +password=qn123456 + + +&{data} + +&{data} = { username=laiyonglan@qniao.cn | password=qn123456 } + + + +Logs the given message with the given level. + +${data} + +{'username': 'laiyonglan@qniao.cn', 'password': 'qn123456'} + + + +Sends a POST request on a previously created HTTP Session. + +ZTBT +recycle-service/admin/login +data=${data} + + +${reps} + +POST Request : url=http://api-ops-ztb-test.qniao.cn/recycle-service/admin/login + path_url=/recycle-service/admin/login + headers={'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/x-www-form-urlencoded', 'X-APP-ID': '470236309865238555', 'Content-Length': '48'} + body=username=laiyonglan%40qniao.cn&password=qn123456 + +POST Response : url=http://api-ops-ztb-test.qniao.cn/recycle-service/admin/login + status=200, reason= + headers={'Server': 'nginx/1.16.1', 'Date': 'Fri, 20 Aug 2021 07:53:42 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Access-Control-Allow-Origin': '*', 'Access-Control-Request-Method': '*', 'Cache-Control': 'no-cache', 'Authorization': 'Token 6b08add42d6bcf73abb935b2adf83525', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'X-Frame-Options': 'DENY'} + body={"code":200,"message":"登陆成功"} + +${reps} = <Response [200]> + + + +Logs the given message with the given level. + +${reps.json()} + +{'code': 200, 'message': '登陆成功'} + + + +Returns the given values which can then be assigned to a variables. + +Token 6b08add42d6bcf73abb935b2adf83525 + + +${gettoken} + +${gettoken} = Token 6b08add42d6bcf73abb935b2adf83525 + + + +Fails if objects are unequal after converting them to strings. + +${reps.json()["message"]} +登陆成功 + + + + +Makes a variable available globally in all tests and suites. + +${gettoken} + +${gettoken} = Token 6b08add42d6bcf73abb935b2adf83525 + + + + + + +Creates and returns a dictionary based on the given ``items``. + +X-APP-ID=470236309865238555 +Authorization=Token 6b08add42d6bcf73abb935b2adf83525 + + +${header} + +${header} = {'X-APP-ID': '470236309865238555', 'Authorization': 'Token 6b08add42d6bcf73abb935b2adf83525'} + + + +Create Session: create a HTTP session to a server + +login-info +http://api-ops-ztb-test.qniao.cn +${header} + +Creating Session using : alias=login-info, url=http://api-ops-ztb-test.qniao.cn, headers={'X-APP-ID': '470236309865238555', 'Authorization': 'Token 6b08add42d6bcf73abb935b2adf83525'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 + + + +Sends a GET request on a previously created HTTP Session. + +login-info +recycle-service/admin/employee/get/login-info + + +${reps_data} + +GET Request : url=http://api-ops-ztb-test.qniao.cn/recycle-service/admin/employee/get/login-info + path_url=/recycle-service/admin/employee/get/login-info + headers={'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'X-APP-ID': '470236309865238555', 'Authorization': 'Token 6b08add42d6bcf73abb935b2adf83525'} + body=None + +GET Response : url=http://api-ops-ztb-test.qniao.cn/recycle-service/admin/employee/get/login-info + status=200, reason= + headers={'Server': 'nginx/1.16.1', 'Date': 'Fri, 20 Aug 2021 07:53:42 GMT', 'Content-Type': 'application/json;charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Authorization': '6b08add42d6bcf73abb935b2adf83525', 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'X-Frame-Options': 'DENY'} + body={"code":0,"message":"successful","data":{"adminId":"617003842541850624","name":"赖勇兰","avatar":"https://static-legacy.dingtalk.com/media/lADPBF8a9_2FSfvNAr3NArw_700_701.jpg","position":"测试工程师","positionList":[{"id":"1","name":"管理员"}],"menuList":["/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/CreatePaperPrice","/microSystemManagement/menu","/preciousPaperGeneral/sellOnConsignmentManage/dealManage/TransscationMainBody","/preciousPaperGeneral/sellOnConsignmentManage/invoiceManagement/InvoiceManagementList","/preciousPaperGeneral/packaginStationSAASManage/proxyPaymentOrder/PaymentOrderList","/preciousPaperGeneral/operationManagementBackground/scoreManage/Role/Index","/microSystemManagement/position","/sysManage/listLibraryManage/Index","/preciousPaperGeneral/packaginStationSAASManage/financeManage/MergerPayment","/preciousPaperGeneral/financialManagementBackground/settlementManage/settlementPayment/Index","/preciousPaperGeneral/operationManagementBackground/sysManage/information","/preciousPaperGeneral/companyAndUserManage/companyManage/Index","/preciousPaperGeneral/packaginStationSAASManage/proxyManage","/preciousPaperGeneral/financialManagementBackground/payCenter/memberAccountInfo/memberCcountDetails","/preciousPaperGeneral/packaginStationSAASManage/factoryOrder/ProxyDetails","/preciousPaperGeneral/packaginStationSAASManage/proxyOrderInfo/OrderDetails","/preciousPaperGeneral/sellOnConsignmentManage/operationAudit/operationAuditDetails/standingBook","/preciousPaperGeneral/operationManagementBackground/wastePaperPriceIndex","/preciousPaperGeneral/operationManagementBackground/wastePaperPriceIndex/detail","/preciousPaperGeneral/sellOnConsignmentManage/marketingAudit/awaitDeleveryDetails","/preciousPaperGeneral/packaginStationSAASManage/operationManage/ServiceChargeStandard","/preciousPaperGeneral/operationManagementBackground/wastePaperPriceIndex/DiscountFigure","/preciousPaperGeneral/companyAndUserManage/companyManage","/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/CreatePoint","/preciousPaperGeneral/operationManagementBackground/staffActicities","/preciousPaperGeneral/packaginStationSAASManage/authFactory/ApplyList","/preciousPaperGeneral/sellOnConsignmentManage/financeAudit/finaceAuditList","/preciousPaperGeneral/sellOnConsignmentManage/operationAudit/PaperFctRetMoneyIndex","/preciousPaperGeneral/operationManagementBackground/staffActicities/Index","/preciousPaperGeneral/sellOnConsignmentManage/customerManage/Index","/preciousPaperGeneral/operationManagementBackground/scoreManage/convert/Index","/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/PointList","/preciousPaperGeneral/operationManagementBackground/basicSetting/vipPaid/Index","/preciousPaperGeneral/operationManagementBackground/wastePaperPriceIndex/list","/preciousPaperGeneral/financialManagementBackground/payCenter/payForWater/Index","/preciousPaperGeneral/sellOnConsignmentManage/operationAudit/PaperFctRetMoneyIndex/orderList","/preciousPaperGeneral/packaginStationSAASManage/saasRefund/SaasRefundInfo","/preciousPaperGeneral/packaginStationSAASManage/operationManage/AuthorizationIndex","/preciousPaperGeneral/operationManagementBackground/basicSetting","/preciousPaperGeneral/packaginStationSAASManage/financeManage","/preciousPaperGeneral/sellOnConsignmentManage/operationAudit/operationAuditDetails","/preciousPaperGeneral/sellOnConsignmentManage","/preciousPaperGeneral/operationManagementBackground/contractManege/Index","/preciousPaperGeneral/sellOnConsignmentManage/orderReconciliation/financeAudit/PaperFctRetMoneyIndex","/preciousPaperGeneral/operationManagementBackground/articManage/Index","/preciousPaperGeneral/paperFctSellOnManage/ForwardList/Index","/preciousPaperGeneral/packaginStationSAASManage/saasAccount/SaasAccountList","/preciousPaperGeneral/operationManagementBackground/wastePaperPriceIndex/edit","/microSystemManagement/employee","/preciousPaperGeneral/operationManagementBackground/scoreManage","/preciousPaperGeneral/operationManagementBackground/articManage/Details","/preciousPaperGeneral/operationManagementBackground/basicSetting/wasteType/Index","/preciousPaperGeneral/operationManagementBackground/supplyOrderManage/Index","/preciousPaperGeneral/packaginStationSAASManage/proxyCheckOrder/CheckOrderList","/preciousPaperGeneral/operationManagementBackground/wastePaperPriceIndex/create","/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/Edit","/preciousPaperGeneral/packaginStationSAASManage/operationManage","/preciousPaperGeneral/operationManagementBackground/basicSetting/shop/Index","/preciousPaperGeneral/operationManagementBackground/contractManege","/preciousPaperGeneral/operationManagementBackground/feedbackManage/FeedbackIndex","/preciousPaperGeneral/sellOnConsignmentManage/capitalSource/CapitalSourceIndex","/preciousPaperGeneral/packaginStationSAASManage/factoryProxy/FactoryAgency","/preciousPaperGeneral/companyAndUserManage","/preciousPaperGeneral/operationManagementBackground/acticityRuleSetManage/acticityRuleSet","/preciousPaperGeneral/financialManagementBackground","/preciousPaperGeneral/operationManagementBackground/activityThemeManage/activityThemeManageIndex","/preciousPaperGeneral/operationManagementBackground/vipManage/personageVipManage/Details","/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/PaperFctoryTypeOfferList","/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/PaperType","/preciousPaperGeneral/sellOnConsignmentManage/PaperFctRetMoneyIndex/operationAudit/operationAuditList","/preciousPaperGeneral/sellOnConsignmentManage/operationAudit/operationAuditDetails/financialManagementBackground","/preciousPaperGeneral/paperFctSellOnManage/OrderList/JLIndex","/preciousPaperGeneral/paperFctSellOnManage","/preciousPaperGeneral/companyAndUserManage/packginStationManage/Index","/preciousPaperGeneral/financialManagementBackground/payCenter/memberAccountInfo/Index","/preciousPaperGeneral/operationManagementBackground/basicSetting/automaticallyArrive/Index","/preciousPaperGeneral/operationManagementBackground/basicSetting/orderSincereMoney/Index","/preciousPaperGeneral/packaginStationSAASManage/proxyReturn/ReturnOrderList","/preciousPaperGeneral/operationManagementBackground/feedbackManage","/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/Index","/preciousPaperGeneral/operationManagementBackground","/preciousPaperGeneral/operationManagementBackground/vipManage/personageVipManage/Index","/preciousPaperGeneral/paperFctSellOnManage/OrderList/OrderInfo","/microSystemManagement","/preciousPaperGeneral/paperFctSellOnManage/ForwardList/Details","/preciousPaperGeneral/operationManagementBackground/sysManage/departmentManage","/preciousPaperGeneral/financialManagementBackground/settlementManage/orderReconciliation/Index","/preciousPaperGeneral/operationManagementBackground/basicSetting/wasteTypeOneManage/Index","/preciousPaperGeneral/sellOnConsignmentManage/marketingAudit/inTheSettlementDetails","/preciousPaperGeneral/packaginStationSAASManage/saasOrder/SaasRefundList","/preciousPaperGeneral/sellOnConsignmentManage/standingBookManage/standingBook","/preciousPaperGeneral/paperFctSellOnManage/OrderList/Index","/preciousPaperGeneral/operationManagementBackground/supplyOrderManage","/microSystemManagement/department","/preciousPaperGeneral/sellOnConsignmentManage/marketingAudit/awaitSubscribeDetails","/preciousPaperGeneral/paperFctSellOnManage/PaperFctList/VehicleQueueIndex"]}} + +${reps_data} = <Response [200]> + + + +Logs the given message with the given level. + +${reps_data} + +<Response [200]> + + + +Fails if objects are unequal after converting them to strings. + +${reps_data.json()["message"]} +successful + + + + + + + + + + + + + +Critical Tests +All Tests + + + + +1-APPlogin & 1-WebLogin +1-APPlogin & 1-WebLogin.1-APPlogin +1-APPlogin & 1-WebLogin.1-WebLogin +1-APPlogin & 1-WebLogin.1-WebLogin.Weblogin + + + + + diff --git a/report.html b/report.html new file mode 100644 index 0000000..051de43 --- /dev/null +++ b/report.html @@ -0,0 +1,2431 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework report failed

+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +