Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
test_platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Wallen姚文辉
test_platform
Commits
65687afc
Commit
65687afc
authored
May 22, 2024
by
Wallen姚文辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复bug及过滤非自项目测试用例
parent
aa406493
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Tool.py
controller/Tool.py
+5
-3
No files found.
controller/Tool.py
View file @
65687afc
...
...
@@ -98,6 +98,8 @@ def reportinfo():
story
=
list
(
filter
(
lambda
x
:
type_
[
x
[
"typeId"
]]
==
"Story"
,
iterationitems
))
bug
=
list
(
filter
(
lambda
x
:
type_
[
x
[
"typeId"
]]
==
"BUG"
,
iterationitems
))
testcase
=
list
(
filter
(
lambda
x
:
type_
[
x
[
"typeId"
]]
==
"测试用例"
,
all_
))
keylist
=
list
(
map
(
lambda
x
:
x
.
get
(
"key"
),
testcase
))
print
(
keylist
)
for
i
in
story
:
i
[
"case"
]
=
[]
i
[
"childrenTask"
]
=
[
i
.
get
(
"key"
)]
...
...
@@ -131,17 +133,17 @@ def reportinfo():
for
each
in
j
.
get
(
"sections"
):
if
each
[
"label"
]
==
"测试用例"
:
soup
=
BeautifulSoup
(
each
[
"html"
],
"html.parser"
)
i
[
"case"
]
=
[
i
.
next_element
for
i
in
soup
.
select
(
'tr>td[align="left"]>span>a'
)]
i
[
"case"
]
=
[
i
.
next_element
for
i
in
soup
.
select
(
'tr>td[align="left"]>span>a'
)
if
i
.
next_element
in
keylist
]
for
i
in
bug
:
info
=
requests
.
request
(
"get"
,
jiraAddress
+
"/rest/api/latest/issue/"
+
i
.
get
(
"key"
),
headers
=
headers
)
.
json
()
m
=
requests
.
request
(
"get"
,
jiraAddress
+
"/secure/AjaxIssueEditAction!default.jspa?decorator=none&issueId="
+
str
(
i
.
get
(
"id"
)),
headers
=
headers
)
.
json
()
count
=
0
for
j
in
m
.
get
(
"fields"
):
if
j
.
get
(
"label"
)
==
"严重程度"
:
i
[
"Severity"
]
=
info
[
"fields"
][
j
.
get
(
"id"
)]
.
get
(
"value"
)
i
[
"Severity"
]
=
info
[
"fields"
][
j
.
get
(
"id"
)]
and
info
[
"fields"
][
j
.
get
(
"id"
)]
.
get
(
"value"
)
or
""
count
+=
1
if
j
.
get
(
"label"
)
==
"BUG修复者"
:
i
[
"ascription"
]
=
info
[
"fields"
][
j
.
get
(
"id"
)]
and
info
[
"fields"
][
j
.
get
(
"id"
)]
.
get
(
"displayName"
)
or
i
[
"assigneeName"
]
i
[
"ascription"
]
=
info
[
"fields"
][
j
.
get
(
"id"
)]
and
info
[
"fields"
][
j
.
get
(
"id"
)]
.
get
(
"displayName"
)
or
i
.
get
(
"assigneeName"
)
count
+=
1
if
count
>=
2
:
break
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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