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
179473ff
Commit
179473ff
authored
Sep 05, 2019
by
Aleksandr Soborov
Committed by
Tanya Pazitny
Sep 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and unquarantine Secure E2E tests
Fixes for UI changes. Adds new selectors where necessary.
parent
8239bfd4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
34 deletions
+63
-34
ee/app/assets/javascripts/vue_shared/security_reports/split_security_reports_app.vue
...ue_shared/security_reports/split_security_reports_app.vue
+2
-1
ee/app/views/projects/pipelines/_tabs_holder.html.haml
ee/app/views/projects/pipelines/_tabs_holder.html.haml
+2
-2
qa/qa/ee/page/group/secure/show.rb
qa/qa/ee/page/group/secure/show.rb
+7
-0
qa/qa/ee/page/project/pipeline/show.rb
qa/qa/ee/page/project/pipeline/show.rb
+10
-11
qa/qa/ee/page/project/secure/show.rb
qa/qa/ee/page/project/secure/show.rb
+12
-0
qa/qa/specs/features/ee/browser_ui/secure/security_reports_spec.rb
...cs/features/ee/browser_ui/secure/security_reports_spec.rb
+30
-20
No files found.
ee/app/assets/javascripts/vue_shared/security_reports/split_security_reports_app.vue
View file @
179473ff
...
...
@@ -289,7 +289,8 @@ export default {
:unresolved-issues=
"dependencyScanning.newIssues"
:has-issues=
"dependencyScanning.newIssues.length > 0"
:popover-options=
"dependencyScanningPopover"
class=
"js-dss-widget split-report-section qa-dependency-scanning-report"
class=
"js-dss-widget split-report-section"
data-qa-selector=
"dependency_scanning_report"
/>
<report-section
...
...
ee/app/views/projects/pipelines/_tabs_holder.html.haml
View file @
179473ff
...
...
@@ -3,9 +3,9 @@
-
if
pipeline
.
expose_security_dashboard?
%li
.js-security-tab-link
=
link_to
security_project_pipeline_path
(
project
,
pipeline
),
data:
{
target:
'#js-tab-security'
,
action:
'security'
,
toggle:
'tab'
},
class:
'security-tab
qa-security-
tab'
do
=
link_to
security_project_pipeline_path
(
project
,
pipeline
),
data:
{
target:
'#js-tab-security'
,
action:
'security'
,
toggle:
'tab'
},
class:
'security-tab
'
,
'data-qa-selector'
:
'security_
tab'
do
=
_
(
"Security"
)
%span
.badge.badge-pill.js-security-counter.hidden
%span
.badge.badge-pill.js-security-counter.hidden
{
'data-qa-selector'
:
'security_counter'
}
-
if
pipeline
.
expose_license_management_data?
%li
.js-licenses-tab-link
...
...
qa/qa/ee/page/group/secure/show.rb
View file @
179473ff
...
...
@@ -21,6 +21,13 @@ module QA
end
end
def
filter_report_type
(
report
)
find_element
(
:filter_report_type_dropdown
).
click
within_element
(
:filter_dropdown_content
)
do
click_on
report
end
end
def
has_low_vulnerability_count_of?
(
expected
)
find_element
(
:vulnerability_count_low
).
has_content?
(
expected
)
end
...
...
qa/qa/ee/page/project/pipeline/show.rb
View file @
179473ff
...
...
@@ -7,14 +7,12 @@ module QA::EE::Page
page
.
module_eval
do
view
'ee/app/views/projects/pipelines/_tabs_holder.html.haml'
do
element
:security_tab
element
:security_counter
end
view
'ee/app/assets/javascripts/vue_shared/security_reports/split_security_reports_app.vue'
do
element
:dependency_scanning_report
end
view
'app/assets/javascripts/reports/components/report_section.vue'
do
element
:expand_report_button
view
'ee/app/assets/javascripts/security_dashboard/components/filter.vue'
do
element
:filter_dropdown
,
':data-qa-selector="qaSelector"'
# rubocop:disable QA/ElementWithPattern
element
:filter_dropdown_content
end
end
end
...
...
@@ -23,13 +21,14 @@ module QA::EE::Page
click_element
(
:security_tab
)
end
def
has_
dependency_report?
find_element
(
:
dependency_scanning_repor
t
)
def
has_
vulnerability_count_of?
(
count
)
find_element
(
:
security_counter
).
has_content?
(
coun
t
)
end
def
expand_dependency_report
within_element
(
:dependency_scanning_report
)
do
click_element
(
:expand_report_button
)
def
filter_report_type
(
report
)
find_element
(
:filter_report_type_dropdown
).
click
within_element
(
:filter_dropdown_content
)
do
click_on
report
end
end
end
...
...
qa/qa/ee/page/project/secure/show.rb
View file @
179473ff
...
...
@@ -9,6 +9,18 @@ module QA
element
:vulnerability_count
,
':data-qa-selector="qaSelector"'
# rubocop:disable QA/ElementWithPattern
end
view
'ee/app/assets/javascripts/security_dashboard/components/filter.vue'
do
element
:filter_dropdown
,
':data-qa-selector="qaSelector"'
# rubocop:disable QA/ElementWithPattern
element
:filter_dropdown_content
end
def
filter_report_type
(
report
)
find_element
(
:filter_report_type_dropdown
).
click
within_element
(
:filter_dropdown_content
)
do
click_on
report
end
end
def
has_low_vulnerability_count_of?
(
expected
)
find_element
(
:vulnerability_count_low
).
has_content?
(
expected
)
end
...
...
qa/qa/specs/features/ee/browser_ui/secure/security_reports_spec.rb
View file @
179473ff
# frozen_string_literal: true
require
'pathname'
NUMBER_OF_DEPENDENCIES_IN_FIXTURE
=
1309
module
QA
context
'Secure'
,
:docker
do
let
(
:number_of_dependencies_in_fixture
)
{
1309
}
let
(
:dependency_scan_example_vuln
)
{
'jQuery before 3.4.0'
}
def
login
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
perform
(
&
:sign_in_using_credentials
)
end
def
wait_for_job
(
job_name
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
job_name
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
end
end
describe
'Security Reports'
do
after
do
Service
::
Runner
.
new
(
@executor
).
remove!
...
...
@@ -42,56 +53,55 @@ module QA
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:click_on_latest_pipeline
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_job
(
'dependency_scanning'
)
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
).
to
be_successful
(
timeout:
600
)
end
end
it
'displays the Dependency Scanning report in the pipeline'
do
wait_for_job
"dependency_scanning"
Page
::
Project
::
Menu
.
perform
(
&
:click_ci_cd_pipelines
)
Page
::
Project
::
Pipeline
::
Index
.
perform
(
&
:click_on_latest_pipeline
)
Page
::
Project
::
Pipeline
::
Show
.
perform
do
|
pipeline
|
pipeline
.
click_on_security
expect
(
pipeline
).
to
have_dependency_report
expect
(
pipeline
).
to
have_content
(
"Dependency scanning detected 4"
)
pipeline
.
expand_dependency_report
expect
(
pipeline
).
to
have_content
(
"jQuery before 3.4.0"
)
pipeline
.
filter_report_type
"Dependency Scanning"
expect
(
pipeline
).
to
have_vulnerability_count_of
4
expect
(
pipeline
).
to
have_content
(
dependency_scan_example_vuln
)
end
end
# Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/70
it
'displays the Dependency Scanning report in the project security dashboard'
,
:quarantine
do
it
'displays the Dependency Scanning report in the project security dashboard'
do
wait_for_job
"dependency_scanning"
Page
::
Project
::
Menu
.
perform
(
&
:click_project
)
Page
::
Project
::
Menu
.
perform
(
&
:click_on_security_dashboard
)
EE
::
Page
::
Project
::
Secure
::
Show
.
perform
do
|
dashboard
|
dashboard
.
filter_report_type
"Dependency Scanning"
expect
(
dashboard
).
to
have_low_vulnerability_count_of
"1"
end
end
# Failure issue: https://gitlab.com/gitlab-org/quality/nightly/issues/130
it
'displays the Dependency Scanning report in the group security dashboard'
,
:quarantine
do
it
'displays the Dependency Scanning report in the group security dashboard'
do
wait_for_job
"dependency_scanning"
Page
::
Main
::
Menu
.
perform
{
|
page
|
page
.
go_to_groups
}
Page
::
Dashboard
::
Groups
.
perform
{
|
page
|
page
.
click_group
(
@project
.
group
.
path
)
}
EE
::
Page
::
Group
::
Menu
.
perform
{
|
page
|
page
.
click_group_security_link
}
EE
::
Page
::
Group
::
Secure
::
Show
.
perform
do
|
dashboard
|
dashboard
.
filter_project
(
@project
.
name
)
expect
(
dashboard
).
to
have_low_vulnerability_count_of
"1"
dashboard
.
filter_report_type
"Dependency Scanning"
expect
(
dashboard
).
to
have_content
dependency_scan_example_vuln
end
end
# Failure issue: https://gitlab.com/gitlab-org/quality/staging/issues/70
it
'displays the Dependency List'
,
:quarantine
do
it
'displays the Dependency List'
do
wait_for_job
"dependency_scanning"
Page
::
Project
::
Menu
.
perform
(
&
:click_on_dependency_list
)
EE
::
Page
::
Project
::
Secure
::
DependencyList
.
perform
do
|
page
|
expect
(
page
).
to
have_dependency_count_of
NUMBER_OF_DEPENDENCIES_IN_FIXTURE
expect
(
page
).
to
have_dependency_count_of
number_of_dependencies_in_fixture
end
end
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