Commit cd4f8e08 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

优化脚本

parent 34731358
...@@ -41,7 +41,7 @@ result = commonFuc().http_post(url, request_body, headers) ...@@ -41,7 +41,7 @@ result = commonFuc().http_post(url, request_body, headers)
# # print(result) # # print(result)
#获取预期结果 #获取预期结果
check_dict = commonFuc().get_business_data(module, "checkDict") check_dict = commonFuc().get_business_data(module, "checkDict")
print(check_dict) # print(check_dict)
#断言实际结果中是否包含预期结果的内容 #断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict, result) commonFuc().check_result(check_dict, result)
#=============== 企业注册提交接口_认领结束 #=============== 企业注册提交接口_认领结束
......
...@@ -19,10 +19,10 @@ from a企业认领 import * ...@@ -19,10 +19,10 @@ from a企业认领 import *
# print('global_var_id',global_var_id) # print('global_var_id',global_var_id)
id1=global_var_id id1=global_var_id
""" """
场景:注册企业认领 场景:注册企业审核
用例名称:企业认领 用例名称:企业审核
输入:CRid 输入:CRid
输出:"rtn_msg": "企业被认领" 输出:"rtn_msg": "{"code": 0,'msg': None,'data':'审核通过'}"
""" """
# 企业注册提交接口_审核通过_开始 # 企业注册提交接口_审核通过_开始
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username")
...@@ -46,4 +46,5 @@ check_dict1 = commonFuc().get_business_data(module, "checkDict1") ...@@ -46,4 +46,5 @@ check_dict1 = commonFuc().get_business_data(module, "checkDict1")
#断言实际结果中是否包含预期结果的内容 #断言实际结果中是否包含预期结果的内容
commonFuc().check_result(check_dict1, result) commonFuc().check_result(check_dict1, result)
#===============企业注册提交接口_审核通过_结束 #===============企业注册提交接口_审核通过_结束
\ No newline at end of file #审核通过的企业名称
...@@ -4,7 +4,7 @@ from common.fileUtls import FileUtils ...@@ -4,7 +4,7 @@ from common.fileUtls import FileUtils
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
case_tag:api,mdm-web,产品新增和审核,id2251,id2251-1,sit,on,2023091201 case_tag:api,mdm-web,产品新增和审核,id2251,id2251-0,sit,on,2023091201
主数据平台:产品新增和审核通过 主数据平台:产品新增和审核通过
""" """
...@@ -28,7 +28,6 @@ def Enterprise_audit(): ...@@ -28,7 +28,6 @@ def Enterprise_audit():
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
# 获取接口返回id # 获取接口返回id
id1 = commonFuc().analysis_json('id', result) id1 = commonFuc().analysis_json('id', result)
# 企业注册提交接口_认领 # 企业注册提交接口_认领
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url")
username = commonFuc().get_business_data(module, "username") username = commonFuc().get_business_data(module, "username")
......
# -*- encoding=utf8 -*-
from common.timeUtils import timeUtils
from common.fileUtls import FileUtils
import sys
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,分页查询供应商产品数据,id2251,id2251-1,sit,on,2023091201
主数据平台:分页查询供应商产品数据
"""
module = "mdm3_pim"
from common.common_func import commonFuc, using
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
pro_path=commonFuc().get_pro_path()
sys.path.append(pro_path+r'\\air_case\\mdm3_ea\\a企业认领.air')
using(pro_path+r'\\air_case\\mdm3_ea\\a企业认领.air')
sys.path.append(pro_path+r'\\air_case\\mdm3_ea\\a企业锁定.air')
using(pro_path+r'\\air_case\\mdm3_ea\\a企业锁定.air')
sys.path.append(pro_path+r'\\air_case\\mdm3_ea\\企业审核.air')
using(pro_path+r'\\air_case\\mdm3_ea\\企业审核.air')
from a企业认领 import *
from a企业锁定 import *
from 企业审核 import *
"""
场景:分页查询供应商产品数据
用例名称:分页查询供应商产品数据
输入:CRid
输出:"rtn_msg": "ok"
"""
# 登录
username = global_var_cname
password = commonFuc().get_business_data(module, "password")
print(username, password)
# 获取token和projectCode
token, projectCode, uxid, corpId,info = login_system(username, password).get_token()
# 分页查询供应商产品数据接口
module = "mdm3_pim"
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url")
print(url)
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
request_body = commonFuc().get_business_data(module, "payload", corpId)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('实际值',result)
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
data = commonFuc().analysis_json('data', data)
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaaa',data)
# 断言实际结果中是否包含预期结果的内容
# 新注册的企业首次查询产品信息,预期结果为空
check_dict = commonFuc().get_business_data(module, "checkDict")
# print('预期值',check_dict)
commonFuc().check_text_exist(code, result) # 检查验证码
commonFuc().check_text_exist(data, result) # 检查数据data为空[]
\ No newline at end of file
...@@ -15,10 +15,10 @@ case_tag:api,mdm-web产品规格新增,id2253,id2253-1,sit,on ...@@ -15,10 +15,10 @@ case_tag:api,mdm-web产品规格新增,id2253,id2253-1,sit,on
module = "mdm3_psm" module = "mdm3_psm"
# 登录 # 登录
info = FileUtils().r_info(module,'产品新增') info = FileUtils().r_info("mdm3_pim",'产品新增')
username=info['username'] username=info['username']
goodsname=info['goodsname'] goodsname=info['goodsname']
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data("mdm3_pim", "password")
# print(username, password) # print(username, password)
# 获取token和projectCode # 获取token和projectCode
token, projectCode, uxid, corpId,info = login_system(username, password).get_token() token, projectCode, uxid, corpId,info = login_system(username, password).get_token()
...@@ -45,10 +45,12 @@ request_body = commonFuc().get_business_data(module, "payload1", MGID,goodsname) ...@@ -45,10 +45,12 @@ request_body = commonFuc().get_business_data(module, "payload1", MGID,goodsname)
# print('request_body',request_body) # print('request_body',request_body)
# 发送请求 # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
# print('产品规格申报',result) print('产品规格申报',result)
code=commonFuc().analysis_json('code',result) code=commonFuc().analysis_json('code',result)
goodsname1=commonFuc().analysis_json('goodsName',commonFuc().analysis_json('goodsRegistVO',commonFuc().analysis_json('data',result))) goodsname1=commonFuc().analysis_json('goodsName',commonFuc().analysis_json('goodsRegistVO',commonFuc().analysis_json('data',result)))
# print("goodsname1",goodsname1) # print("goodsname1",goodsname1)
commonFuc().check_text_exist(code,result) commonFuc().check_text_exist(code,result)
commonFuc().check_text_exist(goodsname1,result) commonFuc().check_text_exist(goodsname1,result)
...@@ -9,37 +9,45 @@ from common.fileUtls import * ...@@ -9,37 +9,45 @@ from common.fileUtls import *
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
case_tag:api,mdm-web产品规格新增,id2251,id2251-3,sit,on,2023091202 case_tag:api,mdm-web,产品规格查询,id2253,id2253-2,sit,on,20230915
主数据平台:web产品规格新增 主数据平台:web产品规格查询
""" """
module = "mdm3_pim" module = "mdm3_psm"
# 登录 # 登录
info = FileUtils().r_info(module,'产品新增') info = FileUtils().r_info('mdm3_pim','产品新增')
username=info['username'] username=info['username']
goodsname=info['goodsname'] goodsname=info['goodsname']
password = commonFuc().get_business_data(module, "password") password = commonFuc().get_business_data('mdm3_pim', "password")
# print(username, password) # print(username, password)
# 获取token和projectCode # 获取token和projectCode
token, projectCode, uxid, corpId,info = login_system(username, password).get_token() token, projectCode, uxid, corpId,info = login_system(username, password).get_token()
# 分页查询供应商产品数据接口 # 查询产品规格信息
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listVoPage_url") url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "listAuditSpecsBillByPage_url")
# 获取请求头信息 # 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2", headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token, commonFuc().get_business_data(module, "json_contentType"), token,
projectCode) projectCode)
request_body = commonFuc().get_business_data(module, "payload12", corpId,goodsname) request_body = commonFuc().get_business_data(module, "payload2",goodsname)
# 发送请求 # 发送请求
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('result',result) print('result',result)
# print('实际值',result) # print('实际值',result)
code = commonFuc().analysis_json('code', result) code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result) total = commonFuc().analysis_json('total', result)
data = commonFuc().analysis_json('data', data) print(code,total)
# print('aaaaaaaaaaaaaaaaaaaaaaaaaaaa',data) # print('aaaaaaaaaaaaaaaaaaaaaaaaaaaa',data)
# 断言实际结果中是否包含预期结果的内容 # 断言实际结果中是否包含预期结果的内容
# 新注册的企业首次查询产品信息,预期结果为空 commonFuc().check_text_exist(code,result)
check_dict = commonFuc().get_business_data(module, "checkDict") if total>0:
commonFuc().check_text_exist(total,result)
GRBID=commonFuc().analysis_json('id',commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)))
goodsId=commonFuc().analysis_json('goodsId',commonFuc().analysis_json('data', commonFuc().analysis_json('data', result)))
global_GRBID = GRBID
global_goodsId=goodsId
else:
commonFuc().check_text_exist(-1, result)
# -*- encoding=utf8 -*-
import sys
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from common.timeUtils import timeUtils
from airtest.core.api import using
from common.common_func import commonFuc
from common.fileUtls import *
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,认领锁定产品规格信息,id2253,id2253-3,sit,on,20230915
主数据平台:web产品规格查询
"""
pro_path=commonFuc().get_pro_path()
sys.path.append(pro_path+r'\\air_case\\mdm3_psm\\a查询产品规格数据.air')
using(pro_path+r'\\air_case\\mdm3_psm\\a查询产品规格数据.air')
from a查询产品规格数据 import *
print('GRBID',global_GRBID)
GRBID=global_GRBID
module = "mdm3_psm"
# 登录
info = FileUtils().r_info('mdm3_pim','产品新增')
username=info['username']
goodsname=info['goodsname']
password = commonFuc().get_business_data('mdm3_pim', "password")
# print(username, password)
# 获取token和projectCode
token, projectCode, uxid, corpId,info = login_system(username, password).get_token()
# 锁定产品规格信息
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "updateById_url2")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
now = timeUtils().get_time_hms()
request_body = commonFuc().get_business_data(module, "payload3", GRBID, uxid, now)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result',result)
# print('实际值',result)
code = commonFuc().analysis_json('code', result)
# print(code)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_text_exist(code,result)
if code==0:
commonFuc().check_text_exist(code,result)
elif code==400:
commonFuc().check_text_exist(code, result)
else:
commonFuc().check_text_exist(500, result)
# -*- encoding=utf8 -*-
import sys
from air_case.mdm_login.登录外网系统.登录外网系统 import login_system
from common.timeUtils import timeUtils
from airtest.core.api import using
from common.common_func import commonFuc
from common.fileUtls import *
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,审核通过产品规格信息,id2253,id2253-4,sit,on,20230915
主数据平台:web产品规格查询
"""
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\mdm3_psm\\a查询产品规格数据.air')
using(pro_path + r'\\air_case\\mdm3_psm\\a查询产品规格数据.air')
from a查询产品规格数据 import *
print('GRBID', global_GRBID, 'global_goodsId', global_goodsId)
GRBID = global_GRBID
goodsId = global_goodsId
module = "mdm3_psm"
# 登录
info = FileUtils().r_info('mdm3_pim', '产品新增')
username = info['username']
goodsname = info['goodsname']
password = commonFuc().get_business_data('mdm3_pim', "password")
# print(username, password)
# 获取token和projectCode
token, projectCode, uxid, corpId, info = login_system(username, password).get_token()
# 审核产品规格信息
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "handleAuditSpecRegist_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
now = timeUtils().get_time_hms()
request_body = commonFuc().get_business_data(module, "payload4", GRBID, now, now, uxid, uxid, GRBID, goodsId, goodsname,
goodsname)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
code = commonFuc().analysis_json('code', result)
# print(code)
# 断言实际结果中是否包含预期结果的内容
commonFuc().check_text_exist(code, result)
if code == 0:
commonFuc().check_text_exist(code, result)
elif code == 400:
commonFuc().check_text_exist(code, result)
else:
commonFuc().check_text_exist(-500, result)
产品新增: 产品新增:
username: 国药集团公司T)^Qj username: 国药集团公司ITzkH
goodsname: 一次性注射器uP^fo goodsname: 一次性注射器DdvmT
"listVoPage_url": "/test2api/mdmService/provGoodsInfo/listVoPage" "listVoPage_url": "/test2api/mdmService/provGoodsInfo/listVoPage"
# 医院注册提交接口_认领
"queryListPage_url": "/test2api/mdmService/companyRegistBill/listPage" "queryListPage_url": "/test2api/mdmService/companyRegistBill/listPage"
"updateById_url": "/test2api/mdmService/companyRegistBill/updateById" "updateById_url": "/test2api/mdmService/companyRegistBill/updateById"
"checkHosRegistInfo_url": "/test2api/mdmService/companyRegistBill/checkHosRegistInfo" "checkHosRegistInfo_url": "/test2api/mdmService/companyRegistBill/checkHosRegistInfo"
...@@ -9,7 +8,8 @@ ...@@ -9,7 +8,8 @@
"getGoodsRegistBillDetail_url": "/test2api/mdmService/goodsRegistBill/getGoodsRegistBillDetail/" "getGoodsRegistBillDetail_url": "/test2api/mdmService/goodsRegistBill/getGoodsRegistBillDetail/"
"handleAuditGoodsRegist_url": "/test2api/mdmService/goodsRegistBill/handleAuditGoodsRegist/" "handleAuditGoodsRegist_url": "/test2api/mdmService/goodsRegistBill/handleAuditGoodsRegist/"
"submitGoodsSpecsRegist_url": "/test2api/mdmService/goodsRegistBill/submitGoodsSpecsRegist/" "submitGoodsSpecsRegist_url": "/test2api/mdmService/goodsRegistBill/submitGoodsSpecsRegist/"
"listAuditSpecsBillByPage_url": "/test2api/mdmService/goodsRegistBill/listAuditSpecsBillByPage/"
"handleAuditSpecRegist_url": "/test2api/mdmService/goodsRegistBill/handleAuditSpecRegist/"
"username": "1679886114521" "username": "1679886114521"
"password": "a123456!" "password": "a123456!"
...@@ -44,7 +44,70 @@ json_headers2: { ...@@ -44,7 +44,70 @@ json_headers2: {
} }
] ]
} }
"payload2": {
"pageNum": 1,
"pageSize": 10,
"queryObject": {
"auditStatus": 10,
"billType": 20,
"goodsName": "%s",
"goodsMfrsName": ""
}
}
"payload3": {
"id": "%s",
"isLocked": 1,
"version": 0,
"auditor": "%s",
"auditStartTime": "%s"
}
"payload4": {
"id": "%s",
"version": 1,
"auditStatus": 20,
"auditComment": "",
"goodsSpecsRegistVOList": [
{
"id": "e0f0a26e3a4f4087b63f2af3ea6a4be2",
"lastModified": "%s",
"version": 0,
"createTime": "%s",
"createUser": "%s",
"lastModifiedUser": "%s",
"billId": "%s",
"goodsRegistId": "%s",
"mdmGoodsSpecCode": null,
"provGoodsSpecsId": null,
"goodsMfrsId": "p56a4",
"goodsName": "%s",
"shortPinyin": "%s",
"goodsGg": "20ml",
"miGoodsGg": "20ml",
"miGoodsXh": "20ml",
"mi27code": "20ml",
"udiCode": "20ml",
"goodsUseUnit": "支",
"auditStatus": 10,
"auditComment": null,
"specAuditStatus": true
}
]
}
"payload10": {
"pageNum": 1,
"pageSize": 20,
"queryObject": {
"pid": "",
"provId": "%s",
"goodsName": "%s",
"goodsMfrsName": "",
"isAbroad": "",
"purpose": "",
"mgrLevel": "",
"status": 0
}
}
"name1": "一次性注射器" "name1": "一次性注射器"
checkDict: {"code": 0, "msg":None,"data": {"pageNum": 1, "pageSize": 20, "total": 0, "data": [], "totalInfo": None}} checkDict: {"code": 0, "msg":None,"data": {"pageNum": 1, "pageSize": 20, "total": 0, "data": [], "totalInfo": None}}
checkDict1: {"code": -2,"msg": "医院已被注册,请耐心等待审核通知!", "data": None} checkDict1: {"code": -2,"msg": "医院已被注册,请耐心等待审核通知!", "data": None}
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<tr width="600"> <tr width="600">
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td> <td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分0</td> <td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">100.0%</td> <td class="details-col-elapsed">100.0%</td>
</tr> </tr>
</table> </table>
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
</tr> </tr>
<tr width="600"> <tr width="600">
<td class="details-col-elapsed"><a href='../log/查询产品数据/log.html' target='_blank'>查询产品数据</a></td> <td class="details-col-elapsed"><a href='../log/分页查询供应商产品数据/log.html' target='_blank'>分页查询供应商产品数据</a></td>
<td class="success">成功</td> <td class="success">成功</td>
<td class="details-col-elapsed">0.699</td> <td class="details-col-elapsed">2.673</td>
<td class="details-col-elapsed">xiaohesheng</td> <td class="details-col-elapsed">xiaohesheng</td>
</tr> </tr>
......
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