@ -3,14 +3,14 @@ Documentation 拼版下单
Test Teardown Run Keyword If Test Failed Fatal Error
Test Teardown Run Keyword If Test Failed Fatal Error
Test Timeout
Test Timeout
Library urllib3
Library urllib3
Library String
Library demjson
Library Collections
Library Collections
Library HttpLibrary
Library JSONLibrary
Library RequestsLibrary
Library RequestsLibrary
Library DatabaseLibrary
Library DatabaseLibrary
Library JSONLibrary
Library demjson
Library HttpLibrary
Library HttpLibrary.HTTP
Library HttpLibrary.HTTP
Library String
*** Test Cases ***
*** Test Cases ***
spuDetail
spuDetail
@ -120,8 +120,8 @@ Quotation
${TotalPrice} Evaluate round(${Material}+${Technology},2) #总价
${TotalPrice} Evaluate round(${Material}+${Technology},2) #总价
${Price} Set Variable If '${TotalPrice}'<='125' 125 ${TotalPrice} #比较价格
${Price} Set Variable If '${TotalPrice}'<='125' 125 ${TotalPrice} #比较价格
${DATA} Evaluate demjson.encode(${DATA}) demjson
${DATA} Evaluate demjson.encode(${DATA}) demjson
${DATA} Replace String ${DATA} None null
${DATA} Replace String ${DATA} "null" null
${DATA} Replace String ${DATA} " None" null
# ${DATA} Replace String ${DATA} "null" null
${DATA} Convert Json To String ${DATA}
${DATA} Convert Json To String ${DATA}
Should Be Equal As Numbers ${Amount} ${Price}
Should Be Equal As Numbers ${Amount} ${Price}
Set Global Variable ${desc}
Set Global Variable ${desc}
@ -287,7 +287,16 @@ CreateOrder
${OrderData} Set Variable { \ \ \ \ "remark":"", \ \ \ \ "totalAmount":"${TotalAmount}", \ \ \ \ "taxFee":"${InvoicePrice}", \ \ \ \ "taxRate":"${InvoiceData}", \ \ \ \ "logisticsFee":"${Charges}", \ \ \ \ "supplierFactoryId":"${factoryId}", \ \ \ \ "supplierOrgId":"${orgId}", \ \ \ \ "customerContactsName":"${consigneeName}", \ \ \ \ "customerContactsPhone":"${consigneeMobile}", \ \ \ \ "deliveryAddressCityId":"${CityId}", \ \ \ \ "deliveryAddressCityName":"${cityName}", \ \ \ \ "deliveryAddressDistrictId":"${DistrictId}", \ \ \ \ "deliveryAddressDistrictName":"${districtName}", \ \ \ \ "shippingAddressId":"${AddressId}", \ \ \ \ "deliveryAddressLocDetails":"${AddressDetail}", \ \ \ \ "deliveryAddressProvinceId":"${ProvinceId}", \ \ \ \ "deliveryAddressProvinceName":"${provinceName}", \ \ \ \ "packingMethod":1, \ \ \ \ "salesOrderInvoice":{ \ \ \ \ \ \ \ \ "type":1, \ \ \ \ \ \ \ \ "invoiceTitleId":"${invoiceTitleId}", \ \ \ \ \ \ \ \ "entityType":"1", \ \ \ \ \ \ \ \ "invoicingEnterpriseAddress":"${invoicingEnterpriseAddress}", \ \ \ \ \ \ \ \ "invoicingEnterpriseName":"${invoicingEnterpriseName}", \ \ \ \ \ \ \ \ "invoicingEnterpriseOpeningBank":"${invoicingEnterpriseOpeningBank}", \ \ \ \ \ \ \ \ "invoicingEnterprisePhone":"${invoicingEnterprisePhone}", \ \ \ \ \ \ \ \ "invoicingOpenAccount":"${invoicingOpenAccount}", \ \ \ \ \ \ \ \ "taxpayerIdentificationNumber":"${taxpayerIdentificationNumber}" \ \ \ \ }, \ \ \ \ "salesOrderItemProduct":{ \ \ \ \ \ \ \ \ "productName":"${productName}", \ \ \ \ \ \ \ \ "productId":"${productId}", \ \ \ \ \ \ \ \ "amount":"${Amount}", \ \ \ \ \ \ \ \ "quantity":"${quantity}", \ \ \ \ \ \ \ \ "price":"${unitprice}", \ \ \ \ \ \ \ \ "productImgUrl":"${url}", \ \ \ \ \ \ \ \ "factoryId":"${factoryId}", \ \ \ \ \ \ \ \ "orgId":"${orgId}", \ \ \ \ \ \ \ \ "orderSource":1, \ \ \ \ \ \ \ \ "desc":"${desc}", \ \ \ \ \ \ \ \ "productMeasureDesc":"${productArea}", \ \ \ \ \ \ \ \ "productMaterialDesc":"${productMaterialDesc}", \ \ \ \ \ \ \ \ "productProcessDesc":"${productProcessDesc}", \ \ \ \ \ \ \ \ "copyFromId":null, \ \ \ \ \ \ \ \ "productSpecDetailJson":${DATA}, \ \ \ \ \ \ \ \ "productSpecDetail":"${desc}" \ \ \ \ }, \ \ \ \ "orderSource":1 }
${OrderData} Set Variable { \ \ \ \ "remark":"", \ \ \ \ "totalAmount":"${TotalAmount}", \ \ \ \ "taxFee":"${InvoicePrice}", \ \ \ \ "taxRate":"${InvoiceData}", \ \ \ \ "logisticsFee":"${Charges}", \ \ \ \ "supplierFactoryId":"${factoryId}", \ \ \ \ "supplierOrgId":"${orgId}", \ \ \ \ "customerContactsName":"${consigneeName}", \ \ \ \ "customerContactsPhone":"${consigneeMobile}", \ \ \ \ "deliveryAddressCityId":"${CityId}", \ \ \ \ "deliveryAddressCityName":"${cityName}", \ \ \ \ "deliveryAddressDistrictId":"${DistrictId}", \ \ \ \ "deliveryAddressDistrictName":"${districtName}", \ \ \ \ "shippingAddressId":"${AddressId}", \ \ \ \ "deliveryAddressLocDetails":"${AddressDetail}", \ \ \ \ "deliveryAddressProvinceId":"${ProvinceId}", \ \ \ \ "deliveryAddressProvinceName":"${provinceName}", \ \ \ \ "packingMethod":1, \ \ \ \ "salesOrderInvoice":{ \ \ \ \ \ \ \ \ "type":1, \ \ \ \ \ \ \ \ "invoiceTitleId":"${invoiceTitleId}", \ \ \ \ \ \ \ \ "entityType":"1", \ \ \ \ \ \ \ \ "invoicingEnterpriseAddress":"${invoicingEnterpriseAddress}", \ \ \ \ \ \ \ \ "invoicingEnterpriseName":"${invoicingEnterpriseName}", \ \ \ \ \ \ \ \ "invoicingEnterpriseOpeningBank":"${invoicingEnterpriseOpeningBank}", \ \ \ \ \ \ \ \ "invoicingEnterprisePhone":"${invoicingEnterprisePhone}", \ \ \ \ \ \ \ \ "invoicingOpenAccount":"${invoicingOpenAccount}", \ \ \ \ \ \ \ \ "taxpayerIdentificationNumber":"${taxpayerIdentificationNumber}" \ \ \ \ }, \ \ \ \ "salesOrderItemProduct":{ \ \ \ \ \ \ \ \ "productName":"${productName}", \ \ \ \ \ \ \ \ "productId":"${productId}", \ \ \ \ \ \ \ \ "amount":"${Amount}", \ \ \ \ \ \ \ \ "quantity":"${quantity}", \ \ \ \ \ \ \ \ "price":"${unitprice}", \ \ \ \ \ \ \ \ "productImgUrl":"${url}", \ \ \ \ \ \ \ \ "factoryId":"${factoryId}", \ \ \ \ \ \ \ \ "orgId":"${orgId}", \ \ \ \ \ \ \ \ "orderSource":1, \ \ \ \ \ \ \ \ "desc":"${desc}", \ \ \ \ \ \ \ \ "productMeasureDesc":"${productArea}", \ \ \ \ \ \ \ \ "productMaterialDesc":"${productMaterialDesc}", \ \ \ \ \ \ \ \ "productProcessDesc":"${productProcessDesc}", \ \ \ \ \ \ \ \ "copyFromId":null, \ \ \ \ \ \ \ \ "productSpecDetailJson":${DATA}, \ \ \ \ \ \ \ \ "productSpecDetail":"${desc}" \ \ \ \ }, \ \ \ \ "orderSource":1 }
log ${OrderData}
log ${OrderData}
${reps} POST On Session factory printing-package-mall-service/user/create/sales-order ${OrderData.encode('utf-8')}
${reps} POST On Session factory printing-package-mall-service/user/create/sales-order ${OrderData.encode('utf-8')}
${OrderId} Get From Dictionary ${reps.json()} data #订单id
${orderid} Get From Dictionary ${reps.json()} data #订单id
Set Global Variable ${orderid}
#支付订单
${OrderPay} Set Variable {"businessType":202,"tradeOrderId":"${orderid}"}
${reps} POST On Session factory wallet-service/user/prepay/wallet-bill ${OrderPay.encode('utf-8')}
${PayId} Get From Dictionary ${reps.json()['data']} id #获取支付id
${IdData} Set Variable {"id":"${PayId}"}
${reps} POST On Session factory /wallet-service/user/confirm/wallet-account-pay ${IdData.encode('utf-8')}
${message} Get From Dictionary ${reps.json()} message
Should Be Equal ${message} successful #校验是否一致
TestCase
TestCase
${Data} Set Variable { \ \ \ \ \ \ \ \ "amount":0.28, \ \ \ \ \ \ \ \ "detailItemName":"测试", \ \ \ \ \ \ \ \ "discountAmount":0, \ \ \ \ \ \ \ \ "formula":"None", \ \ \ \ \ \ \ \ "nodeIdList":"None", \ \ \ \ \ \ \ \ "originalAmount":0.28, \ \ \ \ \ \ \ \ "settlementName":"小小", \ \ \ \ \ \ \ \ "settlementNameEnum":1, \ \ \ \ \ \ \ \ "spuSpecItemType":"None", \ \ \ \ \ \ \ \ "topic":"开心麻花" }
${Data} Set Variable { \ \ \ \ \ \ \ \ "amount":0.28, \ \ \ \ \ \ \ \ "detailItemName":"测试", \ \ \ \ \ \ \ \ "discountAmount":0, \ \ \ \ \ \ \ \ "formula":"None", \ \ \ \ \ \ \ \ "nodeIdList":"None", \ \ \ \ \ \ \ \ "originalAmount":0.28, \ \ \ \ \ \ \ \ "settlementName":"小小", \ \ \ \ \ \ \ \ "settlementNameEnum":1, \ \ \ \ \ \ \ \ "spuSpecItemType":"None", \ \ \ \ \ \ \ \ "topic":"开心麻花" }