22The test verifies the basic functionality of the Incidents page and serves
33as a verification that the Incidents View is working as expected.
44
5- Currently, it depends on an alert being present in the cluster.
6- In the future, mocking requests / injecting alerts should be considered.
7- Natural creation of the alert is done in the 00.coo_incidents_e2e.cy.ts test,
8- but takes significant time.
5+ All tests use mocked data. Tests 1-3 use a default fixture (incident content
6+ is irrelevant for toolbar/filter verification). Tests 4-5 switch mocks
7+ mid-test for empty state and traversal scenarios.
98*/
109
11- import { commonPages } from '../../views/common' ;
1210import { incidentsPage } from '../../views/incidents-page' ;
1311
1412const MCP = {
@@ -26,24 +24,13 @@ const MP = {
2624 operatorName : 'Cluster Monitoring Operator' ,
2725} ;
2826
29- const ALERTNAME = 'Watchdog' ;
30- const NAMESPACE = 'openshift-monitoring' ;
31- const SEVERITY = 'Critical' ;
32- const ALERT_DESC = 'This is an alert meant to ensure that the entire alerting pipeline is functional. This alert is always firing, therefore it should always be firing in Alertmanager and always fire against a receiver. There are integrations with various notification mechanisms that send a notification when this alert is not firing. For example the "DeadMansSnitch" integration in PagerDuty.'
33- const ALERT_SUMMARY = 'An alert that should always be firing to certify that Alertmanager is working properly.'
3427describe ( 'BVT: Incidents - UI' , { tags : [ '@smoke' , '@incidents' ] } , ( ) => {
3528 before ( ( ) => {
3629 cy . beforeBlockCOO ( MCP , MP , { dashboards : false , troubleshootingPanel : false } ) ;
30+ cy . mockIncidentFixture ( 'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml' ) ;
3731 } ) ;
3832
3933
40- beforeEach ( ( ) => {
41- cy . log ( 'Navigate to Observe → Incidents' ) ;
42- incidentsPage . goTo ( ) ;
43- // Temporary workaround for testing against locally built instances.
44- cy . transformMetrics ( ) ;
45- } ) ;
46-
4734 it ( '1. Admin perspective - Incidents page - Toolbar and charts toggle functionality' , ( ) => {
4835 cy . log ( '1.1 Verify toolbar and toggle charts button' ) ;
4936 incidentsPage . elements . toolbar ( ) . should ( 'be.visible' ) ;
@@ -80,24 +67,23 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
8067 cy . log ( '4.1 Verify chart titles are visible' ) ;
8168 incidentsPage . elements . incidentsChartTitle ( ) . should ( 'be.visible' ) ;
8269 incidentsPage . elements . alertsChartTitle ( ) . should ( 'be.visible' ) ;
83-
8470 cy . log ( '4.2 Verify alerts chart shows empty state' ) ;
8571 incidentsPage . elements . alertsChartEmptyState ( ) . should ( 'exist' ) ;
8672 } ) ;
8773
8874 it ( '5. Admin perspective - Incidents page - Traverse Incident Table' , ( ) => {
75+ incidentsPage . goTo ( ) ;
76+
8977 cy . log ( '5.1 Traverse incident table' ) ;
90- incidentsPage . clearAllFilters ( ) ;
9178 cy . mockIncidents ( [ ] ) ;
9279 incidentsPage . findIncidentWithAlert ( 'TargetAlert' ) . should ( 'be.false' ) ;
9380
9481 cy . log ( '5.2 Verify traversing incident table works when the alert is not present' ) ;
9582 cy . mockIncidentFixture ( 'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml' ) ;
9683 incidentsPage . findIncidentWithAlert ( 'TargetAlert' ) . should ( 'be.false' ) ;
9784
98- incidentsPage . clearAllFilters
9985 cy . log ( '5.3 Verify traversing incident table works when the alert is present' ) ;
10086 cy . mockIncidentFixture ( 'incident-scenarios/6-multi-incident-target-alert-scenario.yaml' ) ;
101- incidentsPage . findIncidentWithAlert ( 'TargetAlert' ) . should ( 'be.true' ) ;
87+ incidentsPage . findIncidentWithAlert ( 'TargetAlert' ) . should ( 'be.true' ) ;
10288 } ) ;
10389} ) ;
0 commit comments