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
01ab7f06
Commit
01ab7f06
authored
Dec 15, 2023
by
liguangyu06
Browse files
用例优化
parent
9b33dd34
Changes
4
Hide whitespace changes
Inline
Side-by-side
air_case/cmdc_demand_fail/审核不存在的需求单.air/审核不存在的需求单.py
View file @
01ab7f06
...
...
@@ -15,7 +15,7 @@ import random
module
=
"cmdc_demand_fail"
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
(
100000000000
,
100000000000000
)
# 进行需求单的审核处理
url
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url"
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload3"
,
demand_id
)
"""
...
...
@@ -38,6 +41,6 @@ result = json.loads(result.content)
# print(result)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict3"
)
print
(
check_dict
)
#
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result
)
air_case/cmdc_demand_fail/审核其他状态的需求单.air/审核其他状态的需求单.py
View file @
01ab7f06
...
...
@@ -31,6 +31,7 @@ result = requests.post(url1, json=request_body, headers=headers)
result
=
json
.
loads
(
result
.
content
)
# 获取demandId
demand_id
=
result
[
"data"
][
"list"
][
0
][
"demandId"
]
# 第三步进行审核操作
url1
=
commonFuc
().
get_api_url
()
+
commonFuc
().
get_business_data
(
module
,
"url"
)
request_body1
=
commonFuc
().
get_business_data
(
module
,
"payload4"
,
demand_id
)
...
...
@@ -47,6 +48,6 @@ result1 = json.loads(result1.content)
# print(result1)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict4"
)
print
(
check_dict
)
#
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result1
)
air_case/cmdc_demand_fail/重复审核.air/重复审核.py
View file @
01ab7f06
...
...
@@ -53,6 +53,6 @@ result3 = json.loads(result3.content)
# print(result3)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict2"
)
print
(
check_dict
)
#
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result3
)
air_case/cmdc_demand_fail/需求单审核不通过.air/需求单审核不通过.py
View file @
01ab7f06
...
...
@@ -46,6 +46,6 @@ result1 = json.loads(result1.content)
# print(result1)
# 获取预期结果
check_dict
=
commonFuc
().
get_business_data
(
module
,
"checkDict1"
)
print
(
check_dict
)
#
print(check_dict)
# 断言实际结果中是否包含预期结果的内容
commonFuc
().
check_result
(
check_dict
,
result1
)
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