Commit e804ed38 authored by Alexander Turinske's avatar Alexander Turinske

Create end-to-end for threat monitoring alerts

- test if page loads
parent dda51887
......@@ -200,6 +200,7 @@ export default {
<gl-table
class="alert-management-table"
data-qa-selector="alerts_list"
:busy="isLoadingFirstAlerts"
:items="alerts"
:fields="$options.i18n.FIELDS"
......
......@@ -87,7 +87,11 @@ export default {
</header>
<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 />
</gl-tab>
<gl-tab ref="networkPolicyTab" :title="s__('ThreatMonitoring|Policies')">
......
......@@ -22,6 +22,14 @@ module QA
end
end
def click_on_threat_monitoring
hover_security_compliance do
within_sidebar do
click_element(:sidebar_menu_item_link, menu_item: 'Threat Monitoring')
end
end
end
def click_on_vulnerability_report
hover_security_compliance do
within_submenu do
......
# frozen_string_literal: true
module QA
module Page
module ThreatMonitoring
class AlertsList < 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?
find_element?(:alerts_tab)
end
def has_alerts_list?
find_element?(:alerts_list)
end
end
end
end
end
# frozen_string_literal: true
module QA
RSpec.describe 'Protect', :runner do
let(:approved_license_name) { "MIT License" }
let(:denied_license_name) { "Apache License 2.0" }
describe 'Threat Monitoring Policy List page' do
before(:all) do
@executor = "qa-runner-#{Time.now.to_i}"
Flow::Login.sign_in
@project = Resource::Project.fabricate_via_api! do |p|
p.name = Runtime::Env.auto_devops_project_name || 'project-with-protect'
p.description = 'Project with Protect'
p.auto_devops_enabled = false
p.initialize_with_readme = true
end
@project.visit!
end
it 'can load Threat Monitoring page and view the policy alert list', testcase: 'I do not know what to put here' 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 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