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
f492b888
Commit
f492b888
authored
Mar 22, 2024
by
xiao-hesheng
Browse files
新增采购计划明细脚本
parent
6a70ce2d
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_h4_采购计划明细_列表查询_模糊查询_根据进院供应商.air/a_h4_采购计划明细_列表查询_模糊查询_根据进院供应商.py
0 → 100644
View file @
f492b888
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_h4_采购计划明细_列表查询_模糊查询_根据进院供应商,id2297,id2297-74,sit,on
内网:a_h4_采购计划明细_列表查询_模糊查询_根据进院供应商
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
module
=
"b3_herp3_purchase"
targetOrgId1
=
commonFuc
().
get_business_data
(
module
,
'targetOrgId'
)
targetAreaId1
=
commonFuc
().
get_business_data
(
module
,
'targetAreaId'
)
def
test1
(
targetOrgId
=
targetOrgId1
,
targetAreaId
=
targetAreaId1
):
module
=
"b3_herp3_purchase"
"""
场景:a_h4_采购计划明细_列表查询_模糊查询_根据进院供应商
用例名称:a_h4_采购计划明细_列表查询_模糊查询_根据进院供应商
输入:无
输出:"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_report_progress_page_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
)
# #获取日期
date1
=
timeUtils
().
get_time_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
30
)
# print(date1,date2)
# #调用查询采购计划列表,写入采购计划id和订单号到文件中,更新文件内容
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# using(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# from a_c1_采购计划审核_列表查询_全部查询 import test1
# test1()
# 从文件中获取院区id
branchId
=
commonFuc
().
get_business_data
(
module
,
'branchId'
)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"采购单信息"
,
'message3'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsCode
=
'goodsCode'
purPlanNo
=
'purPlanNo'
purNo
=
'purNo'
provName
=
'provName'
for
i
in
list_a
:
goodsCode
=
i
[
'goodsCode'
]
purPlanNo
=
i
[
'purPlanNo'
]
purNo
=
i
[
'purNo'
]
provName
=
i
[
'provName'
]
break
list2
=
commonFuc
().
get_str
(
provName
)
for
i
in
list2
:
# a_g4_采购计划明细_列表查询_精确查询_根据进院供应商
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload20_9"
,
goodsCode
,
purPlanNo
,
purNo
,
branchId
,
targetOrgId
,
targetAreaId
,
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
()
air_case/b3_herp3_purchase/a_h5_采购计划明细_列表查询_模糊查询_根据二级供应商.air/a_h5_采购计划明细_列表查询_模糊查询_根据二级供应商.py
0 → 100644
View file @
f492b888
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_h5_采购计划明细_列表查询_模糊查询_根据二级供应商,id2297,id2297-75,sit,on
内网:a_h5_采购计划明细_列表查询_模糊查询_根据二级供应商
"""
from
common.common_func
import
commonFuc
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
airtest.core.api
import
using
import
sys
module
=
"b3_herp3_purchase"
targetOrgId1
=
commonFuc
().
get_business_data
(
module
,
'targetOrgId'
)
targetAreaId1
=
commonFuc
().
get_business_data
(
module
,
'targetAreaId'
)
def
test1
(
targetOrgId
=
targetOrgId1
,
targetAreaId
=
targetAreaId1
):
module
=
"b3_herp3_purchase"
"""
场景:a_h5_采购计划明细_列表查询_模糊查询_根据二级供应商
用例名称:a_h5_采购计划明细_列表查询_模糊查询_根据二级供应商
输入:无
输出:"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_report_progress_page_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
)
# #获取日期
date1
=
timeUtils
().
get_time_add
(
1
)
date2
=
timeUtils
().
get_time_add
(
-
30
)
# print(date1,date2)
# #调用查询采购计划列表,写入采购计划id和订单号到文件中,更新文件内容
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# using(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# from a_c1_采购计划审核_列表查询_全部查询 import test1
# test1()
# 从文件中获取院区id
branchId
=
commonFuc
().
get_business_data
(
module
,
'branchId'
)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"采购单信息"
,
'message3'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsCode
=
'goodsCode'
purPlanNo
=
'purPlanNo'
purNo
=
'purNo'
provName
=
'provName'
subProvName
=
'subProvName'
for
i
in
list_a
:
goodsCode
=
i
[
'goodsCode'
]
purPlanNo
=
i
[
'purPlanNo'
]
purNo
=
i
[
'purNo'
]
provName
=
i
[
'provName'
]
subProvName
=
i
[
'subProvName'
]
break
list2
=
commonFuc
().
get_str
(
subProvName
)
for
i
in
list2
:
# a_h5_采购计划明细_列表查询_模糊查询_根据二级供应商
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload20_10"
,
goodsCode
,
purPlanNo
,
purNo
,
branchId
,
targetOrgId
,
targetAreaId
,
provName
,
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
()
air_case/b3_herp3_purchase/a_h6_采购计划明细_列表查询_异常查询_根据产品名称.air/a_h6_采购计划明细_列表查询_异常查询_根据产品名称.py
0 → 100644
View file @
f492b888
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_h6_采购计划明细_列表查询_异常查询_根据产品名称,id2297,id2297-76,sit,on
内网:a_h6_采购计划明细_列表查询_异常查询_根据产品名称
"""
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_h6_采购计划明细_列表查询_异常查询_根据产品名称
用例名称:a_h6_采购计划明细_列表查询_异常查询_根据产品名称
输入:无
输出:"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_report_progress_page_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
)
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# #调用查询采购计划列表,写入采购计划id和订单号到文件中,更新文件内容
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# using(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# from a_c1_采购计划审核_列表查询_全部查询 import test1
# test1()
# 从文件中获取院区id
branchId
=
commonFuc
().
get_business_data
(
module
,
'branchId'
)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"采购单信息"
,
'message3'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsName
=
'goodsName'
for
i
in
list_a
:
goodsName
=
i
[
'goodsName'
]
break
# Ph_id = info['id1']
str
=
commonFuc
().
get_business_data
(
module
,
'data3'
)
list2
=
list
(
str
.
split
(
","
))
# a_h6_采购计划明细_列表查询_异常查询_根据产品名称
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload20_1"
,
i
,
branchId
)
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
()
air_case/b3_herp3_purchase/a_h7_采购计划明细_列表查询_异常查询_根据产品Id.air/a_h7_采购计划明细_列表查询_异常查询_根据产品Id.py
0 → 100644
View file @
f492b888
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_h7_采购计划明细_列表查询_异常查询_根据产品Id,id2297,id2297-77,sit,on
内网:a_h7_采购计划明细_列表查询_异常查询_根据产品Id
"""
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_h6_采购计划明细_列表查询_异常查询_根据产品名称
用例名称:a_h6_采购计划明细_列表查询_异常查询_根据产品名称
输入:无
输出:"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_report_progress_page_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
)
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# #调用查询采购计划列表,写入采购计划id和订单号到文件中,更新文件内容
# pro_path = commonFuc().get_pro_path()
# sys.path.append(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# using(pro_path + r'\\air_case\\b3_herp3_purchase\\a_c1_采购计划审核_列表查询_全部查询.air')
# from a_c1_采购计划审核_列表查询_全部查询 import test1
# test1()
# 从文件中获取院区id
branchId
=
commonFuc
().
get_business_data
(
module
,
'branchId'
)
# 从文件中获取产品名称
info
=
FileUtils
().
r_info8
(
module
,
"采购单信息"
,
'message3'
)
print
(
'info'
,
info
)
list_a
=
info
[
'list_a'
]
print
(
'list_a'
,
list_a
)
goodsName
=
'goodsName'
for
i
in
list_a
:
goodsName
=
i
[
'goodsName'
]
break
# Ph_id = info['id1']
str
=
commonFuc
().
get_business_data
(
module
,
'data3'
)
list2
=
list
(
str
.
split
(
","
))
# a_h7_采购计划明细_列表查询_异常查询_根据产品Id
for
i
in
list2
:
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload20_1"
,
i
,
branchId
)
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
()
report/summary.html
View file @
f492b888
...
...
@@ -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分
1
秒
</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_
g1
_采购计划明细_列表查询_
精确
查询_根据
采购单号
/log.html'
target=
'_blank'
>
a_
g1
_采购计划明细_列表查询_
精确
查询_根据
采购单号
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
h7
_采购计划明细_列表查询_
异常
查询_根据
产品Id
/log.html'
target=
'_blank'
>
a_
h7
_采购计划明细_列表查询_
异常
查询_根据
产品Id
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
1
.1
68
</td>
<td
class=
"details-col-elapsed"
>
2
.1
74
</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