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
5b6d7ead
Commit
5b6d7ead
authored
Nov 13, 2024
by
xiao-hesheng
Browse files
流程一脚本提交
parent
0ae3cab3
Changes
1
Hide whitespace changes
Inline
Side-by-side
air_case/b5_spd3_core_business_flow/a_a4_流程四_基础模块设置.air/a_a4_流程四_基础模块设置.py
View file @
5b6d7ead
...
...
@@ -110,29 +110,47 @@ def import_goods(hosGoodsId):
# 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"
)
#查询产品信息===========================================
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"mcmsBranchGoodsInfo_unBindPage_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"
]
while
True
:
# #请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3
5"
,
hosGoodsId
,
branch_i
d
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3
3_1"
,
branch_id
,
hosGoodsI
d
)
print
(
request_body
)
# # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
print
(
'导入新增的产品result'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
if
code
==
1004
:
time
.
sleep
(
10
)
print
(
'result'
,
result
)
total
=
commonFuc
().
analysis_json
(
'total'
,
result
)
if
total
==
0
:
continue
el
if
code
==
0
:
el
se
:
break
# 查询产品信息=========================================
#导入院区产品
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"
...
...
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