Browse Source

优化编辑拍品规则

pull/5/head
LG_lai 3 years ago
parent
commit
9ce86d3273
14 changed files with 77 additions and 9 deletions
  1. 2
      001-DirectSale/1-Client/create_order.robot
  2. BIN
      Datadriven.xls
  3. BIN
      DatadrivenB-1.xls
  4. BIN
      DatadrivenB-2.xls
  5. BIN
      DatadrivenB.xls
  6. BIN
      DatadrivenC-1.xls
  7. BIN
      DatadrivenC-2.xls
  8. BIN
      DatadrivenC.xls
  9. BIN
      DatadrivenF.xls
  10. BIN
      DatadrivenP.xls
  11. 8
      RF-TEST/0-Data driven/dataDriven.robot
  12. 8
      RF-TEST/1-Client/APPlogin.robot
  13. 3
      RF-TEST/1-Client/create_order.robot
  14. 65
      RF-TEST/2-Platform/Auction.robot

2
001-DirectSale/1-Client/create_order.robot

@ -31,7 +31,7 @@ get_papermill_list
${papermillname} Get From Dictionary ${item} name #获取纸厂name
${cumulativeWeight} Get From Dictionary ${item} cumulativeWeight #累计已代卖吨数
${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类列表
Exit For Loop If '${paperMillId}'=='723518259730714624'
Exit For Loop If '${paperMillId}'=='723518259730714624' #516测试纸厂id
END
${value} Evaluate random.choice(${paperCategoryList}) random
${categoryid} Get From Dictionary ${value} id #纸厂品类id

BIN
Datadriven.xls

BIN
DatadrivenB-1.xls

BIN
DatadrivenB-2.xls

BIN
DatadrivenB.xls

BIN
DatadrivenC-1.xls

BIN
DatadrivenC-2.xls

BIN
DatadrivenC.xls

BIN
DatadrivenF.xls

BIN
DatadrivenP.xls

8
RF-TEST/0-Data driven/dataDriven.robot

@ -112,3 +112,11 @@ ztbsc
${start_time} Get Substring ${start_time} 0 19
${end_time} Add Time To Date ${time} 1 day
${end_time} Get Substring ${end_time} 0 19
#转换'为空
#${List} Set Variable ['{"id":"742739866076450816"}', '{"id":"742363192650502144"}']
#${BList} Convert To String ${List}
#${BList} Replace String Using Regexp ${BList} ' \
#随机获取多个数值
${List} Set Variable [{0},{1},{2},3,4,5,6,7,8,9]
${num} Evaluate random.randint(1,8) random
${data} Evaluate random.sample(${List},${num}) random

8
RF-TEST/1-Client/APPlogin.robot

@ -45,7 +45,7 @@ get_baseInfo
${orgId} Get From Dictionary ${items} id #组织id
${orgfullName} Get From Dictionary ${items} fullName #组织名称
${packerBaseInfo} Get From Dictionary ${items} packerBaseInfo #组织工厂信息
Exit For Loop If '${orgfullName}'=='仔仔工厂'
Exit For Loop If '${orgId}'=='721760754042277888' #仔仔工厂组织id:721761724339982336 #长沙中联组织id:721760754042277888
END
${packerId} Get From Dictionary ${packerBaseInfo['scrapPaperPackingFactoryList'][0]} id #组织工厂id
${packerName} Get From Dictionary ${packerBaseInfo['scrapPaperPackingFactoryList'][0]} name #组织工厂名称
@ -70,10 +70,11 @@ get_Personal_baseInfo
${reps} GET On Session baseinfo ztb-supply-chain-service/get/user/base-info
${organizationList} Get From Dictionary ${reps.json()['data']} organizationList #用户组织列表
FOR ${items} IN @{organizationList}
${orgId_P} Get From Dictionary ${items} id #个人资质组织id
${orgfullName} Get From Dictionary ${items} fullName #组织名称
${enterpriseInfo} Get From Dictionary ${items} enterpriseInfo #组织企业信息
${qualificationType} Get From Dictionary ${items} qualificationType
Exit For Loop If '${orgfullName}'=='仔仔工厂'
Exit For Loop If '${orgId_P}'=='${orgId}'
END
${salesTaxPoint} Set Variable 2051
Set Global Variable ${salesTaxPoint}
@ -84,10 +85,11 @@ get_Enterprise_baseInfo
${reps} GET On Session baseinfo ztb-supply-chain-service/get/user/base-info
${organizationList} Get From Dictionary ${reps.json()['data']} organizationList #用户组织列表
FOR ${items} IN @{organizationList}
${orgId_T} Get From Dictionary ${items} id #个人资质组织id
${orgfullName} Get From Dictionary ${items} fullName #组织名称
${enterpriseInfo} Get From Dictionary ${items} enterpriseInfo #组织企业信息
${qualificationType} Get From Dictionary ${items} qualificationType
Exit For Loop If '${orgfullName}'=='长沙中联泵业股份有限公司'
Exit For Loop If '${orgId_T}'=='${orgId}'
END
${salesTaxPoint} Get From Dictionary ${enterpriseInfo} salesTaxPoint
Set Global Variable ${salesTaxPoint}

3
RF-TEST/1-Client/create_order.robot

@ -1,5 +1,6 @@
*** Settings ***
Documentation \#移动端下单
Test Teardown Run Keyword If Test Failed Fatal Error
Library String
Library DateTime
Library urllib3
@ -31,7 +32,7 @@ get_papermill_list
${papermillname} Get From Dictionary ${item} name #获取纸厂name
${cumulativeWeight} Get From Dictionary ${item} cumulativeWeight #累计已代卖吨数
${paperCategoryList} Get From Dictionary ${item} paperCategoryList #获取纸厂品类列表
Exit For Loop If '${papermillname}'=='516测试613'
Exit For Loop If '${paperMillId}'=='723518259730714624'
END
${value} Evaluate random.choice(${paperCategoryList}) random
${categoryid} Get From Dictionary ${value} id #纸厂品类id

65
RF-TEST/2-Platform/Auction.robot

@ -37,10 +37,12 @@ auction_detail
#拍品详情
Create Session auction ${uecops} ${ztbsc_header}
${reps} GET On Session auction auction-service/admin/get/auction/detail/${auctionEntrustId}
${auctionId} Get From Dictionary ${reps.json()['data']} auctionId #拍品唯一标识
${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 #拍品描述
${auctionId} Set Variable If '${auctionId}'=='${None}' null ${auctionId}
#修改拍品设置
#上传图片
Disable Warnings
@ -61,7 +63,8 @@ auction_detail
#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}" }
${quantity} Evaluate round(random.uniform(2,30),2) random #拍卖重量(吨)
${auctionData} Set Variable { \ \ \ \ "auctionLotImageList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "url":"${pictures}", \ \ \ \ \ \ \ \ \ \ \ \ "type":1 \ \ \ \ \ \ \ \ }], \ \ \ \ "displayDescribe":"${displayDescribe}", \ \ \ \ "displayAddress":"${displayAddress}", \ \ \ \ "displayName":"${displayName}", \ \ \ \ "quantity":${quantity}, \ \ \ \ "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
#设置拍品规则
@ -71,9 +74,12 @@ auction_detail
${Bidders} Get From Dictionary ${reps.json()['data']} records #竞拍人员列表
FOR ${items} IN @{Bidders}
${id} Get From Dictionary ${items} id #竞拍人员id
Append To List ${List} ${id}
Append To List ${List} {"id":"${id}"}
END
${bidders_List} Evaluate random.choice(${List}) random
${Num} Evaluate random.randint(1,6) random #获取随机数字
${bidders_List} Evaluate random.sample(${List},${Num}) random #获取多个竞拍人员id
${BList} Convert To String ${bidders_List}
${BiddersList} Replace String Using Regexp ${BList} ' \
#获取时间
${time} Get Current Date result_format=%Y-%m-%d %H:%M:00 #获取当前时间
${start_time} Add Time To Date ${time} 00:05:00 #获取未来两小时
@ -82,7 +88,10 @@ auction_detail
${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}" \ \ \ \ } }
${bidScale} Evaluate random.randint(1,10) random #加价幅度
${startingPrice} Evaluate random.randint(1000,2000) random #起拍价(元/吨)
${addDelayTime} Evaluate random.randint(1,5) random #延期时间(分钟)
${Auction_rules} Set Variable { \ \ \ \ "auctionBidderDtoList":${BiddersList}, \ \ \ \ "auctionLotDto":{ \ \ \ \ \ \ \ \ "startingPrice":"${startingPrice}", \ \ \ \ \ \ \ \ "id":"${auctionLotId}" \ \ \ \ }, \ \ \ \ "auctionDto":{ \ \ \ \ \ \ \ \ "id":"${auctionId}", \ \ \ \ \ \ \ \ "auctionEntrustId":"${auctionEntrustId}", \ \ \ \ \ \ \ \ "bidOptions":"${bidScale},${bidScale},${bidScale},${bidScale}", \ \ \ \ \ \ \ \ "bidScale":"${bidScale}", \ \ \ \ \ \ \ \ "endTime":"${end_time}", \ \ \ \ \ \ \ \ "startTime":"${start_time}", \ \ \ \ \ \ \ \ "addDelayStatus":true, \ \ \ \ \ \ \ \ "addDelayTime":"${addDelayTime}" \ \ \ \ } }
${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
#委托拍品列表
@ -97,3 +106,51 @@ auction_detail
${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
auction_detail1
#拍品详情
Create Session auction ${uecops} ${ztbsc_header}
${reps} GET On Session auction auction-service/admin/get/auction/detail/${auctionEntrustId}
${auctionId} Get From Dictionary ${reps.json()['data']} auctionId #拍品唯一标识
${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 #拍品描述
${auctionId} Set Variable If '${auctionId}'=='${None}' null ${auctionId}
#修改拍品设置
#上传图片
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}
${quantity} Evaluate round(random.uniform(2,30),2) random #拍卖重量(吨)
${auctionData} Set Variable { \ \ \ \ "auctionLotImageList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "url":"${pictures}", \ \ \ \ \ \ \ \ \ \ \ \ "type":1 \ \ \ \ \ \ \ \ }], \ \ \ \ "displayDescribe":"${displayDescribe}", \ \ \ \ "displayAddress":"${displayAddress}", \ \ \ \ "displayName":"${displayName}", \ \ \ \ "quantity":${quantity}, \ \ \ \ "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":"${id}"}
END
${Num} Evaluate random.randint(1,6) random #获取随机数字
${bidders_List} Evaluate random.sample(${List},${Num}) random
${BList} Convert To String ${bidders_List}
${BList} Replace Variables ${BList} ' "
Loading…
Cancel
Save