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
9b33dd34
Commit
9b33dd34
authored
Dec 15, 2023
by
liguangyu06
Browse files
用例优化
parent
f5caafc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_demand_delete/删除不存在的需求单.air/删除不存在的需求单.py
View file @
9b33dd34
...
...
@@ -15,7 +15,7 @@ import random
module
=
"cmdc_demand_delete"
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url"
)
# 获取登录所需账号密码
username
=
commonFuc
().
get_business_data
(
module
,
"username"
)
password
=
commonFuc
().
get_business_data
(
module
,
"password"
)
...
...
@@ -24,6 +24,9 @@ cmdc_access_token = CmdcDoLogin(username, password).get_token()
headers
=
commonFuc
().
get_business_data
(
module
,
"json_headers1"
,
cmdc_access_token
)
# 随机生成不存在的需求单id
demand_id
=
random
.
randint
(
10000000000000
,
1000000000000000
)
# 进行需求单的删除
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload2"
,
demand_id
)
"""
...
...
air_case/cmdc_demand_delete/需求单删除.air/需求单删除.py
View file @
9b33dd34
...
...
@@ -51,7 +51,7 @@ if result["code"] == "200":
# print(result1)
# 获取demandId
demand_id
=
result1
[
"data"
][
"list"
][
0
][
"demandId"
]
print
(
demand_id
)
#
print(demand_id)
# 第三步删除操作
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url"
)
...
...
@@ -67,7 +67,7 @@ if result["code"] == "200":
# 发送请求
result
=
requests
.
post
(
url
,
json
=
request_body
,
headers
=
headers
)
result
=
json
.
loads
(
result
.
content
)
print
(
result
)
#
print(result)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict2"
)
# 断言实际结果中是否包含预期结果的内容
...
...
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