Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
1d14a724
Commit
1d14a724
authored
Mar 28, 2024
by
xiao-hesheng
Browse files
新增临采任务模块脚本
parent
88da5deb
Changes
10
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_k3_带量采购目录_新增_添加产品页面列表查询_全部查询.air/a_k3_带量采购目录_新增_添加产品页面列表查询_全部查询.py
0 → 100644
View file @
1d14a724
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_k3_带量采购目录_新增_添加产品页面列表查询_全部查询,id2297,id2297-103,sit,on
内网:a_k3_带量采购目录_新增_添加产品页面列表查询_全部查询
"""
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_k3_带量采购目录_新增_添加产品页面列表查询_全部查询
用例名称:a_k3_带量采购目录_新增_添加产品页面列表查询_全部查询
输入:无
输出:"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_basic_mcmsGoodsInfo_goodsPage_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_k3_带量采购目录_新增_添加产品页面列表查询_全部查询
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload22"
)
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
len
(
data
)
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
# 将三个产品明细信息存入到文件中,用于后面的精确查询和模糊查询
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
# print(type(data1), data1)
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data1
[
0
])
list_b
.
append
(
data1
[
1
])
list_c
.
append
(
data1
[
2
])
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将采购计划明细信息写入到文件中
FileUtils
().
w_info8
(
info
,
module
,
'产品明细信息'
,
titlename
,
'message6'
)
test1
()
air_case/b3_herp3_purchase/a_k4_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_产品名称.air/a_k4_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_产品名称.py
0 → 100644
View file @
1d14a724
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_k4_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_产品名称,id2297,id2297-104,sit,on
内网:a_k4_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_产品名称
"""
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_k4_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_产品名称
用例名称:a_k4_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_产品名称
输入:无
输出:"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_basic_mcmsGoodsInfo_goodsPage_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_k4_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
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
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload22_1"
,
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
==
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_k5_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_规格型号.air/a_k5_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_规格型号.py
0 → 100644
View file @
1d14a724
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_k5_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_规格型号,id2297,id2297-105,sit,on
内网:a_k5_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_规格型号
"""
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_k5_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_规格型号
用例名称:a_k5_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_规格型号
输入:无
输出:"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_basic_mcmsGoodsInfo_goodsPage_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_k5_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_规格型号
# 从文件中获取产品名称
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'
goodsSpec
=
'goodsSpec'
for
i
in
list_a
:
hosGoodsCode
=
i
[
'hosGoodsCode'
]
goodsName
=
i
[
'goodsName'
]
goodsGeneralName
=
i
[
'goodsGeneralName'
]
goodsSpec
=
i
[
'goodsSpec'
]
break
list2
=
[
goodsSpec
]
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload22_2"
,
hosGoodsCode
,
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
==
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_k6_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_器械注册人.air/a_k6_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_器械注册人.py
0 → 100644
View file @
1d14a724
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_k6_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_器械注册人,id2297,id2297-106,sit,on
内网:a_k6_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_器械注册人
"""
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_k6_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_器械注册人
用例名称:a_k6_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_器械注册人
输入:无
输出:"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_basic_mcmsGoodsInfo_goodsPage_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_k6_带量采购目录_新增_添加产品页面列表查询_条件查询_精确查询_器械注册人
# 从文件中获取产品名称
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'
goodsSpec
=
'goodsSpec'
goodsMfrsName
=
'goodsMfrsName'
for
i
in
list_a
:
hosGoodsCode
=
i
[
'hosGoodsCode'
]
goodsName
=
i
[
'goodsName'
]
goodsGeneralName
=
i
[
'goodsGeneralName'
]
goodsSpec
=
i
[
'goodsSpec'
]
goodsMfrsName
=
i
[
'goodsMfrsName'
]
break
list2
=
[
goodsMfrsName
]
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload22_3"
,
hosGoodsCode
,
goodsSpec
,
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
==
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_k7_带量采购目录_新增_添加产品页面列表查询_分页查询.air/a_k7_带量采购目录_新增_添加产品页面列表查询_分页查询.py
0 → 100644
View file @
1d14a724
# -*- 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_k7_带量采购目录_新增_添加产品页面列表查询_分页查询,id2297,id2297-107,sit,on
内网:a_k7_带量采购目录_新增_添加产品页面列表查询_分页查询
"""
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_k7_带量采购目录_新增_添加产品页面列表查询_分页查询
用例名称:a_k7_带量采购目录_新增_添加产品页面列表查询_分页查询
输入:无
输出:"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_basic_mcmsGoodsInfo_goodsPage_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_4"
,
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
()
air_case/b3_herp3_purchase/a_k8_带量采购目录_新增_保存.air/a_k8_带量采购目录_新增_保存.py
0 → 100644
View file @
1d14a724
# -*- encoding=utf8 -*-
from
common.db.sql.sql_del_branch_info
import
delData
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_k8_带量采购目录_新增_保存,id2297,id2297-108,sit,on
内网:a_k8_带量采购目录_新增_保存
"""
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_k8_带量采购目录_新增_保存
用例名称:a_k8_带量采购目录_新增_保存
输入:无
输出:"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_edit_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
(
4
)
date2
=
timeUtils
().
get_time_hms
(
3
)
# print(date1,date2)
# a_k8_带量采购目录_新增_保存
# 从文件中获取产品名称
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'
goodsSpec
=
'goodsSpec'
goodsMfrsName
=
'goodsMfrsName'
hosGoodsId
=
'hosGoodsId'
goodsMfrsId
=
'goodsMfrsId'
for
i
in
list_a
:
hosGoodsCode
=
i
[
'hosGoodsCode'
]
goodsName
=
i
[
'goodsName'
]
goodsGeneralName
=
i
[
'goodsGeneralName'
]
goodsSpec
=
i
[
'goodsSpec'
]
goodsMfrsName
=
i
[
'goodsMfrsName'
]
hosGoodsId
=
i
[
'hosGoodsId'
]
goodsMfrsId
=
i
[
'goodsMfrsId'
]
break
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload22_5"
,
hosGoodsId
,
hosGoodsCode
,
goodsMfrsId
,
goodsMfrsId
,
goodsMfrsName
,
date1
,
date2
)
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
)
if
code
==
0
and
len
(
data
)
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_k9_带量采购目录_列表查询_全部查询.air/a_k9_带量采购目录_列表查询_全部查询.py
0 → 100644
View file @
1d14a724
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_k9_带量采购目录_列表查询_全部查询,id2297,id2297-109,sit,on
内网:a_k9_带量采购目录_列表查询_全部查询
"""
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_k9_带量采购目录_列表查询_全部查询
用例名称:a_k9_带量采购目录_列表查询_全部查询
输入:无
输出:"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_k9_带量采购目录_列表查询_全部查询
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload22_6"
)
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
len
(
data
)
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
# 将带量采购id存入文件中
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
data1
)
# print(type(data1), data1)
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
id1
)
list_b
.
append
(
id1
)
list_c
.
append
(
id1
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将采购计划明细信息写入到文件中
FileUtils
().
w_info8
(
info
,
module
,
'带量采购目录信息'
,
titlename
,
'message7'
)
test1
()
common/timeUtils.py
View file @
1d14a724
...
@@ -14,6 +14,14 @@ class timeUtils(object):
...
@@ -14,6 +14,14 @@ class timeUtils(object):
elif
type
==
2
:
elif
type
==
2
:
t
=
time
.
strftime
(
"%Y-%m-%d 00:00:00"
,
time
.
localtime
())
t
=
time
.
strftime
(
"%Y-%m-%d 00:00:00"
,
time
.
localtime
())
return
t
return
t
elif
type
==
3
:
t
=
time
.
strftime
(
"%Y-%m-%dT00:00:00.906Z"
,
time
.
localtime
())
return
t
elif
type
==
4
:
one_day_in_seconds
=
60
*
60
*
24
tomorrow
=
time
.
localtime
(
time
.
time
()
+
one_day_in_seconds
)
t
=
time
.
strftime
(
"%Y-%m-%dT00:00:00.906Z"
,
tomorrow
)
return
t
def
get_time_add
(
self
,
days_aa
):
def
get_time_add
(
self
,
days_aa
):
import
time
import
time
...
...
data/b3_herp3_purchase/data
View file @
1d14a724
...
@@ -16,7 +16,9 @@
...
@@ -16,7 +16,9 @@
"herpService_temporaryPurchase_close_url": "/api/herpService/temporaryPurchase/close"
"herpService_temporaryPurchase_close_url": "/api/herpService/temporaryPurchase/close"
"herpService_temporaryPurchase_getById_url": "/api/herpService/temporaryPurchase/getById/"
"herpService_temporaryPurchase_getById_url": "/api/herpService/temporaryPurchase/getById/"
"herpService_temporaryPurchase_listPage_url": "/api/herpService/temporaryPurchase/listPage"
"herpService_temporaryPurchase_listPage_url": "/api/herpService/temporaryPurchase/listPage"
"herpService_basic_mcmsGoodsInfo_goodsPage_url": "/api/herpService/basic/mcmsGoodsInfo/goodsPage"
"herpService_vbp_edit_url": "/api/herpService/vbp/edit"
"herpService_vbp_listPage_url": "/api/herpService/vbp/listPage"
data1: "10,20,60"
data1: "10,20,60"
...
@@ -150,5 +152,12 @@ json_headers2: {
...
@@ -150,5 +152,12 @@ json_headers2: {
"payload21_11": {"pageNum":1,"pageSize":50,"queryObject":{"taskName":"%s","goodsName":"%s","startTime":"%s","endTime":"%s"}}
"payload21_11": {"pageNum":1,"pageSize":50,"queryObject":{"taskName":"%s","goodsName":"%s","startTime":"%s","endTime":"%s"}}
"payload21_12": {"pageNum":1,"pageSize":50,"queryObject":{"taskName":"","goodsName":"","tbStatus":"%s","startTime":"","endTime":""}}
"payload21_12": {"pageNum":1,"pageSize":50,"queryObject":{"taskName":"","goodsName":"","tbStatus":"%s","startTime":"","endTime":""}}
"payload21_13": {"pageNum":1,"pageSize":"%s","queryObject":{"taskName":"","goodsName":"","tbStatus":"","startTime":"","endTime":""}}
"payload21_13": {"pageNum":1,"pageSize":"%s","queryObject":{"taskName":"","goodsName":"","tbStatus":"","startTime":"","endTime":""}}
"payload22": {"queryObject":{},"pageNum":1,"pageSize":50}
"payload22_1": {"queryObject":{"goodsKeyword":"%s","goodsMfrsId":"","goodsMfrsName":""},"pageNum":1,"pageSize":50}
"payload22_2": {"queryObject":{"goodsKeyword":"%s","goodsMfrsId":"",goodsSpec":"%s","goodsMfrsName":""},"pageNum":1,"pageSize":50}
"payload22_3": {"queryObject":{"goodsKeyword":"%s","goodsMfrsId":"",goodsSpec":"%s","goodsMfrsName":"%s"},"pageNum":1,"pageSize":50}
"payload22_4": {"queryObject":{},"pageNum":1,"pageSize":"%s"}
"payload22_5": {"detailList":[{"hosGoodsId":"%s","hosGoodsCode":"%s","goodsMfrsId":"%s"}],"remark":"自动化测试","goodsMfrsId":"%s","goodsMfrsName":"%s","planEndTime":"%s","planStartTime":"%s","projectName":"自动化测试","qty":"1","brand":"自动化测试"}
"payload22_6": {"pageNum":1,"pageSize":50,"queryObject":{"orderNo":"","goodsName":"","startTime":null,"endTime":null}}
checkDict2: {"code": 0,'msg': None,'data':1}
checkDict2: {"code": 0,'msg': None,'data':1}
report/summary.html
View file @
1d14a724
...
@@ -72,9 +72,9 @@
...
@@ -72,9 +72,9 @@
</tr>
</tr>
<tr
width=
"600"
>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_k
2_临采任务_列表查询_分页查询
/log.html'
target=
'_blank'
>
a_k
2_临采任务_列表查询_分页查询
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_k
8_带量采购目录_新增_保存
/log.html'
target=
'_blank'
>
a_k
8_带量采购目录_新增_保存
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1.
829
</td>
<td
class=
"details-col-elapsed"
>
1.
321
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
</tr>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment