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
341aca50
Commit
341aca50
authored
Nov 13, 2024
by
xiao-hesheng
Browse files
流程一脚本提交
parent
3f9fedc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air/a_a4_流程四_基础模块设置.py
View file @
341aca50
...
...
@@ -63,13 +63,19 @@ def test1(type=1):
# 新增科室
execute_command
(
"python runner_test.py tag id2263-19,id2263-20,id2263-21,id2263-22,id2263-23,id2263-24,id2263-25,id2263-26 debug sit"
)
# 一键导入所有产品
execute_command
(
"python runner_test.py tag id2263-48 debug sit"
)
# 一键导入所有产品(2024.11.3因为产品数量多了导致导入时间太长,优化一下)
# execute_command("python runner_test.py tag id2263-48 debug sit")
#导入同步过来的新产品,防止因同步时间差导致新建的产品没有导入过来
for
i
in
range
(
1
,
6
):
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
hosGoodsId
=
info
[
'hosGoodsId'
]
import_goods
(
hosGoodsId
)
for
i
in
range
(
1
,
6
):
info
=
FileUtils
().
r_info8
(
'b5_spd3_core_business_flow'
,
"产品审核信息"
,
'message%s'
%
i
)
hosGoodsId
=
info
[
'hosGoodsId'
]
check_import_goods
(
hosGoodsId
)
# r_b8库房管理_库区设置_同步库房信息
execute_command
(
"python runner_test.py tag id2263-221 debug sit"
)
...
...
@@ -91,7 +97,33 @@ def test1(type=1):
# 科室管理-科室人员查询 设置科室负责人
execute_command
(
"python runner_test.py tag id2263-219 debug sit"
)
def
import_goods
(
hosGoodsId
):
def
import_goods
(
hosGoodsId
):
print
(
'导入新增的产品'
)
module
=
"b2_herp3_bs"
# 内网登录
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
()
url
=
commonFuc
().
get_api_add_port_url
()
+
commonFuc
().
get_business_data
(
module
,
"importGoods_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"
))
# 获取院区id
branch_id
=
FileUtils
().
r_info
(
module
,
'院区新增'
)[
"branch_id"
]
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload35"
,
hosGoodsId
,
branch_id
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'导入新增的产品result'
,
result
)
def
check_import_goods
(
hosGoodsId
):
module
=
"b2_herp3_bs"
# 内网登录
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
...
...
@@ -129,7 +161,8 @@ def import_goods(hosGoodsId):
# j=j+6
time
.
sleep
(
6
)
# 再次调用一键导入产品
execute_command
(
"python runner_test.py tag id2263-48 debug sit"
)
# execute_command("python runner_test.py tag id2263-48 debug sit")
import_goods
(
hosGoodsId
)
else
:
break
print
(
'result'
,
result
)
...
...
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