summaryrefslogtreecommitdiff
path: root/qa/qa/specs/features/browser_ui/8_monitor/alert_management/automatically_creates_incident_for_alert_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'qa/qa/specs/features/browser_ui/8_monitor/alert_management/automatically_creates_incident_for_alert_spec.rb')
-rw-r--r--qa/qa/specs/features/browser_ui/8_monitor/alert_management/automatically_creates_incident_for_alert_spec.rb54
1 files changed, 54 insertions, 0 deletions
diff --git a/qa/qa/specs/features/browser_ui/8_monitor/alert_management/automatically_creates_incident_for_alert_spec.rb b/qa/qa/specs/features/browser_ui/8_monitor/alert_management/automatically_creates_incident_for_alert_spec.rb
new file mode 100644
index 00000000000..565f56b90ec
--- /dev/null
+++ b/qa/qa/specs/features/browser_ui/8_monitor/alert_management/automatically_creates_incident_for_alert_spec.rb
@@ -0,0 +1,54 @@
+# frozen_string_literal: true
+
+module QA
+ RSpec.describe 'Monitor', product_group: :respond do
+ describe 'Alert' do
+ shared_examples 'new alert' do
+ it 'automatically creates new incident' do
+ Page::Project::Menu.perform(&:go_to_monitor_incidents)
+ Page::Project::Monitor::Incidents::Index.perform do |index|
+ expect(index).to have_incident
+ end
+ end
+ end
+
+ let(:project) do
+ Resource::Project.fabricate_via_api! do |project|
+ project.name = 'project-for-alerts'
+ project.description = 'Project for alerts'
+ end
+ end
+
+ before do
+ Flow::Login.sign_in
+ project.visit!
+ Flow::AlertSettings.go_to_monitor_settings
+ Flow::AlertSettings.enable_create_incident
+ end
+
+ context(
+ 'when using HTTP endpoint integration',
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/388469'
+ ) do
+ before do
+ Flow::AlertSettings.setup_http_endpoint_integration
+ Flow::AlertSettings.send_test_alert
+ end
+
+ it_behaves_like 'new alert'
+ end
+
+ context(
+ 'when using Prometheus integration',
+ testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/390123'
+ ) do
+ before do
+ Flow::AlertSettings.setup_prometheus_integration
+ Flow::AlertSettings.send_test_alert(integration_type: 'prometheus')
+ end
+
+ it_behaves_like 'new alert'
+ end
+ end
+ end
+end