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

优化脚本

parent 2c6f67aa
...@@ -43,8 +43,8 @@ def test1(): ...@@ -43,8 +43,8 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # 获取id # # 获取id
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
# from g7_批量导入_查询产品信息 import select1 # from g7_批量导入_查询产品信息 import select1
# id1 = select1() # id1 = select1()
info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2') info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2')
......
...@@ -43,8 +43,8 @@ def test1(): ...@@ -43,8 +43,8 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # id # # id
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
# from g7_批量导入_查询产品信息 import select1 # from g7_批量导入_查询产品信息 import select1
# id1 = select1() # id1 = select1()
info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2') info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2')
......
...@@ -43,8 +43,8 @@ def test1(): ...@@ -43,8 +43,8 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # 获取hosGoodsId # # 获取hosGoodsId
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
from g8_6添加产品列表_查询 import select1 from g8_6添加产品列表_查询 import select1
hosGoodsId,provGoodsId = select1() hosGoodsId,provGoodsId = select1()
# #请求体 # #请求体
......
...@@ -44,8 +44,8 @@ def test1(): ...@@ -44,8 +44,8 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # 获取hosGoodsId # # 获取hosGoodsId
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
from g8_6添加产品列表_查询 import select1 from g8_6添加产品列表_查询 import select1
hosGoodsId,provGoodsId = select1() hosGoodsId,provGoodsId = select1()
#获取日期 #获取日期
......
...@@ -58,9 +58,10 @@ def test1(): ...@@ -58,9 +58,10 @@ def test1():
if code>=0 and total>=0: if code>=0 and total>=0:
# print(code) # print(code)
GChid=commonFuc().analysis_json('id',data1[0]) GChid=commonFuc().analysis_json('id',data1[0])
print(GChid) orderNo=commonFuc().analysis_json('orderNo',data1[0])
print(GChid,orderNo)
commonFuc().check_text_exist(0, result) commonFuc().check_text_exist(0, result)
return GChid return GChid,orderNo
else: else:
commonFuc().check_text_exist('error', result) commonFuc().check_text_exist('error', result)
test1() test1()
...@@ -44,15 +44,15 @@ def test1(): ...@@ -44,15 +44,15 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # 获取hosGoodsId # # 获取hosGoodsId
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g8_6添加产品列表_查询.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
from g8_6添加产品列表_查询 import select1 from g8_6添加产品列表_查询 import select1
hosGoodsId,provGoodsId = select1() hosGoodsId,provGoodsId = select1()
#获取GChid #获取GChid
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g8_9调价管理列表_查询_暂存状态数据.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g8_9调价管理列表_查询_暂存状态数据.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air')
from g8_9调价管理列表_查询_暂存状态数据 import test1 from g8_9调价管理列表_查询_暂存状态数据 import test1
GChid = test1() GChid,orderNo = test1()
#获取日期 #获取日期
currentdate=dateUtils().get_current_date() currentdate=dateUtils().get_current_date()
# print(currentdate) # print(currentdate)
......
# -*- encoding=utf8 -*-
import sys
from airtest.core.helper import using
from common.dateUtils import dateUtils
from common.db.sql.sql_del_branch_info import delByBranchId
from common.db.sql.sql_del_kind_goodsinfo import delKindGoodsinfo
from common.db.sql.sql_del_notices_info import delByNoticeName
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,g9_2审批中心_列表查询,id2263,id2263-78,sit,on
内网:g9_2审批中心_列表查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
module = "b2_herp3_bs"
def test1():
"""
场景:g8_8修改产品价格_暂存
用例名称:g8_8修改产品价格_暂存
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
"""
#内网登录
username = commonFuc().get_business_data(module, "username")
# # print('医院名称',username)
password = commonFuc().get_business_data(module, "password")
# print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# 获取token和projectCode
token,projectCode,uxid,corpId,info= login_system(username, password).get_token()
# print( token,projectCode,uxid,corpId,info)
#g8_8修改产品价格_暂存
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "goodsChgMain_insert_url")
# 获取请求头信息
headers = commonFuc().get_business_data(module, "json_headers2",
commonFuc().get_business_data(module, "json_contentType"), token,
commonFuc().get_business_data(module, "X-APP-CODE"))
# # 获取hosGoodsId
pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_13添加产品列表_查询.air')
from g8_6添加产品列表_查询 import select1
hosGoodsId,provGoodsId = select1()
#获取GChid
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_16调价管理列表_查询_暂存状态数据.air')
from g8_9调价管理列表_查询_暂存状态数据 import test1
GChid,orderNo = test1()
#获取日期
currentdate=dateUtils().get_current_date()
# print(currentdate)
#请求体
request_body = commonFuc().get_business_data(module, "payload50_5",hosGoodsId,provGoodsId,currentdate,GChid)
print(request_body)
# # # 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('resultaaaaaaaaaaaaaaaaaaaaaaaaaaa', result)
#断言
# checkDict=commonFuc().get_business_data(module,'checkDict10')
# commonFuc().check_result(checkDict,result)
code=commonFuc().analysis_json('code',result)
data=commonFuc().analysis_json('data',result)
checkDict=commonFuc().get_business_data(module,'checkDict10')
if code>=0 :
print(code)
commonFuc().check_text_exist(0, result)
commonFuc().check_result(checkDict,result)
else:
commonFuc().check_text_exist('error', result)
test1()
...@@ -12,8 +12,8 @@ from common.timeUtils import timeUtils ...@@ -12,8 +12,8 @@ from common.timeUtils import timeUtils
__author__ = "xiaohesheng" __author__ = "xiaohesheng"
""" """
case_tag:api,herp-web,g8_批量导入_导入一个产品_中心库结算,id2263,id2263-69,sit,on case_tag:api,herp-web,g2_7批量导入_查询产品信息,id2263,id2263-69,sit,on
内网:g8_批量导入_导入一个产品_中心库结算 内网:g2_7批量导入_查询产品信息
""" """
from common.common_func import commonFuc from common.common_func import commonFuc
...@@ -21,8 +21,8 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_ ...@@ -21,8 +21,8 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
module = "b2_herp3_bs" module = "b2_herp3_bs"
def test1(): def test1():
""" """
场景:g8_批量导入_导入一个产品_中心库结算 场景:g2_7批量导入_查询产品信息
用例名称:g8_批量导入_导入一个产品_中心库结算 用例名称:g2_7批量导入_查询产品信息
输入:无 输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": 1} 输出:"rtn_msg": {"code": 0, "msg": null, "data": 1}
""" """
...@@ -34,7 +34,7 @@ def test1(): ...@@ -34,7 +34,7 @@ def test1():
# 获取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()
# print( token,projectCode,uxid,corpId,info) # print( token,projectCode,uxid,corpId,info)
#g8_批量导入_导入一个产品_中心库结算 #g2_7批量导入_查询产品信息
url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "updateSettleType_url1") url=commonFuc().get_api_url()+commonFuc().get_business_data(module, "updateSettleType_url1")
# 获取请求头信息 # 获取请求头信息
...@@ -43,8 +43,8 @@ def test1(): ...@@ -43,8 +43,8 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # 获取id # # 获取id
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
# from g7_批量导入_查询产品信息 import select1 # from g7_批量导入_查询产品信息 import select1
# id1 = select1() # id1 = select1()
info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2') info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2')
......
...@@ -43,8 +43,8 @@ def test1(): ...@@ -43,8 +43,8 @@ def test1():
commonFuc().get_business_data(module, "X-APP-CODE")) commonFuc().get_business_data(module, "X-APP-CODE"))
# # 获取id # # 获取id
pro_path = commonFuc().get_pro_path() pro_path = commonFuc().get_pro_path()
sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') sys.path.append(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
using(pro_path + r'\\air_case\\b2_herp3_bs\\g7_批量导入_查询产品信息.air') using(pro_path + r'\\air_case\\b2_herp3_bs\\g2_7批量导入_查询产品信息.air')
# from g7_批量导入_查询产品信息 import select1 # from g7_批量导入_查询产品信息 import select1
# id1 = select1() # id1 = select1()
info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2') info = FileUtils().r_info6("b2_herp3_bs", "产品信息1",'message2')
......
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