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

99 lines
7.1 KiB

*** Settings ***
Library RequestsLibrary
Library Collections
Library urllib3
Library DateTime
Library String
*** Test Cases ***
create_delegation
#创建委托
#获取委托方组织列表
Create Session auction ${uecops} ${ztbsc_header}
${reps} GET On Session auction uec/admin/get/organization-list params=pageNum=1&pageSize=300&keyword=
${records} Get From Dictionary ${reps.json()['data']} records #委托方组织列表
${auctionOrgInfo} Evaluate random.choice(${records}) random
${auctionFullName} Get From Dictionary ${auctionOrgInfo} fullName #委托方组织名称
#获取委托方组织
${reps} GET On Session auction uec/admin/get/organization-list params=pageNum=1&pageSize=30&keyword=${auctionFullName}
${fullName} Get From Dictionary ${reps.json()['data']['records'][0]} fullName #委托方组织名称
${orgId} Get From Dictionary ${reps.json()['data']['records'][0]} id #委托方组织id
Set Global Variable ${fullName}
#创建委托拍品
${autionData} Set Variable { \ \ \ \ "auctionEntrustDto":{ \ \ \ \ \ \ \ \ "contact":"小小", \ \ \ \ \ \ \ \ "contactNumber":"15014242835", \ \ \ \ \ \ \ \ "entrustTime":"${time}", \ \ \ \ \ \ \ \ "orgId":"${orgId}" \ \ \ \ }, \ \ \ \ "auctionLotDto":{ \ \ \ \ \ \ \ \ "address":"重庆", \ \ \ \ \ \ \ \ "lotDescribe":"黄废", \ \ \ \ \ \ \ \ "name":"一级纸(黄废)" \ \ \ \ } }
${reps} POST On Session auction auction-service/admin/create/auction ${autionData.encode('utf-8')}
Should Be Equal As Strings ${reps.json()['message']} successful
#委托拍品列表
${reps} GET On Session auction auction-service/admin/page/auction params=status=&pageNum=1&pageSize=10
${List} Get From Dictionary ${reps.json()['data']} records #委托拍品列表
FOR ${items} IN @{List}
${auctionEntrustId} Get From Dictionary ${items} auctionEntrustId #委托拍品id
${auctionSellerOrgName} Get From Dictionary ${items} auctionSellerOrgName #委托组织名称
Exit For Loop If '${auctionSellerOrgName}'=='${fullName}'
END
Set Global Variable ${auctionEntrustId}
auction_detail
#拍品详情
Create Session auction ${uecops} ${ztbsc_header}
${reps} GET On Session auction auction-service/admin/get/auction/detail/${auctionEntrustId}
${displayName} Get From Dictionary ${reps.json()['data']} displayName #拍品名称
${auctionLotId} Get From Dictionary ${reps.json()['data']} auctionLotId
${displayAddress} Get From Dictionary ${reps.json()['data']} displayAddress #拍品地
${displayDescribe} Get From Dictionary ${reps.json()['data']} displayDescribe #拍品描述
#修改拍品设置
#上传图片
Disable Warnings
${image} Evaluate open('./标的1-6.jpg','rb')
${filepath} Evaluate open('./标的1-6.jpg','rb')
${file} Create Dictionary filepath=${filepath} image=${image}
Create Session auction ${ztbops}
${reps} POST On Session auction recycle-user-center/upload/image files=${file}
${pictures} Get From Dictionary ${reps.json()} data
#上传MP4文件
#${file} Evaluate open('./5e7f47fb6aea3.mp4','rb')
#${file_data} Create Dictionary file=${file}
#${type_data} Create Dictionary type='mp4'
#Create Session auction ${ztbops}
#${reps} POST On Session auction recycle-user-center/upload/file data=${type_data} files=${fileData}
#${MP4Data} Get From Dictionary ${reps.json()} data
#Set Global Variable ${MP4Data}
#sleep 0.5
#保存拍品设置
Create Session auction ${uecops} ${ztbsc_header}
${auctionData} Set Variable { \ \ \ \ "auctionLotImageList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "url":"${pictures}", \ \ \ \ \ \ \ \ \ \ \ \ "type":1 \ \ \ \ \ \ \ \ }], \ \ \ \ "displayDescribe":"${displayDescribe}", \ \ \ \ "displayAddress":"${displayAddress}", \ \ \ \ "displayName":"${displayName}", \ \ \ \ "quantity":9, \ \ \ \ "id":"${auctionLotId}" }
${reps} POST On Session auction auction-service/admin/modify/auction-lot ${auctionData.encode('utf-8')}
Should Be Equal As Strings ${reps.json()['message']} successful
#设置拍品规则
#随机获取竞拍人员
${reps} GET On Session auction auction-service/admin/page/auction-bidder params=pageNum=1&pageSize=30&keyword=&depositPaymentStatus=1
${List} Create List
${Bidders} Get From Dictionary ${reps.json()['data']} records #竞拍人员列表
FOR ${items} IN @{Bidders}
${id} Get From Dictionary ${items} id #竞拍人员id
Append To List ${List} ${id}
END
${bidders_List} Evaluate random.choice(${List}) random
#获取时间
${time} Get Current Date result_format=%Y-%m-%d %H:%M:00 #获取当前时间
${start_time} Add Time To Date ${time} 00:05:00 #获取未来两小时
${start_time} Get Substring ${start_time} 0 19 #截取正常时间时间
#${end_time} Add Time To Date ${time} 1 day #获取第二天当前时间
${end_time} Add Time To Date ${time} 00:10:00
${end_time} Get Substring ${end_time} 0 19 #截取正常时间时间
#保存拍品规则
${Auction_rules} Set Variable { \ \ \ \ "auctionBidderDtoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "id":"${bidders_List}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "auctionLotDto":{ \ \ \ \ \ \ \ \ "startingPrice":2150, \ \ \ \ \ \ \ \ "id":"${auctionLotId}" \ \ \ \ }, \ \ \ \ "auctionDto":{ \ \ \ \ \ \ \ \ "id":null, \ \ \ \ \ \ \ \ "auctionEntrustId":"${auctionEntrustId}", \ \ \ \ \ \ \ \ "bidOptions":"10,30,15,20", \ \ \ \ \ \ \ \ "bidScale":10, \ \ \ \ \ \ \ \ "endTime":"${end_time}", \ \ \ \ \ \ \ \ "startTime":"${start_time}" \ \ \ \ } }
${reps} POST On Session auction auction-service/admin/modify/auction-rule ${Auction_rules.encode('utf-8')}
Should Be Equal As Strings ${reps.json()['message']} successful
#委托拍品列表
${reps} GET On Session auction auction-service/admin/page/auction params=status=&pageNum=1&pageSize=10
${List} Get From Dictionary ${reps.json()['data']} records #委托拍品列表
FOR ${items} IN @{List}
${auctionId} Get From Dictionary ${items} auctionId #竞拍唯一标识
${auctionSellerOrgName} Get From Dictionary ${items} auctionSellerOrgName #委托组织名称
Exit For Loop If '${auctionSellerOrgName}'=='${fullName}'
END
#上架拍品
${PutonAuction} Set Variable { \ \ \ \ "id":"${auctionId}", \ \ \ \ "isDown":false }
${reps} POST On Session auction auction-service/admin/operate/auction ${PutonAuction.encode('utf-8')}
Should Be Equal As Strings ${reps.json()['message']} successful