Commit 34f00d94 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

优化脚本

parent cd4f8e08
......@@ -56,4 +56,4 @@ data = commonFuc().analysis_json('data', 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
commonFuc().check_text_exist('[]', result) # 检查数据data为空[]
# -*- encoding=utf8 -*-
from common.timeUtils import timeUtils
from common.fileUtls import FileUtils
import sys
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web,产品信息申报,id2251,id2251-2,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_pim\\a分页查询供应商产品数据.air')
using(pro_path+r'\\air_case\\mdm3_pim\\a分页查询供应商产品数据.air')
from a分页查询供应商产品数据 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, "submitGoodsRegist_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
projectCode)
p_name = commonFuc().get_business_data(module, "name1") # 获取前缀name
p_name = p_name + commonFuc().randomString(5) # 随机数生成拼接产品名称
request_body = commonFuc().get_business_data(module, "payload6", p_name, p_name, p_name, p_name, p_name, p_name, p_name,
p_name, p_name, p_name, p_name, p_name, p_name, p_name)
print('新增产品请求体', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print("新增产品返回结果", result)
goodsRegistVO = commonFuc().analysis_json('goodsRegistVO', result)
goodsName = commonFuc().analysis_json('goodsName', goodsRegistVO)
commonFuc().check_text_exist(goodsName, result) # 检查返回结果中是否存在新增的产品名称
\ No newline at end of file
......@@ -9,7 +9,7 @@ from common.fileUtls import *
__author__ = "xiaohesheng"
"""
case_tag:api,mdm-web产品规格新增,id2253,id2253-1,sit,on
case_tag:api,mdm-web,产品规格新增,id2253,id2253-1,sit,on
主数据平台:web产品规格新增
"""
......
......@@ -54,8 +54,8 @@
</tr>
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>4</td>
<td class='details-col-elapsed'>4</td>
<td class='details-col-elapsed'>0分2秒</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
......@@ -72,9 +72,30 @@
</tr>
<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/a产品规格申报/log.html' target='_blank'>a产品规格申报</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">2.673</td>
<td class="details-col-elapsed">0.829</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a查询产品规格数据/log.html' target='_blank'>a查询产品规格数据</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.415</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a认领锁定产品规格/log.html' target='_blank'>a认领锁定产品规格</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.835</td>
<td class="details-col-elapsed">xiaohesheng</td>
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/b产品规格审核通过/log.html' target='_blank'>b产品规格审核通过</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">0.398</td>
<td class="details-col-elapsed">xiaohesheng</td>
</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