You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
5.1 KiB
77 lines
5.1 KiB
*** 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 ***
|