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
0f82bd72
Commit
0f82bd72
authored
Nov 03, 2023
by
liguangyu06
Browse files
用例优化
parent
c9d1fc9f
Changes
3
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_special_fresenius_group/按条件停用_停用已停用的套包_套包商品管理.air/按条件停用_停用已停用的套包_套包商品管理.py
View file @
0f82bd72
...
...
@@ -49,7 +49,7 @@ excel.write_data(row=2, column=2, value=group_name)
# 第二步进行套包数据导入操作
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url10"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1
0
"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1
1
"
)
# 获取文件
file
=
open
(
file_path
,
"rb"
)
...
...
@@ -67,8 +67,9 @@ result = json.loads(result.content)
file
.
close
()
# 截取结果中errList信息
result
=
{
"errList"
:
result
[
"data"
][
"errMsg"
][
"errList"
]}
print
(
result
)
# 获取预期结果
err_list
=
"平台套包编号【{}】 在待
启
用记录里不存在!"
.
format
(
group_code
)
err_list
=
"平台套包编号【{}】 在待
停
用记录里不存在!"
.
format
(
group_code
)
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict11"
,
err_list
)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
air_case/cmdc_special_fresenius_group/按条件停用_草稿状态的套包_套包商品管理.air/按条件停用_草稿状态的套包_套包商品管理.py
View file @
0f82bd72
...
...
@@ -28,7 +28,7 @@ headers = commonFuc().get_business_data(module, "json_headers2", cmdc_access_tok
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"
# 套包状态-
停用
状态
# 套包状态-
草稿
状态
group_status
=
0
# 获取套包列表
...
...
@@ -49,7 +49,7 @@ excel.write_data(row=2, column=2, value=group_name)
# 第二步进行套包数据导入操作
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url10"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1
0
"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload1
1
"
)
# 获取文件
file
=
open
(
file_path
,
"rb"
)
...
...
@@ -67,8 +67,9 @@ result = json.loads(result.content)
file
.
close
()
# 截取结果中errList信息
result
=
{
"errList"
:
result
[
"data"
][
"errMsg"
][
"errList"
]}
# 获取预期结果
err_list
=
"平台套包编号【{}】 在待
启
用记录里不存在!"
.
format
(
group_code
)
err_list
=
"平台套包编号【{}】 在待
停
用记录里不存在!"
.
format
(
group_code
)
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict11"
,
err_list
)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
data/cmdc_special_fresenius_group/data
View file @
0f82bd72
...
...
@@ -109,7 +109,9 @@ checkDict11: {"errList":["%s"]}
#预期结果
checkDict12: {"success":true,"code":"200","message":"OK","data":{"success":true},"freshToken":null}
#测试场景:批量停用功能验证
#按条件启用接口地址和报文
"payload11": {"type":1}
...
...
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