Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-cmdc
Commits
dc4fa65a
Commit
dc4fa65a
authored
Feb 18, 2024
by
liguangyu06
Browse files
用例新增:草稿单创建功能验证_代客下单
parent
54b1d8d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_order_list/草稿单创建功能验证_代客下单.air/草稿单创建功能验证_代客下单.py
0 → 100644
View file @
dc4fa65a
# -*- encoding=utf8 -*-
__author__
=
"liguangyu"
"""
case_tag:cmdc_api,cmdc草稿单创建功能验证_代客下单,2295,2295-56,sit,bs
主数据平台:后台运营系统草稿订单创建接口
"""
from
common.common_func
import
commonFuc
from
air_case.cmdc_login.后台管理系统登录.后台管理系统登录
import
CmdcDoLogin
import
requests
import
json
module
=
"cmdc_order_list"
# 第一步登录后台运营系统获取token
username
=
commonFuc
().
get_business_data
(
module
,
"username2"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password2"
)
# 获取登录后Cmdc_access_token
cmdc_access_token
=
CmdcDoLogin
(
username
,
password
).
get_token
()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers"
,
cmdc_access_token
)
# 第二步进行草稿订单创建操作
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url56"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload56"
)
# print(request_body)
"""
场景: 草稿单创建功能验证_代客下单
用例名称:草稿单创建功能验证_代客下单
输出:{"userNo":"1000086"}
"""
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
# 获取接口响应时间
api_time
=
float
(
result
.
elapsed
.
total_seconds
())
# 获取生成草稿订单对应的客户信息
result
=
json
.
loads
(
result
.
content
)
result
=
{
"userNo"
:
result
[
"data"
][
"userNo"
]}
# 将接口响应时间添加至result
result
[
"api_time"
]
=
api_time
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict56"
)
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
data/cmdc_order_list/data
View file @
dc4fa65a
...
...
@@ -391,7 +391,11 @@ checkDict54: {"success":true,"code":"200","message":"OK","data":false,"freshToke
#预期结果
checkDict55: {"success":true,"code":"200","message":"OK","data":false,"freshToken":null}
#测试场景五十六:草稿单创建功能验证_代客下单
"url56": "/product/public/draft/add"
"payload56": {"productMap":{"orderStatus":102,"demandItems":[{"maxProductNum":999999,"minProductNum":1,"addMinProductNum":1,"minProductNumSign":false,"isMultiple":false,"quantityTip":"","productCode":"10145928","productId":9,"materialCode":"","productName":"威尔特","specifications":"犬瘟热","manufacturer":"北京康思润业生物技术有限公司-黄翼","productLineName":"电商产品线","productLineCode":"DS-002","zonePriceVOList":null,"price":68.88,"storageType":"999","optionStr":"犬瘟热","measuringUnit":"EA","ippMiniPurchaseNum":null,"ippMultipleSign":null,"ippPurchaseMultiple":null,"ippStatus":null,"quantity":1,"isGift":0,"measuringUnit1":"个","imageUrl":"https://pro-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2020/12/30/a5937bce-1fd4-4219-8271-b15d0e9260ca.JPG","companyCode":"00102","areaName":null,"areaPrice":68.88,"agreementPriceId":null,"hidden":null,"description":"","taxRate":"0.17","allMaterialSign":null,"materialCodeExact":null,"specificationsExact":null,"hospitalOrderType":null,"hospitalHopeDate":null,"siteCompanyCode":null,"propertyName":"商品属性名","propertyVal":"10145928","propertyNote":"10145928","mustInstallDate":false,"showDemandAuditLineLabel":false,"yaPei":false,"installedDateMust":0,"yapeiPrice":null,"editProductCode":false,"quantityErr":false,"fresenuis":false,"zeroSign":false,"purchaseZeroProductList":[],"activityBasicId":null,"giftList":[],"selectGiftArr":[],"selectZeroGiftObj":{"mainProductList":[],"giftProductList":[]},"giftGroupQuantity":1,"propertyStr":"商品属性名:10145928&10145928"}],"paymentAmount":68.88,"productAmount":68.88,"userId":124100,"userNo":"1000086","customerCode":"1000086","userName":"北京海德锐视科技有限公司","companyId":"7","paymentType":1,"receiveBankName":"国药集团联合医疗器械有限公司","receiveBankAccount":"0200002919200155850","accountId":5,"receiverName":"张梦怡","receiverContact":"13810613577","receiverAddress":"上海市浦东新区浦电路3号1","addressNumber":17823,"remark":"","receiverNote":"张梦怡","receiverPhoneNote":"13810613577","receiverAddressNote":"上海市浦东新区浦电路3号1","addressNoNote":17823,"fileList":[],"sellerCompanyCode":"00102","sellerCompanyName":"国药集团联合医疗器械有限公司","orderSource":2,"customerInfo":{"userId":124100,"userName":"GL1000086","rejectUserName":null,"password":null,"realName":"张梦","userNo":"1000086","telephone":"18008613531","rejectTelephone":null,"registerAddress":null,"detailAddress":"国联客户地址","businessScope":null,"companyProperty":101,"companyId":null,"companyCode":null,"companyName":"国药集团联合医疗器械有限公司","companyNameList":null,"customerCompanyName":"北京海德锐视科技有限公司","lienceNo":"91110106579004448R","userType":2,"companyType":null,"status":3,"disableSign":0,"deleteSign":null,"createBy":null,"updateBy":null,"createTime":null,"updateTime":null,"licenceSketchUrl":null,"licenceUrl":null,"openId":null,"referrer":null,"gift":null,"identity":null,"department":null,"platformStatus":1,"rejectionReason":null,"registerType":null,"siteType":null,"departmentCode":null,"personName":null,"registration":null,"realPassword":null,"recommend":null,"merchantsStatus":null,"backAuditing":false,"taxRate":0.17,"roleNames":null,"subCompanyName":"国药集团联合医疗器械有限公司","roleIds":null,"addressList":null,"licenseList":null,"labelList":null,"managerList":null,"createTimeStr":null,"categoriesList":null,"merchantsAddress":null,"merchantStatus":null,"refuseReason":null,"merchantsId":null,"userTransactionAmount":"630.63","gray":null,"bindingTime":null,"bindSign":1,"jdeStatus":0,"jdePhone":"","recommender":null,"coopeSgin":null,"cusCompanyName":null,"registerLicenceList":null,"bindflowList":null,"userJDEInfo":null}},"id":null,"type":1,"userNo":"1000086","customerCode":"1000086","userName":"北京海德锐视科技有限公司"}
#预期结果
checkDict56: {"userNo":"1000086"}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment