Commit 7cc3590c authored by Ramya Authappan's avatar Ramya Authappan

Merge branch '9192-secure-e2e-tests-dependency-list' into 'master'

Added a Secure E2E test for Dependency List

Closes #9192

See merge request gitlab-org/gitlab-ee!14876
parents 502f2c56 53875199
......@@ -140,7 +140,9 @@ export default {
<div class="d-sm-flex justify-content-between align-items-baseline my-2">
<h3 class="h5">
{{ __('Dependencies') }}
<gl-badge v-if="pageInfo.total" pill>{{ pageInfo.total }}</gl-badge>
<gl-badge v-if="pageInfo.total" pill data-qa-selector="dependency_list_total_content">{{
pageInfo.total
}}</gl-badge>
</h3>
<dependencies-actions :namespace="currentList" />
......
......@@ -19,5 +19,5 @@
- if @project.feature_available?(:dependency_list)
= nav_link(path: 'projects/dependencies#show') do
= link_to project_dependencies_path(@project), title: _('Dependency List') do
= link_to project_dependencies_path(@project), title: _('Dependency List'), data: { qa_selector: 'dependency_list_link' } do
%span= _('Dependency List')
......@@ -16,6 +16,7 @@ exports[`DependenciesApp component on creation given a dependency list which is
Dependencies
<glbadge-stub
data-qa-selector="dependency_list_total_content"
pill=""
>
100
......@@ -78,6 +79,7 @@ exports[`DependenciesApp component on creation given a list of dependencies and
Dependencies
<glbadge-stub
data-qa-selector="dependency_list_total_content"
pill=""
>
100
......
......@@ -93,6 +93,7 @@ module QA
module Secure
autoload :Show, 'qa/ee/page/project/secure/show'
autoload :DependencyList, 'qa/ee/page/project/secure/dependency_list'
end
end
......
# frozen_string_literal: true
module QA
module EE
module Page
module Project::Secure
class DependencyList < QA::Page::Base
view 'ee/app/assets/javascripts/dependencies/components/app.vue' do
element :dependency_list_total_content
end
def has_dependency_count_of?(expected)
find_element(:dependency_list_total_content).has_content?(expected)
end
end
end
end
end
end
......@@ -12,6 +12,7 @@ module QA
page.class_eval do
view 'ee/app/views/layouts/nav/sidebar/_project_security_link.html.haml' do
element :link_security_dashboard
element :dependency_list_link
end
end
end
......@@ -21,6 +22,22 @@ module QA
click_element :link_security_dashboard
end
end
def click_on_dependency_list
hover_security_compliance do
within_submenu do
click_element(:dependency_list_link)
end
end
end
def hover_security_compliance
within_sidebar do
find_element(:link_security_dashboard).hover
yield
end
end
end
end
end
......
......@@ -57,7 +57,7 @@ module QA
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 1")
expect(pipeline).to have_content("Dependency scanning detected 2")
pipeline.expand_dependency_report
expect(pipeline).to have_content("jQuery before 3.4.0")
end
......@@ -80,6 +80,12 @@ module QA
EE::Page::Group::Secure::Show.perform do |dashboard|
dashboard.filter_project(@project.name)
expect(dashboard).to have_low_vulnerability_count_of "1"
it 'displays the Dependency List' do
Page::Project::Menu.perform(&:click_on_dependency_list)
EE::Page::Project::Secure::DependencyList.perform do |page|
expect(page).to have_dependency_count_of "1293"
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment