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
15799985
Commit
15799985
authored
Apr 24, 2024
by
xiao-hesheng
Browse files
优化脚本
parent
d129efab
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_a5流程五_中心库入库结算_正结算1_提交采购计划.air/a_a5流程五_中心库入库结算_正结算1_提交采购计划.py
View file @
15799985
...
...
@@ -453,46 +453,45 @@ def reagent_purchase_plan():
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
try
:
# 获取低值的hosGoodsId
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
get_GoodsPkgDef
(
hosGoodsId
)
# 获取单元包id
except
:
print
(
'流程五获取hosGoodsId出现错误,请检查脚本或者数据'
)
try
:
low_vaule_purchase_plan
()
except
Exception
as
e
:
print
(
'低值采购计划提交出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
traceback
.
print_exc
()
#审批
try
:
approval_center
()
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
hight_vaule_purchase_plan
()
except
Exception
as
e
:
print
(
'高值采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
()
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
reagent_purchase_plan
()
except
Exception
as
e
:
print
(
'试剂采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
()
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
commonFuc
().
check_text_exist_result_text
(
'succeed'
,
'succeed'
)
\ No newline at end of file
def
main
():
try
:
# 获取低值的hosGoodsId
hosGoodsId
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
'产品审核信息'
,
'message2'
)[
"hosGoodsId"
]
get_GoodsPkgDef
(
hosGoodsId
)
# 获取单元包id
except
:
print
(
'流程五获取hosGoodsId出现错误,请检查脚本或者数据'
)
try
:
low_vaule_purchase_plan
()
except
Exception
as
e
:
print
(
'低值采购计划提交出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
traceback
.
print_exc
()
#审批
try
:
approval_center
()
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
hight_vaule_purchase_plan
()
except
Exception
as
e
:
print
(
'高值采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
()
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
reagent_purchase_plan
()
except
Exception
as
e
:
print
(
'试剂采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
try
:
approval_center
()
except
Exception
as
e
:
print
(
'审批采购计划出现错误,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
commonFuc
().
check_text_exist_result_text
(
'succeed'
,
'succeed'
)
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
air_case/b5_spd3_core_business_flow/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算.air/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算.py
View file @
15799985
...
...
@@ -2,9 +2,11 @@
import
traceback
from
air_case.b1_herp3_login.登录内网系统.登录内网系统
import
login_system
from
air_case.public.public
import
approval_center
from
common.fileUtls
import
FileUtils
from
common.run_cmd_script
import
execute_command
from
common.timeUtils
import
timeUtils
from
airtest.core.api
import
using
__author__
=
"xiaohesheng"
...
...
@@ -328,14 +330,60 @@ def putaway():
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
# ================================入库上架================================
def
settle
():
#结算相关
# # 登录获取用户id等信息,使用创建的用户登录===========开始
info
=
FileUtils
().
r_info8
(
'b2_herp3_bs'
,
"用户名信息"
,
'message3'
)
# print(info)
username
=
info
[
'username1'
]
password
=
commonFuc
().
get_business_data
(
"b2_herp3_bs"
,
"password"
)
# username = '001f90380'
# password='1qaz!QAZ'
print
(
'username,password'
,
username
,
password
)
# # print(username, password,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
# # 获取token和projectCode
token
,
projectCode
,
uxid
,
corpId
,
info
=
login_system
(
username
,
password
).
get_token
()
# 登录获取用户id等信息,使用创建的用户登录============结束
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers2"
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
projectCode
)
#================生成结算单列表查询===================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"mcmsOutUnBalance_listVoPage_url"
)
print
(
url
)
branch_id
=
FileUtils
().
r_info
(
'b2_herp3_bs'
,
'院区新增'
)[
"branch_id"
]
hosId
=
branch_id
[
0
:
5
]
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload7"
,
hosId
,
hosId
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
#取结算单id
list_a
=
[]
for
i
in
data1
:
id
=
commonFuc
().
analysis_json
(
'id'
,
i
)
list_a
.
append
(
id
)
print
(
list_a
)
print
(
list_a
[
0
],
list_a
[
1
],
type
(
list_a
[
0
]))
#===================生成结算单列表查询======================
#================== 生成结算单==============================
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"mcmsOutUnBalance_genBalanceBill_url"
)
print
(
url
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload8"
,
hosId
,
list_a
[
0
],
list_a
[
1
],
hosId
)
print
(
'request_body'
,
request_body
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'result'
,
result
)
# ================== 生成结算单==============================
try
:
check_accept_order
(
1
)
#低值
check_accept_order
(
2
)
#高值
check_accept_order
(
3
)
#试剂
putaway
()
putaway
()
putaway
()
# check_accept_order(1)#低值
# check_accept_order(2)#高值
# check_accept_order(3)#试剂
# putaway()
# putaway()
# putaway()
settle
()
#调用审批结算单
approval_center
()
except
Exception
as
e
:
print
(
'验收入库上架脚本出现异常,请检查脚本或者数据'
)
print
(
"发生异常:"
,
str
(
e
))
...
...
data/b5_spd3_core_business_flow/data
View file @
15799985
...
...
@@ -5,6 +5,9 @@
"stock_detail_url": "/api/herpService/stock/in/detail"
"stock_detail_submit_url": "/api/herpService/stock/in/submit"
"stock_in_page_url": "/api/herpService/stock/in/page"
"mcmsOutUnBalance_listVoPage_url": "/api/herpService/mcmsOutUnBalance/listVoPage"
"mcmsOutUnBalance_genBalanceBill_url": "/api/herpService/mcmsOutUnBalance/genBalanceBill"
"username": "xhs1009"
"password": "1qaz!QAZ"
...
...
@@ -26,3 +29,5 @@ json_headers2: {
"payload4": {"targetDeptId":"%s","targetAreaCode":"%s","hosId":"%s","sourceId":"%s","sourceType":"%s","pkgTaskId":null}
"payload5": {"batchList":[{"viewId":"%s","shelfCode":"%s"}],"sourceId":"%s","sourceType":"%s","sourceVersion":"%s","targetDeptId":"%s","targetDeptName":"%s","targetAreaCode":"%s","targetAreaName":"%s","pkgTaskId":null}
"payload6": {"pageNum":1,"pageSize":50,"orderBy":"","queryObject":{"branchId":"%s","taskType":0,"stockKind":"","sourceOrgName":"","hosId":"%s"}}
"payload7": {"pageNum":1,"pageSize":50,"queryObject":{"goodsInfo":"","barCodeInfo":"","fromOrderNo":"","purModeList":[],"accountDate1":"","accountDate2":"","tbStatus":0,"hosId":"%s"},"hosId":"%s"}
"payload8": {"genTypeEnum":"0","queryInfo":{"pageNum":1,"pageSize":50,"queryObject":{"goodsInfo":"","barCodeInfo":"","fromOrderNo":"","purModeList":[],"accountDate1":"","accountDate2":"","tbStatus":0,"hosId":"%s"}},"idList":["%s","%s"],"hosId":"%s"}
\ No newline at end of file
report/summary.html
View file @
15799985
...
...
@@ -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'
>
8分42
秒
</td>
<td
class=
'details-col-elapsed'
>
0分9
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
</table>
...
...
@@ -74,7 +74,7 @@
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/a_a7流程五_中心库入库结算_正结算3_内网验收入库结算/log.html'
target=
'_blank'
>
a_a7流程五_中心库入库结算_正结算3_内网验收入库结算
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
521.851
</td>
<td
class=
"details-col-elapsed"
>
9.54
</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