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-cmdc
Commits
d4dd7535
Commit
d4dd7535
authored
Jan 08, 2024
by
liguangyu06
Browse files
优化
parent
d0f7e89a
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_product/m_商品限购规则批量导入.air/m_商品限购规则批量导入.py
View file @
d4dd7535
...
...
@@ -8,6 +8,7 @@ case_tag:cmdc_api,cmdc商品限购规则批量导入,2293,2293-014,sit,bs
from
common.common_func
import
commonFuc
from
air_case.cmdc_login.后台管理系统登录.后台管理系统登录
import
CmdcDoLogin
from
common.handle_excel
import
HandleExcel
import
requests
import
json
import
os
...
...
@@ -27,6 +28,19 @@ headers = commonFuc().get_business_data(module, "json_headers_file", cmdc_access
BASE_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))))
file_path
=
BASE_DIR
+
"/data/cmdc_files/商品限购模板.xlsx"
# 设定商品信息
product_code
=
"12364265"
product_name
=
"医用检查手套"
cus_code
=
"1071246"
cus_name
=
"上海勘泽贸易商行"
# 将商品信息写入文件中
excel
=
HandleExcel
(
file_path
,
"Sheet1"
)
excel
.
write_data
(
row
=
2
,
column
=
1
,
value
=
product_code
)
excel
.
write_data
(
row
=
2
,
column
=
2
,
value
=
product_name
)
excel
.
write_data
(
row
=
2
,
column
=
3
,
value
=
cus_code
)
excel
.
write_data
(
row
=
2
,
column
=
4
,
value
=
cus_name
)
# 第二步商品限购规则批量导入操作
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url46"
)
...
...
air_case/cmdc_product/n_商品限购删除功能验证.air/n_商品限购删除功能验证.py
View file @
d4dd7535
...
...
@@ -43,7 +43,7 @@ request_body = commonFuc().get_business_data(module, "payload47", id)
# 发送请求
result
=
requests
.
get
(
url
,
params
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
print
(
result
)
#
print(result)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict47"
)
# print(check_dict)
...
...
data/cmdc_files/商品限购模板.xlsx
View file @
d4dd7535
No preview for this file type
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