纸通宝交易版
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.
 
 

53 lines
3.1 KiB

*** Settings ***
Library RequestsLibrary
Library Collections
Library DateTime
*** 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 #纸厂品类价格
Set Global Variable ${categoryid} ${unitPrice}
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