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
7be3fe96
Commit
7be3fe96
authored
Mar 13, 2024
by
xiao-hesheng
Browse files
优化脚本
parent
7a0b5313
Changes
6
Hide whitespace changes
Inline
Side-by-side
air_case/b2_herp3_bs/r_e6用户管理_用户管理_列表查询_查询全部.air/r_e6用户管理_用户管理_列表查询_查询全部.py
View file @
7be3fe96
...
@@ -22,7 +22,7 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
...
@@ -22,7 +22,7 @@ from air_case.b1_herp3_login.登录内网系统.登录内网系统 import login_
module
=
"b2_herp3_bs"
module
=
"b2_herp3_bs"
def
test1
():
def
test1
(
username123
=
"xhs"
):
"""
"""
场景:r_e6用户管理_用户管理_列表查询_查询全部
场景:r_e6用户管理_用户管理_列表查询_查询全部
用例名称:r_e6用户管理_用户管理_列表查询_查询全部
用例名称:r_e6用户管理_用户管理_列表查询_查询全部
...
@@ -54,10 +54,22 @@ def test1():
...
@@ -54,10 +54,22 @@ def test1():
# 断言
# 断言
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
code
=
commonFuc
().
analysis_json
(
'code'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
data
=
commonFuc
().
analysis_json
(
'data'
,
result
)
data1
=
commonFuc
().
analysis_json
(
'data'
,
data
)
id1
=
""
id1
=
""
if
code
==
0
and
len
(
data
)
>=
1
:
if
code
==
0
and
len
(
data
)
>=
1
:
commonFuc
().
check_text_exist
(
0
,
result
)
commonFuc
().
check_text_exist
(
0
,
result
)
else
:
else
:
commonFuc
().
check_text_exist
(
'error'
,
result
)
commonFuc
().
check_text_exist
(
'error'
,
result
)
#增加返回用户id的脚本
print
(
'dataccccccccccccccccccccccccccccccccccc'
,
data1
)
for
i
in
data1
:
userCode
=
commonFuc
().
analysis_json
(
'userCode'
,
i
)
print
(
userCode
)
if
userCode
==
username123
:
print
(
userCode
,
'ccccccccccccccccccccccccccc'
)
id1
=
commonFuc
().
analysis_json
(
'id'
,
i
)
print
(
id1
)
return
id1
# break
test1
()
test1
()
air_case/b2_herp3_bs/r_f0用户管理_用户管理_新增用户.air/r_f0用户管理_用户管理_新增用户.py
View file @
7be3fe96
...
@@ -44,8 +44,10 @@ def test1(orgName='d69a68df361a4289b2262e4ef75b55a5'):
...
@@ -44,8 +44,10 @@ def test1(orgName='d69a68df361a4289b2262e4ef75b55a5'):
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"json_contentType"
),
token
,
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
commonFuc
().
get_business_data
(
module
,
"X-APP-CODE"
))
name
=
commonFuc
().
randomString
(
5
)
name
=
commonFuc
().
randomString
(
5
)
username
=
'自动化测试'
+
name
username
=
'自动化测试'
+
name
info
=
(
username
,
username
)
info
=
(
username
,
username
)
titlename
=
(
'username1'
,
'username2'
)
titlename
=
(
'username1'
,
'username2'
)
# 将二级科室id写入文件中
# 将二级科室id写入文件中
...
...
air_case/b2_herp3_bs/r_f2用户管理_用户管理_编辑用户_禁用.air/r_f2用户管理_用户管理_编辑用户_禁用.py
View file @
7be3fe96
...
@@ -47,8 +47,15 @@ def test1(orgName='d69a68df361a4289b2262e4ef75b55a5'):
...
@@ -47,8 +47,15 @@ def test1(orgName='d69a68df361a4289b2262e4ef75b55a5'):
info
=
FileUtils
().
r_info6
(
module
,
"用户名信息"
,
"message3"
)
info
=
FileUtils
().
r_info6
(
module
,
"用户名信息"
,
"message3"
)
print
(
info
)
print
(
info
)
username1
=
info
[
'username1'
]
username1
=
info
[
'username1'
]
#获取userid
pro_path
=
commonFuc
().
get_pro_path
()
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\r_e6用户管理_用户管理_列表查询_查询全部.air'
)
using
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\r_e6用户管理_用户管理_列表查询_查询全部.air'
)
from
r_e6用户管理_用户管理_列表查询_查询全部
import
test1
userid
=
test1
(
username1
)
print
(
'userid'
,
userid
)
# # 请求体
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload63_10"
,
username1
,
username1
,
orgName
,
username1
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload63_10"
,
username1
,
username1
,
orgName
,
userid
,
username1
)
print
(
'request_body'
,
request_body
)
print
(
'request_body'
,
request_body
)
# # # # 发送请求
# # # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
air_case/b2_herp3_bs/r_f3用户管理_用户管理_编辑用户_启用.air/r_f3用户管理_用户管理_编辑用户_启用.py
View file @
7be3fe96
...
@@ -47,8 +47,15 @@ def test1(orgName='d69a68df361a4289b2262e4ef75b55a5'):
...
@@ -47,8 +47,15 @@ def test1(orgName='d69a68df361a4289b2262e4ef75b55a5'):
info
=
FileUtils
().
r_info6
(
module
,
"用户名信息"
,
"message3"
)
info
=
FileUtils
().
r_info6
(
module
,
"用户名信息"
,
"message3"
)
print
(
info
)
print
(
info
)
username1
=
info
[
'username1'
]
username1
=
info
[
'username1'
]
# 获取userid
pro_path
=
commonFuc
().
get_pro_path
()
sys
.
path
.
append
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\r_e6用户管理_用户管理_列表查询_查询全部.air'
)
using
(
pro_path
+
r
'\\air_case\\b2_herp3_bs\\r_e6用户管理_用户管理_列表查询_查询全部.air'
)
from
r_e6用户管理_用户管理_列表查询_查询全部
import
test1
userid
=
test1
(
username1
)
print
(
'userid'
,
userid
)
# # 请求体
# # 请求体
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload63_11"
,
username1
,
username1
,
orgName
,
username1
)
request_body
=
commonFuc
().
get_business_data
(
module
,
"payload63_11"
,
username1
,
username1
,
orgName
,
userid
,
username1
)
print
(
'request_body'
,
request_body
)
print
(
'request_body'
,
request_body
)
# # # # 发送请求
# # # # 发送请求
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
result
=
commonFuc
().
http_post
(
url
,
request_body
,
headers
)
...
...
data/b2_herp3_bs/data
View file @
7be3fe96
...
@@ -507,8 +507,8 @@ json_headers2: {
...
@@ -507,8 +507,8 @@ json_headers2: {
"payload63_7": {"pageNum":1,"pageSize":50,"queryObject":{"cname":"xhs1009","roleCode":"ro00442","orgName":"%s","corpId":"h0347"}}
"payload63_7": {"pageNum":1,"pageSize":50,"queryObject":{"cname":"xhs1009","roleCode":"ro00442","orgName":"%s","corpId":"h0347"}}
"payload63_8": {"pageNum":1,"pageSize":50,"queryObject":{"cname":"%s","roleCode":"ro00442","orgName":"%s","corpId":"h0347"}}
"payload63_8": {"pageNum":1,"pageSize":50,"queryObject":{"cname":"%s","roleCode":"ro00442","orgName":"%s","corpId":"h0347"}}
"payload63_9": {"userCode":"%s","cname":"%s","tel":"xhs0301","orgCode":"","orgId":"%s","roleCode":"ro00442","projectCode":"herp","erpCode":"%s"}
"payload63_9": {"userCode":"%s","cname":"%s","tel":"xhs0301","orgCode":"","orgId":"%s","roleCode":"ro00442","projectCode":"herp","erpCode":"%s"}
"payload63_10": {"userCode":"%s","cname":"%s","tel":"xhs0301","orgCode":"001","orgId":"%s","id":"
h0347_UID-051072
","enableFlag":"0","roleCode":"ro00442","projectCode":"herp","erpCode":"%s"}
"payload63_10": {"userCode":"%s","cname":"%s","tel":"xhs0301","orgCode":"001","orgId":"%s","id":"
%s
","enableFlag":"0","roleCode":"ro00442","projectCode":"herp","erpCode":"%s"}
"payload63_11": {"userCode":"%s","cname":"%s","tel":"xhs0301","orgCode":"001","orgId":"%s","id":"
h0347_UID-051072
","enableFlag":"1","roleCode":"ro00442","projectCode":"herp","erpCode":"%s_update"}
"payload63_11": {"userCode":"%s","cname":"%s","tel":"xhs0301","orgCode":"001","orgId":"%s","id":"
%s
","enableFlag":"1","roleCode":"ro00442","projectCode":"herp","erpCode":"%s_update"}
"payload63_12": {"roleCode":"ro00442","userId":"h0347_UID-051050","projectCode":"herp","grantInfos":[{"corpId":"h0347","corpName":"","mgrBranchId":"h0347-2011","mgrBranchName":"东土城院区","mgrRangeId":"%s","mgrRangeName":"001","roleCode":"ro00442"},{"corpId":"h0347","corpName":"","mgrBranchId":"h0347-2011","mgrBranchName":"东土城院区","mgrRangeId":"%s","mgrRangeName":"008","roleCode":"ro00442"}]}
"payload63_12": {"roleCode":"ro00442","userId":"h0347_UID-051050","projectCode":"herp","grantInfos":[{"corpId":"h0347","corpName":"","mgrBranchId":"h0347-2011","mgrBranchName":"东土城院区","mgrRangeId":"%s","mgrRangeName":"001","roleCode":"ro00442"},{"corpId":"h0347","corpName":"","mgrBranchId":"h0347-2011","mgrBranchName":"东土城院区","mgrRangeId":"%s","mgrRangeName":"008","roleCode":"ro00442"}]}
"payload64": {"pageNum":1,"pageSize":50,"queryObject":{"startTime":"","endTime":""}}
"payload64": {"pageNum":1,"pageSize":50,"queryObject":{"startTime":"","endTime":""}}
"payload64_1": {"pageNum":1,"pageSize":200,"queryObject":{"methodCode":"S0102","operType":"restful","startTime":"2024-02-28 00:00:00","endTime":"2024-02-29 23:59:59"}}
"payload64_1": {"pageNum":1,"pageSize":200,"queryObject":{"methodCode":"S0102","operType":"restful","startTime":"2024-02-28 00:00:00","endTime":"2024-02-29 23:59:59"}}
...
...
report/summary.html
View file @
7be3fe96
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<tr
width=
"600"
>
<tr
width=
"600"
>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
1
</td>
<td
class=
'details-col-elapsed'
>
0分
2
秒
</td>
<td
class=
'details-col-elapsed'
>
0分
7
秒
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
<td
class=
"details-col-elapsed"
>
100.0%
</td>
</tr>
</tr>
</table>
</table>
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
<tr
width=
"600"
>
<tr
width=
"600"
>
<td
class=
"details-col-elapsed"
><a
href=
'../log/r_f3用户管理_用户管理_编辑用户_启用/log.html'
target=
'_blank'
>
r_f3用户管理_用户管理_编辑用户_启用
</a></td>
<td
class=
"details-col-elapsed"
><a
href=
'../log/r_f3用户管理_用户管理_编辑用户_启用/log.html'
target=
'_blank'
>
r_f3用户管理_用户管理_编辑用户_启用
</a></td>
<td
class=
"success"
>
成功
</td>
<td
class=
"success"
>
成功
</td>
<td
class=
"details-col-elapsed"
>
2.174
</td>
<td
class=
"details-col-elapsed"
>
7.233
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
<td
class=
"details-col-elapsed"
>
xiaohesheng
</td>
</tr>
</tr>
...
...
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