Commit 04e26c94 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '300838-e2e-view-alerts-list' into 'master'

Create end-to-end for threat monitoring alerts

See merge request gitlab-org/gitlab!60767
parents 72aa021f f5da3dfd
...@@ -200,6 +200,7 @@ export default { ...@@ -200,6 +200,7 @@ export default {
<gl-table <gl-table
class="alert-management-table" class="alert-management-table"
data-qa-selector="alerts_list"
:busy="isLoadingFirstAlerts" :busy="isLoadingFirstAlerts"
:items="alerts" :items="alerts"
:fields="$options.i18n.FIELDS" :fields="$options.i18n.FIELDS"
......
...@@ -87,7 +87,11 @@ export default { ...@@ -87,7 +87,11 @@ export default {
</header> </header>
<gl-tabs content-class="gl-pt-0"> <gl-tabs content-class="gl-pt-0">
<gl-tab :title="s__('ThreatMonitoring|Alerts')" data-testid="threat-monitoring-alerts-tab"> <gl-tab
:title="s__('ThreatMonitoring|Alerts')"
data-testid="threat-monitoring-alerts-tab"
data-qa-selector="alerts_tab"
>
<alerts /> <alerts />
</gl-tab> </gl-tab>
<gl-tab ref="networkPolicyTab" :title="s__('ThreatMonitoring|Policies')"> <gl-tab ref="networkPolicyTab" :title="s__('ThreatMonitoring|Policies')">
......
...@@ -181,6 +181,10 @@ module QA ...@@ -181,6 +181,10 @@ module QA
module Job module Job
autoload :Show, 'qa/ee/page/project/job/show' autoload :Show, 'qa/ee/page/project/job/show'
end end
module ThreatMonitoring
autoload :AlertsList, 'qa/ee/page/project/threat_monitoring/alerts_list'
end
end end
module MergeRequest module MergeRequest
......
...@@ -22,6 +22,14 @@ module QA ...@@ -22,6 +22,14 @@ module QA
end end
end end
def click_on_threat_monitoring
hover_security_compliance do
within_submenu do
click_element(:sidebar_menu_item_link, menu_item: 'Threat Monitoring')
end
end
end
def click_on_vulnerability_report def click_on_vulnerability_report
hover_security_compliance do hover_security_compliance do
within_submenu do within_submenu do
......
# frozen_string_literal: true
module QA
module EE
module Page
module Project
module ThreatMonitoring
class AlertsList < QA::Page::Base
view 'ee/app/assets/javascripts/threat_monitoring/components/app.vue' do
element :alerts_tab
end
view 'ee/app/assets/javascripts/threat_monitoring/components/alerts/alerts_list.vue' do
element :alerts_list
end
def has_alerts_tab?
has_element?(:alerts_tab)
end
def has_alerts_list?
has_element?(:alerts_list)
end
end
end
end
end
end
end
# frozen_string_literal: true
module QA
RSpec.describe 'Protect' do
describe 'Threat Monitoring Policy List page' do
let(:project) do
Resource::Project.fabricate_via_api! do |project|
project.name = Runtime::Env.auto_devops_project_name || 'project-with-protect'
project.description = 'Project with Protect'
project.auto_devops_enabled = false
project.initialize_with_readme = true
end
end
before do
Flow::Login.sign_in
project.visit!
end
it 'can load Threat Monitoring page and view the policy alert list', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1786' do
Page::Project::Menu.perform(&:click_on_threat_monitoring)
EE::Page::Project::ThreatMonitoring::AlertsList.perform do |alerts_list|
expect(alerts_list).to have_alerts_tab
expect(alerts_list).to have_alerts_list
end
end
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