From 91cfc517944e63621b58d434e6cc449478cad998 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 07:40:20 -0400 Subject: [PATCH 1/2] refactor: move test files to feature folders --- .../alerts_acm.cy.ts} | 0 .../alerts_bvt.cy.ts} | 2 +- .../alerts_ivt.cy.ts} | 18 --- .../alerts_regression.cy.ts} | 34 +++++- .../alerts_virtualization_bvt.cy.ts} | 28 +---- web/cypress/e2e/coo/01.coo_bvt.cy.ts | 33 ------ ...01.incidents.cy.ts => incidents_bvt.cy.ts} | 0 ...ncidents_e2e.cy.ts => incidents_e2e.cy.ts} | 0 ....cy.ts => incidents_mocking_example.cy.ts} | 0 ...mark.cy.ts => performance_benchmark.cy.ts} | 0 ...gh.cy.ts => performance_walkthrough.cy.ts} | 2 +- ..._alerts.cy.ts => end_and_resolution.cy.ts} | 0 ...01.reg_filtering.cy.ts => filtering.cy.ts} | 0 ...ip_boundary_times.cy.ts => interval.cy.ts} | 0 ...ls.cy.ts => permission_and_silences.cy.ts} | 0 ..._testing_ui.cy.ts => stress_test_ui.cy.ts} | 0 ...dux_effects.cy.ts => ui_interaction.cy.ts} | 0 ...mprehensive.cy.ts => ui_regressions.cy.ts} | 0 .../legacy_dashboards_regression.cy.ts} | 12 +- ...ashboards_virtualization_regression.cy.ts} | 19 ---- .../e2e/metrics/metrics_regression.cy.ts | 80 ++++++++++++++ .../metrics/metrics_virtualization_ivt.cy.ts | 103 ++++++++++++++++++ .../regression/01.reg_alerts_dev.cy.ts | 27 ----- .../regression/02.reg_metrics_admin_1.cy.ts | 42 ------- .../regression/02.reg_metrics_admin_2.cy.ts | 42 ------- .../lightspeed_integration.cy.ts} | 0 .../perses_dashboards_bvt.cy.ts} | 0 .../perses_dashboards_create.cy.ts} | 0 .../perses_dashboards_datasources.cy.ts} | 0 .../perses_dashboards_edit.cy.ts} | 0 .../perses_dashboards_import.cy.ts} | 0 .../perses_dashboards_list.cy.ts} | 0 ...erses_dashboards_virtualization_ivt.cy.ts} | 26 +---- .../rbac/perses_dashboards_user1.cy.ts} | 6 +- .../rbac/perses_dashboards_user2.cy.ts} | 6 +- .../rbac/perses_dashboards_user3.cy.ts} | 6 +- .../rbac/perses_dashboards_user4.cy.ts} | 6 +- .../rbac/perses_dashboards_user5.cy.ts} | 6 +- .../rbac/perses_dashboards_user6.cy.ts} | 6 +- .../admin_perspective_bvt.cy.ts} | 0 web/cypress/e2e/shared/coo_submenus.cy.ts | 45 ++++++++ .../virtualization/02.coo_ivt_metrics_1.cy.ts | 82 -------------- 42 files changed, 292 insertions(+), 339 deletions(-) rename web/cypress/e2e/{coo/02.acm_alerting_ui.cy.ts => alerts/alerts_acm.cy.ts} (100%) rename web/cypress/e2e/{monitoring/00.bvt_dev.cy.ts => alerts/alerts_bvt.cy.ts} (90%) rename web/cypress/e2e/{virtualization/01.coo_ivt_alerts.cy.ts => alerts/alerts_ivt.cy.ts} (81%) rename web/cypress/e2e/{monitoring/regression/01.reg_alerts_admin.cy.ts => alerts/alerts_regression.cy.ts} (50%) rename web/cypress/e2e/{virtualization/00.coo_ivt.cy.ts => alerts/alerts_virtualization_bvt.cy.ts} (69%) delete mode 100644 web/cypress/e2e/coo/01.coo_bvt.cy.ts rename web/cypress/e2e/incidents/{01.incidents.cy.ts => incidents_bvt.cy.ts} (100%) rename web/cypress/e2e/incidents/{00.coo_incidents_e2e.cy.ts => incidents_e2e.cy.ts} (100%) rename web/cypress/e2e/incidents/{02.incidents-mocking-example.cy.ts => incidents_mocking_example.cy.ts} (100%) rename web/cypress/e2e/incidents/performance/{01.performance_benchmark.cy.ts => performance_benchmark.cy.ts} (100%) rename web/cypress/e2e/incidents/performance/{02.performance_walkthrough.cy.ts => performance_walkthrough.cy.ts} (98%) rename web/cypress/e2e/incidents/regression/{03-04.reg_e2e_firing_alerts.cy.ts => end_and_resolution.cy.ts} (100%) rename web/cypress/e2e/incidents/regression/{01.reg_filtering.cy.ts => filtering.cy.ts} (100%) rename web/cypress/e2e/incidents/regression/{02.reg_ui_tooltip_boundary_times.cy.ts => interval.cy.ts} (100%) rename web/cypress/e2e/incidents/regression/{03.reg_api_calls.cy.ts => permission_and_silences.cy.ts} (100%) rename web/cypress/e2e/incidents/regression/{05.reg_stress_testing_ui.cy.ts => stress_test_ui.cy.ts} (100%) rename web/cypress/e2e/incidents/regression/{04.reg_redux_effects.cy.ts => ui_interaction.cy.ts} (100%) rename web/cypress/e2e/incidents/regression/{02.reg_ui_charts_comprehensive.cy.ts => ui_regressions.cy.ts} (100%) rename web/cypress/e2e/{monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts => legacy-dashboards/legacy_dashboards_regression.cy.ts} (78%) rename web/cypress/e2e/{virtualization/03.coo_ivt_legacy_dashboards.cy.ts => legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts} (85%) create mode 100644 web/cypress/e2e/metrics/metrics_regression.cy.ts create mode 100644 web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts delete mode 100644 web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts delete mode 100644 web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts delete mode 100644 web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts rename web/cypress/e2e/{coo/03.coo_lightspeed_show_timeseries.cy.ts => perses-dashboards/lightspeed_integration.cy.ts} (100%) rename web/cypress/e2e/{perses/00.coo_bvt_perses_admin.cy.ts => perses-dashboards/perses_dashboards_bvt.cy.ts} (100%) rename web/cypress/e2e/{perses/03.coo_create_perses_admin.cy.ts => perses-dashboards/perses_dashboards_create.cy.ts} (100%) rename web/cypress/e2e/{perses/05.coo_tempo_loki_admin.cy.ts => perses-dashboards/perses_dashboards_datasources.cy.ts} (100%) rename web/cypress/e2e/{perses/02.coo_edit_perses_admin.cy.ts => perses-dashboards/perses_dashboards_edit.cy.ts} (100%) rename web/cypress/e2e/{perses/04.coo_import_perses_admin.cy.ts => perses-dashboards/perses_dashboards_import.cy.ts} (100%) rename web/cypress/e2e/{perses/01.coo_list_perses_admin.cy.ts => perses-dashboards/perses_dashboards_list.cy.ts} (100%) rename web/cypress/e2e/{virtualization/04.coo_ivt_perses.cy.ts => perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts} (65%) rename web/cypress/e2e/{perses/99.coo_rbac_perses_user1.cy.ts => perses-dashboards/rbac/perses_dashboards_user1.cy.ts} (91%) rename web/cypress/e2e/{perses/99.coo_rbac_perses_user2.cy.ts => perses-dashboards/rbac/perses_dashboards_user2.cy.ts} (92%) rename web/cypress/e2e/{perses/99.coo_rbac_perses_user3.cy.ts => perses-dashboards/rbac/perses_dashboards_user3.cy.ts} (92%) rename web/cypress/e2e/{perses/99.coo_rbac_perses_user4.cy.ts => perses-dashboards/rbac/perses_dashboards_user4.cy.ts} (92%) rename web/cypress/e2e/{perses/99.coo_rbac_perses_user5.cy.ts => perses-dashboards/rbac/perses_dashboards_user5.cy.ts} (92%) rename web/cypress/e2e/{perses/99.coo_rbac_perses_user6.cy.ts => perses-dashboards/rbac/perses_dashboards_user6.cy.ts} (92%) rename web/cypress/e2e/{monitoring/00.bvt_admin.cy.ts => shared/admin_perspective_bvt.cy.ts} (100%) create mode 100644 web/cypress/e2e/shared/coo_submenus.cy.ts delete mode 100644 web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts diff --git a/web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts b/web/cypress/e2e/alerts/alerts_acm.cy.ts similarity index 100% rename from web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts rename to web/cypress/e2e/alerts/alerts_acm.cy.ts diff --git a/web/cypress/e2e/monitoring/00.bvt_dev.cy.ts b/web/cypress/e2e/alerts/alerts_bvt.cy.ts similarity index 90% rename from web/cypress/e2e/monitoring/00.bvt_dev.cy.ts rename to web/cypress/e2e/alerts/alerts_bvt.cy.ts index 52013e81a..f01b97d5e 100644 --- a/web/cypress/e2e/monitoring/00.bvt_dev.cy.ts +++ b/web/cypress/e2e/alerts/alerts_bvt.cy.ts @@ -5,7 +5,7 @@ import { testBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt import { commonPages } from '../../views/common'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; -describe('BVT: Monitoring - Namespaced', { tags: ['@alerting'] }, () => { +describe('BVT: Monitoring - Namespaced', { tags: ['@alerting', '@metrics'] }, () => { before(() => { cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); }); diff --git a/web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts b/web/cypress/e2e/alerts/alerts_ivt.cy.ts similarity index 81% rename from web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts rename to web/cypress/e2e/alerts/alerts_ivt.cy.ts index a37fb19f5..82a28889c 100644 --- a/web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts +++ b/web/cypress/e2e/alerts/alerts_ivt.cy.ts @@ -17,30 +17,12 @@ describe( before(() => { cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); cy.log('Installation: COO and setting up Monitoring Plugin'); - }); - }, -); - -describe( - 'IVT: Monitoring UIPlugin + Virtualization', - { tags: ['@alerting', '@coo', '@virtualization', '@slow'] }, - () => { - before(() => { cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); - }); - - it('1. Virtualization perspective - Observe Menu', () => { cy.log('Virtualization perspective - Observe Menu and verify all submenus'); cy.switchPerspective('Virtualization', 'Fleet virtualization'); guidedTour.closeKubevirtTour(); }); - }, -); -describe( - 'Regression: Monitoring - Alerts (Virtualization)', - { tags: ['@alerting', '@coo', '@virtualization', '@slow'] }, - () => { beforeEach(() => { cy.visit('/'); cy.validateLogin(); diff --git a/web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts b/web/cypress/e2e/alerts/alerts_regression.cy.ts similarity index 50% rename from web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts rename to web/cypress/e2e/alerts/alerts_regression.cy.ts index bd939ce1b..9485f572e 100644 --- a/web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts +++ b/web/cypress/e2e/alerts/alerts_regression.cy.ts @@ -1,12 +1,13 @@ -import { CLUSTER_MONITORING_OPERATOR } from '../../../support/operators'; -import { alerts } from '../../../fixtures/monitoring/alert'; +import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { testAlertsCorePlatformHeaderRegression, testAlertsRegression, -} from '../../../support/monitoring/01.reg_alerts.cy'; -import { commonPages } from '../../../views/common'; -import { nav } from '../../../views/nav'; -import { CustomerPerspectiveName } from '@/shared/constants/perspective'; +} from '../../support/monitoring/01.reg_alerts.cy'; +import { alerts } from '../../fixtures/monitoring/alert'; +import { testAlertsRegressionNamespace } from '../../support/monitoring/04.reg_alerts_namespace.cy'; +import { commonPages } from '../../views/common'; +import { nav } from '../../views/nav'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; // Test suite for Core platform perspective describe( @@ -33,3 +34,24 @@ describe( testAlertsRegression(CustomerPerspectiveName.CorePlatform); }, ); + +describe( + 'Regression: Monitoring - Alerts Namespaced (Administrator)', + { tags: ['@alerting'] }, + () => { + before(() => { + cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + }); + + beforeEach(() => { + alerts.interceptWatchdogAlert(); + nav.sidenav.clickNavLink(['Observe', 'Alerting']); + commonPages.titleShouldHaveText('Alerting'); + alerts.interceptWatchdogAlert(); + cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); + }); + + // Run tests in Administrator perspective + testAlertsRegressionNamespace(CustomerPerspectiveName.CorePlatform); + }, +); diff --git a/web/cypress/e2e/virtualization/00.coo_ivt.cy.ts b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts similarity index 69% rename from web/cypress/e2e/virtualization/00.coo_ivt.cy.ts rename to web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts index 9c6ed7202..5c2e52cf2 100644 --- a/web/cypress/e2e/virtualization/00.coo_ivt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts @@ -4,6 +4,7 @@ import { guidedTour } from '../../views/tour'; import { alerts } from '../../fixtures/monitoring/alert'; import { nav } from '../../views/nav'; import { commonPages } from '../../views/common'; +import { troubleshootingPanelPage } from 'cypress/views/troubleshooting-panel'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, @@ -16,36 +17,19 @@ describe( () => { before(() => { cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); - }); - - it('1. Installation: COO and setting up Monitoring Plugin', () => { cy.log('Installation: COO and setting up Monitoring Plugin'); + cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); + cy.log('Virtualization perspective - Observe Menu and verify all submenus'); + cy.switchPerspective('Virtualization', 'Fleet virtualization'); + guidedTour.closeKubevirtTour(); }); - }, -); - -describe('Installation: Virtualization', { tags: ['@coo', '@virtualization', '@slow'] }, () => { - before(() => { - cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); - }); - - it('1. Virtualization perspective - Observe Menu', () => { - cy.log('Virtualization perspective - Observe Menu and verify all submenus'); - cy.switchPerspective('Virtualization', 'Fleet virtualization'); - guidedTour.closeKubevirtTour(); - }); -}); - -describe( - 'IVT: Monitoring + Virtualization', - { tags: ['@alerting', '@metrics', '@coo', '@virtualization'] }, - () => { beforeEach(() => { cy.visit('/'); guidedTour.close(); cy.validateLogin(); cy.switchPerspective('Virtualization', 'Fleet virtualization'); guidedTour.closeKubevirtTour(); + troubleshootingPanelPage.signalCorrelationShouldNotBeVisible(); nav.sidenav.clickNavLink(['Observe', 'Metrics']); commonPages.titleShouldHaveText('Metrics'); cy.changeNamespace('All Projects'); diff --git a/web/cypress/e2e/coo/01.coo_bvt.cy.ts b/web/cypress/e2e/coo/01.coo_bvt.cy.ts deleted file mode 100644 index 63667ab5b..000000000 --- a/web/cypress/e2e/coo/01.coo_bvt.cy.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { - CLUSTER_MONITORING_OPERATOR, - CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; -import { troubleshootingPanelPage } from '../../views/troubleshooting-panel'; - -describe('BVT: COO', { tags: ['@alerting', '@coo'] }, () => { - before(() => { - cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); - }); - - it('1. Admin perspective - Observe Menu', () => { - cy.log('Admin perspective - Observe Menu and verify all submenus'); - cy.reload(true); - cy.wait(10000); - nav.sidenav.clickNavLink(['Observe', 'Alerting']); - commonPages.titleShouldHaveText('Alerting'); - nav.tabs.switchTab('Silences'); - nav.tabs.switchTab('Alerting rules'); - nav.tabs.switchTab('Incidents'); - nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']); - commonPages.titleShouldHaveText('Dashboards'); - nav.sidenav.clickNavLink(['Observe', 'Alerting']); - troubleshootingPanelPage.openSignalCorrelation(); - troubleshootingPanelPage.troubleshootingPanelPageShouldBeLoadedEnabled(); - }); - - /** - * TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios - */ -}); diff --git a/web/cypress/e2e/incidents/01.incidents.cy.ts b/web/cypress/e2e/incidents/incidents_bvt.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/01.incidents.cy.ts rename to web/cypress/e2e/incidents/incidents_bvt.cy.ts diff --git a/web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts b/web/cypress/e2e/incidents/incidents_e2e.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts rename to web/cypress/e2e/incidents/incidents_e2e.cy.ts diff --git a/web/cypress/e2e/incidents/02.incidents-mocking-example.cy.ts b/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/02.incidents-mocking-example.cy.ts rename to web/cypress/e2e/incidents/incidents_mocking_example.cy.ts diff --git a/web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts rename to web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts diff --git a/web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts b/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts similarity index 98% rename from web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts rename to web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts index ec43a5ded..253967438 100644 --- a/web/cypress/e2e/incidents/performance/02.performance_walkthrough.cy.ts +++ b/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts @@ -2,7 +2,7 @@ Performance walkthrough: measures rendering cost of interactive operations (filter toggling, time range switching, table row expansion) under load. -Unlike 01.performance_benchmark which measures initial chart render time, +Unlike performance_benchmark which measures initial chart render time, this test measures incremental re-render cost during a realistic user session. Verifies: OBSINTA-1006 diff --git a/web/cypress/e2e/incidents/regression/03-04.reg_e2e_firing_alerts.cy.ts b/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/regression/03-04.reg_e2e_firing_alerts.cy.ts rename to web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts diff --git a/web/cypress/e2e/incidents/regression/01.reg_filtering.cy.ts b/web/cypress/e2e/incidents/regression/filtering.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/regression/01.reg_filtering.cy.ts rename to web/cypress/e2e/incidents/regression/filtering.cy.ts diff --git a/web/cypress/e2e/incidents/regression/02.reg_ui_tooltip_boundary_times.cy.ts b/web/cypress/e2e/incidents/regression/interval.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/regression/02.reg_ui_tooltip_boundary_times.cy.ts rename to web/cypress/e2e/incidents/regression/interval.cy.ts diff --git a/web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts b/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts rename to web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts diff --git a/web/cypress/e2e/incidents/regression/05.reg_stress_testing_ui.cy.ts b/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/regression/05.reg_stress_testing_ui.cy.ts rename to web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts diff --git a/web/cypress/e2e/incidents/regression/04.reg_redux_effects.cy.ts b/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/regression/04.reg_redux_effects.cy.ts rename to web/cypress/e2e/incidents/regression/ui_interaction.cy.ts diff --git a/web/cypress/e2e/incidents/regression/02.reg_ui_charts_comprehensive.cy.ts b/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts similarity index 100% rename from web/cypress/e2e/incidents/regression/02.reg_ui_charts_comprehensive.cy.ts rename to web/cypress/e2e/incidents/regression/ui_regressions.cy.ts diff --git a/web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts similarity index 78% rename from web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts rename to web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts index 407bdb057..cc50b58af 100644 --- a/web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts @@ -1,9 +1,9 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { CLUSTER_MONITORING_OPERATOR } from '../../../support/operators'; -import { testLegacyDashboardsRegression } from '../../../support/monitoring/03.reg_legacy_dashboards.cy'; -import { testLegacyDashboardsRegressionNamespace } from '../../../support/monitoring/06.reg_legacy_dashboards_namespace.cy'; -import { commonPages } from '../../../views/common'; -import { nav } from '../../../views/nav'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { testLegacyDashboardsRegression } from '../../support/monitoring/03.reg_legacy_dashboards.cy'; +import { testLegacyDashboardsRegressionNamespace } from '../../support/monitoring/06.reg_legacy_dashboards_namespace.cy'; +import { commonPages } from '../../views/common'; +import { nav } from '../../views/nav'; // Test suite for Administrator perspective describe( @@ -34,7 +34,7 @@ describe( // Test suite for Administrator perspective describe( 'Regression: Monitoring - Legacy Dashboards Namespaced (Administrator)', - { tags: ['@legacy-dashboards'] }, + { tags: ['@legacy-dashboards', '@metrics'] }, () => { before(() => { cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); diff --git a/web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts similarity index 85% rename from web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts rename to web/cypress/e2e/legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts index ef8e6aaaf..b043fb5c7 100644 --- a/web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts @@ -17,30 +17,11 @@ describe( before(() => { cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); cy.log('Installation: COO and setting up Monitoring Plugin'); - }); - }, -); - -describe( - 'IVT: Monitoring UIPlugin + Virtualization', - { tags: ['@coo', '@virtualization', '@slow'] }, - () => { - before(() => { cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); - }); - - it('1. Virtualization perspective - Observe Menu', () => { cy.log('Virtualization perspective - Observe Menu and verify all submenus'); cy.switchPerspective('Virtualization', 'Fleet virtualization'); guidedTour.closeKubevirtTour(); }); - }, -); - -describe( - 'Regression: Monitoring - Legacy Dashboards (Virtualization)', - { tags: ['@legacy-dashboards', '@coo', '@virtualization', '@slow'] }, - () => { beforeEach(() => { cy.visit('/'); cy.validateLogin(); diff --git a/web/cypress/e2e/metrics/metrics_regression.cy.ts b/web/cypress/e2e/metrics/metrics_regression.cy.ts new file mode 100644 index 000000000..11018abdc --- /dev/null +++ b/web/cypress/e2e/metrics/metrics_regression.cy.ts @@ -0,0 +1,80 @@ +import { CustomerPerspectiveName } from '@/shared/constants/perspective'; +import { testMetricsRegression2 } from '../../support/monitoring/02.reg_metrics_2.cy'; +import { testMetricsRegression1 } from '../../support/monitoring/02.reg_metrics_1.cy'; +import { testMetricsRegressionNamespace1 } from '../../support/monitoring/05.reg_metrics_namespace_1.cy'; +import { commonPages } from '../../views/common'; +import { nav } from '../../views/nav'; +import { testMetricsRegressionNamespace2 } from '../../support/monitoring/05.reg_metrics_namespace_2.cy'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; + +// Test suite for Administrator perspective +describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => { + before(() => { + cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + }); + + beforeEach(() => { + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace('All Projects'); + }); + + // Run tests in Administrator perspective + testMetricsRegression1(CustomerPerspectiveName.CorePlatform); +}); + +// Test suite for Administrator perspective +describe( + 'Regression: Monitoring - Metrics Namespaced (Administrator)', + { tags: ['@metrics'] }, + () => { + before(() => { + cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + }); + + beforeEach(() => { + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); + }); + + // Run tests in Administrator perspective + testMetricsRegressionNamespace1(CustomerPerspectiveName.CorePlatform); + }, +); + +// Test suite for Administrator perspective +describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => { + before(() => { + cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + }); + + beforeEach(() => { + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace('All Projects'); + }); + + // Run tests in Administrator perspective + testMetricsRegression2(CustomerPerspectiveName.CorePlatform); +}); + +// Test suite for Administrator perspective +describe( + 'Regression: Monitoring - Metrics Namespaced (Administrator)', + { tags: ['@metrics'] }, + () => { + before(() => { + cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + }); + + beforeEach(() => { + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); + }); + + // Run tests in Administrator perspective + testMetricsRegressionNamespace2(CustomerPerspectiveName.CorePlatform); + }, +); diff --git a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts new file mode 100644 index 000000000..4c7704c70 --- /dev/null +++ b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts @@ -0,0 +1,103 @@ +import { CustomerPerspectiveName } from '@/shared/constants/perspective'; +import { testMetricsRegression2 } from '../../support/monitoring/02.reg_metrics_2.cy'; +import { alerts } from '../../fixtures/monitoring/alert'; +import { testMetricsRegression1 } from '../../support/monitoring/02.reg_metrics_1.cy'; +import { testMetricsRegressionNamespace1 } from '../../support/monitoring/05.reg_metrics_namespace_1.cy'; +import { commonPages } from '../../views/common'; +import { nav } from '../../views/nav'; +import { guidedTour } from '../../views/tour'; +import { testMetricsRegressionNamespace2 } from '../../support/monitoring/05.reg_metrics_namespace_2.cy'; +import { + CLUSTER_MONITORING_OPERATOR, + CLUSTER_OBSERVABILITY_OPERATOR, + KUBEVIRT_HYPERCONVERGED_OPERATOR, +} from '../../support/operators'; + +describe('Regression: Monitoring - Metrics (Virtualization)', () => { + before(() => { + cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); + cy.log('Installation: COO and setting up Monitoring Plugin'); + cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); + cy.log('Virtualization perspective - Observe Menu and verify all submenus'); + }); + + describe( + 'Regression: Monitoring - Metrics (Virtualization)', + { tags: ['@metrics', '@coo', '@virtualization', '@slow'] }, + () => { + beforeEach(() => { + cy.visit('/'); + cy.validateLogin(); + cy.switchPerspective('Virtualization'); + guidedTour.closeKubevirtTour(); + alerts.interceptWatchdogAlert(); + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace('All Projects'); + alerts.interceptWatchdogAlert(); + }); + + testMetricsRegression1(CustomerPerspectiveName.Virtualization); + }, + ); + + describe( + 'Regression: Monitoring - Metrics Namespaced (Virtualization)', + { tags: ['@metrics', '@coo', '@virtualization', '@slow'] }, + () => { + beforeEach(() => { + cy.visit('/'); + cy.validateLogin(); + cy.switchPerspective('Virtualization'); + guidedTour.closeKubevirtTour(); + alerts.interceptWatchdogAlert(); + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); + alerts.interceptWatchdogAlert(); + }); + + testMetricsRegressionNamespace1(CustomerPerspectiveName.Virtualization); + }, + ); + + describe( + 'Regression: Monitoring - Metrics (Virtualization)', + { tags: ['@metrics', '@virtualization', '@slow'] }, + () => { + beforeEach(() => { + cy.visit('/'); + cy.validateLogin(); + cy.switchPerspective('Virtualization', 'Fleet virtualization'); + guidedTour.closeKubevirtTour(); + alerts.interceptWatchdogAlert(); + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace('All Projects'); + alerts.interceptWatchdogAlert(); + }); + + testMetricsRegression2(CustomerPerspectiveName.Virtualization); + }, + ); + + describe( + 'Regression: Monitoring - Metrics Namespaced (Virtualization)', + { tags: ['@metrics', '@virtualization', '@slow'] }, + () => { + beforeEach(() => { + cy.visit('/'); + cy.validateLogin(); + cy.switchPerspective('Virtualization', 'Fleet virtualization'); + guidedTour.closeKubevirtTour(); + alerts.interceptWatchdogAlert(); + nav.sidenav.clickNavLink(['Observe', 'Metrics']); + commonPages.titleShouldHaveText('Metrics'); + cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); + alerts.interceptWatchdogAlert(); + }); + + testMetricsRegressionNamespace2(CustomerPerspectiveName.Virtualization); + }, + ); +}); diff --git a/web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts b/web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts deleted file mode 100644 index 76a95f20b..000000000 --- a/web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { CLUSTER_MONITORING_OPERATOR } from '../../../support/operators'; -import { alerts } from '../../../fixtures/monitoring/alert'; -import { testAlertsRegressionNamespace } from '../../../support/monitoring/04.reg_alerts_namespace.cy'; -import { commonPages } from '../../../views/common'; -import { nav } from '../../../views/nav'; -import { CustomerPerspectiveName } from '@/shared/constants/perspective'; - -describe( - 'Regression: Monitoring - Alerts Namespaced (Administrator)', - { tags: ['@alerting'] }, - () => { - before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); - }); - - beforeEach(() => { - alerts.interceptWatchdogAlert(); - nav.sidenav.clickNavLink(['Observe', 'Alerting']); - commonPages.titleShouldHaveText('Alerting'); - alerts.interceptWatchdogAlert(); - cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); - }); - - // Run tests in Administrator perspective - testAlertsRegressionNamespace(CustomerPerspectiveName.CorePlatform); - }, -); diff --git a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts b/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts deleted file mode 100644 index 03659835e..000000000 --- a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { CLUSTER_MONITORING_OPERATOR } from '../../../support/operators'; -import { testMetricsRegression1 } from '../../../support/monitoring/02.reg_metrics_1.cy'; -import { testMetricsRegressionNamespace1 } from '../../../support/monitoring/05.reg_metrics_namespace_1.cy'; -import { commonPages } from '../../../views/common'; -import { nav } from '../../../views/nav'; -import { CustomerPerspectiveName } from '@/shared/constants/perspective'; - -// Test suite for Administrator perspective -describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => { - before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); - }); - - beforeEach(() => { - nav.sidenav.clickNavLink(['Observe', 'Metrics']); - commonPages.titleShouldHaveText('Metrics'); - cy.changeNamespace('All Projects'); - }); - - // Run tests in Administrator perspective - testMetricsRegression1(CustomerPerspectiveName.CorePlatform); -}); - -// Test suite for Administrator perspective -describe( - 'Regression: Monitoring - Metrics Namespaced (Administrator)', - { tags: ['@metrics'] }, - () => { - before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); - }); - - beforeEach(() => { - nav.sidenav.clickNavLink(['Observe', 'Metrics']); - commonPages.titleShouldHaveText('Metrics'); - cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); - }); - - // Run tests in Administrator perspective - testMetricsRegressionNamespace1(CustomerPerspectiveName.CorePlatform); - }, -); diff --git a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts b/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts deleted file mode 100644 index b0798079a..000000000 --- a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { CLUSTER_MONITORING_OPERATOR } from '../../../support/operators'; -import { testMetricsRegression2 } from '../../../support/monitoring/02.reg_metrics_2.cy'; -import { testMetricsRegressionNamespace2 } from '../../../support/monitoring/05.reg_metrics_namespace_2.cy'; -import { commonPages } from '../../../views/common'; -import { nav } from '../../../views/nav'; -import { CustomerPerspectiveName } from '@/shared/constants/perspective'; - -// Test suite for Administrator perspective -describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => { - before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); - }); - - beforeEach(() => { - nav.sidenav.clickNavLink(['Observe', 'Metrics']); - commonPages.titleShouldHaveText('Metrics'); - cy.changeNamespace('All Projects'); - }); - - // Run tests in Administrator perspective - testMetricsRegression2(CustomerPerspectiveName.CorePlatform); -}); - -// Test suite for Administrator perspective -describe( - 'Regression: Monitoring - Metrics Namespaced (Administrator)', - { tags: ['@metrics'] }, - () => { - before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); - }); - - beforeEach(() => { - nav.sidenav.clickNavLink(['Observe', 'Metrics']); - commonPages.titleShouldHaveText('Metrics'); - cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); - }); - - // Run tests in Administrator perspective - testMetricsRegressionNamespace2(CustomerPerspectiveName.CorePlatform); - }, -); diff --git a/web/cypress/e2e/coo/03.coo_lightspeed_show_timeseries.cy.ts b/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts similarity index 100% rename from web/cypress/e2e/coo/03.coo_lightspeed_show_timeseries.cy.ts rename to web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts diff --git a/web/cypress/e2e/perses/00.coo_bvt_perses_admin.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts similarity index 100% rename from web/cypress/e2e/perses/00.coo_bvt_perses_admin.cy.ts rename to web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts diff --git a/web/cypress/e2e/perses/03.coo_create_perses_admin.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts similarity index 100% rename from web/cypress/e2e/perses/03.coo_create_perses_admin.cy.ts rename to web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts diff --git a/web/cypress/e2e/perses/05.coo_tempo_loki_admin.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts similarity index 100% rename from web/cypress/e2e/perses/05.coo_tempo_loki_admin.cy.ts rename to web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts diff --git a/web/cypress/e2e/perses/02.coo_edit_perses_admin.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts similarity index 100% rename from web/cypress/e2e/perses/02.coo_edit_perses_admin.cy.ts rename to web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts diff --git a/web/cypress/e2e/perses/04.coo_import_perses_admin.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts similarity index 100% rename from web/cypress/e2e/perses/04.coo_import_perses_admin.cy.ts rename to web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts diff --git a/web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts similarity index 100% rename from web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts rename to web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts diff --git a/web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts similarity index 65% rename from web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts rename to web/cypress/e2e/perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts index 809a8589f..b78328a60 100644 --- a/web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts @@ -16,30 +16,12 @@ describe( () => { before(() => { cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); - }); - - it('1. Installation: COO and setting up Monitoring Plugin', () => { cy.log('Installation: COO and setting up Monitoring Plugin'); + cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); + cy.log('Virtualization perspective - Observe Menu and verify all submenus'); + cy.switchPerspective('Virtualization', 'Fleet virtualization'); + guidedTour.closeKubevirtTour(); }); - }, -); - -describe('Installation: Virtualization', { tags: ['@virtualization', '@slow'] }, () => { - before(() => { - cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); - }); - - it('1. Installation: Virtualization', () => { - cy.log('Installation: Virtualization'); - cy.switchPerspective('Virtualization', 'Fleet virtualization'); - guidedTour.closeKubevirtTour(); - }); -}); - -describe( - 'IVT: COO - Dashboards (Perses) - Virtualization perspective', - { tags: ['@perses-dashboards', '@coo', '@virtualization', '@slow'] }, - () => { beforeEach(() => { cy.visit('/'); guidedTour.close(); diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user1.cy.ts similarity index 91% rename from web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts rename to web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user1.cy.ts index a8573957d..9a29151d9 100644 --- a/web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user1.cy.ts @@ -1,10 +1,10 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { nav } from '../../views/nav'; -import { testCOORBACPersesTestsDevUser1 } from '../../support/perses/99.coo_rbac_perses_user1.cy'; +import { nav } from '../../../views/nav'; +import { testCOORBACPersesTestsDevUser1 } from '../../../support/perses/99.coo_rbac_perses_user1.cy'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../../support/operators'; describe( 'RBAC User1: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user2.cy.ts similarity index 92% rename from web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts rename to web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user2.cy.ts index c81d6a492..fa08bd2e7 100644 --- a/web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user2.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { nav } from '../../views/nav'; -import { testCOORBACPersesTestsDevUser2 } from '../../support/perses/99.coo_rbac_perses_user2.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { nav } from '../../../views/nav'; +import { testCOORBACPersesTestsDevUser2 } from '../../../support/perses/99.coo_rbac_perses_user2.cy'; +import { operatorAuthUtils } from '../../../support/commands/auth-commands'; describe( 'RBAC User2: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user3.cy.ts similarity index 92% rename from web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts rename to web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user3.cy.ts index 2816015a9..066c14baa 100644 --- a/web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user3.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { nav } from '../../views/nav'; -import { testCOORBACPersesTestsDevUser3 } from '../../support/perses/99.coo_rbac_perses_user3.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { nav } from '../../../views/nav'; +import { testCOORBACPersesTestsDevUser3 } from '../../../support/perses/99.coo_rbac_perses_user3.cy'; +import { operatorAuthUtils } from '../../../support/commands/auth-commands'; describe( 'RBAC User3: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user4.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user4.cy.ts similarity index 92% rename from web/cypress/e2e/perses/99.coo_rbac_perses_user4.cy.ts rename to web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user4.cy.ts index cfb344fc8..b8ff0b60b 100644 --- a/web/cypress/e2e/perses/99.coo_rbac_perses_user4.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user4.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { nav } from '../../views/nav'; -import { testCOORBACPersesTestsDevUser4 } from '../../support/perses/99.coo_rbac_perses_user4.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { nav } from '../../../views/nav'; +import { testCOORBACPersesTestsDevUser4 } from '../../../support/perses/99.coo_rbac_perses_user4.cy'; +import { operatorAuthUtils } from '../../../support/commands/auth-commands'; describe( 'RBAC User4: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user5.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user5.cy.ts similarity index 92% rename from web/cypress/e2e/perses/99.coo_rbac_perses_user5.cy.ts rename to web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user5.cy.ts index 0fedf98f2..51be1b0cb 100644 --- a/web/cypress/e2e/perses/99.coo_rbac_perses_user5.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user5.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { nav } from '../../views/nav'; -import { testCOORBACPersesTestsDevUser5 } from '../../support/perses/99.coo_rbac_perses_user5.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { nav } from '../../../views/nav'; +import { testCOORBACPersesTestsDevUser5 } from '../../../support/perses/99.coo_rbac_perses_user5.cy'; +import { operatorAuthUtils } from '../../../support/commands/auth-commands'; describe( 'RBAC User5: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user6.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user6.cy.ts similarity index 92% rename from web/cypress/e2e/perses/99.coo_rbac_perses_user6.cy.ts rename to web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user6.cy.ts index 259dd57e2..8042fbb18 100644 --- a/web/cypress/e2e/perses/99.coo_rbac_perses_user6.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user6.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { nav } from '../../views/nav'; -import { testCOORBACPersesTestsDevUser6 } from '../../support/perses/99.coo_rbac_perses_user6.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { nav } from '../../../views/nav'; +import { testCOORBACPersesTestsDevUser6 } from '../../../support/perses/99.coo_rbac_perses_user6.cy'; +import { operatorAuthUtils } from '../../../support/commands/auth-commands'; describe( 'RBAC User6: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/e2e/monitoring/00.bvt_admin.cy.ts b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts similarity index 100% rename from web/cypress/e2e/monitoring/00.bvt_admin.cy.ts rename to web/cypress/e2e/shared/admin_perspective_bvt.cy.ts diff --git a/web/cypress/e2e/shared/coo_submenus.cy.ts b/web/cypress/e2e/shared/coo_submenus.cy.ts new file mode 100644 index 000000000..a28da7f61 --- /dev/null +++ b/web/cypress/e2e/shared/coo_submenus.cy.ts @@ -0,0 +1,45 @@ +import { + CLUSTER_MONITORING_OPERATOR, + CLUSTER_OBSERVABILITY_OPERATOR, +} from '../../support/operators'; +import { commonPages } from '../../views/common'; +import { nav } from '../../views/nav'; +import { troubleshootingPanelPage } from '../../views/troubleshooting-panel'; + +describe( + 'BVT: COO', + { + tags: [ + '@alerting', + '@cluster-health-analyzer', + '@legacy-dashboards', + '@perses-dashboards', + '@coo', + ], + }, + () => { + before(() => { + cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); + }); + + it('1. Admin perspective - Observe Menu', () => { + cy.log('Admin perspective - Observe Menu and verify all submenus'); + cy.reload(true); + cy.wait(10000); + nav.sidenav.clickNavLink(['Observe', 'Alerting']); + commonPages.titleShouldHaveText('Alerting'); + nav.tabs.switchTab('Silences'); + nav.tabs.switchTab('Alerting rules'); + nav.tabs.switchTab('Incidents'); + nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']); + commonPages.titleShouldHaveText('Dashboards'); + nav.sidenav.clickNavLink(['Observe', 'Alerting']); + troubleshootingPanelPage.openSignalCorrelation(); + troubleshootingPanelPage.troubleshootingPanelPageShouldBeLoadedEnabled(); + }); + + /** + * TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios + */ + }, +); diff --git a/web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts b/web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts deleted file mode 100644 index 7470194ec..000000000 --- a/web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { - CLUSTER_MONITORING_OPERATOR, - CLUSTER_OBSERVABILITY_OPERATOR, - KUBEVIRT_HYPERCONVERGED_OPERATOR, -} from '../../support/operators'; -import { alerts } from '../../fixtures/monitoring/alert'; -import { testMetricsRegression1 } from '../../support/monitoring/02.reg_metrics_1.cy'; -import { testMetricsRegressionNamespace1 } from '../../support/monitoring/05.reg_metrics_namespace_1.cy'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; -import { guidedTour } from '../../views/tour'; -import { CustomerPerspectiveName } from '@/shared/constants/perspective'; - -describe( - 'Regression: Monitoring - Metrics (Virtualization)', - { tags: ['@metrics', '@coo', '@virtualization', '@slow'] }, - () => { - before(() => { - cy.beforeBlockCOO(CLUSTER_OBSERVABILITY_OPERATOR, CLUSTER_MONITORING_OPERATOR); - }); - - it('1. Installation: COO and setting up Monitoring Plugin', () => { - cy.log('Installation: COO and setting up Monitoring Plugin'); - }); - }, -); - -describe( - 'IVT: Monitoring UIPlugin + Virtualization', - { tags: ['@coo', '@virtualization', '@slow'] }, - () => { - before(() => { - cy.beforeBlockVirtualization(KUBEVIRT_HYPERCONVERGED_OPERATOR); - }); - - it('1. Virtualization perspective - Observe Menu', () => { - cy.log('Virtualization perspective - Observe Menu and verify all submenus'); - cy.switchPerspective('Virtualization', 'Fleet virtualization'); - guidedTour.closeKubevirtTour(); - }); - }, -); - -describe( - 'Regression: Monitoring - Metrics (Virtualization)', - { tags: ['@metrics', '@coo', '@virtualization', '@slow'] }, - () => { - beforeEach(() => { - cy.visit('/'); - cy.validateLogin(); - cy.switchPerspective('Virtualization', 'Fleet virtualization'); - guidedTour.closeKubevirtTour(); - alerts.interceptWatchdogAlert(); - nav.sidenav.clickNavLink(['Observe', 'Metrics']); - commonPages.titleShouldHaveText('Metrics'); - cy.changeNamespace('All Projects'); - alerts.interceptWatchdogAlert(); - }); - - testMetricsRegression1(CustomerPerspectiveName.Virtualization); - }, -); - -describe( - 'Regression: Monitoring - Metrics Namespaced (Virtualization)', - { tags: ['@metrics', '@coo', '@virtualization', '@slow'] }, - () => { - beforeEach(() => { - cy.visit('/'); - cy.validateLogin(); - cy.switchPerspective('Virtualization', 'Fleet virtualization'); - guidedTour.closeKubevirtTour(); - alerts.interceptWatchdogAlert(); - nav.sidenav.clickNavLink(['Observe', 'Metrics']); - commonPages.titleShouldHaveText('Metrics'); - cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace); - alerts.interceptWatchdogAlert(); - }); - - testMetricsRegressionNamespace1(CustomerPerspectiveName.Virtualization); - }, -); From d553433e74d7fcc188e05a3969ffdfe6e4d7a786 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Mon, 31 Aug 2026 16:51:39 -0400 Subject: [PATCH 2/2] feat: add idempotent ensureMonitoringPlugin command --- web/cypress/e2e/alerts/alerts_bvt.cy.ts | 2 +- .../e2e/alerts/alerts_regression.cy.ts | 4 +- .../legacy_dashboards_regression.cy.ts | 4 +- .../e2e/metrics/metrics_regression.cy.ts | 8 +- .../e2e/shared/admin_perspective_bvt.cy.ts | 2 +- web/cypress/support/commands/auth-commands.ts | 27 ++--- .../support/commands/image-patch-commands.ts | 107 +++++++++++++----- .../support/commands/operator-commands.ts | 51 +++------ .../support/commands/utility-commands.ts | 60 ---------- 9 files changed, 117 insertions(+), 148 deletions(-) diff --git a/web/cypress/e2e/alerts/alerts_bvt.cy.ts b/web/cypress/e2e/alerts/alerts_bvt.cy.ts index f01b97d5e..777fffabf 100644 --- a/web/cypress/e2e/alerts/alerts_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_bvt.cy.ts @@ -7,7 +7,7 @@ import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; describe('BVT: Monitoring - Namespaced', { tags: ['@alerting', '@metrics'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { diff --git a/web/cypress/e2e/alerts/alerts_regression.cy.ts b/web/cypress/e2e/alerts/alerts_regression.cy.ts index 9485f572e..aa9785a1a 100644 --- a/web/cypress/e2e/alerts/alerts_regression.cy.ts +++ b/web/cypress/e2e/alerts/alerts_regression.cy.ts @@ -15,7 +15,7 @@ describe( { tags: ['@alerting', '@metrics'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); cy.switchPerspective('Core platform'); }); @@ -40,7 +40,7 @@ describe( { tags: ['@alerting'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { diff --git a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts index cc50b58af..cd5eb21c0 100644 --- a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts @@ -11,7 +11,7 @@ describe( { tags: ['@legacy-dashboards'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { @@ -37,7 +37,7 @@ describe( { tags: ['@legacy-dashboards', '@metrics'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { diff --git a/web/cypress/e2e/metrics/metrics_regression.cy.ts b/web/cypress/e2e/metrics/metrics_regression.cy.ts index 11018abdc..37a889b92 100644 --- a/web/cypress/e2e/metrics/metrics_regression.cy.ts +++ b/web/cypress/e2e/metrics/metrics_regression.cy.ts @@ -10,7 +10,7 @@ import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; // Test suite for Administrator perspective describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { @@ -29,7 +29,7 @@ describe( { tags: ['@metrics'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { @@ -46,7 +46,7 @@ describe( // Test suite for Administrator perspective describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { @@ -65,7 +65,7 @@ describe( { tags: ['@metrics'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { diff --git a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts index b55383b06..95e9a6508 100644 --- a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts +++ b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts @@ -11,7 +11,7 @@ describe( { tags: ['@alerting', '@legacy-dashboards', '@metrics', '@targets'] }, () => { before(() => { - cy.beforeBlock(CLUSTER_MONITORING_OPERATOR); + cy.ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR); }); beforeEach(() => { diff --git a/web/cypress/support/commands/auth-commands.ts b/web/cypress/support/commands/auth-commands.ts index 6b35cce26..928401d79 100644 --- a/web/cypress/support/commands/auth-commands.ts +++ b/web/cypress/support/commands/auth-commands.ts @@ -35,7 +35,7 @@ declare global { // Moved from operator-commands.ts so all auth concerns live in one file. export const operatorAuthUtils = { - performLoginAndAuth(useSession: boolean): void { + ensureUserPermissions(): void { if (`${Cypress.env('LOGIN_USERNAME')}` === 'kubeadmin') { cy.adminCLI( `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`, @@ -70,6 +70,9 @@ export const operatorAuthUtils = { `oc adm policy add-role-to-user view ${Cypress.env('LOGIN_USERNAME')} -n default`, ); } + }, + + login(useSession = true): void { cy.exec( `oc get oauthclient openshift-browser-client -o go-template ` + `--template="{{index .redirectURIs 0}}" --kubeconfig "${Cypress.env('KUBECONFIG_PATH')}"`, @@ -108,12 +111,14 @@ export const operatorAuthUtils = { loginAndAuth(): void { cy.log('Before block'); - operatorAuthUtils.performLoginAndAuth(true); + operatorAuthUtils.ensureUserPermissions(); + operatorAuthUtils.login(); }, loginAndAuthNoSession(): void { cy.log('Before block (no session)'); - operatorAuthUtils.performLoginAndAuth(false); + operatorAuthUtils.ensureUserPermissions(); + operatorAuthUtils.login(false); }, generateCOOSessionKey( @@ -147,20 +152,6 @@ export const operatorAuthUtils = { return [...baseKey, ...envVars.map((v) => v || '')]; }, - generateMPSessionKey(CLUSTER_MONITORING_OPERATOR: { - namespace: string; - operatorName: string; - }): string[] { - const baseKey = [ - Cypress.env('LOGIN_IDP'), - Cypress.env('LOGIN_USERNAME'), - CLUSTER_MONITORING_OPERATOR.namespace, - CLUSTER_MONITORING_OPERATOR.operatorName, - ]; - const envVars = [Cypress.env('SKIP_ALL_INSTALL'), Cypress.env('MP_IMAGE')]; - return [...baseKey, ...envVars.map((v) => v || '')]; - }, - generateKNVSessionKey(CNV: { namespace: string; packageName: string }): string[] { const baseKey = [ Cypress.env('LOGIN_IDP'), @@ -337,7 +328,7 @@ Cypress.Commands.add('relogin', (provider: string, username: string, password: s cy.log('Commands relogin - fetching OAuth URL and performing fresh login'); cy.uiLogout(); - // Get the OAuth URL from the cluster (same as performLoginAndAuth does) + // Get the OAuth URL from the cluster before performing a fresh login. cy.exec( `oc get oauthclient openshift-browser-client -o go-template ` + `--template="{{index .redirectURIs 0}}" --kubeconfig "${Cypress.env('KUBECONFIG_PATH')}"`, diff --git a/web/cypress/support/commands/image-patch-commands.ts b/web/cypress/support/commands/image-patch-commands.ts index 0cf18d387..b5357bb8b 100644 --- a/web/cypress/support/commands/image-patch-commands.ts +++ b/web/cypress/support/commands/image-patch-commands.ts @@ -3,33 +3,90 @@ import { readyTimeoutMilliseconds } from '../timeouts'; export {}; +function getImage(resource: string, namespace: string): Cypress.Chainable { + return cy + .exec( + `oc get ${resource} -n ${namespace} ` + + `-o jsonpath='{.spec.template.spec.containers[0].image}' ` + + `--kubeconfig "${Cypress.env('KUBECONFIG_PATH')}"`, + ) + .then((result) => result.stdout.trim()); +} + +function waitForMonitoringPluginImage(namespace: string, expectedImage: string): void { + cy.waitUntil( + () => + cy + .exec( + `oc get pods -l app.kubernetes.io/name=monitoring-plugin -n ${namespace} ` + + `-o jsonpath='{range .items[*]}{.spec.containers[0].image}{"\\n"}{end}' ` + + `--kubeconfig "${Cypress.env('KUBECONFIG_PATH')}"`, + { failOnNonZeroExit: false }, + ) + .then((result) => { + const images = result.stdout.trim().split('\n').filter(Boolean); + return ( + result.code === 0 && + images.length > 0 && + images.every((image) => image === expectedImage) + ); + }), + { + timeout: readyTimeoutMilliseconds, + interval: 5000, + errorMsg: `Monitoring Plugin pods did not converge to image ${expectedImage}`, + }, + ); +} + export const imagePatchUtils = { + getImage, + setupMonitoringPluginImage(CLUSTER_MONITORING_OPERATOR: { namespace: string }): void { - cy.log('Set Monitoring Plugin image in operator CSV'); - if (Cypress.env('MP_IMAGE')) { - cy.exec('./cypress/fixtures/cmo/update-monitoring-plugin-image.sh', { - env: { - MP_IMAGE: Cypress.env('MP_IMAGE'), - KUBECONFIG: Cypress.env('KUBECONFIG_PATH'), - MP_NAMESPACE: `${CLUSTER_MONITORING_OPERATOR.namespace}`, - }, - timeout: readyTimeoutMilliseconds, - failOnNonZeroExit: true, - }).then((result) => { - expect(result.code).to.eq(0); - cy.log(`CMO deployment Scaled Down successfully: ${result.stdout}`); - }); + const expectedImage = Cypress.env('MP_IMAGE') as string | undefined; + if (expectedImage) { + cy.log('Check Monitoring Plugin image'); + imagePatchUtils + .getImage('deployment/monitoring-plugin', CLUSTER_MONITORING_OPERATOR.namespace) + .then((currentImage) => { + if (currentImage === expectedImage) { + waitForPodsReady( + 'app.kubernetes.io/name=monitoring-plugin', + CLUSTER_MONITORING_OPERATOR.namespace, + readyTimeoutMilliseconds, + ); + waitForMonitoringPluginImage(CLUSTER_MONITORING_OPERATOR.namespace, expectedImage); + cy.log(`Monitoring Plugin already uses ${expectedImage}`); + return; + } - waitForPodsReady( - 'app.kubernetes.io/name=monitoring-plugin', - CLUSTER_MONITORING_OPERATOR.namespace, - readyTimeoutMilliseconds, - ); - cy.log( - `Monitoring plugin pod is now running in namespace: ` + - `${CLUSTER_MONITORING_OPERATOR.namespace}`, - ); - cy.reload(true); + cy.log( + `Update Monitoring Plugin image from ${currentImage || 'unknown'} to ${expectedImage}`, + ); + cy.exec('./cypress/fixtures/cmo/update-monitoring-plugin-image.sh', { + env: { + MP_IMAGE: expectedImage, + KUBECONFIG: Cypress.env('KUBECONFIG_PATH'), + MP_NAMESPACE: `${CLUSTER_MONITORING_OPERATOR.namespace}`, + }, + timeout: readyTimeoutMilliseconds, + }).then((result) => { + expect(result.code).to.eq(0); + cy.log(`CMO deployment Scaled Down successfully: ${result.stdout}`); + }); + + waitForPodsReady( + 'app.kubernetes.io/name=monitoring-plugin', + CLUSTER_MONITORING_OPERATOR.namespace, + readyTimeoutMilliseconds, + ); + cy.log( + `Monitoring plugin pod is now running in namespace: ` + + `${CLUSTER_MONITORING_OPERATOR.namespace}`, + ); + waitForMonitoringPluginImage(CLUSTER_MONITORING_OPERATOR.namespace, expectedImage); + cy.reload(true); + }); } else { cy.log('MP_IMAGE is NOT set. Skipping patching the image in CMO operator CSV.'); } @@ -58,7 +115,6 @@ export const imagePatchUtils = { MCP_NAMESPACE: `${CLUSTER_OBSERVABILITY_OPERATOR.namespace}`, }, timeout: readyTimeoutMilliseconds, - failOnNonZeroExit: true, }).then((result) => { expect(result.code).to.eq(0); cy.log(`COO CSV updated successfully with ${config.componentName} image: ${result.stdout}`); @@ -192,7 +248,6 @@ export const imagePatchUtils = { MP_NAMESPACE: `${CLUSTER_MONITORING_OPERATOR.namespace}`, }, timeout: readyTimeoutMilliseconds, - failOnNonZeroExit: true, }).then((result) => { expect(result.code).to.eq(0); cy.log(`CMO CSV reverted successfully with Monitoring Plugin image: ${result.stdout}`); diff --git a/web/cypress/support/commands/operator-commands.ts b/web/cypress/support/commands/operator-commands.ts index e5b09481c..10bacefb6 100644 --- a/web/cypress/support/commands/operator-commands.ts +++ b/web/cypress/support/commands/operator-commands.ts @@ -22,7 +22,10 @@ declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace Cypress { interface Chainable { - beforeBlock(CLUSTER_MONITORING_OPERATOR: { namespace: string; operatorName: string }); + ensureMonitoringPlugin(CLUSTER_MONITORING_OPERATOR: { + namespace: string; + operatorName: string; + }); cleanupMP(CLUSTER_MONITORING_OPERATOR: { namespace: string; operatorName: string }); beforeBlockCOO( CLUSTER_OBSERVABILITY_OPERATOR: { @@ -92,9 +95,13 @@ function collectDebugInfo( return; } cy.aboutModal(); - cy.podImage('monitoring-plugin', CLUSTER_MONITORING_OPERATOR.namespace); + imagePatchUtils + .getImage('deployment/monitoring-plugin', CLUSTER_MONITORING_OPERATOR.namespace) + .then((image) => cy.log(`Monitoring Plugin image: ${image}`)); if (CLUSTER_OBSERVABILITY_OPERATOR && CLUSTER_OBSERVABILITY_OPERATOR.namespace) { - cy.podImage('monitoring', CLUSTER_OBSERVABILITY_OPERATOR.namespace); + imagePatchUtils + .getImage('deployment/monitoring', CLUSTER_OBSERVABILITY_OPERATOR.namespace) + .then((image) => cy.log(`Monitoring Console Plugin image: ${image}`)); } } @@ -200,38 +207,14 @@ function cleanupUIPlugin( // ── Cypress commands ─────────────────────────────────────────────── Cypress.Commands.add( - 'beforeBlock', + 'ensureMonitoringPlugin', (CLUSTER_MONITORING_OPERATOR: { namespace: string; operatorName: string }) => { - if (useSession) { - const sessionKey = operatorAuthUtils.generateMPSessionKey(CLUSTER_MONITORING_OPERATOR); - - cy.session( - sessionKey, - () => { - cy.log('Before block (session)'); - cy.cleanupMP(CLUSTER_MONITORING_OPERATOR); - operatorAuthUtils.loginAndAuthNoSession(); - imagePatchUtils.setupMonitoringPluginImage(CLUSTER_MONITORING_OPERATOR); - collectDebugInfo(CLUSTER_MONITORING_OPERATOR); - cy.task('clearDownloads'); - cy.log('Before block (session) completed'); - }, - { - cacheAcrossSpecs: true, - validate() { - cy.validateLogin(); - }, - }, - ); - } else { - cy.log('Before block (no session)'); - cy.cleanupMP(CLUSTER_MONITORING_OPERATOR); - operatorAuthUtils.loginAndAuth(); - imagePatchUtils.setupMonitoringPluginImage(CLUSTER_MONITORING_OPERATOR); - collectDebugInfo(CLUSTER_MONITORING_OPERATOR); - cy.task('clearDownloads'); - cy.log('Before block (no session) completed'); - } + cy.log('Ensure Monitoring Plugin'); + operatorAuthUtils.loginAndAuth(); + imagePatchUtils.setupMonitoringPluginImage(CLUSTER_MONITORING_OPERATOR); + collectDebugInfo(CLUSTER_MONITORING_OPERATOR); + cy.task('clearDownloads'); + cy.log('Ensure Monitoring Plugin completed'); }, ); diff --git a/web/cypress/support/commands/utility-commands.ts b/web/cypress/support/commands/utility-commands.ts index adc5069a5..c506dd4e1 100644 --- a/web/cypress/support/commands/utility-commands.ts +++ b/web/cypress/support/commands/utility-commands.ts @@ -14,7 +14,6 @@ declare global { clickNavLink(path: string[]): Chainable; changeNamespace(namespace: string): Chainable; aboutModal(): Chainable; - podImage(pod: string, namespace: string): Chainable; assertNamespace(namespace: string, exists: boolean): Chainable; checkForAlertRecursively(attemptsLeft?: number): Chainable; dynamicPluginWorkConsoleAround(): Chainable; @@ -191,65 +190,6 @@ Cypress.Commands.overwrite('log', (log, ...args) => { } }); -Cypress.Commands.add('podImage', (pod: string, namespace: string) => { - cy.log('Get pod image'); - cy.switchPerspective('Core platform', 'Administrator'); - cy.clickNavLink(['Workloads', 'Pods']); - cy.byTestID('page-heading').contains('Pods').should('be.visible'); - cy.get( - 'table tbody tr, [data-ouia-component-id="DataViewTableBasic"], [data-test="empty-box-body"]', - { timeout: 30000 }, - ).should('have.length.greaterThan', 0); - cy.changeNamespace(namespace); - // Wait for the pod table to load after namespace change so the page stabilizes - cy.get('table tbody tr, [data-ouia-component-id="DataViewTableBasic"] tbody tr', { - timeout: 30000, - }).should('have.length.greaterThan', 0); - cy.get('[data-ouia-component-id="DataViewFilters"]', { - timeout: 30000, - }).should('have.length.greaterThan', 0); - cy.wait(10000); - // Re-check for DataViewFilters after the table has stabilized - cy.get('body').then(($body) => { - const hasDataViewFilters = $body.find('[data-ouia-component-id="DataViewFilters"]').length > 0; - let filterSelector: string; - if (hasDataViewFilters) { - const hasFilterByName = $body.find('[placeholder="Filter by name"]').length > 0; - filterSelector = '[placeholder="Filter by name"]'; - if (!hasFilterByName) { - cy.byOUIAID('DataViewFilters') - .find('button') - .contains('Status') - .scrollIntoView() - .should('be.visible') - .click(); - cy.byOUIAID('OUIA-Generated-Menu') - .find('button') - .contains('Name') - .scrollIntoView() - .should('be.visible') - .click(); - } - } else { - filterSelector = '[data-test="name-filter-input"]'; - } - // Separate the visibility assertion from the type action so Cypress - // re-queries the element for each command independently. - cy.get(filterSelector).scrollIntoView().should('be.visible'); - cy.get(filterSelector).type(pod); - }); - cy.get(`a[data-test^="${pod}"]`).eq(0).as('podLink').click(); - cy.byPFRole('rowgroup') - .find('td') - .eq(1) - .scrollIntoView() - .should('be.visible') - .then(($td) => { - cy.log('Pod image: ' + $td.text()); - }); - cy.log('Get pod image completed'); -}); - Cypress.Commands.add('assertNamespace', (namespace: string, exists: boolean) => { cy.log('Asserting Namespace: ' + namespace + ' exists: ' + exists); cy.get('body').then(($body) => {