Commit d71b4a91 authored by liguangyu06's avatar liguangyu06
Browse files

用例新增:站点资料申请变更功能验证

parent 347c80db
# -*- encoding=utf8 -*-
__author__ = "liguangyu"
"""
case_tag:cmdc_api,cmdc站点资料申请变更功能验证,31,31-5,sit,be
主数据平台:后台运营系统站点资料申请变更接口
"""
from common.common_func import commonFuc
from air_case.cmdc_login.后台管理系统登录.后台管理系统登录 import CmdcDoLogin
import requests
import json
module = "cmdc_31st"
# 第一步登录后台运营系统获取token
username = commonFuc().get_business_data(module, "username1_be")
password = commonFuc().get_business_data(module, "password1_be")
# 获取登录后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, "url11")
request_body = commonFuc().get_business_data(module, "payload11")
"""
场景: 站点资料申请变更功能验证
用例名称:站点资料申请变更功能验证
输出:{"success":true,"code":"200","message":"OK","data":"success"}
"""
# 发送请求
result = requests.post(url, json=request_body, headers=headers)
# 获取接口响应时间
api_time = float(result.elapsed.total_seconds())
result = json.loads(result.content)
print(result)
# 将接口响应时间添加至result
result["api_time"] = api_time
# 获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict11")
# print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result)
...@@ -100,7 +100,11 @@ checkDict9: {"success":true,"code":"200","message":"OK"} ...@@ -100,7 +100,11 @@ checkDict9: {"success":true,"code":"200","message":"OK"}
checkDict10: {"success":true,"code":"200","message":"OK"} checkDict10: {"success":true,"code":"200","message":"OK"}
#测试场景十一:站点资料申请变更功能验证
"url11": "/user/tripartiteChange/toChange"
"payload11": {"changeSubject":"站点资料变更申请测试","companyName":"国药集团联合医疗器械有限公司","companyProperty":"101","licenceList":[{"validityStartTime":"2024-01-22","validityEndTime":"2032-04-30","validityTime":["2024-01-22","2032-04-30"],"licenceTypeExplain":"营业执照","licenceType":"008","licenceUrl":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/91e5bc63-3883-4f69-9c46-a698c7682ced.jpg","fileList":[{"status":"success","name":"WechatIMG252.jpg","size":456498,"percentage":100,"uid":1705907694509,"raw":{"uid":1705907694509},"url":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/91e5bc63-3883-4f69-9c46-a698c7682ced.jpg","response":{"success":true,"code":"200","message":"OK","data":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/91e5bc63-3883-4f69-9c46-a698c7682ced.jpg","freshToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjIsInVzZXJOYW1lIjoiYWRtaW4yIiwidGltZSI6MTcwNTkwNzY5NDY2N30.1ePCWHUgUa1j4gK3gKrOpAiC0nAvbcz2pFTKZX_1QN4"},"filetype":"","title":"WechatIMG252.jpg","validId":""}],"newOneScope":"","oldOneScope":"","newTwoScope":"","oldTwoScope":"","newThreeScope":"","oldThreeScope":"","licenceCode":"213421414"}],"suppleList":[{"validityStartTime":"2024-01-22","validityEndTime":"2035-02-28","validityTime":["2024-01-22","2035-02-28"],"licenceTypeExplain":"续签协议","licenceType":"0012","licenceUrl":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/14e2940e-5415-4b30-8822-1e3dffbae79e.jpg","fileList":[{"status":"success","name":"WechatIMG252.jpg","size":456498,"percentage":100,"uid":1705907730774,"raw":{"uid":1705907730774},"url":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/14e2940e-5415-4b30-8822-1e3dffbae79e.jpg","response":{"success":true,"code":"200","message":"OK","data":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/14e2940e-5415-4b30-8822-1e3dffbae79e.jpg","freshToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjIsInVzZXJOYW1lIjoiYWRtaW4yIiwidGltZSI6MTcwNTkwNzczMDkwNn0.abX7CpflkGMmQrdsOSOHycL_g2ObHsyHPDt1DxW2Vu0"},"filetype":"","title":"WechatIMG252.jpg","validId":""}],"licenceCode":"3245315251515"}],"companyCode":"00102","area":3,"businessUnit":"12325556677","registrations":[],"city":2,"telephone":"18008613536","userName":"admin2","userId":2,"businessPlace":"北京市顺义区金航中路3号天竺万科中心1号楼3单元2层201(北京天竺综合保税区))","legalName":"张洁2","principal":"张洁2","province":1,"merchantsDepositoryList":[{"depositoryId":964,"abbreviation":null,"addressDetail":"北京市顺义区顺义港物流园区机场北街10号A2-2","merchantsId":null,"userId":null,"depotProvince":1,"depotCity":2,"depotArea":3,"createTime":"2024-01-11T03:09:40.000+0000","updateTime":"2024-01-11T03:09:40.000+0000","tripartiteId":255},{"depositoryId":965,"abbreviation":null,"addressDetail":"仓库地址","merchantsId":null,"userId":null,"depotProvince":217,"depotCity":218,"depotArea":221,"createTime":"2024-01-11T03:09:40.000+0000","updateTime":"2024-01-11T03:09:40.000+0000","tripartiteId":255}],"registerLicenceList":[{"validityStartTime":"","validityEndTime":"","validityTime":["2024-01-22","2032-04-30"],"licenceTypeExplain":"营业执照","licenceType":"008","licenceUrl":"","fileList":[{"status":"success","name":"WechatIMG252.jpg","size":456498,"percentage":100,"uid":1705907694509,"raw":{"uid":1705907694509},"url":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/91e5bc63-3883-4f69-9c46-a698c7682ced.jpg","response":{"success":true,"code":"200","message":"OK","data":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/91e5bc63-3883-4f69-9c46-a698c7682ced.jpg","freshToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjIsInVzZXJOYW1lIjoiYWRtaW4yIiwidGltZSI6MTcwNTkwNzY5NDY2N30.1ePCWHUgUa1j4gK3gKrOpAiC0nAvbcz2pFTKZX_1QN4"},"filetype":"","title":"WechatIMG252.jpg","validId":""}],"newOneScope":"","oldOneScope":"","newTwoScope":[],"oldTwoScope":[],"newThreeScope":[],"oldThreeScope":[],"licenceCode":"213421414"}],"detailAddress":"北京市朝阳区太阳宫中路19号院1号楼2层\n","merchantsCategoryList":[{"id":1193,"categoryId":1,"typeId":2,"merchantsId":null,"categoryTypeTxt":"测试测试","tripartiteId":255},{"id":1194,"categoryId":2,"typeId":3,"merchantsId":null,"categoryTypeTxt":"测试","tripartiteId":255}],"supplementLicences":[{"validityStartTime":"","validityEndTime":"","validityTime":["2024-01-22","2035-02-28"],"licenceTypeExplain":"续签协议","licenceType":"0012","licenceUrl":"","fileList":[{"status":"success","name":"WechatIMG252.jpg","size":456498,"percentage":100,"uid":1705907730774,"raw":{"uid":1705907730774},"url":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/14e2940e-5415-4b30-8822-1e3dffbae79e.jpg","response":{"success":true,"code":"200","message":"OK","data":"https://uat-cmdc.oss-cn-beijing.aliyuncs.com/productFile/2024/01/22/14e2940e-5415-4b30-8822-1e3dffbae79e.jpg","freshToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VySWQiOjIsInVzZXJOYW1lIjoiYWRtaW4yIiwidGltZSI6MTcwNTkwNzczMDkwNn0.abX7CpflkGMmQrdsOSOHycL_g2ObHsyHPDt1DxW2Vu0"},"filetype":"","title":"WechatIMG252.jpg","validId":""}],"licenceCode":"3245315251515"}],"siteType":0,"remarks":"","tripartiteCategoryChangeList":[{"id":1193,"categoryId":1,"typeId":2,"merchantsId":null,"categoryTypeTxt":"测试测试","tripartiteId":255},{"id":1194,"categoryId":2,"typeId":3,"merchantsId":null,"categoryTypeTxt":"测试","tripartiteId":255}],"tripartiteDepositoryChangeList":[{"depositoryId":964,"abbreviation":null,"addressDetail":"北京市顺义区顺义港物流园区机场北街10号A2-2","merchantsId":null,"userId":null,"depotProvince":1,"depotCity":2,"depotArea":3,"createTime":"2024-01-11T03:09:40.000+0000","updateTime":"2024-01-11T03:09:40.000+0000","tripartiteId":255},{"depositoryId":965,"abbreviation":null,"addressDetail":"仓库地址","merchantsId":null,"userId":null,"depotProvince":217,"depotCity":218,"depotArea":221,"createTime":"2024-01-11T03:09:40.000+0000","updateTime":"2024-01-11T03:09:40.000+0000","tripartiteId":255}]}
#预期结果
checkDict11: {"success":true,"code":"200","message":"OK","data":"success"}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment