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
25b56356
Commit
25b56356
authored
Apr 10, 2024
by
xiao-hesheng
Browse files
新增期初录入脚本
parent
2df39af0
Changes
5
Hide whitespace changes
Inline
Side-by-side
air_case/b4_herp3_InitStock/a_b9_期初录入_列表_查询全部.air/a_b9_期初录入_列表_查询全部.py
0 → 100644
View file @
25b56356
# -*- encoding=utf8 -*-
from
common.db.sql.sql_get_info
import
sql_get_info
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_b9_期初录入_列表_查询全部,id2301,id2301-19,sit,on
内网:a_b9_期初录入_列表_查询全部
"""
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
=
"b4_herp3_InitStock"
"""
场景:a_b9_期初录入_列表_查询全部
用例名称:a_b9_期初录入_列表_查询全部
输入:无
输出:"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_mcmsInitStock_listVoPage_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
)
# 调用a_a1_期初录入_新增_低值生成一个期初单据
pro_path
=
commonFuc
().
get_pro_path
()
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b4_herp3_InitStock\\a_a1_期初录入_新增_低值.air'
)
using
(
pro_path
+
r
'\\air_case\\b4_herp3_InitStock\\a_a1_期初录入_新增_低值.air'
)
from
a_a1_期初录入_新增_低值
import
test1
# # 请求体
hospitalId
=
commonFuc
().
get_business_data
(
module
,
"hospitalId"
)
branchId
=
commonFuc
().
get_business_data
(
module
,
"branchId"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_12"
,
hospitalId
,
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
len
(
data
)
>=
1
and
total
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b4_herp3_InitStock/a_c0_期初录入_列表_条件查询_精确查询_库房.air/a_c0_期初录入_列表_条件查询_精确查询_库房.py
0 → 100644
View file @
25b56356
# -*- encoding=utf8 -*-
from
common.db.sql.sql_get_info
import
sql_get_info
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_c0_期初录入_列表_条件查询_精确查询_库房,id2301,id2301-20,sit,on
内网:a_c0_期初录入_列表_条件查询_精确查询_库房
"""
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
=
"b4_herp3_InitStock"
"""
场景:a_c0_期初录入_列表_条件查询_精确查询_库房
用例名称:a_c0_期初录入_列表_条件查询_精确查询_库房
输入:无
输出:"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_mcmsInitStock_listVoPage_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
)
# 调用a_a1_期初录入_新增_低值生成一个期初单据
pro_path
=
commonFuc
().
get_pro_path
()
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b4_herp3_InitStock\\a_a1_期初录入_新增_低值.air'
)
using
(
pro_path
+
r
'\\air_case\\b4_herp3_InitStock\\a_a1_期初录入_新增_低值.air'
)
from
a_a1_期初录入_新增_低值
import
test1
# # 请求体
hospitalId
=
commonFuc
().
get_business_data
(
module
,
"hospitalId"
)
branchId
=
commonFuc
().
get_business_data
(
module
,
"branchId"
)
stockId004
=
commonFuc
().
get_business_data
(
module
,
"stockId004"
)
# 没有数据的库房id
stockId001
=
commonFuc
().
get_business_data
(
module
,
"stockId001"
)
#中心库id
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_12_1"
,
stockId004
,
hospitalId
,
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
)
#
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_12_1"
,
stockId001
,
hospitalId
,
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
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
air_case/b4_herp3_InitStock/a_c1_期初录入_列表_条件查询_精确查询_状态.air/a_c1_期初录入_列表_条件查询_精确查询_状态.py
0 → 100644
View file @
25b56356
# -*- encoding=utf8 -*-
from
common.db.sql.sql_get_info
import
sql_get_info
from
common.fileUtls
import
FileUtils
from
common.timeUtils
import
timeUtils
__author__
=
"xiaohesheng"
"""
case_tag:api,herp-web,a_c1_期初录入_列表_条件查询_精确查询_状态,id2301,id2301-21,sit,on
内网:a_c1_期初录入_列表_条件查询_精确查询_状态
"""
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
=
"b4_herp3_InitStock"
"""
场景:a_c1_期初录入_列表_条件查询_精确查询_状态
用例名称:a_c1_期初录入_列表_条件查询_精确查询_状态
输入:无
输出:"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_mcmsInitStock_listVoPage_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
)
# 调用a_a1_期初录入_新增_低值生成一个期初单据
pro_path
=
commonFuc
().
get_pro_path
()
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b4_herp3_InitStock\\a_a1_期初录入_新增_低值.air'
)
using
(
pro_path
+
r
'\\air_case\\b4_herp3_InitStock\\a_a1_期初录入_新增_低值.air'
)
from
a_a1_期初录入_新增_低值
import
test1
# # 请求体
hospitalId
=
commonFuc
().
get_business_data
(
module
,
"hospitalId"
)
branchId
=
commonFuc
().
get_business_data
(
module
,
"branchId"
)
str1
=
commonFuc
().
get_business_data
(
module
,
'status'
)
list2
=
list
(
str1
.
split
(
","
))
print
(
list2
)
for
i
in
list2
:
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload_12_2"
,
i
,
hospitalId
,
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
)
tbStatus
=
commonFuc
().
analysis_json
(
'tbStatus'
,
data
)
if
code
==
0
and
total
>=
1
and
str
(
tbStatus
)
==
i
:
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
test1
()
data/b4_herp3_InitStock/data
View file @
25b56356
...
@@ -6,7 +6,10 @@
...
@@ -6,7 +6,10 @@
"herpService_mcmsInitStock_decode_url": "/api/herpService/mcmsInitStock/decode"
"herpService_mcmsInitStock_decode_url": "/api/herpService/mcmsInitStock/decode"
"herpService_mcmsInitStock_generate_url": "/api/herpService/mcmsInitStock/generate"
"herpService_mcmsInitStock_generate_url": "/api/herpService/mcmsInitStock/generate"
"herpService_mcmsInitStock_getInitStockDetails_url": "/api/herpService/mcmsInitStock/getInitStockDetails"
"herpService_mcmsInitStock_getInitStockDetails_url": "/api/herpService/mcmsInitStock/getInitStockDetails"
"herpService_mcmsInitStock_listVoPage_url": "/api/herpService/mcmsInitStock/listVoPage"
status: "0,1"
data1: "10,20,60"
data1: "10,20,60"
data2: "00001986,一次性医药包-低值,一次性医药包"
data2: "00001986,一次性医药包-低值,一次性医药包"
data3: "abcxxedd,1234456,',!@#$%,select,where 1=1"
data3: "abcxxedd,1234456,',!@#$%,select,where 1=1"
...
@@ -19,7 +22,6 @@ data9: "16,10,20,25,40,60,66,67"
...
@@ -19,7 +22,6 @@ data9: "16,10,20,25,40,60,66,67"
data10: "1,2,3,4,5"
data10: "1,2,3,4,5"
data11: "0,30,40"
data11: "0,30,40"
businessMode: "10,20,30"
businessMode: "10,20,30"
status: "0,1,2,3,4,5"
closeStatus: "0,1"
closeStatus: "0,1"
status2: "10,20,30,40"
status2: "10,20,30,40"
status3: "10,20,30,70"
status3: "10,20,30,70"
...
@@ -32,7 +34,11 @@ status3: "10,20,30,70"
...
@@ -32,7 +34,11 @@ status3: "10,20,30,70"
"hospitalId": "h0347"
"hospitalId": "h0347"
"decode1": "010000001165804810123456112403011726022821F24032900001"
"decode1": "010000001165804810123456112403011726022821F24032900001"
stock_name: "东土城院区中心库房"
stock_name: "东土城院区中心库房"
stockId004: "7fd43947cb1948158aa6a2ea7522b912"
stockId001: "c66b6ed38dbb4fbc8603dc00cdabb572"
json_contentType: "application/json"
json_contentType: "application/json"
json_headers: {
json_headers: {
...
@@ -48,7 +54,6 @@ json_headers2: {
...
@@ -48,7 +54,6 @@ json_headers2: {
"payload_2": {"stockId":"%s","areaCode":"%s","purMode":"60","hosId":"%s","branchId":"%s"}
"payload_2": {"stockId":"%s","areaCode":"%s","purMode":"60","hosId":"%s","branchId":"%s"}
"payload_3": {"queryObject":{"id":"%s","hosId":"%s","deptId":"%s","stockId":"%s","orderNo":"%s","purMode":"%s"},"pageNum":1,"pageSize":50}
"payload_3": {"queryObject":{"id":"%s","hosId":"%s","deptId":"%s","stockId":"%s","orderNo":"%s","purMode":"%s"},"pageNum":1,"pageSize":50}
"payload_3_1": {"queryObject":{"id":"%s","hosId":"%s","deptId":"%s","stockId":"%s","orderNo":"%s","purMode":"%s"},"pageNum":1,"pageSize":50}
"payload_3_1": {"queryObject":{"id":"%s","hosId":"%s","deptId":"%s","stockId":"%s","orderNo":"%s","purMode":"%s"},"pageNum":1,"pageSize":50}
"payload_4": {"branchId":"%s","hosGoodsId":"%s","pkgDefId":""}
"payload_4": {"branchId":"%s","hosGoodsId":"%s","pkgDefId":""}
"payload_5": {"initStockId":"%s","orderNo":"%s","initStockDetailDTOList":[{"hosGoodsId":"%s","hosGoodsCode":"%s","provId":"%s","subProvId":"%s","inSettlement":"%s","supplyId":"%s","initStockBatchVOS":[{"batchCode":"%s","productDate":"%s","expdtDate":"%s","stockQty":"%s","pkgDefId":"%s","pkgDefName":"%s","pkgDefQty":"%s"}]}]}
"payload_5": {"initStockId":"%s","orderNo":"%s","initStockDetailDTOList":[{"hosGoodsId":"%s","hosGoodsCode":"%s","provId":"%s","subProvId":"%s","inSettlement":"%s","supplyId":"%s","initStockBatchVOS":[{"batchCode":"%s","productDate":"%s","expdtDate":"%s","stockQty":"%s","pkgDefId":"%s","pkgDefName":"%s","pkgDefQty":"%s"}]}]}
"payload_6": {"stockId":"%s","hosId":"%s","code":"%s"}
"payload_6": {"stockId":"%s","hosId":"%s","code":"%s"}
...
@@ -57,6 +62,8 @@ json_headers2: {
...
@@ -57,6 +62,8 @@ json_headers2: {
"payload_9": {"initStockId":"%s","orderNo":"%s","initStockDetailDTOList":[{"hosGoodsId":"%s","hosGoodsCode":"%s","provId":"%s","subProvId":"%s","inSettlement":"%s","supplyId":"%s","initStockBatchVOS":[{"id":"%s","lastModified":"%s","version":"%s","createTime":"%s","createUser":"%s","lastModifiedUser":"%s","pid":"%s","detailId":"%s","batchCode":"%s","productDate":"%s","expdtDate":"%s","stockQty":"%s","pkgDefId":"%s","pkgDefName":"%s","pkgDefQty":"%s","snCode":null,"unit":"%s","purMode":"%s","unitName":"%s","batchVORepeatKey":"%s"}]}]}
"payload_9": {"initStockId":"%s","orderNo":"%s","initStockDetailDTOList":[{"hosGoodsId":"%s","hosGoodsCode":"%s","provId":"%s","subProvId":"%s","inSettlement":"%s","supplyId":"%s","initStockBatchVOS":[{"id":"%s","lastModified":"%s","version":"%s","createTime":"%s","createUser":"%s","lastModifiedUser":"%s","pid":"%s","detailId":"%s","batchCode":"%s","productDate":"%s","expdtDate":"%s","stockQty":"%s","pkgDefId":"%s","pkgDefName":"%s","pkgDefQty":"%s","snCode":null,"unit":"%s","purMode":"%s","unitName":"%s","batchVORepeatKey":"%s"}]}]}
"payload_10": {"pid":"%s"}
"payload_10": {"pid":"%s"}
"payload_11": {"initStockDetailDTOList":[{"hosGoodsCode":"%s","id":"%s","inSettlement":"%s","hosGoodsId":"%s","provId":"%s","subProvId":"%s","provName":"%s","subProvName":"%s","supplyId":"%s","mfrCode":"%s","pkgCodeSee":"%s","initStockBatchVOS":[{"batchCode":"%s","expdtDate":"%s","id":"%s","lastModified":"%s","lastModifiedUser":"%s","pid":"%s","productDate":"%s","stockQty":"%s","snCode":"%s"}]}],"initStockId":"%s","orderNo":"%s"}
"payload_11": {"initStockDetailDTOList":[{"hosGoodsCode":"%s","id":"%s","inSettlement":"%s","hosGoodsId":"%s","provId":"%s","subProvId":"%s","provName":"%s","subProvName":"%s","supplyId":"%s","mfrCode":"%s","pkgCodeSee":"%s","initStockBatchVOS":[{"batchCode":"%s","expdtDate":"%s","id":"%s","lastModified":"%s","lastModifiedUser":"%s","pid":"%s","productDate":"%s","stockQty":"%s","snCode":"%s"}]}],"initStockId":"%s","orderNo":"%s"}
"payload_12": {"pageNum":1,"pageSize":50,"queryObject":{"hosId":"%s","branchId":"%s"}}
"payload_12_1": {"pageNum":1,"pageSize":50,"queryObject":{"stockId":"%s","hosId":"%s","branchId":"%s"}}
"payload_12_2": {"pageNum":1,"pageSize":50,"queryObject":{"tbStatus":"%s","hosId":"%s","branchId":"%s"}}
checkDict2: {"code": 0,'msg': None,'data':1}
checkDict2: {"code": 0,'msg': None,'data':1}
report/summary.html
View file @
25b56356
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<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'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分
5
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
1
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
<td
class=
"details-col-elapsed"
>
100.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_
b8
_期初录入_
试剂_生成
/log.html'
target=
'_blank'
>
a_
b8
_期初录入_
试剂_生成
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_
c1
_期初录入_
列表_条件查询_精确查询_状态
/log.html'
target=
'_blank'
>
a_
c1
_期初录入_
列表_条件查询_精确查询_状态
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
5.835
</td>
<td
class=
"details-col-elapsed"
>
1.207
</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