An error occurred while loading the file. Please try again.
An error occurred while loading the file. Please try again.
An error occurred while loading the file. Please try again.
-
xiao-hesheng authored465ee95f
# -*- 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)