Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6b3158da
Commit
6b3158da
authored
Nov 13, 2019
by
Zeff Morgan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor vulnerability requirements
parent
413e010f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
qa/qa/ee/page/merge_request/show.rb
qa/qa/ee/page/merge_request/show.rb
+8
-5
qa/qa/specs/features/ee/browser_ui/secure/create_merge_request_with_secure_spec.rb
...rowser_ui/secure/create_merge_request_with_secure_spec.rb
+2
-3
No files found.
qa/qa/ee/page/merge_request/show.rb
View file @
6b3158da
...
...
@@ -153,24 +153,27 @@ module QA
def
resolve_vulnerability_with_mr
(
name
)
expand_vulnerability_report
click_vulnerability
(
name
)
previous_page
=
page
.
current_url
click_element
:resolve_split_button
wait
(
reload:
false
)
do
has_no_element?
(
:resolve_split_button
)
wait
(
max
:
15
,
reload:
false
)
do
page
.
current_url
!=
previous_page
end
end
def
has_vulnerability_report?
(
timeout:
60
)
wait
(
reload:
true
,
max:
timeout
,
interval:
1
)
do
finished_loading?
has_element?
(
:vulnerability_report_grouped
,
wait:
1
)
has_element?
(
:vulnerability_report_grouped
,
wait:
1
0
)
end
find_element
(
:vulnerability_report_grouped
).
has_no_content?
(
"is loading"
)
end
def
has_
total_vulnerability_count_of?
(
expected
)
def
has_
vulnerability_count?
# Match text cut off in order to find both "1 vulnerability" and "X vulnerabilities"
find_element
(
:vulnerability_report_grouped
).
has_content?
(
/Security scanning detected
#{
expected
}
( new)? vulnerabilit
/
)
find_element
(
:vulnerability_report_grouped
).
has_content?
(
/Security scanning detected/
)
end
def
has_sast_vulnerability_count_of?
(
expected
)
...
...
qa/qa/specs/features/ee/browser_ui/secure/create_merge_request_with_secure_spec.rb
View file @
6b3158da
...
...
@@ -5,7 +5,6 @@ require 'pathname'
module
QA
context
'Secure'
,
:docker
do
describe
'Security Reports in a Merge Request'
do
let
(
:total_vuln_count
)
{
49
}
let
(
:sast_vuln_count
)
{
33
}
let
(
:dependency_scan_vuln_count
)
{
4
}
let
(
:container_scan_vuln_count
)
{
8
}
...
...
@@ -70,7 +69,7 @@ module QA
it
'displays the Security reports in the merge request'
do
Page
::
MergeRequest
::
Show
.
perform
do
|
mergerequest
|
expect
(
mergerequest
).
to
have_vulnerability_report
(
timeout:
60
)
expect
(
mergerequest
).
to
have_
total_vulnerability_count_of
(
total_vuln_count
)
expect
(
mergerequest
).
to
have_
vulnerability_count
mergerequest
.
expand_vulnerability_report
...
...
@@ -84,8 +83,8 @@ module QA
it
'can create an auto-remediation MR'
do
Page
::
MergeRequest
::
Show
.
perform
do
|
mergerequest
|
vuln_name
=
"Authentication bypass via incorrect DOM traversal and canonicalization in saml2-js"
expect
(
mergerequest
).
to
have_vulnerability_report
(
timeout:
60
)
# Context changes as resolve method created new MR
mergerequest
.
resolve_vulnerability_with_mr
vuln_name
expect
(
mergerequest
).
to
have_title
vuln_name
end
...
...
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