Commit 465ee95f authored by xiao-hesheng's avatar xiao-hesheng
Browse files

优化脚本

parent 9042bb08
...@@ -46,7 +46,7 @@ request_body = commonFuc().get_business_data(module, "payload6", ids,corpId) ...@@ -46,7 +46,7 @@ request_body = commonFuc().get_business_data(module, "payload6", ids,corpId)
result = commonFuc().http_post(url, request_body, headers) result = commonFuc().http_post(url, request_body, headers)
print('实际值aaaaaaaaaaaaaaaaaaaaaaaaaaa',result) # print('实际值aaaaaaaaaaaaaaaaaaaaaaaaaaa',result)
# # #断言实际结果中是否包含预期结果的内容 # # #断言实际结果中是否包含预期结果的内容
checkDict=commonFuc().get_business_data(module,'checkDict') checkDict=commonFuc().get_business_data(module,'checkDict')
......
# -*- 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-5,sit,on
主数据平台:查询产品数据
"""
# 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, "listMdmGoodsInfoByPage_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, "payload6",corpId,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)
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-6,sit,on
主数据平台:获取产品列表信息
"""
# 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, "18FL_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, "payload5",corpId,goodsname)
# 发送请求
result = commonFuc().http_get(url, headers,request_body)
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)
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-7,sit,on
主数据平台:进入产品规格页面
"""
# 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, "18FL_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, "payload5",corpId,goodsname)
# 发送请求
result = commonFuc().http_get(url, headers,request_body)
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)
else:
commonFuc().check_text_exist(-500, result)
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
"submitGoodsSpecsRegist_url": "/test2api/mdmService/goodsRegistBill/submitGoodsSpecsRegist/" "submitGoodsSpecsRegist_url": "/test2api/mdmService/goodsRegistBill/submitGoodsSpecsRegist/"
"listAuditSpecsBillByPage_url": "/test2api/mdmService/goodsRegistBill/listAuditSpecsBillByPage/" "listAuditSpecsBillByPage_url": "/test2api/mdmService/goodsRegistBill/listAuditSpecsBillByPage/"
"handleAuditSpecRegist_url": "/test2api/mdmService/goodsRegistBill/handleAuditSpecRegist/" "handleAuditSpecRegist_url": "/test2api/mdmService/goodsRegistBill/handleAuditSpecRegist/"
"18FL_url": "/test2api/platformService/dict/f/getDictionary/18FL/"
"listMdmGoodsInfoByPage_url": "/test2api/mdmService/mdmGoodsInfo/listMdmGoodsInfoByPage/"
"username": "1679886114521" "username": "1679886114521"
"password": "a123456!" "password": "a123456!"
...@@ -94,6 +96,32 @@ json_headers2: { ...@@ -94,6 +96,32 @@ json_headers2: {
} }
] ]
} }
"payload5": {
"pageNum": 1,
"pageSize": 10,
"queryObject": {
"pid": "",
"corpId": "%s",
"goodsName": "%s",
"goodsMfrsName": "",
"certCode": ""
}
}
"payload6": {
"pageNum": 1,
"pageSize": 10,
"queryObject": {
"pid": "",
"provId": "%s",
"goodsName": "%s",
"goodsMfrsName": "",
"isAbroad": "",
"purpose": "",
"mgrLevel": "",
"status": 0
}
}
"payload10": { "payload10": {
"pageNum": 1, "pageNum": 1,
"pageSize": 20, "pageSize": 20,
......
...@@ -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分3</td> <td class='details-col-elapsed'>0分0</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">3.275</td> <td class="details-col-elapsed">0.623</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