11// 02.acm_alerting_ui.cy.ts
22// E2E test for validating ACM Alerting UI integration with Cluster Observability Operator (COO)
3+ import '../../support/commands/auth-commands' ;
4+ import { nav } from '../../views/nav' ;
5+ import { acmAlertingPage } from '../../views/acm-alerting-page' ;
6+
37const MCP = {
48 namespace : 'openshift-cluster-observability-operator' ,
59 packageName : 'cluster-observability-operator' ,
@@ -15,38 +19,17 @@ const MP = {
1519} ;
1620const expectedAlerts = [ 'Watchdog' , 'Watchdog-spoke' , 'ClusterCPUHealth-jb' ] ;
1721
18- // ignore error message
19- Cypress . on ( 'uncaught:exception' , ( err ) => {
20- const ignoreList = [
21- 'Unauthorized' ,
22- "Cannot read properties of null (reading 'default')" ,
23- 'ResizeObserver loop limit exceeded' ,
24- 'Bad Gateway' ,
25- '(intermediate value) is not a function' ,
26- ] ;
27- if ( ignoreList . some ( ( txt ) => err . message . includes ( txt ) ) ) {
28- console . warn ( 'Ignored frontend exception:' , err . message ) ;
29- return false ;
30- }
31- } ) ;
32-
3322describe ( 'ACM Alerting UI' , ( ) => {
3423 before ( ( ) => {
3524 cy . beforeBlockACM ( MCP , MP ) ;
3625 } ) ;
3726
3827 it ( 'Navigate to Fleet Management > local-cluster > Observe > Alerting' , ( ) => {
3928 // wait for console page loading completed
29+ cy . visit ( '/' ) ;
4030 cy . get ( 'body' , { timeout : 60000 } ) . should ( 'contain.text' , 'Administrator' ) ;
41- // click Fleet Management
42- cy . get ( '[data-test-id="perspective-switcher-toggle"]' , { timeout : 20000 } )
43- . should ( 'be.visible' )
44- . click ( ) ;
45- // select “Fleet Management”
46- cy . get ( '[data-test-id="perspective-switcher-menu-option"]' )
47- . contains ( 'Fleet Management' )
48- . should ( 'be.visible' )
49- . click ( ) ;
31+ // switch to Fleet Management page
32+ cy . switchPerspective ( 'Fleet Management' ) ;
5033 // close pop-up window
5134 cy . closeOnboardingModalIfPresent ( ) ;
5235 // click “local-cluster” when visible
@@ -58,13 +41,13 @@ describe('ACM Alerting UI', () => {
5841 cy . wrap ( $el ) . click ( { force : true } ) ;
5942 } ) ;
6043 // click side menu -> Observe -> Alerting
61- cy . contains ( 'Observe' , { timeout : 20000 } ) . should ( 'be.visible' ) . click ( ) ;
62- cy . contains ( 'Alerting' , { timeout : 20000 } ) . should ( 'be.visible' ) . click ( ) ;
44+ nav . sidenav . clickNavLink ( [ 'Observe' , 'Alerting' ] ) ;
6345 // Wait for alert tab content to become visible
6446 cy . get ( 'section#alerts-tab-content' , { timeout : 60000 } )
6547 . should ( 'be.visible' ) ;
66- // confirm Alerting page loading completed then check three alert exist
67- cy . get ( 'body' , { timeout : 60000 } ) . should ( 'contain.text' , 'Alerting' ) ;
48+ // confirm Alerting page loading completed
49+ acmAlertingPage . shouldBeLoaded ( ) ;
50+ // check three test alerts exist
6851 expectedAlerts . forEach ( ( alert ) => {
6952 cy . contains ( 'a[data-test-id="alert-resource-link"]' , alert , { timeout : 60000 } )
7053 . should ( 'be.visible' ) ;
0 commit comments