11// 02.acm_alerting_ui.cy.ts
22// E2E test for validating ACM Alerting UI integration with Cluster Observability Operator (COO)
3- import { commonPages } from '../../views/common' ;
4- import { nav } from '../../views/nav' ;
5-
63const MCP = {
74 namespace : 'openshift-cluster-observability-operator' ,
85 packageName : 'cluster-observability-operator' ,
@@ -12,12 +9,10 @@ const MCP = {
129 name : 'monitoring' ,
1310 } ,
1411} ;
15-
1612const MP = {
1713 namespace : 'openshift-monitoring' ,
1814 operatorName : 'Cluster Monitoring Operator' ,
1915} ;
20-
2116const expectedAlerts = [ 'Watchdog' , 'Watchdog-spoke' , 'ClusterCPUHealth-jb' ] ;
2217
2318// ignore error message
@@ -26,27 +21,18 @@ Cypress.on('uncaught:exception', (err) => {
2621 'Unauthorized' ,
2722 "Cannot read properties of null (reading 'default')" ,
2823 'ResizeObserver loop limit exceeded' ,
24+ 'Bad Gateway' ,
25+ '(intermediate value) is not a function' ,
2926 ] ;
3027 if ( ignoreList . some ( ( txt ) => err . message . includes ( txt ) ) ) {
31- console . warn ( '⚠️ Ignored frontend exception:' , err . message ) ;
28+ console . warn ( 'Ignored frontend exception:' , err . message ) ;
3229 return false ;
3330 }
3431} ) ;
3532
3633describe ( 'ACM Alerting UI' , ( ) => {
3734 before ( ( ) => {
38- cy . beforeBlockCOO ( MCP , MP ) ;
39- cy . log ( '=== [Setup] Installing ACM operator and MultiCluster Observability ===' ) ;
40- // install acm through shell script
41- cy . exec ( 'bash ./cypress/fixtures/coo/acm-install.sh' , {
42- env : { KUBECONFIG : Cypress . env ( 'KUBECONFIG_PATH' ) , } ,
43- failOnNonZeroExit : false ,
44- timeout : 1200000 , // long time script
45- } ) ;
46- // update UIPlugin with the acm related content, (OCP enabled since installed from operatorHub)
47- cy . exec ( `oc apply -f ./cypress/fixtures/coo/acm-uiplugin.yaml --kubeconfig ${ Cypress . env ( 'KUBECONFIG_PATH' ) } ` ) ;
48- // add thanos-ruler-custom-rules
49- cy . exec ( `oc apply -f ./cypress/fixtures/coo/acm-alerrule-test.yaml --kubeconfig ${ Cypress . env ( 'KUBECONFIG_PATH' ) } ` ) ;
35+ cy . beforeBlockACM ( MCP , MP ) ;
5036 } ) ;
5137
5238 it ( 'Navigate to Fleet Management > local-cluster > Observe > Alerting' , ( ) => {
@@ -61,52 +47,29 @@ describe('ACM Alerting UI', () => {
6147 . contains ( 'Fleet Management' )
6248 . should ( 'be.visible' )
6349 . click ( ) ;
64-
6550 // close pop-up window
66- cy . get ( 'body' ) . then ( ( $body ) => {
67- const modalCloseBtn = $body . find ( 'button[data-ouia-component-id="clustersOnboardingModal-ModalBoxCloseButton"]' ) ;
68- if ( modalCloseBtn . length > 0 ) {
69- cy . wrap ( modalCloseBtn )
70- . should ( 'be.visible' )
71- . should ( 'not.be.disabled' )
72- . click ( { force : true } ) ;
73- cy . log ( '✅ Closed onboarding modal' ) ;
74- } else {
75- cy . log ( 'ℹ️ No onboarding modal found' ) ;
76- }
77- } ) ;
78-
51+ cy . closeOnboardingModalIfPresent ( ) ;
7952 // click “local-cluster” when visible
80- cy . contains ( 'a' , 'local-cluster' , { timeout : 90000 } )
53+ cy . log ( 'Waiting for local-cluster link to appear...' ) ;
54+ cy . contains ( 'local-cluster' , { timeout : 120000 } )
55+ . should ( 'exist' )
8156 . should ( 'be.visible' )
82- . should ( 'not.be.disabled' )
83- . click ( { force : true } ) ;
84-
57+ . then ( ( $el ) => {
58+ cy . wrap ( $el ) . click ( { force : true } ) ;
59+ } ) ;
8560 // click side menu -> Observe -> Alerting
8661 cy . contains ( 'Observe' , { timeout : 20000 } ) . should ( 'be.visible' ) . click ( ) ;
8762 cy . contains ( 'Alerting' , { timeout : 20000 } ) . should ( 'be.visible' ) . click ( ) ;
88-
8963 // Wait for alert tab content to become visible
9064 cy . get ( 'section#alerts-tab-content' , { timeout : 60000 } )
9165 . should ( 'be.visible' ) ;
92-
9366 // confirm Alerting page loading completed then check three alert exist
9467 cy . get ( 'body' , { timeout : 60000 } ) . should ( 'contain.text' , 'Alerting' ) ;
9568 expectedAlerts . forEach ( ( alert ) => {
9669 cy . contains ( 'a[data-test-id="alert-resource-link"]' , alert , { timeout : 60000 } )
9770 . should ( 'be.visible' ) ;
9871 } ) ;
99-
100- cy . log ( '✅ Verified all expected alerts are visible on the Alerting page' ) ;
101- cy . log ( '✅ ACM Alerting UI test completed successfully' ) ;
102- } ) ;
103-
104- after ( ( ) => {
105- cy . log ( '=== [Teardown] Uninstalling ACM operator and cleaning up ===' ) ;
106- cy . exec ( 'bash ./cypress/fixtures/coo/acm-uninstall.sh' , {
107- env : { KUBECONFIG : Cypress . env ( 'KUBECONFIG_PATH' ) } ,
108- failOnNonZeroExit : false ,
109- timeout : 600000 ,
110- } ) ;
72+ cy . log ( 'Verified all expected alerts are visible on the Alerting page' ) ;
73+ cy . log ( 'ACM Alerting UI test completed successfully' ) ;
11174 } ) ;
11275} ) ;
0 commit comments