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
f5a8f479
Commit
f5a8f479
authored
Mar 26, 2024
by
xiao-hesheng
Browse files
新增临采任务模块脚本
parent
4ddb6569
Changes
12
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称.air/a_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称,id2297,id2297-82,sit,on
内网:a_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
"""
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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
用例名称:a_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
输入:无
输出:"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_lcPage_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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
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
,
"payload21_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_i3_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_规格型号.air/a_i3_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_规格型号.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i3_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_规格型号,id2297,id2297-83,sit,on
内网:a_i3_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_规格型号
"""
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_i3_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_规格型号
用例名称:a_i3_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_规格型号
输入:无
输出:"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_lcPage_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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsSpec
=
'goodsSpec'
for
i
in
list_a
:
goodsSpec
=
i
[
'goodsSpec'
]
break
list2
=
[
goodsSpec
]
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_2"
,
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_i4_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_注册证.air/a_i4_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_注册证.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i4_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_注册证,id2297,id2297-84,sit,on
内网:a_i4_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_注册证
"""
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_i4_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_注册证
用例名称:a_i4_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_注册证
输入:无
输出:"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_lcPage_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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsRegCert
=
'goodsRegCert'
for
i
in
list_a
:
goodsRegCert
=
i
[
'goodsRegCert'
]
break
list2
=
[
goodsRegCert
]
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_3"
,
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_i5_临采任务_新增临采任务_保存.air/a_i5_临采任务_新增临采任务_保存.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i5_临采任务_新增临采任务_保存,id2297,id2297-85,sit,on
内网:a_i5_临采任务_新增临采任务_保存
"""
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_i5_临采任务_新增临采任务_保存
用例名称:a_i5_临采任务_新增临采任务_保存
输入:无
输出:"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_temporaryPurchase_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(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
hosGoodsId
=
'hosGoodsId'
hosGoodsCode
=
'hosGoodsCode'
for
i
in
list_a
:
hosGoodsId
=
i
[
'hosGoodsId'
]
hosGoodsCode
=
i
[
'hosGoodsCode'
]
break
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_4"
,
hosGoodsId
,
hosGoodsCode
)
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
)
#将id写入文件中
list_a
=
[]
list_b
=
[]
list_c
=
[]
list_a
.
append
(
data
)
list_b
.
append
(
data
)
list_c
.
append
(
data
)
# print('list_a', len(list_a), list_a)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将临采任务id写入到文件中
FileUtils
().
w_info8
(
info
,
module
,
'临采任务id'
,
titlename
,
'message5'
)
test1
()
air_case/b3_herp3_purchase/a_i6_临采任务_新增临采任务_编辑.air/a_i6_临采任务_新增临采任务_编辑.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i6_临采任务_新增临采任务_编辑,id2297,id2297-86,sit,on
内网:a_i6_临采任务_新增临采任务_编辑
"""
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_i6_临采任务_新增临采任务_编辑
用例名称:a_i6_临采任务_新增临采任务_编辑
输入:无
输出:"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_temporaryPurchase_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(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# a_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
hosGoodsId
=
'hosGoodsId'
hosGoodsCode
=
'hosGoodsCode'
for
i
in
list_a
:
hosGoodsId
=
i
[
'hosGoodsId'
]
hosGoodsCode
=
i
[
'hosGoodsCode'
]
break
#读取临采任务id
info
=
FileUtils
().
r_info8
(
module
,
"临采任务id"
,
'message5'
)
list2
=
info
[
'list_a'
]
my_string
=
' '
.
join
(
list2
)
print
(
'bbbb'
,
my_string
,
type
(
my_string
))
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_5"
,
hosGoodsId
,
hosGoodsCode
,
my_string
)
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
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_i7_临采任务_临采任务_执行.air/a_i7_临采任务_临采任务_执行.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i7_临采任务_临采任务_执行,id2297,id2297-87,sit,on
内网:a_i7_临采任务_临采任务_执行
"""
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_i7_临采任务_临采任务_执行
用例名称:a_i7_临采任务_临采任务_执行
输入:无
输出:"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_temporaryPurchase_execute_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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
# info = FileUtils().r_info8(module, "产品明细信息", 'message4')
# print('info', info)
# list_a = info['list_a']
# print('list_a', list_a)
# hosGoodsId = 'hosGoodsId'
# hosGoodsCode = 'hosGoodsCode'
# for i in list_a:
# hosGoodsId = i['hosGoodsId']
# hosGoodsCode =i['hosGoodsCode']
# break
#读取临采任务id
info
=
FileUtils
().
r_info8
(
module
,
"临采任务id"
,
'message5'
)
list2
=
info
[
'list_a'
]
my_string
=
' '
.
join
(
list2
)
print
(
'bbbb'
,
my_string
,
type
(
my_string
))
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_6"
,
my_string
)
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
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_i8_临采任务_临采任务_异常_重复执行.air/a_i8_临采任务_临采任务_异常_重复执行.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i8_临采任务_临采任务_异常_重复执行,id2297,id2297-88,sit,on
内网:a_i8_临采任务_临采任务_异常_重复执行
"""
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_i8_临采任务_临采任务_异常_重复执行
用例名称:a_i8_临采任务_临采任务_异常_重复执行
输入:无
输出:"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_temporaryPurchase_execute_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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
# info = FileUtils().r_info8(module, "产品明细信息", 'message4')
# print('info', info)
# list_a = info['list_a']
# print('list_a', list_a)
# hosGoodsId = 'hosGoodsId'
# hosGoodsCode = 'hosGoodsCode'
# for i in list_a:
# hosGoodsId = i['hosGoodsId']
# hosGoodsCode =i['hosGoodsCode']
# break
#读取临采任务id
info
=
FileUtils
().
r_info8
(
module
,
"临采任务id"
,
'message5'
)
list2
=
info
[
'list_a'
]
my_string
=
' '
.
join
(
list2
)
print
(
'bbbb'
,
my_string
,
type
(
my_string
))
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_6"
,
my_string
)
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
)
msg
=
commonFuc
().
analysis_json
(
'msg'
,
result
)
if
code
==
14030097
and
msg
==
'当前状态不可执行!'
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_i9_临采任务_临采任务_关闭.air/a_i9_临采任务_临采任务_关闭.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i8_临采任务_临采任务_关闭,id2297,id2297-89,sit,on
内网:a_i8_临采任务_临采任务_关闭
"""
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_i8_临采任务_临采任务_关闭
用例名称:a_i8_临采任务_临采任务_关闭
输入:无
输出:"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_temporaryPurchase_close_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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
# info = FileUtils().r_info8(module, "产品明细信息", 'message4')
# print('info', info)
# list_a = info['list_a']
# print('list_a', list_a)
# hosGoodsId = 'hosGoodsId'
# hosGoodsCode = 'hosGoodsCode'
# for i in list_a:
# hosGoodsId = i['hosGoodsId']
# hosGoodsCode =i['hosGoodsCode']
# break
#读取临采任务id
info
=
FileUtils
().
r_info8
(
module
,
"临采任务id"
,
'message5'
)
list2
=
info
[
'list_a'
]
my_string
=
' '
.
join
(
list2
)
print
(
'bbbb'
,
my_string
,
type
(
my_string
))
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_7"
,
my_string
)
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
data
==
True
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_j0_临采任务_临采任务_异常_重复关闭.air/a_j0_临采任务_临采任务_异常_重复关闭.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j0_临采任务_临采任务_异常_重复关闭,id2297,id2297-90,sit,on
内网:a_j0_临采任务_临采任务_异常_重复关闭
"""
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_j0_临采任务_临采任务_异常_重复关闭
用例名称:a_j0_临采任务_临采任务_异常_重复关闭
输入:无
输出:"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_temporaryPurchase_close_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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
# info = FileUtils().r_info8(module, "产品明细信息", 'message4')
# print('info', info)
# list_a = info['list_a']
# print('list_a', list_a)
# hosGoodsId = 'hosGoodsId'
# hosGoodsCode = 'hosGoodsCode'
# for i in list_a:
# hosGoodsId = i['hosGoodsId']
# hosGoodsCode =i['hosGoodsCode']
# break
#读取临采任务id
info
=
FileUtils
().
r_info8
(
module
,
"临采任务id"
,
'message5'
)
list2
=
info
[
'list_a'
]
my_string
=
' '
.
join
(
list2
)
print
(
'bbbb'
,
my_string
,
type
(
my_string
))
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_7"
,
my_string
)
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
)
msg
=
commonFuc
().
analysis_json
(
'msg'
,
result
)
if
code
==
14030100
and
msg
==
'当前状态不可关闭!'
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_j1_临采任务_临采任务_查看.air/a_j1_临采任务_临采任务_查看.py
0 → 100644
View file @
f5a8f479
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j1_临采任务_临采任务_查看,id2297,id2297-91,sit,on
内网:a_j1_临采任务_临采任务_查看
"""
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_j1_临采任务_临采任务_查看
用例名称:a_j1_临采任务_临采任务_查看
输入:无
输出:"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)
#
# 读取临采任务id
info
=
FileUtils
().
r_info8
(
module
,
"临采任务id"
,
'message5'
)
list2
=
info
[
'list_a'
]
my_string
=
' '
.
join
(
list2
)
print
(
'bbbb'
,
my_string
,
type
(
my_string
))
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"herpService_temporaryPurchase_getById_url"
)
url
=
url
+
my_string
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_i2_临采任务_新增临采任务_新增产品页面列表查询_条件查询_精确查询_产品名称
# 从文件中获取产品名称
# info = FileUtils().r_info8(module, "产品明细信息", 'message4')
# print('info', info)
# list_a = info['list_a']
# print('list_a', list_a)
# hosGoodsId = 'hosGoodsId'
# hosGoodsCode = 'hosGoodsCode'
# for i in list_a:
# hosGoodsId = i['hosGoodsId']
# hosGoodsCode =i['hosGoodsCode']
# break
# # 请求体
# request_body = commonFuc().get_business_data(module, "payload21_7",my_string)
# print('request_body', request_body)
# 发送请求
result
=
commonFuc
().
http_get
(
url
,
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
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
data/b3_herp3_purchase/data
View file @
f5a8f479
...
...
@@ -11,6 +11,10 @@
"herpService_report_progress_page_url": "/api/herpService/report/progress/pur/page"
"herpService_report_export_url": "/api/herpService/report/progress/pur/export"
"herpService_basic_lcPage_url": "/api/herpService/basic/mcmsGoodsInfo/lcPage"
"herpService_temporaryPurchase_edit_url": "/api/herpService/temporaryPurchase/edit"
"herpService_temporaryPurchase_execute_url": "/api/herpService/temporaryPurchase/execute"
"herpService_temporaryPurchase_close_url": "/api/herpService/temporaryPurchase/close"
"herpService_temporaryPurchase_getById_url": "/api/herpService/temporaryPurchase/getById/"
data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包"
...
...
@@ -129,6 +133,12 @@ json_headers2: {
"payload20_16": {"pageNum":1,"pageSize":"%s","queryObject":{"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"","createDateEnd":""}}
"payload20_17": {"goodsName":"","orderNo":"","status":[],"purPlanNo":"","planType":[],"purNo":"","branchId":"%s","targetAreaId":[],"provName":"","subProvName":"","purMode":[],"businessMode":[],"closeStatus":"","createDateStart":"%s","createDateEnd":"%s"}
"payload21": {"queryObject":{"goodsKeyword":"","goodsRegCert":"","goodsSpec":""},"pageNum":1,"pageSize":50}
"payload21_1": {"queryObject":{"goodsKeyword":"%s","goodsRegCert":"","goodsSpec":""},"pageNum":1,"pageSize":50}
"payload21_2": {"queryObject":{"goodsKeyword":"","goodsRegCert":"","goodsSpec":"%s"},"pageNum":1,"pageSize":50}
"payload21_3": {"queryObject":{"goodsKeyword":"","goodsRegCert":"%s","goodsSpec":""},"pageNum":1,"pageSize":50}
"payload21_4": {"detailList":[{"hosGoodsId":"%s","hosGoodsCode":"%s"}],"remark":"11","taskName":"自动化测试","taskQty":"1"}
"payload21_5": {"detailList":[{"hosGoodsId":"%s","hosGoodsCode":"%s"}],"id":"%s","remark":"22","taskName":"自动化测试22","taskQty":"2"}
"payload21_6": {"id":"%s","version":1}
"payload21_7": {"id":"%s","version":2}
checkDict2: {"code": 0,'msg': None,'data':1}
report/summary.html
View file @
f5a8f479
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
i
1_临采任务_
新增
临采任务_
新增产品页面列表查询_全部查询
/log.html'
target=
'_blank'
>
a_
i
1_临采任务_
新增
临采任务_
新增产品页面列表查询_全部查询
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
j
1_临采任务_临采任务_
查看
/log.html'
target=
'_blank'
>
a_
j
1_临采任务_临采任务_
查看
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1.
291
</td>
<td
class=
"details-col-elapsed"
>
1.
084
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</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