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
f8d8d032
Commit
f8d8d032
authored
Mar 15, 2024
by
xiao-hesheng
Browse files
优化脚本,精确查询时,解决因数据库中的数据被删除导致脚本失败的问题
parent
2445f7cb
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b3_herp3_purchase/a_a1_手工采购计划_添加产品页面_列表查询_查询全部.air/a_a1_手工采购计划_添加产品页面_列表查询_查询全部.py
View file @
f8d8d032
...
@@ -45,8 +45,8 @@ def test1():
...
@@ -45,8 +45,8 @@ def test1():
# print(date1,date2)
# print(date1,date2)
# # 请求体
# # 请求体
hospitalId
=
commonFuc
().
get_business_data
(
module
,
"hospitalId"
)
hospitalId
=
commonFuc
().
get_business_data
(
module
,
"hospitalId"
)
branchId
=
commonFuc
().
get_business_data
(
module
,
"branchId"
)
branchId
=
commonFuc
().
get_business_data
(
module
,
"branchId"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_4"
,
hospitalId
,
branchId
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_4"
,
hospitalId
,
branchId
)
# 发送请求
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
print
(
'result'
,
result
)
...
@@ -58,15 +58,15 @@ def test1():
...
@@ -58,15 +58,15 @@ def test1():
commonFuc
().
check_text_exist
(
0
,
result
)
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
commonFuc
().
check_text_exist
(
'error'
,
result
)
#返回三个产品,包含低值,高值,试剂
#
返回三个产品,包含低值,高值,试剂
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
print
(
type
(
data1
),
data1
)
print
(
type
(
data1
),
data1
)
list_a
=
[]
list_a
=
[]
list_b
=
[]
list_b
=
[]
list_c
=
[]
list_c
=
[]
for
i
in
data1
:
for
i
in
data1
:
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
i
)
purMode
=
commonFuc
().
analysis_json
(
'purMode'
,
i
)
if
purMode
==
10
:
if
purMode
==
10
:
list_a
.
append
(
i
)
list_a
.
append
(
i
)
break
break
for
i
in
data1
:
for
i
in
data1
:
...
@@ -80,11 +80,11 @@ def test1():
...
@@ -80,11 +80,11 @@ def test1():
if
purMode
==
60
:
if
purMode
==
60
:
list_c
.
append
(
i
)
list_c
.
append
(
i
)
break
break
print
(
'list_a'
,
len
(
list_a
),
list_a
)
print
(
'list_a'
,
len
(
list_a
),
list_a
)
info
=
(
list_a
,
list_b
,
list_c
)
info
=
(
list_a
,
list_b
,
list_c
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
titlename
=
(
'list_a'
,
'list_b'
,
'list_c'
)
# 将产品信息写入到文件中
# 将产品信息写入到文件中
FileUtils
().
w_info8
(
info
,
module
,
'产品信息'
,
titlename
,
'message1'
)
FileUtils
().
w_info8
(
info
,
module
,
'产品信息'
,
titlename
,
'message1'
)
test1
()
test1
()
air_case/b3_herp3_purchase/a_a2_手工采购计划_添加产品页面_列表查询_条件查询_精确查询.air/a_a2_手工采购计划_添加产品页面_列表查询_条件查询_精确查询.py
View file @
f8d8d032
...
@@ -129,7 +129,7 @@ def test1():
...
@@ -129,7 +129,7 @@ def test1():
commonFuc
().
check_text_exist
(
'error'
,
result
)
commonFuc
().
check_text_exist
(
'error'
,
result
)
#按进院供应商查询
#按进院供应商查询
# # 请求体
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_9"
,
hospitalId
,
branchId
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_9"
,
hospitalId
,
branchId
,
provName
)
print
(
'request_body'
,
request_body
)
print
(
'request_body'
,
request_body
)
# 发送请求
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
air_case/b3_herp3_purchase/a_a3_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询.air/a_a3_手工采购计划_添加产品页面_列表查询_条件查询_模糊查询.py
View file @
f8d8d032
# -*- encoding=utf8 -*-
# -*- encoding=utf8 -*-
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
__author__
=
"xiaohesheng"
...
@@ -38,12 +39,31 @@ def test1():
...
@@ -38,12 +39,31 @@ def test1():
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
print
(
'headers'
,
headers
)
print
(
'headers'
,
headers
)
info
=
FileUtils
().
r_info8
(
module
,
"产品信息"
,
'message1'
)
# print('info', info)
list_a
=
info
[
'list_a'
]
# print('list_a', list_a)
goodsMfrsName
=
"a"
goodsName
=
"a"
provName
=
"a"
for
i
in
list_a
:
goodsMfrsName
=
i
[
'goodsMfrsName'
]
goodsName
=
i
[
'goodsName'
]
provName
=
i
[
'provName'
]
break
hospitalId
=
commonFuc
().
get_business_data
(
module
,
"hospitalId"
)
branchId
=
commonFuc
().
get_business_data
(
module
,
"branchId"
)
# # #获取日期
# # #获取日期
# date1=timeUtils().get_time_hms(2)
# date1=timeUtils().get_time_hms(2)
# date2=timeUtils().get_time_add(-1)
# date2=timeUtils().get_time_add(-1)
# print(date1,date2)
# print(date1,date2)
# # 请求体
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_5_1"
)
goodsMfrsName
=
goodsMfrsName
[
0
:
5
]
goodsName
=
goodsName
[
0
:
2
]
provName
=
goodsName
[
0
:
5
]
print
(
'ffffffffffffffffffffffffffffffffffffffffffffff'
,
goodsMfrsName
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_5_1"
,
hospitalId
,
branchId
,
goodsMfrsName
,
goodsName
,
provName
)
# 发送请求
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
print
(
'result'
,
result
)
...
@@ -57,12 +77,16 @@ def test1():
...
@@ -57,12 +77,16 @@ def test1():
commonFuc
().
check_text_exist
(
'error'
,
result
)
commonFuc
().
check_text_exist
(
'error'
,
result
)
# 按器械注册人模糊查询
# 按器械注册人模糊查询
str
=
commonFuc
().
get_business_data
(
module
,
'data4'
)
goodsMfrsName1
=
goodsMfrsName
[
0
:
5
]
list2
=
list
(
str
.
split
(
","
))
goodsMfrsName2
=
goodsMfrsName
[
2
:
6
]
goodsMfrsName3
=
goodsMfrsName
[
6
:
len
(
goodsMfrsName
)]
# str = commonFuc().get_business_data(module, 'data4')
list2
=
[
goodsMfrsName1
,
goodsMfrsName2
,
goodsMfrsName3
]
print
(
'list2'
,
list2
)
print
(
'list2'
,
list2
)
for
i
in
list2
:
for
i
in
list2
:
# # 请求体
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_6_1"
,
i
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_6_1"
,
hospitalId
,
branchId
,
i
)
print
(
'request_body'
,
request_body
)
print
(
'request_body'
,
request_body
)
# 发送请求
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
@@ -81,7 +105,7 @@ def test1():
...
@@ -81,7 +105,7 @@ def test1():
print
(
'list2'
,
list2
)
print
(
'list2'
,
list2
)
for
i
in
list2
:
for
i
in
list2
:
# # 请求体
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_8_1"
,
i
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_8_1"
,
hospitalId
,
branchId
,
i
)
print
(
'request_body'
,
request_body
)
print
(
'request_body'
,
request_body
)
# 发送请求
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
@@ -100,7 +124,7 @@ def test1():
...
@@ -100,7 +124,7 @@ def test1():
print
(
'list2'
,
list2
)
print
(
'list2'
,
list2
)
for
i
in
list2
:
for
i
in
list2
:
# # 请求体
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_9_1"
,
i
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_9_1"
,
hospitalId
,
branchId
,
i
)
print
(
'request_body'
,
request_body
)
print
(
'request_body'
,
request_body
)
# 发送请求
# 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
data/b3_herp3_purchase/data
View file @
f8d8d032
...
@@ -39,8 +39,8 @@ json_headers2: {
...
@@ -39,8 +39,8 @@ json_headers2: {
"payload_6": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"","purModes":["%s"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_6": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"","purModes":["%s"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_7": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"%s","goodsName":"","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_7": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"%s","goodsName":"","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_8": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"%s","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_8": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"%s","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_9": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"
国药器械光谷分公司
","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_9": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"
%s
","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_5_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"
国药集团浙江
","goodsName":"
000017
","purModes":["10"],"provName":"
国药器械光谷分公司
","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_5_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"
%s
","goodsName":"
%s
","purModes":["10"],"provName":"
%s
","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_6_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"%s","goodsName":"","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_6_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"%s","goodsName":"","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_8_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"%s","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_8_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"%s","purModes":["10"],"provName":"","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_9_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
"payload_9_1": {"queryObject":{"hosId":"%s","branchId":"%s","goodsMfrsName":"","goodsName":"","purModes":["10"],"provName":"%s","tbStatus":1,"purchaseFlag":1},"pageNum":1,"pageSize":50}
...
...
report/summary.html
View file @
f8d8d032
...
@@ -55,9 +55,9 @@
...
@@ -55,9 +55,9 @@
<tr
width=
"600"
>
<tr
width=
"600"
>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0
</td>
<td
class=
'details-col-elapsed'
>
0分
2
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
0
秒
</td>
<td
class=
"details-col-elapsed"
>
10
0.0%
</td>
<td
class=
"details-col-elapsed"
>
0.0%
</td>
</tr>
</tr>
</table>
</table>
...
@@ -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_a
2
_手工采购计划_添加产品页面_列表查询_条件查询_
精确
查询/log.html'
target=
'_blank'
>
a_a
2
_手工采购计划_添加产品页面_列表查询_条件查询_
精确
查询
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_a
3
_手工采购计划_添加产品页面_列表查询_条件查询_
模糊
查询/log.html'
target=
'_blank'
>
a_a
3
_手工采购计划_添加产品页面_列表查询_条件查询_
模糊
查询
</a></td>
<td
class=
"
success"
>
成功
</td>
<td
class=
"
fail"
>
失败
</td>
<td
class=
"details-col-elapsed"
>
1.962
</td>
<td
class=
"details-col-elapsed"
>
0.764
</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