From f09f645d02ecf551beb6204ca3cf6165ba9ccee9 Mon Sep 17 00:00:00 2001 From: LG_lai Date: Tue, 16 Aug 2022 19:56:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 000-Data/3-Infomation.robot | 77 ++++++++++++++++++++++++++++++ 001-Client/1-FactoryReceipt.robot | 74 ---------------------------- 001-Client/2-FactoryOffsite.robot | 69 -------------------------- 001-Client/3-FactoryOutbound.robot | 73 ---------------------------- 4 files changed, 77 insertions(+), 216 deletions(-) create mode 100644 000-Data/3-Infomation.robot diff --git a/000-Data/3-Infomation.robot b/000-Data/3-Infomation.robot new file mode 100644 index 0000000..005ab08 --- /dev/null +++ b/000-Data/3-Infomation.robot @@ -0,0 +1,77 @@ +*** Settings *** +Library Collections +Library RequestsLibrary + +*** Test Cases *** +getInformation + #获取所有废纸分类 + Create Session ztbf ${ztbClient} ${client_header} + ${reps} GET On Session ztbf ztb-factory/factory/get/all-product params=pageNum=1&pageSize=100 + ${records} Get From Dictionary ${reps.json()['data']} records #废纸分类列表 + FOR ${items} IN @{records} + ${id} Get From Dictionary ${items} id + ${name} Get From Dictionary ${items} name + ${smallProductCategoryInfoList} Get From Dictionary ${items} smallProductCategoryInfoList + Exit For Loop If '${id}'=='101010101' + END + ${CategoryInfo} Evaluate random.choice(${smallProductCategoryInfoList}) random #随机获取品类 + ${categoryId} Get From Dictionary ${CategoryInfo} id #纸品id + ${categoryName} Get From Dictionary ${CategoryInfo} categoryName #纸品name + ${defaultUnitPrice} Get From Dictionary ${CategoryInfo} defaultUnitPrice #纸品指导价格 + ${highestUnitPrice} Get From Dictionary ${CategoryInfo} highestUnitPrice #纸品最高价格 + ${productcategoryId} Get From Dictionary ${CategoryInfo} categoryId #纸品品类id + Set Global Variable ${categoryId} + Set Global Variable ${categoryName} + Set Global Variable ${defaultUnitPrice} + Set Global Variable ${highestUnitPrice} + Set Global Variable ${productcategoryId} + #获取供应商 + ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 + ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 + ${CustomerInfo} Evaluate random.choice(${customerList}) random #随机获取供应商信息 + ${name} Get From Dictionary ${CustomerInfo} name #供应商姓名 + ${CustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 + ${customerSettleType} Get From Dictionary ${CustomerInfo} customerSettleType + Set Global Variable ${name} + Set Global Variable ${CustomerId} + Set Global Variable ${customerSettleType} + #获取厂外收货供应商列表 + Create Session ztbf ${ztbClient} ${client_header} + ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 + ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 + FOR ${CustomerInfo} IN @{customerList} + ${Offsitename} Get From Dictionary ${CustomerInfo} name #供应商姓名 + ${OffsitecardNo} Get From Dictionary ${CustomerInfo} cardNo #供应商卡ID + ${OffsiteCustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 + Exit For Loop If '${OffsiteCustomerId}'=='133' + END + Set Global Variable ${Offsitename} + Set Global Variable ${OffsitecardNo} + Set Global Variable ${OffsiteCustomerId} + #获取客户信息 + ${reps} GET On Session ztbf ztb-factory/factorydeliverychannel/get/self-factory-delivery-channel-list params=pageNum=1&pageSize=20 + ${ChannelList} Get From Dictionary ${reps.json()['data']} records #客户列表 + ${ChannelInfo} Evaluate random.choice(${ChannelList}) random #随机获取客户信息 + ${ChannelId} Get From Dictionary ${ChannelInfo} id #客户id + ${factoryId} Get From Dictionary ${ChannelInfo} factoryId #工厂id + ${ChannelName} Get From Dictionary ${ChannelInfo} name #客户name + Set Global Variable ${factoryId} + Set Global Variable ${ChannelId} + Set Global Variable ${ChannelName} + #获取员工 + ${reps} GET On Session ztbf recycle-user-center/get/self-department-member-list params=enterpriseId=null&isPassFromBackstage=1 + ${MemberList} Get From Dictionary ${reps.json()['data']} records #获取员工列表 + ${MemberInfo} Evaluate random.choice(${MemberList}) random #随机获取员工信息 + ${enterpriseMemberId} Get From Dictionary ${MemberInfo} enterpriseMemberId #企业员工id + ${enterpriseMemberName} Get From Dictionary ${MemberInfo} enterpriseMemberName #企业员工name + Set Global Variable ${enterpriseMemberId} + Set Global Variable ${enterpriseMemberName} + #上传图片 + ${filepath} Evaluate open('./21042217001449712.png','rb') + ${image} Evaluate open('./21042217001449712.png','rb') + ${file_data} Create Dictionary file=${filepath} image=${image} + ${type} Create Dictionary type=image + Create Session order ${ztbClient} ${Header} + ${reps} POST On Session order recycle-user-center/file-uploading/upload/image data=${type} files=${file_data} + ${Image} Get From Dictionary ${reps.json()} data #获取图片阿里云地址 + Set Global Variable ${Image} diff --git a/001-Client/1-FactoryReceipt.robot b/001-Client/1-FactoryReceipt.robot index 65f772c..b830ca6 100644 --- a/001-Client/1-FactoryReceipt.robot +++ b/001-Client/1-FactoryReceipt.robot @@ -3,75 +3,6 @@ Library Collections Library RequestsLibrary *** Test Cases *** -getInformation - #获取所有废纸分类 - Create Session ztbf ${ztbClient} ${client_header} - ${reps} GET On Session ztbf ztb-factory/factory/get/all-product params=pageNum=1&pageSize=100 - ${records} Get From Dictionary ${reps.json()['data']} records #废纸分类列表 - FOR ${items} IN @{records} - ${id} Get From Dictionary ${items} id - ${name} Get From Dictionary ${items} name - ${smallProductCategoryInfoList} Get From Dictionary ${items} smallProductCategoryInfoList - Exit For Loop If '${id}'=='101010101' - END - ${CategoryInfo} Evaluate random.choice(${smallProductCategoryInfoList}) random #随机获取品类 - ${categoryId} Get From Dictionary ${CategoryInfo} id #纸品id - ${categoryName} Get From Dictionary ${CategoryInfo} categoryName #纸品name - ${defaultUnitPrice} Get From Dictionary ${CategoryInfo} defaultUnitPrice #纸品指导价格 - ${highestUnitPrice} Get From Dictionary ${CategoryInfo} highestUnitPrice #纸品最高价格 - Set Global Variable ${categoryId} - Set Global Variable ${categoryName} - Set Global Variable ${defaultUnitPrice} - Set Global Variable ${highestUnitPrice} - #获取供应商 - ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 - ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 - ${CustomerInfo} Evaluate random.choice(${customerList}) random #随机获取供应商信息 - ${name} Get From Dictionary ${CustomerInfo} name #供应商姓名 - ${CustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 - ${customerSettleType} Get From Dictionary ${CustomerInfo} customerSettleType - Set Global Variable ${name} - Set Global Variable ${CustomerId} - Set Global Variable ${customerSettleType} - #获取厂外收货供应商列表 - Create Session ztbf ${ztbClient} ${client_header} - ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 - ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 - FOR ${CustomerInfo} IN @{customerList} - ${Offsitename} Get From Dictionary ${CustomerInfo} name #供应商姓名 - ${OffsitecardNo} Get From Dictionary ${CustomerInfo} cardNo #供应商卡ID - ${OffsiteCustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 - Exit For Loop If '${OffsiteCustomerId}'=='133' - END - Set Global Variable ${Offsitename} - Set Global Variable ${OffsitecardNo} - Set Global Variable ${OffsiteCustomerId} - #获取客户信息 - ${reps} GET On Session ztbf ztb-factory/factorydeliverychannel/get/self-factory-delivery-channel-list params=pageNum=1&pageSize=20 - ${ChannelList} Get From Dictionary ${reps.json()['data']} records #客户列表 - ${ChannelInfo} Evaluate random.choice(${ChannelList}) random #随机获取客户信息 - ${ChannelId} Get From Dictionary ${ChannelInfo} id #客户id - ${ChannelName} Get From Dictionary ${ChannelInfo} name #客户name - Set Global Variable ${ChannelId} - Set Global Variable ${ChannelName} - #获取员工 - ${reps} GET On Session ztbf recycle-user-center/get/self-department-member-list params=enterpriseId=null&isPassFromBackstage=1 - ${MemberList} Get From Dictionary ${reps.json()['data']} records #获取员工列表 - ${MemberInfo} Evaluate random.choice(${MemberList}) random #随机获取员工信息 - ${enterpriseMemberId} Get From Dictionary ${MemberInfo} enterpriseMemberId #企业员工id - ${enterpriseMemberName} Get From Dictionary ${MemberInfo} enterpriseMemberName #企业员工name - Set Global Variable ${enterpriseMemberId} - Set Global Variable ${enterpriseMemberName} - #上传图片 - ${filepath} Evaluate open('./21042217001449712.png','rb') - ${image} Evaluate open('./21042217001449712.png','rb') - ${file_data} Create Dictionary file=${filepath} image=${image} - ${type} Create Dictionary type=image - Create Session order ${ztbClient} ${Header} - ${reps} POST On Session order recycle-user-center/file-uploading/upload/image data=${type} files=${file_data} - ${Image} Get From Dictionary ${reps.json()} data #获取图片阿里云地址 - Set Global Variable ${Image} - ReceiptOrder #创建厂内收货订单--手工单 Create Session ztbf ${ztbClient} ${client_header} @@ -89,11 +20,6 @@ ReceiptOrder #支付订单:现金、银行卡支付 ${paymentData} Set Variable {"settleType":2,"ids":["${OrderId}"]} ${reps} POST On Session ztbf ztb-factory/wechat-applet/merge-receiving-pay-order/pay ${paymentData.encode('utf-8')} - ${weightNoteList} Get From Dictionary ${reps.json()['data']} records #磅单列表 - FOR ${items} IN @{weightNoteList} - ${OrderId} Get From Dictionary ${items} id #订单Id - ${productId} Get From Dictionary ${items} productId #纸品id - Exit For Loop If '${productId}'=='' ReceiptWeigh #厂内收货--刷卡过磅 diff --git a/001-Client/2-FactoryOffsite.robot b/001-Client/2-FactoryOffsite.robot index 4a43129..6dfb164 100644 --- a/001-Client/2-FactoryOffsite.robot +++ b/001-Client/2-FactoryOffsite.robot @@ -5,75 +5,6 @@ Library Collections Library RequestsLibrary *** Test Cases *** -getInformation - #获取所有废纸分类 - Create Session ztbf ${ztbClient} ${client_header} - ${reps} GET On Session ztbf ztb-factory/factory/get/all-product params=pageNum=1&pageSize=100 - ${records} Get From Dictionary ${reps.json()['data']} records #废纸分类列表 - FOR ${items} IN @{records} - ${id} Get From Dictionary ${items} id - ${name} Get From Dictionary ${items} name - ${smallProductCategoryInfoList} Get From Dictionary ${items} smallProductCategoryInfoList - Exit For Loop If '${id}'=='101010101' - END - ${CategoryInfo} Evaluate random.choice(${smallProductCategoryInfoList}) random #随机获取品类 - ${categoryId} Get From Dictionary ${CategoryInfo} id #纸品id - ${categoryName} Get From Dictionary ${CategoryInfo} categoryName #纸品name - ${defaultUnitPrice} Get From Dictionary ${CategoryInfo} defaultUnitPrice #纸品指导价格 - ${highestUnitPrice} Get From Dictionary ${CategoryInfo} highestUnitPrice #纸品最高价格 - Set Global Variable ${categoryId} - Set Global Variable ${categoryName} - Set Global Variable ${defaultUnitPrice} - Set Global Variable ${highestUnitPrice} - #获取供应商 - ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 - ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 - ${CustomerInfo} Evaluate random.choice(${customerList}) random #随机获取供应商信息 - ${name} Get From Dictionary ${CustomerInfo} name #供应商姓名 - ${CustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 - ${customerSettleType} Get From Dictionary ${CustomerInfo} customerSettleType - Set Global Variable ${name} - Set Global Variable ${CustomerId} - Set Global Variable ${customerSettleType} - #获取厂外收货供应商列表 - Create Session ztbf ${ztbClient} ${client_header} - ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 - ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 - FOR ${CustomerInfo} IN @{customerList} - ${Offsitename} Get From Dictionary ${CustomerInfo} name #供应商姓名 - ${OffsitecardNo} Get From Dictionary ${CustomerInfo} cardNo #供应商卡ID - ${OffsiteCustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 - Exit For Loop If '${OffsiteCustomerId}'=='133' - END - Set Global Variable ${Offsitename} - Set Global Variable ${OffsitecardNo} - Set Global Variable ${OffsiteCustomerId} - #获取客户信息 - ${reps} GET On Session ztbf ztb-factory/factorydeliverychannel/get/self-factory-delivery-channel-list params=pageNum=1&pageSize=20 - ${ChannelList} Get From Dictionary ${reps.json()['data']} records #客户列表 - ${ChannelInfo} Evaluate random.choice(${ChannelList}) random #随机获取客户信息 - ${ChannelId} Get From Dictionary ${ChannelInfo} id #客户id - ${ChannelName} Get From Dictionary ${ChannelInfo} name #客户name - Set Global Variable ${ChannelId} - Set Global Variable ${ChannelName} - #获取员工 - ${reps} GET On Session ztbf recycle-user-center/get/self-department-member-list params=enterpriseId=null&isPassFromBackstage=1 - ${MemberList} Get From Dictionary ${reps.json()['data']} records #获取员工列表 - ${MemberInfo} Evaluate random.choice(${MemberList}) random #随机获取员工信息 - ${enterpriseMemberId} Get From Dictionary ${MemberInfo} enterpriseMemberId #企业员工id - ${enterpriseMemberName} Get From Dictionary ${MemberInfo} enterpriseMemberName #企业员工name - Set Global Variable ${enterpriseMemberId} - Set Global Variable ${enterpriseMemberName} - #上传图片 - ${filepath} Evaluate open('./21042217001449712.png','rb') - ${image} Evaluate open('./21042217001449712.png','rb') - ${file_data} Create Dictionary file=${filepath} image=${image} - ${type} Create Dictionary type=image - Create Session order ${ztbClient} ${Header} - ${reps} POST On Session order recycle-user-center/file-uploading/upload/image data=${type} files=${file_data} - ${Image} Get From Dictionary ${reps.json()} data #获取图片阿里云地址 - Set Global Variable ${Image} - OffsiteOrder #创建厂外收货订单 Create Session ztbf ${ztbClient} ${client_header} diff --git a/001-Client/3-FactoryOutbound.robot b/001-Client/3-FactoryOutbound.robot index 026076c..ebe18de 100644 --- a/001-Client/3-FactoryOutbound.robot +++ b/001-Client/3-FactoryOutbound.robot @@ -3,79 +3,6 @@ Library Collections Library RequestsLibrary *** Test Cases *** -getInformation - #获取所有废纸分类 - Create Session ztbf ${ztbClient} ${client_header} - ${reps} GET On Session ztbf ztb-factory/factory/get/all-product params=pageNum=1&pageSize=100 - ${records} Get From Dictionary ${reps.json()['data']} records #废纸分类列表 - FOR ${items} IN @{records} - ${id} Get From Dictionary ${items} id - ${name} Get From Dictionary ${items} name - ${smallProductCategoryInfoList} Get From Dictionary ${items} smallProductCategoryInfoList - Exit For Loop If '${id}'=='101010101' - END - ${CategoryInfo} Evaluate random.choice(${smallProductCategoryInfoList}) random #随机获取品类 - ${categoryId} Get From Dictionary ${CategoryInfo} id #纸品id - ${categoryName} Get From Dictionary ${CategoryInfo} categoryName #纸品name - ${defaultUnitPrice} Get From Dictionary ${CategoryInfo} defaultUnitPrice #纸品指导价格 - ${highestUnitPrice} Get From Dictionary ${CategoryInfo} highestUnitPrice #纸品最高价格 - ${productcategoryId} Get From Dictionary ${CategoryInfo} categoryId #纸品品类id - Set Global Variable ${categoryId} - Set Global Variable ${categoryName} - Set Global Variable ${defaultUnitPrice} - Set Global Variable ${highestUnitPrice} - Set Global Variable ${productcategoryId} - #获取供应商 - ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 - ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 - ${CustomerInfo} Evaluate random.choice(${customerList}) random #随机获取供应商信息 - ${name} Get From Dictionary ${CustomerInfo} name #供应商姓名 - ${CustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 - ${customerSettleType} Get From Dictionary ${CustomerInfo} customerSettleType - Set Global Variable ${name} - Set Global Variable ${CustomerId} - Set Global Variable ${customerSettleType} - #获取厂外收货供应商列表 - Create Session ztbf ${ztbClient} ${client_header} - ${reps} GET On Session ztbf ztb-factory/factory/get/customer-list params=name=&pageNum=1&pageSize=1500 - ${customerList} Get From Dictionary ${reps.json()['data']} records #供应商列表 - FOR ${CustomerInfo} IN @{customerList} - ${Offsitename} Get From Dictionary ${CustomerInfo} name #供应商姓名 - ${OffsitecardNo} Get From Dictionary ${CustomerInfo} cardNo #供应商卡ID - ${OffsiteCustomerId} Get From Dictionary ${CustomerInfo} id #供应商唯一标识 - Exit For Loop If '${OffsiteCustomerId}'=='133' - END - Set Global Variable ${Offsitename} - Set Global Variable ${OffsitecardNo} - Set Global Variable ${OffsiteCustomerId} - #获取客户信息 - ${reps} GET On Session ztbf ztb-factory/factorydeliverychannel/get/self-factory-delivery-channel-list params=pageNum=1&pageSize=20 - ${ChannelList} Get From Dictionary ${reps.json()['data']} records #客户列表 - ${ChannelInfo} Evaluate random.choice(${ChannelList}) random #随机获取客户信息 - ${ChannelId} Get From Dictionary ${ChannelInfo} id #客户id - ${factoryId} Get From Dictionary ${ChannelInfo} factoryId #工厂id - ${ChannelName} Get From Dictionary ${ChannelInfo} name #客户name - Set Global Variable ${factoryId} - Set Global Variable ${ChannelId} - Set Global Variable ${ChannelName} - #获取员工 - ${reps} GET On Session ztbf recycle-user-center/get/self-department-member-list params=enterpriseId=null&isPassFromBackstage=1 - ${MemberList} Get From Dictionary ${reps.json()['data']} records #获取员工列表 - ${MemberInfo} Evaluate random.choice(${MemberList}) random #随机获取员工信息 - ${enterpriseMemberId} Get From Dictionary ${MemberInfo} enterpriseMemberId #企业员工id - ${enterpriseMemberName} Get From Dictionary ${MemberInfo} enterpriseMemberName #企业员工name - Set Global Variable ${enterpriseMemberId} - Set Global Variable ${enterpriseMemberName} - #上传图片 - ${filepath} Evaluate open('./21042217001449712.png','rb') - ${image} Evaluate open('./21042217001449712.png','rb') - ${file_data} Create Dictionary file=${filepath} image=${image} - ${type} Create Dictionary type=image - Create Session order ${ztbClient} ${Header} - ${reps} POST On Session order recycle-user-center/file-uploading/upload/image data=${type} files=${file_data} - ${Image} Get From Dictionary ${reps.json()} data #获取图片阿里云地址 - Set Global Variable ${Image} - OutboundOrder #出货--手工单 Create Session ztbf ${ztbClient} ${client_header} -- 2.26.2