Commit 9de115b1 authored by xiao-hesheng's avatar xiao-hesheng
Browse files

新增带量采购目录脚本

parent 1bde27c3
......@@ -46,7 +46,7 @@ def test1():
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_l7_带量采购目录_列表查询_条件查询_精确查询_计划状态
projectname=commonFuc().get_business_data(module, "projectname")
projectname = commonFuc().get_business_data(module, "projectname")
# 从文件中获取产品名称
info = FileUtils().r_info8(module, "产品明细信息", 'message6')
# print('info', info)
......@@ -60,13 +60,13 @@ def test1():
goodsName = i['goodsName']
goodsGeneralName = i['goodsGeneralName']
break
list2=[hosGoodsCode,goodsName,goodsGeneralName]
list2 = [hosGoodsCode, goodsName, goodsGeneralName]
# # #获取日期
date1 = timeUtils().get_time_hms(2)
date2 = timeUtils().get_time_add(1)
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_13",projectname,i,date1,date2)
request_body = commonFuc().get_business_data(module, "payload22_13", projectname, i, date1, date2)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
......@@ -75,16 +75,16 @@ def test1():
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if code == 0 and total==1:
if code == 0 and total == 1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
#以此选择计划状态进行查询
str=commonFuc().get_business_data(module,'status2')
# 以此选择计划状态进行查询
str = commonFuc().get_business_data(module, 'status2')
list2 = list(str.split(","))
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_14",i)
request_body = commonFuc().get_business_data(module, "payload22_14", i)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
......@@ -93,9 +93,10 @@ def test1():
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if code == 0 and total>=0:
if code == 0 and total >= 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_l8_带量采购目录_列表查询_条件查询_模糊查询_项目名称,id2297,id2297-118,sit,on
内网:a_l8_带量采购目录_列表查询_条件查询_模糊查询_项目名称
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_l8_带量采购目录_列表查询_条件查询_模糊查询_项目名称
用例名称:a_l8_带量采购目录_列表查询_条件查询_模糊查询_项目名称
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_vbp_listPage_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_l8_带量采购目录_列表查询_条件查询_模糊查询_项目名称
projectname=commonFuc().get_business_data(module, "projectname")
list2=commonFuc().get_str(projectname)
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_10",i)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if code == 0 and total>=0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_l9_带量采购目录_列表查询_条件查询_模糊查询_产品名称,id2297,id2297-119,sit,on
内网:a_l9_带量采购目录_列表查询_条件查询_模糊查询_产品名称
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_l9_带量采购目录_列表查询_条件查询_模糊查询_产品名称
用例名称:a_l9_带量采购目录_列表查询_条件查询_模糊查询_产品名称
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_vbp_listPage_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_l9_带量采购目录_列表查询_条件查询_模糊查询_产品名称
projectname=commonFuc().get_business_data(module, "projectname")
# 从文件中获取产品名称
info = FileUtils().r_info8(module, "产品明细信息", 'message6')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a)
hosGoodsCode = 'hosGoodsCode'
goodsName = 'goodsName'
goodsGeneralName = 'goodsGeneralName'
for i in list_a:
hosGoodsCode = i['hosGoodsCode']
goodsName = i['goodsName']
goodsGeneralName = i['goodsGeneralName']
break
list2=[hosGoodsCode,goodsName,goodsGeneralName]
for i in list2:
list3=commonFuc().get_str(i)
for j in list3:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_11",projectname,j)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if code == 0 and total==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_m0_带量采购目录_列表查询_条件查询_异常查询_项目名称,id2297,id2297-120,sit,on
内网:a_m0_带量采购目录_列表查询_条件查询_异常查询_项目名称
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_m0_带量采购目录_列表查询_条件查询_异常查询_项目名称
用例名称:a_m0_带量采购目录_列表查询_条件查询_异常查询_项目名称
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_vbp_listPage_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_m0_带量采购目录_列表查询_条件查询_异常查询_项目名称
str = commonFuc().get_business_data(module, 'data3')
list2 = list(str.split(","))
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_10",i)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if code == 0 and total==0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_m1_带量采购目录_列表查询_条件查询_异常查询_产品名称,id2297,id2297-121,sit,on
内网:a_m1_带量采购目录_列表查询_条件查询_异常查询_产品名称
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_m1_带量采购目录_列表查询_条件查询_异常查询_产品名称
用例名称:a_m1_带量采购目录_列表查询_条件查询_异常查询_产品名称
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_vbp_listPage_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_m1_带量采购目录_列表查询_条件查询_异常查询_产品名称
projectname = commonFuc().get_business_data(module, "projectname")
# 从文件中获取产品名称
info = FileUtils().r_info8(module, "产品明细信息", 'message6')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a)
hosGoodsCode = 'hosGoodsCode'
goodsName = 'goodsName'
goodsGeneralName = 'goodsGeneralName'
for i in list_a:
hosGoodsCode = i['hosGoodsCode']
goodsName = i['goodsName']
goodsGeneralName = i['goodsGeneralName']
break
list2 = [hosGoodsCode, goodsName, goodsGeneralName]
str = commonFuc().get_business_data(module, 'data3')
list2 = list(str.split(","))
for j in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_11", projectname, j)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if code == 0 and total == 0:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.fileUtls import FileUtils
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_l6_带量采购目录_列表查询_条件查询_精确查询_日期,id2297,id2297-122,sit,on
内网:a_l6_带量采购目录_列表查询_条件查询_精确查询_日期
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_l6_带量采购目录_列表查询_条件查询_精确查询_日期
用例名称:a_l6_带量采购目录_列表查询_条件查询_精确查询_日期
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_vbp_listPage_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_l6_带量采购目录_列表查询_条件查询_精确查询_日期
projectname=commonFuc().get_business_data(module, "projectname")
# 从文件中获取产品名称
info = FileUtils().r_info8(module, "产品明细信息", 'message6')
# print('info', info)
list_a = info['list_a']
# print('list_a', list_a)
hosGoodsCode = 'hosGoodsCode'
goodsName = 'goodsName'
goodsGeneralName = 'goodsGeneralName'
for i in list_a:
hosGoodsCode = i['hosGoodsCode']
goodsName = i['goodsName']
goodsGeneralName = i['goodsGeneralName']
break
list2=[hosGoodsCode,goodsName,goodsGeneralName]
# # #获取日期
date1 = timeUtils().get_time_hms(2)
date2 = timeUtils().get_time_add(1)
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_12",projectname,i,date2,date1)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
total = commonFuc().analysis_json('total', data)
if code == 0 and total==1:
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
# -*- encoding=utf8 -*-
from common.db.sql.sql_del_branch_info import delData
from common.timeUtils import timeUtils
__author__ = "xiaohesheng"
"""
case_tag:api,herp-web,a_m3_带量采购目录_列表_分页查询,id2297,id2297-123,sit,on
内网:a_m3_带量采购目录_列表_分页查询
"""
from common.common_func import commonFuc
from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_system
from airtest.core.api import using
import sys
def test1():
module = "b3_herp3_purchase"
"""
场景:a_m3_带量采购目录_列表_分页查询
用例名称:a_m3_带量采购目录_列表_分页查询
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
# 内网登录
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)
#
url = commonFuc().get_api_url() + commonFuc().get_business_data(module, "herpService_vbp_listPage_url")
print(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"))
print('headers', headers)
# 从文件中获取院区id
branchId = commonFuc().get_business_data(module, 'branchId')
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# 分页查询
str = commonFuc().get_business_data(module, 'data6')
list2 = list(str.split(","))
print('list2', list2)
for i in list2:
# # 请求体
request_body = commonFuc().get_business_data(module, "payload22_15", i)
print('request_body', request_body)
# 发送请求
result = commonFuc().http_post(url, request_body, headers)
print('result', result)
# 断言
code = commonFuc().analysis_json('code', result)
data = commonFuc().analysis_json('data', result)
pageSize = commonFuc().analysis_json('pageSize', data)
if code == 0 and pageSize == int(i):
commonFuc().check_text_exist(0, result)
else:
commonFuc().check_text_exist('error', result)
test1()
#删除数据
delData().Delete_ld_directory()
\ No newline at end of file
......@@ -165,7 +165,23 @@ class delData(object):
print(sql)
cursor.execute(sql)
cursor.execute("commit;")
print('临采任务子表信息删除成功 ')
print('临采任务主表信息删除成功 ')
cursor.close()
def Delete_ld_directory(self):
connection = pymysql.connect(host="10.17.65.108", user="root", password="Cmic.2023", database="spd3_herp_test2",
charset="utf8")
cursor = connection.cursor()
# 删除用户信息
sql = "delete from mcms_vbp_detail where pid in(select id from mcms_vbp where project_name like '%自动化测试%');"
print(sql)
cursor.execute(sql)
cursor.execute("commit;")
print('带量项目子表信息删除成功 ')
sql = "delete from mcms_vbp where project_name like '%自动化测试%';"
print(sql)
cursor.execute(sql)
cursor.execute("commit;")
print('带量项目主表信息删除成功 ')
cursor.close()
# delData().Delete_branch_by_id()
# delData().Delete_goods_change_info()
......
......@@ -173,6 +173,7 @@ json_headers2: {
"payload22_12": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","projectName":"%s","goodsName":"%s","startTime":"%s","endTime":"%s"}}
"payload22_13": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","projectName":"%s","goodsName":"%s","tbStatus":20,"startTime":"%s","endTime":"%s"}}
"payload22_14": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","projectName":"","goodsName":"","tbStatus":"%s","startTime":"","endTime":""}}
"payload22_15": {"pageNum":1,"pageSize":"%s","queryObject":{"orderNo":"","projectName":"","goodsName":"","tbStatus":"","startTime":"","endTime":""}}
checkDict2: {"code": 0,'msg': None,'data':1}
......@@ -56,7 +56,7 @@
<tr width="600">
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>1</td>
<td class='details-col-elapsed'>0分5</td>
<td class='details-col-elapsed'>0分2</td>
<td class="details-col-elapsed">100.0%</td>
</tr>
</table>
......@@ -72,9 +72,9 @@
</tr>
<tr width="600">
<td class="details-col-elapsed"><a href='../log/a_l7_带量采购目录_列表查询_条件查询_精确查询_计划状态/log.html' target='_blank'>a_l7_带量采购目录_列表查询_条件查询_精确查询_计划状态</a></td>
<td class="details-col-elapsed"><a href='../log/a_m3_带量采购目录_列表_分页查询/log.html' target='_blank'>a_m3_带量采购目录_列表_分页查询</a></td>
<td class="success">成功</td>
<td class="details-col-elapsed">5.217</td>
<td class="details-col-elapsed">2.677</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