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
88da5deb
Commit
88da5deb
authored
Mar 28, 2024
by
xiao-hesheng
Browse files
新增临采任务模块脚本
parent
f5a8f479
Changes
20
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_i6_临采任务_新增临采任务_编辑.air/a_i6_临采任务_新增临采任务_编辑.py
View file @
88da5deb
...
...
@@ -74,7 +74,6 @@ def test1():
if
code
==
0
and
len
(
data
)
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
...
...
air_case/b3_herp3_purchase/a_i7_临采任务_临采任务_执行.air/a_i7_临采任务_临采任务_执行.py
View file @
88da5deb
...
...
@@ -74,7 +74,7 @@ def test1():
if
code
==
0
and
data
==
None
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
...
...
air_case/b3_herp3_purchase/a_i8_临采任务_临采任务_异常_重复执行.air/a_i8_临采任务_临采任务_异常_重复执行.py
View file @
88da5deb
...
...
@@ -74,7 +74,7 @@ def test1():
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
)
...
...
air_case/b3_herp3_purchase/a_i9_临采任务_临采任务_关闭.air/a_i9_临采任务_临采任务_关闭.py
View file @
88da5deb
...
...
@@ -5,8 +5,8 @@ from common.timeUtils import timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_i
8
_临采任务_临采任务_关闭,id2297,id2297-89,sit,on
内网:a_i
8
_临采任务_临采任务_关闭
case_tag:api,herp-web,a_i
9
_临采任务_临采任务_关闭,id2297,id2297-89,sit,on
内网:a_i
9
_临采任务_临采任务_关闭
"""
from
common.common_func
import
commonFuc
...
...
@@ -18,8 +18,8 @@ import sys
def
test1
():
module
=
"b3_herp3_purchase"
"""
场景:a_i
8
_临采任务_临采任务_关闭
用例名称:a_i
8
_临采任务_临采任务_关闭
场景:a_i
9
_临采任务_临采任务_关闭
用例名称:a_i
9
_临采任务_临采任务_关闭
输入:无
输出:"rtn_msg": {"code": 0, "msg": null, "data": true}
"""
...
...
@@ -74,7 +74,7 @@ def test1():
if
code
==
0
and
data
==
True
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
...
...
air_case/b3_herp3_purchase/a_j0_临采任务_临采任务_异常_重复关闭.air/a_j0_临采任务_临采任务_异常_重复关闭.py
View file @
88da5deb
...
...
@@ -74,7 +74,7 @@ def test1():
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
)
...
...
air_case/b3_herp3_purchase/a_j1_临采任务_临采任务_查看.air/a_j1_临采任务_临采任务_查看.py
View file @
88da5deb
...
...
@@ -75,7 +75,7 @@ def test1():
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
)
...
...
air_case/b3_herp3_purchase/a_j2_临采任务_列表查询_全部查询.air/a_j2_临采任务_列表查询_全部查询.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j2_临采任务_列表查询_全部查询,id2297,id2297-92,sit,on
内网:a_j2_临采任务_列表查询_全部查询
"""
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_j2_临采任务_列表查询_全部查询
用例名称:a_j2_临采任务_列表查询_全部查询
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# 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_8"
)
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'
,
result
)
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_j3_临采任务_列表查询_条件查询_精确查询_临采任务名称.air/a_j3_临采任务_列表查询_条件查询_精确查询_临采任务名称.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j3_临采任务_列表查询_条件查询_临采任务名称,id2297,id2297-93,sit,on
内网:a_j3_临采任务_列表查询_条件查询_临采任务名称
"""
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_j3_临采任务_列表查询_条件查询_临采任务名称
用例名称:a_j3_临采任务_列表查询_条件查询_临采任务名称
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
# 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
lc_name
=
commonFuc
().
get_business_data
(
module
,
"lc_name"
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_9"
,
lc_name
)
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'
,
result
)
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_j4_临采任务_列表查询_条件查询_精确查询_产品名称.air/a_j4_临采任务_列表查询_条件查询_精确查询_产品名称.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j4_临采任务_列表查询_条件查询_精确查询_产品名称,id2297,id2297-94,sit,on
内网:a_j4_临采任务_列表查询_条件查询_精确查询_产品名称
"""
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_j4_临采任务_列表查询_条件查询_精确查询_产品名称
用例名称:a_j4_临采任务_列表查询_条件查询_精确查询_产品名称
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsName
=
'goodsName'
hosGoodsCode
=
'hosGoodsCode'
for
i
in
list_a
:
goodsName
=
i
[
'goodsName'
]
hosGoodsCode
=
i
[
'hosGoodsCode'
]
break
list2
=
[
goodsName
,
hosGoodsCode
]
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_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'
,
result
)
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_j5_临采任务_列表查询_条件查询_精确查询_根据制单日期.air/a_j5_临采任务_列表查询_条件查询_精确查询_根据制单日期.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j5_临采任务_列表查询_条件查询_精确查询_根据制单日期,id2297,id2297-95,sit,on
内网:a_j5_临采任务_列表查询_条件查询_精确查询_根据制单日期
"""
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_j5_临采任务_列表查询_条件查询_精确查询_根据制单日期
用例名称:a_j5_临采任务_列表查询_条件查询_精确查询_根据制单日期
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsName
=
'goodsName'
hosGoodsCode
=
'hosGoodsCode'
for
i
in
list_a
:
goodsName
=
i
[
'goodsName'
]
hosGoodsCode
=
i
[
'hosGoodsCode'
]
break
lc_name
=
commonFuc
().
get_business_data
(
module
,
"lc_name"
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_11"
,
lc_name
,
goodsName
,
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'
,
result
)
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_j6_临采任务_列表查询_条件查询_精确查询_状态.air/a_j6_临采任务_列表查询_条件查询_精确查询_状态.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j6_临采任务_列表查询_条件查询_精确查询_状态,id2297,id2297-96,sit,on
内网:a_j6_临采任务_列表查询_条件查询_精确查询_状态
"""
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_j4_临采任务_列表查询_条件查询_精确查询_产品名称
用例名称:a_j4_临采任务_列表查询_条件查询_精确查询_产品名称
输入:无
输出:"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_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_add(1)
# date2=timeUtils().get_time_add(-91)
# print(date1,date2)
# # 从文件中获取产品名称
# info = FileUtils().r_info8(module, "产品明细信息", 'message4')
# print('info', info)
# list_a = info['list_a']
# print('list_a', list_a)
# goodsName = 'goodsName'
# hosGoodsCode = 'hosGoodsCode'
# for i in list_a:
# goodsName = i['goodsName']
# hosGoodsCode =i['hosGoodsCode']
# break
str
=
commonFuc
().
get_business_data
(
module
,
'status2'
)
list2
=
list
(
str
.
split
(
","
))
print
(
list2
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_12"
,
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'
,
result
)
if
code
==
0
and
total
>=
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_j7_临采任务_列表查询_条件查询_模糊查询_临采任务名称.air/a_j7_临采任务_列表查询_条件查询_模糊查询_临采任务名称.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j7_临采任务_列表查询_条件查询_模糊查询_临采任务名称,id2297,id2297-97,sit,on
内网:a_j7_临采任务_列表查询_条件查询_模糊查询_临采任务名称
"""
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_j7_临采任务_列表查询_条件查询_模糊查询_临采任务名称
用例名称:a_j7_临采任务_列表查询_条件查询_模糊查询_临采任务名称
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
# 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
lc_name
=
commonFuc
().
get_business_data
(
module
,
"lc_name"
)
list2
=
commonFuc
().
get_str
(
lc_name
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_9"
,
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'
,
result
)
if
code
==
0
and
total
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_j8_临采任务_列表查询_条件查询_模糊查询_产品名称.air/a_j8_临采任务_列表查询_条件查询_模糊查询_产品名称.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j8_临采任务_列表查询_条件查询_模糊查询_产品名称,id2297,id2297-98,sit,on
内网:a_j8_临采任务_列表查询_条件查询_模糊查询_产品名称
"""
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_j8_临采任务_列表查询_条件查询_模糊查询_产品名称
用例名称:a_j8_临采任务_列表查询_条件查询_模糊查询_产品名称
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsName
=
'goodsName'
hosGoodsCode
=
'hosGoodsCode'
for
i
in
list_a
:
goodsName
=
i
[
'goodsName'
]
hosGoodsCode
=
i
[
'hosGoodsCode'
]
break
list2
=
commonFuc
().
get_str
(
goodsName
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_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'
,
result
)
if
code
==
0
and
total
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
return
data
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_j9_临采任务_列表查询_条件查询_异常查询_临采任务名称.air/a_j9_临采任务_列表查询_条件查询_异常查询_临采任务名称.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_j9_临采任务_列表查询_条件查询_异常查询_临采任务名称,id2297,id2297-99,sit,on
内网:a_j9_临采任务_列表查询_条件查询_异常查询_临采任务名称
"""
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_j9_临采任务_列表查询_条件查询_异常查询_临采任务名称
用例名称:a_j9_临采任务_列表查询_条件查询_异常查询_临采任务名称
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
# 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
str
=
commonFuc
().
get_business_data
(
module
,
'data3'
)
list2
=
list
(
str
.
split
(
","
))
print
(
list2
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_9"
,
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'
,
result
)
if
code
==
0
and
total
==
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_k0_临采任务_列表查询_条件查询_异常查询_产品名称.air/a_k0_临采任务_列表查询_条件查询_异常查询_产品名称.py
0 → 100644
View file @
88da5deb
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_k0_临采任务_列表查询_条件查询_异常查询_产品名称,id2297,id2297-100,sit,on
内网:a_k0_临采任务_列表查询_条件查询_异常查询_产品名称
"""
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_k0_临采任务_列表查询_条件查询_异常查询_产品名称
用例名称:a_k0_临采任务_列表查询_条件查询_异常查询_产品名称
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
# 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
str
=
commonFuc
().
get_business_data
(
module
,
'data3'
)
list2
=
list
(
str
.
split
(
","
))
print
(
list2
)
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_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'
,
result
)
if
code
==
0
and
total
==
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_k1_临采任务_列表查询_条件查询_异常查询_根据制单日期.air/a_k1_临采任务_列表查询_条件查询_异常查询_根据制单日期.py
0 → 100644
View file @
88da5deb
# -*- 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_k1_临采任务_列表查询_条件查询_异常查询_根据制单日期,id2297,id2297-101,sit,on
内网:a_k1_临采任务_列表查询_条件查询_异常查询_根据制单日期
"""
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_k1_临采任务_列表查询_条件查询_异常查询_根据制单日期
用例名称:a_k1_临采任务_列表查询_条件查询_异常查询_根据制单日期
输入:无
输出:"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_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_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
91
)
# print(date1,date2)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"产品明细信息"
,
'message4'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsName
=
'goodsName'
hosGoodsCode
=
'hosGoodsCode'
for
i
in
list_a
:
goodsName
=
i
[
'goodsName'
]
hosGoodsCode
=
i
[
'hosGoodsCode'
]
break
lc_name
=
commonFuc
().
get_business_data
(
module
,
"lc_name"
)
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload21_11"
,
lc_name
,
goodsName
,
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
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
if
code
==
0
and
total
==
0
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b3_herp3_purchase/a_k2_临采任务_列表查询_分页查询.air/a_k2_临采任务_列表查询_分页查询.py
0 → 100644
View file @
88da5deb
# -*- 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_k2_临采任务_列表查询_分页查询,id2297,id2297-102,sit,on
内网:a_k2_临采任务_列表查询_分页查询
"""
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_k2_临采任务_列表查询_分页查询
用例名称:a_k2_临采任务_列表查询_分页查询
输入:无
输出:"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_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
,
"payload21_13"
,
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_lcTask
()
\ No newline at end of file
common/db/sql/sql_del_branch_info.py
View file @
88da5deb
...
...
@@ -151,6 +151,22 @@ class delData(object):
cursor
.
execute
(
"commit;"
)
print
(
'用户信息删除成功 '
)
cursor
.
close
()
def
Delete_lcTask
(
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_temporary_purchase_detail where pid in(select id from mcms_temporary_purchase where task_name like '%自动化测试%');"
print
(
sql
)
cursor
.
execute
(
sql
)
cursor
.
execute
(
"commit;"
)
print
(
'临采任务子表信息删除成功 '
)
sql
=
"delete from mcms_temporary_purchase where task_name like '%自动化测试%';"
print
(
sql
)
cursor
.
execute
(
sql
)
cursor
.
execute
(
"commit;"
)
print
(
'临采任务子表信息删除成功 '
)
cursor
.
close
()
# delData().Delete_branch_by_id()
# delData().Delete_goods_change_info()
# delData().Delete_sys_config()
...
...
data/b3_herp3_purchase/data
View file @
88da5deb
...
...
@@ -15,6 +15,9 @@
"herpService_temporaryPurchase_execute_url": "/api/herpService/temporaryPurchase/execute"
"herpService_temporaryPurchase_close_url": "/api/herpService/temporaryPurchase/close"
"herpService_temporaryPurchase_getById_url": "/api/herpService/temporaryPurchase/getById/"
"herpService_temporaryPurchase_listPage_url": "/api/herpService/temporaryPurchase/listPage"
data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包"
...
...
@@ -30,6 +33,7 @@ data11: "0,30,40"
businessMode: "10,20,30"
status: "0,1,2,3,4,5"
closeStatus: "0,1"
status2: "10,20,30,40"
"username": "xhs1009"
"password": "1qaz!QAZ"
...
...
@@ -38,7 +42,7 @@ closeStatus: "0,1"
"hospitalId": "h0347"
"targetOrgId": "d69a68df361a4289b2262e4ef75b55a5"
"targetAreaId": "areah03470414"
"lc_name": "自动化测试22"
json_contentType: "application/json"
json_headers: {
...
...
@@ -140,5 +144,11 @@ json_headers2: {
"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}
"payload21_8": {"pageNum":1,"pageSize":50,"queryObject":{"taskName":"","goodsName":"","startTime":"","endTime":""}}
"payload21_9": {"pageNum":1,"pageSize":50,"queryObject":{"taskName":"%s","goodsName":"","startTime":"","endTime":""}}
"payload21_10": {"pageNum":1,"pageSize":50,"queryObject":{"taskName":"","goodsName":"%s","startTime":"","endTime":""}}
"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_13": {"pageNum":1,"pageSize":"%s","queryObject":{"taskName":"","goodsName":"","tbStatus":"","startTime":"","endTime":""}}
checkDict2: {"code": 0,'msg': None,'data':1}
report/summary.html
View file @
88da5deb
...
...
@@ -72,9 +72,9 @@
</tr>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
j1
_临采任务_
临采任务_查看
/log.html'
target=
'_blank'
>
a_
j1
_临采任务_
临采任务_查看
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
k2
_临采任务_
列表查询_分页查询
/log.html'
target=
'_blank'
>
a_
k2
_临采任务_
列表查询_分页查询
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1.
084
</td>
<td
class=
"details-col-elapsed"
>
1.
829
</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