Commit b8c23ed0 authored by Ramya Authappan's avatar Ramya Authappan

Merge branch 'group_dashboard_spec_update' into 'master'

Update for security_reports_spec

Closes gitlab-org/quality/testcases#950 and #235804

See merge request gitlab-org/gitlab!39435
parents d5c428a8 f16c9d04
......@@ -95,6 +95,7 @@ export default {
v-for="severityGroup in severityGroups"
:ref="`accordionItem${severityGroup.type}`"
:key="severityGroup.type"
:data-qa-selector="`severity_accordion_item_${severityGroup.type}`"
:accordion-id="accordionId"
:is-loading="isLoading"
:disabled="shouldAccordionItemBeDisabled(severityGroup)"
......@@ -122,9 +123,12 @@ export default {
<div class="gl-ml-7 gl-pb-2">
<ul class="list-unstyled gl-py-1">
<li v-for="project in severityGroup.projects" :key="project.id" class="gl-py-2">
<gl-link target="_blank" :href="`${project.fullPath}/security/dashboard`">{{
project.fullName
}}</gl-link>
<gl-link
target="_blank"
:href="`${project.fullPath}/security/dashboard`"
data-qa-selector="project_name_text"
>{{ project.fullName }}</gl-link
>
<span
v-if="project.mostSevereVulnerability"
ref="mostSevereCount"
......
......@@ -14,7 +14,7 @@
- if group_level_security_dashboard_available?(@group)
= nav_link(path: 'vulnerabilities#index') do
= link_to group_security_vulnerabilities_path(@group), title: _('Vulnerability Report') do
= link_to group_security_vulnerabilities_path(@group), title: _('Vulnerability Report'), data: { qa_selector: 'vulnerability_report_link' } do
%span= _('Vulnerability Report')
- if group_level_compliance_dashboard_available?(@group)
......
......@@ -25,6 +25,7 @@ module QA
element :security_compliance_link
element :group_secure_submenu
element :security_dashboard_link
element :vulnerability_report_link
end
view 'ee/app/views/layouts/nav/_group_insights_link.html.haml' do
......@@ -119,6 +120,14 @@ module QA
end
end
def click_group_vulnerability_link
hover_element(:security_compliance_link) do
within_submenu(:group_secure_submenu) do
click_element(:vulnerability_report_link)
end
end
end
def click_group_wiki_link
within_sidebar do
click_element(:wiki_link)
......
......@@ -12,12 +12,21 @@ module QA
element :security_report_content, required: true
end
view 'ee/app/assets/javascripts/security_dashboard/components/vulnerability_severity.vue' do
element :project_name_text, required: true
end
def filter_project(project)
click_element(:filter_project_dropdown)
within_element(:filter_dropdown_content) do
click_on project
end
end
def has_security_status_project_for_severity?(severity, project)
click_element("severity_accordion_item_#{severity}")
has_element?(:project_name_text, text: "#{project.group.sandbox.path} / #{project.group.path} / #{project.name}")
end
end
end
end
......
......@@ -97,13 +97,19 @@ module QA
end
end
it 'displays security reports in the group security dashboard', quarantine: { issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/235804', type: :stale } do
it 'displays security reports in the group security dashboard' do
Page::Main::Menu.perform(&:go_to_groups)
Page::Dashboard::Groups.perform do |groups|
groups.click_group @project.group.path
end
Page::Group::Menu.perform(&:click_group_security_link)
EE::Page::Group::Secure::Show.perform do |dashboard|
expect(dashboard).to have_security_status_project_for_severity('F', @project)
end
Page::Group::Menu.perform(&:click_group_vulnerability_link)
EE::Page::Group::Secure::Show.perform do |dashboard|
dashboard.filter_project(@project.name)
......
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