From 65b9e8aec95d10f01952ecd31ed789bfd8e4ce34 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:43:41 -0400 Subject: [PATCH] refactor: move view files --- .cursor/commands/generate-regression-test.md | 4 +- .../rules/incidents-testing-guidelines.mdc | 6 +- .../performance/03.endurance_test_source.md | 2 +- web/cypress/e2e/alerts/alerts_acm.cy.ts | 17 +- web/cypress/e2e/alerts/alerts_bvt.cy.ts | 4 +- web/cypress/e2e/alerts/alerts_ivt.cy.ts | 6 +- .../e2e/alerts/alerts_regression.cy.ts | 4 +- .../alerts/alerts_virtualization_bvt.cy.ts | 8 +- web/cypress/e2e/incidents/incidents_bvt.cy.ts | 2 +- web/cypress/e2e/incidents/incidents_e2e.cy.ts | 2 +- .../incidents/incidents_mocking_example.cy.ts | 2 +- .../performance/performance_benchmark.cy.ts | 2 +- .../performance/performance_walkthrough.cy.ts | 2 +- .../regression/end_and_resolution.cy.ts | 2 +- .../e2e/incidents/regression/filtering.cy.ts | 2 +- .../e2e/incidents/regression/interval.cy.ts | 2 +- .../regression/permission_and_silences.cy.ts | 4 +- .../incidents/regression/stress_test_ui.cy.ts | 2 +- .../incidents/regression/ui_interaction.cy.ts | 2 +- .../incidents/regression/ui_regressions.cy.ts | 2 +- .../legacy_dashboards_regression.cy.ts | 4 +- ...dashboards_virtualization_regression.cy.ts | 6 +- .../e2e/metrics/metrics_regression.cy.ts | 4 +- .../metrics/metrics_virtualization_ivt.cy.ts | 6 +- .../lightspeed_integration.cy.ts | 10 +- .../perses_dashboards_bvt.cy.ts | 2 +- .../perses_dashboards_create.cy.ts | 2 +- .../perses_dashboards_datasources.cy.ts | 2 +- .../perses_dashboards_edit.cy.ts | 2 +- .../perses_dashboards_import.cy.ts | 2 +- .../perses_dashboards_list.cy.ts | 2 +- ...perses_dashboards_virtualization_ivt.cy.ts | 6 +- .../rbac/perses_dashboards_user1.cy.ts | 2 +- .../rbac/perses_dashboards_user2.cy.ts | 2 +- .../rbac/perses_dashboards_user3.cy.ts | 2 +- .../rbac/perses_dashboards_user4.cy.ts | 2 +- .../rbac/perses_dashboards_user5.cy.ts | 2 +- .../rbac/perses_dashboards_user6.cy.ts | 2 +- .../e2e/shared/admin_perspective_bvt.cy.ts | 6 +- web/cypress/e2e/shared/coo_submenus.cy.ts | 6 +- web/cypress/support/alerts/alerts_bvt.cy.ts | 90 +++--- .../alerts/alerts_bvt_namespaced.cy.ts | 92 +++--- .../support/alerts/alerts_regressions.cy.ts | 21 +- .../alerts_regressions_namespaced.cy.ts | 196 ++++++------ .../support/incidents/prometheus-mocks.ts | 2 +- .../legacy_dashboards_regressions.cy.ts | 18 +- ...cy_dashboards_regressions_namespaced.cy.ts | 18 +- .../support/metrics/metrics_regressions.cy.ts | 2 +- .../metrics_regressions_namespaced.cy.ts | 2 +- .../perses/commands/perses-commands.ts | 4 +- .../support/perses/perses_bvt_admin.cy.ts | 16 +- .../support/perses/perses_create_admin.cy.ts | 12 +- .../perses/perses_create_import_admin.cy.ts | 12 +- .../support/perses/perses_edit_admin.cy.ts | 10 +- .../support/perses/perses_edit_admin_1.cy.ts | 12 +- .../support/perses/perses_import_admin.cy.ts | 8 +- .../support/perses/perses_list_admin.cy.ts | 8 +- .../perses/perses_list_admin_namespace.cy.ts | 8 +- .../support/perses/rbac/perses_user1.cy.ts | 16 +- .../support/perses/rbac/perses_user2.cy.ts | 4 +- .../support/perses/rbac/perses_user3.cy.ts | 16 +- .../support/perses/rbac/perses_user4.cy.ts | 2 +- .../support/perses/rbac/perses_user5.cy.ts | 16 +- .../support/perses/rbac/perses_user6.cy.ts | 2 +- .../coo-install-commands.ts | 4 +- .../support/shared/commands/auth-commands.ts | 4 +- .../commands/traces-logging-commands.ts | 4 +- .../commands/virtualization-commands.ts | 6 +- .../views/{ => alerts}/acm-alerting-page.ts | 0 .../alerts/alert-and-silence-details-page.ts | 125 ++++++++ .../alerting-rule-details-page.ts | 8 +- .../{ => alerts}/alerting-rule-list-page.ts | 6 +- web/cypress/views/alerts/alerts-list-page.ts | 291 ++++++++++++++++++ .../views/{ => alerts}/silence-alert-page.ts | 0 .../{ => alerts}/silence-details-page.ts | 8 +- .../views/{ => alerts}/silences-list-page.ts | 2 +- .../views/{ => incidents}/incidents-page.ts | 2 +- .../legacy-dashboards.ts | 4 +- web/cypress/views/{ => metrics}/metrics.ts | 4 +- .../perses-dashboards-create-dashboard.ts | 5 +- .../perses-dashboards-edit-datasources.ts | 4 +- .../perses-dashboards-edit-variables.ts | 4 +- .../perses-dashboards-import-dashboard.ts | 2 +- .../perses-dashboards-list-dashboards.ts | 6 +- .../perses-dashboards-panel.ts | 4 +- .../perses-dashboards-panelgroup.ts | 4 +- .../perses-dashboards.ts | 8 +- web/cypress/views/{ => shared}/common.ts | 4 +- .../views/{ => shared}/details-page.ts | 0 web/cypress/views/{ => shared}/list-page.ts | 0 web/cypress/views/{ => shared}/nav.ts | 0 .../views/{ => shared}/operator-hub-page.ts | 2 +- .../views/{ => shared}/overview-page.ts | 0 web/cypress/views/{ => shared}/tour.ts | 0 .../{ => shared}/troubleshooting-panel.ts | 0 web/cypress/views/{ => shared}/utils.ts | 0 96 files changed, 834 insertions(+), 413 deletions(-) rename web/cypress/views/{ => alerts}/acm-alerting-page.ts (100%) create mode 100644 web/cypress/views/alerts/alert-and-silence-details-page.ts rename web/cypress/views/{ => alerts}/alerting-rule-details-page.ts (90%) rename web/cypress/views/{ => alerts}/alerting-rule-list-page.ts (91%) create mode 100644 web/cypress/views/alerts/alerts-list-page.ts rename web/cypress/views/{ => alerts}/silence-alert-page.ts (100%) rename web/cypress/views/{ => alerts}/silence-details-page.ts (90%) rename web/cypress/views/{ => alerts}/silences-list-page.ts (98%) rename web/cypress/views/{ => incidents}/incidents-page.ts (99%) rename web/cypress/views/{ => legacy-dashboards}/legacy-dashboards.ts (98%) rename web/cypress/views/{ => metrics}/metrics.ts (99%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards-create-dashboard.ts (96%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards-edit-datasources.ts (98%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards-edit-variables.ts (99%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards-import-dashboard.ts (99%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards-list-dashboards.ts (98%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards-panel.ts (99%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards-panelgroup.ts (98%) rename web/cypress/views/{ => perses-dashboards}/perses-dashboards.ts (99%) rename web/cypress/views/{ => shared}/common.ts (95%) rename web/cypress/views/{ => shared}/details-page.ts (100%) rename web/cypress/views/{ => shared}/list-page.ts (100%) rename web/cypress/views/{ => shared}/nav.ts (100%) rename web/cypress/views/{ => shared}/operator-hub-page.ts (95%) rename web/cypress/views/{ => shared}/overview-page.ts (100%) rename web/cypress/views/{ => shared}/tour.ts (100%) rename web/cypress/views/{ => shared}/troubleshooting-panel.ts (100%) rename web/cypress/views/{ => shared}/utils.ts (100%) diff --git a/.cursor/commands/generate-regression-test.md b/.cursor/commands/generate-regression-test.md index 3462a99ed..dc36c2876 100644 --- a/.cursor/commands/generate-regression-test.md +++ b/.cursor/commands/generate-regression-test.md @@ -92,7 +92,7 @@ Generate automated regression tests from test documentation in [`docs/incident_d Verifies: OU-XXX */ -import { incidentsPage } from "../../../views/incidents-page"; +import { incidentsPage } from "../../../views/incidents/incidents-page"; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, @@ -532,7 +532,7 @@ Tests both incidents chart and alerts chart tooltip behavior. Verifies: OU-XXX */ -import { incidentsPage } from "../../../views/incidents-page"; +import { incidentsPage } from "../../../views/incidents/incidents-page"; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, diff --git a/.cursor/rules/incidents-testing-guidelines.mdc b/.cursor/rules/incidents-testing-guidelines.mdc index 8b564040c..878758783 100644 --- a/.cursor/rules/incidents-testing-guidelines.mdc +++ b/.cursor/rules/incidents-testing-guidelines.mdc @@ -3,7 +3,7 @@ alwaysApply: true description: "Development guidelines for Incidents page Cypress tests" globs: - "web/cypress/e2e/incidents/**/*.cy.ts" - - "web/cypress/views/incidents-page.ts" + - "web/cypress/views/incidents/incidents-page.ts" - "web/cypress/fixtures/incidents/scenarios/**/*.yaml" --- @@ -99,7 +99,7 @@ Additional context about the bug or behavior. Verifies: OU-XXX */ -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR } from "../../../support/operators"; describe('Regression:
', () => { @@ -296,7 +296,7 @@ cy.mockIncidents([]); ### Imports ```typescript // Always import from relative path -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; // Import types when needed import { IncidentDefinition } from '../../support/incidents'; diff --git a/docs/incident_detection/tests/performance/03.endurance_test_source.md b/docs/incident_detection/tests/performance/03.endurance_test_source.md index 282bcde15..f35ee2a1f 100644 --- a/docs/incident_detection/tests/performance/03.endurance_test_source.md +++ b/docs/incident_detection/tests/performance/03.endurance_test_source.md @@ -7,7 +7,7 @@ Shelved due to Cypress DOM snapshot accumulation causing ~10x degradation over 1 **To re-enable:** save the code block below as `web/cypress/e2e/incidents/performance/03.performance_endurance.cy.ts`. ```typescript -import { incidentsPage } from "../../../views/incidents-page"; +import { incidentsPage } from "../../../views/incidents/incidents-page"; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, diff --git a/web/cypress/e2e/alerts/alerts_acm.cy.ts b/web/cypress/e2e/alerts/alerts_acm.cy.ts index cb87a779e..81d810d8d 100644 --- a/web/cypress/e2e/alerts/alerts_acm.cy.ts +++ b/web/cypress/e2e/alerts/alerts_acm.cy.ts @@ -1,17 +1,16 @@ // E2E test for validating ACM Alerting UI integration with Cluster Observability Operator (COO) import '../../support/shared/commands/auth-commands'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; -import { acmAlertingPage } from '../../views/acm-alerting-page'; - -import { troubleshootingPanelPage } from 'cypress/views/troubleshooting-panel'; -import { incidentsPage } from 'cypress/views/incidents-page'; -import { runAllRegressionFleetManagementAlertsTests } from 'cypress/support/monitoring/01.reg_alerts.cy'; -import { listPage } from 'cypress/views/list-page'; +import { troubleshootingPanelPage } from '../../views/shared/troubleshooting-panel'; +import { incidentsPage } from '../../views/incidents/incidents-page'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../support/shared/operators'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; +import { acmAlertingPage } from '../../views/alerts/acm-alerting-page'; +import { runAllRegressionFleetManagementAlertsTests } from '../../support/alerts/alerts_regressions.cy'; +import { listPage } from '../../views/shared/list-page'; const expectedAlerts = ['Watchdog', 'Watchdog-spoke', 'ClusterCPUHealth-jb']; @@ -65,6 +64,6 @@ describe('ACM Alerting UI', { tags: ['@alerting', '@acm-alerting'] }, () => { runAllRegressionFleetManagementAlertsTests({ name: 'Fleet management', alertName: 'Watchdog-spoke', - alertNamespace: `${MP.namespace}`, + alertNamespace: `${CLUSTER_MONITORING_OPERATOR.namespace}`, }); }); diff --git a/web/cypress/e2e/alerts/alerts_bvt.cy.ts b/web/cypress/e2e/alerts/alerts_bvt.cy.ts index 42193caa3..0d1759f42 100644 --- a/web/cypress/e2e/alerts/alerts_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_bvt.cy.ts @@ -1,7 +1,7 @@ -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { runBVTMonitoringTestsNamespace } from '../../support/alerts/alerts_bvt_namespaced.cy'; -import { commonPages } from '../../views/common'; +import { commonPages } from '../../views/shared/common'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; describe('BVT: Monitoring - Namespaced', { tags: ['@alerting', '@metrics'] }, () => { diff --git a/web/cypress/e2e/alerts/alerts_ivt.cy.ts b/web/cypress/e2e/alerts/alerts_ivt.cy.ts index 735db0a6b..5d9a953d0 100644 --- a/web/cypress/e2e/alerts/alerts_ivt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_ivt.cy.ts @@ -5,9 +5,9 @@ import { } from '../../support/shared/operators'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { runAllRegressionAlertsTests } from '../../support/alerts/alerts_regressions.cy'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; -import { guidedTour } from '../../views/tour'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; +import { guidedTour } from '../../views/shared/tour'; describe( 'Regression: Monitoring - Alerts (Virtualization)', diff --git a/web/cypress/e2e/alerts/alerts_regression.cy.ts b/web/cypress/e2e/alerts/alerts_regression.cy.ts index f5e0c8a7e..603877725 100644 --- a/web/cypress/e2e/alerts/alerts_regression.cy.ts +++ b/web/cypress/e2e/alerts/alerts_regression.cy.ts @@ -1,8 +1,8 @@ import { runAllRegressionCorePlatformAlertsTests } from '../../support/alerts/alerts_regressions.cy'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { runAllRegressionAlertsTestsNamespace } from '../../support/alerts/alerts_regressions_namespaced.cy'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; // Test suite for Core platform perspective diff --git a/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts index 8acfb7e75..41ad4bf53 100644 --- a/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts @@ -1,9 +1,9 @@ import { runBVTAlertsTests } from '../../support/alerts/alerts_bvt.cy'; -import { guidedTour } from '../../views/tour'; +import { guidedTour } from '../../views/shared/tour'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { nav } from '../../views/nav'; -import { commonPages } from '../../views/common'; -import { troubleshootingPanelPage } from 'cypress/views/troubleshooting-panel'; +import { nav } from '../../views/shared/nav'; +import { commonPages } from '../../views/shared/common'; +import { troubleshootingPanelPage } from 'cypress/views/shared/troubleshooting-panel'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, diff --git a/web/cypress/e2e/incidents/incidents_bvt.cy.ts b/web/cypress/e2e/incidents/incidents_bvt.cy.ts index b6844dc1b..dcef6b900 100644 --- a/web/cypress/e2e/incidents/incidents_bvt.cy.ts +++ b/web/cypress/e2e/incidents/incidents_bvt.cy.ts @@ -11,7 +11,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../support/shared/operators'; -import { incidentsPage } from '../../views/incidents-page'; +import { incidentsPage } from '../../views/incidents/incidents-page'; describe('BVT: Incidents - UI', { tags: ['@cluster-health-analyzer'] }, () => { before(() => { diff --git a/web/cypress/e2e/incidents/incidents_e2e.cy.ts b/web/cypress/e2e/incidents/incidents_e2e.cy.ts index 70d2ec3ac..28055fc35 100644 --- a/web/cypress/e2e/incidents/incidents_e2e.cy.ts +++ b/web/cypress/e2e/incidents/incidents_e2e.cy.ts @@ -6,7 +6,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../support/shared/operators'; -import { incidentsPage } from '../../views/incidents-page'; +import { incidentsPage } from '../../views/incidents/incidents-page'; describe('BVT: Incidents - e2e', { tags: ['@slow', '@cluster-health-analyzer'] }, () => { let currentAlertName: string; diff --git a/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts b/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts index a66a678e1..0c76a4c58 100644 --- a/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts +++ b/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts @@ -11,7 +11,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../support/shared/operators'; -import { incidentsPage } from '../../views/incidents-page'; +import { incidentsPage } from '../../views/incidents/incidents-page'; describe('Incidents - Mocking Examples', { tags: ['@cluster-health-analyzer'] }, () => { before(() => { diff --git a/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts index 536c7d5ee..fdde705b6 100644 --- a/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts +++ b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts @@ -14,7 +14,7 @@ median observed time. Verifies: OBSINTA-1006 */ -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; import { BenchmarkCollector } from '../../../support/shared/commands/benchmark-utils'; import { CLUSTER_MONITORING_OPERATOR, diff --git a/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts b/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts index d162e1b03..b92556664 100644 --- a/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts +++ b/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts @@ -8,7 +8,7 @@ this test measures incremental re-render cost during a realistic user session. Verifies: OBSINTA-1006 */ -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; import { BenchmarkCollector } from '../../../support/shared/commands/benchmark-utils'; import { CLUSTER_MONITORING_OPERATOR, diff --git a/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts b/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts index e661abd32..fd287fb86 100644 --- a/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts +++ b/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts @@ -21,7 +21,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../../support/shared/operators'; -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; describe( 'Regression: Time-Based Alert Resolution (E2E with Firing Alerts)', diff --git a/web/cypress/e2e/incidents/regression/filtering.cy.ts b/web/cypress/e2e/incidents/regression/filtering.cy.ts index 6eb454c04..e3729767d 100644 --- a/web/cypress/e2e/incidents/regression/filtering.cy.ts +++ b/web/cypress/e2e/incidents/regression/filtering.cy.ts @@ -12,7 +12,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../../support/shared/operators'; -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; describe('Regression: Incidents Filtering', { tags: ['@cluster-health-analyzer'] }, () => { before(() => { diff --git a/web/cypress/e2e/incidents/regression/interval.cy.ts b/web/cypress/e2e/incidents/regression/interval.cy.ts index b40e2697d..fbc728620 100644 --- a/web/cypress/e2e/incidents/regression/interval.cy.ts +++ b/web/cypress/e2e/incidents/regression/interval.cy.ts @@ -15,7 +15,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../../support/shared/operators'; -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; describe( 'Regression: Mixed Severity Interval Boundary Times', diff --git a/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts b/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts index 4b3e34a8f..ed4905cf1 100644 --- a/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts +++ b/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts @@ -17,8 +17,8 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../../support/shared/operators'; -import { incidentsPage } from '../../../views/incidents-page'; -import { nav } from '../../../views/nav'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; +import { nav } from '../../../views/shared/nav'; describe( 'Regression: Silences Not Applied Correctly', diff --git a/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts b/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts index 7ba61a874..d14535b06 100644 --- a/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts +++ b/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts @@ -15,7 +15,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../../support/shared/operators'; -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; const MAX_GAP_STANDARD = 250; const MAX_GAP_RELAXED = 500; diff --git a/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts b/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts index 5bbae7da8..200d7a1c7 100644 --- a/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts +++ b/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts @@ -17,7 +17,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../../support/shared/operators'; -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; describe('Regression: Redux State Management', { tags: ['@cluster-health-analyzer'] }, () => { before(() => { diff --git a/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts b/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts index 4046992ea..e342fe2c0 100644 --- a/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts +++ b/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts @@ -14,7 +14,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../../support/shared/operators'; -import { incidentsPage } from '../../../views/incidents-page'; +import { incidentsPage } from '../../../views/incidents/incidents-page'; const ARROW_HEIGHT = 12; const ALLOWED_MARGIN = 8; 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 f8465e5ec..55d5a0e09 100644 --- a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts @@ -1,8 +1,8 @@ import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; import { runAllRegressionLegacyDashboardsTests } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; // Test suite for Administrator perspective describe( diff --git a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts index 79d25c377..ccdc70ce5 100644 --- a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_virtualization_regression.cy.ts @@ -5,9 +5,9 @@ import { } from '../../support/shared/operators'; import { runAllRegressionLegacyDashboardsTests } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; -import { guidedTour } from '../../views/tour'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; +import { guidedTour } from '../../views/shared/tour'; describe( 'Regression: Monitoring - Legacy Dashboards (Virtualization)', diff --git a/web/cypress/e2e/metrics/metrics_regression.cy.ts b/web/cypress/e2e/metrics/metrics_regression.cy.ts index 1a9e4af1a..107630bb8 100644 --- a/web/cypress/e2e/metrics/metrics_regression.cy.ts +++ b/web/cypress/e2e/metrics/metrics_regression.cy.ts @@ -6,8 +6,8 @@ import { runAllRegressionMetricsTestsNamespace1, runAllRegressionMetricsTestsNamespace2, } from '../../support/metrics/metrics_regressions_namespaced.cy'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; // Test suite for Administrator perspective diff --git a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts index 1a0151f64..489268fc3 100644 --- a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts +++ b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts @@ -7,9 +7,9 @@ import { runAllRegressionMetricsTestsNamespace1, runAllRegressionMetricsTestsNamespace2, } from '../../support/metrics/metrics_regressions_namespaced.cy'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; -import { guidedTour } from '../../views/tour'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; +import { guidedTour } from '../../views/shared/tour'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, diff --git a/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts b/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts index a9c1a90d9..19469327c 100644 --- a/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts +++ b/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts @@ -1,9 +1,9 @@ import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; -import { nav } from '../../views/nav'; -import { commonPages } from '../../views/common'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; +import { nav } from '../../views/shared/nav'; +import { commonPages } from '../../views/shared/common'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-create-dashboard'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; import { persesMUIDataTestIDs } from '@/shared/constants/data-test'; const PROMPT = 'visualize CPU consumption in the openshift-monitoring namespace in last 2 hours'; diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts index 92e7dde5c..6f4af8bc6 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; //TODO: rename after customizable-dashboards gets merged import { runBVTCOOPersesTests1 } from '../../support/perses/perses_bvt_admin.cy'; import { diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts index 2583d83ab..8c2bc6e08 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; import { runCOOCreatePersesTests } from '../../support/perses/perses_create_admin.cy'; import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts index 9f376e11f..fe7b2b51c 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts @@ -7,7 +7,7 @@ import { TEMPO_OPERATOR, } from '../../support/shared/operators'; import { runCOOCreateImportPersesTests } from '../../support/perses/perses_create_import_admin.cy'; -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; describe( 'COO - Dashboards (Perses) - Perses Global Datasources with Tempo and Loki', diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts index c58c42317..0d5e70545 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; import { runCOOEditPersesTests1 } from '../../support/perses/perses_edit_admin_1.cy'; import { runCOOEditPersesTests } from '../../support/perses/perses_edit_admin.cy'; import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts index dfdc41bdd..610d6c3f4 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; import { runCOOImportPersesTests } from '../../support/perses/perses_import_admin.cy'; import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts index 80096863d..32c2b19b4 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; import { runCOOListPersesDuplicateDashboardTests, runCOOListPersesTests, diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts index 29859d643..86ccf936b 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_virtualization_ivt.cy.ts @@ -1,8 +1,8 @@ // Not finished -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; import { runBVTCOOPersesTests1 } from '../../support/perses/perses_bvt_admin.cy'; -import { guidedTour } from '../../views/tour'; -import { commonPages } from '../../views/common'; +import { guidedTour } from '../../views/shared/tour'; +import { commonPages } from '../../views/shared/common'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, diff --git a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user1.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user1.cy.ts index 97f909132..ccbf466e8 100644 --- a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user1.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user1.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../../views/nav'; +import { nav } from '../../../views/shared/nav'; import { runCOORBACPersesTestsDevUser1 } from '../../../support/perses/rbac/perses_user1.cy'; import { CLUSTER_MONITORING_OPERATOR, diff --git a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user2.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user2.cy.ts index df950c61d..0e9487c82 100644 --- a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user2.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user2.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../../views/nav'; +import { nav } from '../../../views/shared/nav'; import { runCOORBACPersesTestsDevUser2 } from '../../../support/perses/rbac/perses_user2.cy'; import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user3.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user3.cy.ts index f2ec5f736..85f5838ad 100644 --- a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user3.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user3.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../../views/nav'; +import { nav } from '../../../views/shared/nav'; import { runCOORBACPersesTestsDevUser3 } from '../../../support/perses/rbac/perses_user3.cy'; import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user4.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user4.cy.ts index 32f656361..b46b25c21 100644 --- a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user4.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user4.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../../views/nav'; +import { nav } from '../../../views/shared/nav'; import { runCOORBACPersesTestsDevUser4 } from '../../../support/perses/rbac/perses_user4.cy'; import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user5.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user5.cy.ts index 181d5b3e3..53828b324 100644 --- a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user5.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user5.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../../views/nav'; +import { nav } from '../../../views/shared/nav'; import { runCOORBACPersesTestsDevUser5 } from '../../../support/perses/rbac/perses_user5.cy'; import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user6.cy.ts b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user6.cy.ts index 0fca9af51..3399ed84f 100644 --- a/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user6.cy.ts +++ b/web/cypress/e2e/perses-dashboards/rbac/perses_dashboards_user6.cy.ts @@ -1,4 +1,4 @@ -import { nav } from '../../../views/nav'; +import { nav } from '../../../views/shared/nav'; import { runCOORBACPersesTestsDevUser6 } from '../../../support/perses/rbac/perses_user6.cy'; import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; diff --git a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts index 4d8eab2d7..ccb5b1b03 100644 --- a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts +++ b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts @@ -1,8 +1,8 @@ -import { nav } from '../../views/nav'; +import { nav } from '../../views/shared/nav'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { runBVTAlertsTests } from '../../support/alerts/alerts_bvt.cy'; -import { commonPages } from '../../views/common'; -import { overviewPage } from '../../views/overview-page'; +import { commonPages } from '../../views/shared/common'; +import { overviewPage } from '../../views/shared/overview-page'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; describe( diff --git a/web/cypress/e2e/shared/coo_submenus.cy.ts b/web/cypress/e2e/shared/coo_submenus.cy.ts index be38aa8f5..addba9721 100644 --- a/web/cypress/e2e/shared/coo_submenus.cy.ts +++ b/web/cypress/e2e/shared/coo_submenus.cy.ts @@ -2,9 +2,9 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, } from '../../support/shared/operators'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; -import { troubleshootingPanelPage } from '../../views/troubleshooting-panel'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; +import { troubleshootingPanelPage } from '../../views/shared/troubleshooting-panel'; describe( 'BVT: COO', diff --git a/web/cypress/support/alerts/alerts_bvt.cy.ts b/web/cypress/support/alerts/alerts_bvt.cy.ts index c6efd2bfb..d47c3ec85 100644 --- a/web/cypress/support/alerts/alerts_bvt.cy.ts +++ b/web/cypress/support/alerts/alerts_bvt.cy.ts @@ -1,18 +1,18 @@ -import { commonPages } from '../../views/common'; -import { detailsPage } from '../../views/details-page'; -import { listPage } from '../../views/list-page'; -import { silenceAlertPage } from '../../views/silence-alert-page'; -import { nav } from '../../views/nav'; -import { silenceDetailsPage } from '../../views/silence-details-page'; -import { silencesListPage } from '../../views/silences-list-page'; -import { getValFromElement } from '../../views/utils'; +import { commonPages } from '../../views/shared/common'; +import { alertAndSilencesDetailsPage } from '../../views/alerts/alert-and-silence-details-page'; +import { alertsListPage } from '../../views/alerts/alerts-list-page'; +import { silenceAlertPage } from '../../views/alerts/silence-alert-page'; +import { nav } from '../../views/shared/nav'; +import { silenceDetailsPage } from '../../views/alerts/silence-details-page'; +import { silencesListPage } from '../../views/alerts/silences-list-page'; +import { getValFromElement } from '../../views/shared/utils'; import { AlertsAlertState, SilenceComment, SilenceState, WatchdogAlert, } from '../../fixtures/shared/cluster-monitoring-operator/constants'; -import { alertingRuleListPage } from '../../views/alerting-rule-list-page'; +import { alertingRuleListPage } from '../../views/alerts/alerting-rule-list-page'; export interface PerspectiveConfig { name: string; @@ -30,29 +30,29 @@ export function testBVTAlerts(perspective: PerspectiveConfig) { () => { cy.log('5.1. use sidebar nav to go to Observe > Alerting'); commonPages.titleShouldHaveText('Alerting'); - listPage.tabShouldHaveText('Alerts'); - listPage.tabShouldHaveText('Silences'); - listPage.tabShouldHaveText('Alerting rules'); + alertsListPage.tabShouldHaveText('Alerts'); + alertsListPage.tabShouldHaveText('Silences'); + alertsListPage.tabShouldHaveText('Alerting rules'); commonPages.linkShouldExist('Export as CSV'); commonPages.linkShouldExist('Clear all filters'); - listPage.ARRows.shouldBeLoaded(); + alertsListPage.ARRows.shouldBeLoaded(); cy.log('5.2. filter Alerts and click on Alert'); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); - listPage.ARRows.ARShouldBe( + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); + alertsListPage.ARRows.ARShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, 'Firing', ); - listPage.ARRows.expandRow(); - listPage.ARRows.AShouldBe( + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.AShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, `${WatchdogAlert.NAMESPACE}`, ); - listPage.ARRows.clickAlert(); + alertsListPage.ARRows.clickAlert(); cy.log('5.3. click on Alert Details Page'); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); @@ -68,7 +68,7 @@ export function testBVTAlerts(perspective: PerspectiveConfig) { }); cy.log('5.4. click on Alert Rule link'); - detailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`); + alertAndSilencesDetailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); commonPages.detailsPage.alertRule(); commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`); @@ -80,13 +80,13 @@ export function testBVTAlerts(perspective: PerspectiveConfig) { }); cy.log('5.5. click on Alert Details Page'); - detailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`); + alertAndSilencesDetailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`); commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`); cy.log('5.6. click on Inspect on Alert Details Page'); - detailsPage.clickInspectAlertPage(); + alertAndSilencesDetailsPage.clickInspectAlertPage(); cy.log('5.7. Metrics page is loaded'); commonPages.titleShouldHaveText('Metrics'); @@ -103,13 +103,13 @@ export function testBVTAlerts(perspective: PerspectiveConfig) { it(`${perspective.name} perspective - Creates and expires a Silence`, () => { cy.log('6.1 filter to Watchdog alert'); nav.tabs.switchTab('Alerts'); - listPage.ARRows.shouldBeLoaded(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); + alertsListPage.ARRows.shouldBeLoaded(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); cy.log('6.2 silence alert'); - listPage.ARRows.expandRow(); - listPage.ARRows.silenceAlert(); + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.silenceAlert(); cy.log('6.3 silence alert page'); commonPages.titleShouldHaveText('Silence alert'); @@ -165,23 +165,23 @@ export function testBVTAlerts(perspective: PerspectiveConfig) { cy.log('6.5 Click on Firing alerts'); silenceDetailsPage.clickOnFiringAlerts(`${WatchdogAlert.ALERTNAME}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); - detailsPage.sectionHeaderShouldExist('Alert details'); - detailsPage.labelShouldExist('alertname=Watchdog'); + alertAndSilencesDetailsPage.sectionHeaderShouldExist('Alert details'); + alertAndSilencesDetailsPage.labelShouldExist('alertname=Watchdog'); cy.log('6.6 Click on Silenced by'); - detailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); + alertAndSilencesDetailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); - detailsPage.sectionHeaderShouldExist('Silence details'); - detailsPage.labelShouldExist('alertname=Watchdog'); + alertAndSilencesDetailsPage.sectionHeaderShouldExist('Silence details'); + alertAndSilencesDetailsPage.labelShouldExist('alertname=Watchdog'); cy.log('6.7 shows the silenced Alert in the Silenced Alerts list'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Silences'); silencesListPage.shouldBeLoaded(); - listPage.filter.removeIndividualTag(SilenceState.ACTIVE); - listPage.filter.removeIndividualTag(SilenceState.PENDING); + alertsListPage.filter.removeIndividualTag(SilenceState.ACTIVE); + alertsListPage.filter.removeIndividualTag(SilenceState.PENDING); silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); silencesListPage.rows.shouldBe(`${WatchdogAlert.ALERTNAME}`, SilenceState.ACTIVE); cy.log('6.8 verify on Alerting Rules list page again'); @@ -197,10 +197,10 @@ export function testBVTAlerts(perspective: PerspectiveConfig) { cy.log('6.9 verify on Alerts list page again'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); - listPage.filter.clearAllFilters(); - listPage.filter.selectFilterOption('Alert State', AlertsAlertState.SILENCED); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.ARShouldBe( + alertsListPage.filter.clearAllFilters(); + alertsListPage.filter.selectFilterOption('Alert State', AlertsAlertState.SILENCED); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.ARShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, @@ -208,16 +208,16 @@ export function testBVTAlerts(perspective: PerspectiveConfig) { ); cy.log('6.10 expires the Silence'); - listPage.ARRows.expandRow(); - listPage.ARRows.clickAlert(); - detailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.clickAlert(); + alertAndSilencesDetailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); silenceDetailsPage.expireSilence(true, true); cy.log('6.11 verify on Alerts list page again'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); - listPage.filter.clearAllFilters(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.ARShouldBe( + alertsListPage.filter.clearAllFilters(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.ARShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, diff --git a/web/cypress/support/alerts/alerts_bvt_namespaced.cy.ts b/web/cypress/support/alerts/alerts_bvt_namespaced.cy.ts index 37c9c763e..708b1ff33 100644 --- a/web/cypress/support/alerts/alerts_bvt_namespaced.cy.ts +++ b/web/cypress/support/alerts/alerts_bvt_namespaced.cy.ts @@ -1,18 +1,18 @@ -import { commonPages } from '../../views/common'; -import { detailsPage } from '../../views/details-page'; -import { listPage } from '../../views/list-page'; -import { silenceAlertPage } from '../../views/silence-alert-page'; -import { nav } from '../../views/nav'; -import { silenceDetailsPage } from '../../views/silence-details-page'; -import { silencesListPage } from '../../views/silences-list-page'; -import { getValFromElement } from '../../views/utils'; +import { commonPages } from '../../views/shared/common'; +import { alertAndSilencesDetailsPage } from '../../views/alerts/alert-and-silence-details-page'; +import { alertsListPage } from '../../views/alerts/alerts-list-page'; +import { silenceAlertPage } from '../../views/alerts/silence-alert-page'; +import { nav } from '../../views/shared/nav'; +import { silenceDetailsPage } from '../../views/alerts/silence-details-page'; +import { silencesListPage } from '../../views/alerts/silences-list-page'; +import { getValFromElement } from '../../views/shared/utils'; import { AlertsAlertState, SilenceComment, SilenceState, WatchdogAlert, } from '../../fixtures/shared/cluster-monitoring-operator/constants'; -import { alertingRuleListPage } from '../../views/alerting-rule-list-page'; +import { alertingRuleListPage } from '../../views/alerts/alerting-rule-list-page'; export interface PerspectiveConfig { name: string; @@ -30,29 +30,29 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) () => { cy.log('4.1. use sidebar nav to go to Observe > Alerting'); commonPages.titleShouldHaveText('Alerting'); - listPage.tabShouldHaveText('Alerts'); - listPage.tabShouldHaveText('Silences'); - listPage.tabShouldHaveText('Alerting rules'); + alertsListPage.tabShouldHaveText('Alerts'); + alertsListPage.tabShouldHaveText('Silences'); + alertsListPage.tabShouldHaveText('Alerting rules'); commonPages.linkShouldExist('Export as CSV'); commonPages.linkShouldExist('Clear filters'); - listPage.ARRows.shouldBeLoaded(); + alertsListPage.ARRows.shouldBeLoaded(); cy.log('4.2. filter Alerts and click on Alert'); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); - listPage.ARRows.ARShouldBe( + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); + alertsListPage.ARRows.ARShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, 'Firing', ); - listPage.ARRows.expandRow(); - listPage.ARRows.AShouldBe( + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.AShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, `${WatchdogAlert.NAMESPACE}`, ); - listPage.ARRows.clickAlert(); + alertsListPage.ARRows.clickAlert(); cy.log('4.3. click on Alert Details Page'); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); @@ -68,7 +68,7 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) }); cy.log('4.4. click on Alert Rule link'); - detailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`); + alertAndSilencesDetailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); commonPages.detailsPage.alertRule(); commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`); @@ -80,13 +80,13 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) }); cy.log('4.5. click on Alert Details Page'); - detailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`); + alertAndSilencesDetailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`); commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`); cy.log('4.6. click on Inspect on Alert Details Page'); - detailsPage.clickInspectAlertPage(); + alertAndSilencesDetailsPage.clickInspectAlertPage(); cy.log('4.7. Metrics page is loaded'); commonPages.titleShouldHaveText('Metrics'); @@ -103,13 +103,13 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) it(`${perspective.name} perspective - Creates and expires a Silence`, () => { cy.log('5.1 filter to Watchdog alert'); nav.tabs.switchTab('Alerts'); - listPage.ARRows.shouldBeLoaded(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); + alertsListPage.ARRows.shouldBeLoaded(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); cy.log('5.2 silence alert'); - listPage.ARRows.expandRow(); - listPage.ARRows.silenceAlert(); + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.silenceAlert(); cy.log('5.3 silence alert page'); commonPages.titleShouldHaveText('Silence alert'); @@ -173,29 +173,29 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) silenceDetailsPage.clickOnFiringAlerts(`${WatchdogAlert.ALERTNAME}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); commonPages.projectDropdownShouldNotExist(); - detailsPage.sectionHeaderShouldExist('Alert details'); - detailsPage.labelShouldExist('alertname=Watchdog'); + alertAndSilencesDetailsPage.sectionHeaderShouldExist('Alert details'); + alertAndSilencesDetailsPage.labelShouldExist('alertname=Watchdog'); cy.log('5.6 Click on Silenced by'); - detailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); + alertAndSilencesDetailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); - detailsPage.sectionHeaderShouldExist('Silence details'); - detailsPage.labelShouldExist('alertname=Watchdog'); + alertAndSilencesDetailsPage.sectionHeaderShouldExist('Silence details'); + alertAndSilencesDetailsPage.labelShouldExist('alertname=Watchdog'); cy.log('5.7 shows the silenced Alert in the Silenced Alerts list'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Silences'); silencesListPage.shouldBeLoaded(); - listPage.filter.removeIndividualTag(SilenceState.ACTIVE); - listPage.filter.removeIndividualTag(SilenceState.PENDING); + alertsListPage.filter.removeIndividualTag(SilenceState.ACTIVE); + alertsListPage.filter.removeIndividualTag(SilenceState.PENDING); silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); silencesListPage.rows.shouldBe(`${WatchdogAlert.ALERTNAME}`, SilenceState.ACTIVE); cy.log('5.8 verify on Alerting Rules list page again'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Alerting rules'); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); alertingRuleListPage.ARShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, @@ -205,10 +205,10 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) cy.log('5.9 verify on Alerts list page again'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); - listPage.filter.clearAllFilters(); - listPage.filter.selectFilterOption('Alert State', AlertsAlertState.SILENCED); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.ARShouldBe( + alertsListPage.filter.clearAllFilters(); + alertsListPage.filter.selectFilterOption('Alert State', AlertsAlertState.SILENCED); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.ARShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, @@ -216,16 +216,16 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) ); cy.log('5.10 expires the Silence'); - listPage.ARRows.expandRow(); - listPage.ARRows.clickAlert(); - detailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.clickAlert(); + alertAndSilencesDetailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`); silenceDetailsPage.expireSilence(true, true); cy.log('5.11 verify on Alerts list page again'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); - listPage.filter.clearAllFilters(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.ARShouldBe( + alertsListPage.filter.clearAllFilters(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.ARShouldBe( `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, diff --git a/web/cypress/support/alerts/alerts_regressions.cy.ts b/web/cypress/support/alerts/alerts_regressions.cy.ts index 96df29edc..8db91613a 100644 --- a/web/cypress/support/alerts/alerts_regressions.cy.ts +++ b/web/cypress/support/alerts/alerts_regressions.cy.ts @@ -1,12 +1,12 @@ -import { commonPages } from '../../views/common'; -import { detailsPage } from '../../views/details-page'; -import { listPage } from '../../views/list-page'; -import { silenceAlertPage } from '../../views/silence-alert-page'; -import { nav } from '../../views/nav'; -import { silenceDetailsPage } from '../../views/silence-details-page'; -import { silencesListPage } from '../../views/silences-list-page'; -import { alertingRuleListPage } from '../../views/alerting-rule-list-page'; -import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page'; +import { commonPages } from '../../views/shared/common'; +import { detailsPage } from '../../views/shared/details-page'; +import { alertsListPage } from '../../views/alerts/alerts-list-page'; +import { silenceAlertPage } from '../../views/alerts/silence-alert-page'; +import { nav } from '../../views/shared/nav'; +import { silenceDetailsPage } from '../../views/alerts/silence-details-page'; +import { silencesListPage } from '../../views/alerts/silences-list-page'; +import { alertingRuleListPage } from '../../views/alerts/alerting-rule-list-page'; +import { alertingRuleDetailsPage } from '../../views/alerts/alerting-rule-details-page'; import { AlertingRulesAlertState, Cluster, @@ -18,6 +18,7 @@ import { WatchdogAlert, } from '../../fixtures/shared/cluster-monitoring-operator/constants'; import { FilterOUIAIDs } from '@/shared/constants/data-test'; +import { listPage } from 'cypress/views/shared/list-page'; export interface PerspectiveConfig { name: string; @@ -376,7 +377,7 @@ export function testAlertsRegression(perspective: PerspectiveConfig) { nav.tabs.switchTab('Alerting rules'); listPage.filter.byName(`${alertName}`, FilterOUIAIDs.RuleNameFilter); alertingRuleListPage.countShouldBe(1); - listPage.filter.clearAllFilters(); + alertsListPage.filter.clearAllFilters(); cy.log('5.2 Search by Label'); listPage.filter.byLabel(`namespace=${alertNamespace}`); diff --git a/web/cypress/support/alerts/alerts_regressions_namespaced.cy.ts b/web/cypress/support/alerts/alerts_regressions_namespaced.cy.ts index 15f196ebb..81addbcb2 100644 --- a/web/cypress/support/alerts/alerts_regressions_namespaced.cy.ts +++ b/web/cypress/support/alerts/alerts_regressions_namespaced.cy.ts @@ -1,12 +1,12 @@ -import { commonPages } from '../../views/common'; -import { detailsPage } from '../../views/details-page'; -import { listPage } from '../../views/list-page'; -import { silenceAlertPage } from '../../views/silence-alert-page'; -import { nav } from '../../views/nav'; -import { silenceDetailsPage } from '../../views/silence-details-page'; -import { silencesListPage } from '../../views/silences-list-page'; -import { alertingRuleListPage } from '../../views/alerting-rule-list-page'; -import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page'; +import { commonPages } from '../../views/shared/common'; +import { alertAndSilencesDetailsPage } from '../../views/alerts/alert-and-silence-details-page'; +import { alertsListPage } from '../../views/alerts/alerts-list-page'; +import { silenceAlertPage } from '../../views/alerts/silence-alert-page'; +import { nav } from '../../views/shared/nav'; +import { silenceDetailsPage } from '../../views/alerts/silence-details-page'; +import { silencesListPage } from '../../views/alerts/silences-list-page'; +import { alertingRuleListPage } from '../../views/alerts/alerting-rule-list-page'; +import { alertingRuleDetailsPage } from '../../views/alerts/alerting-rule-details-page'; import { AlertingRulesAlertState, MainTagState, @@ -30,28 +30,28 @@ export function runAllRegressionAlertsTestsNamespace(perspective: PerspectiveCon export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { it(`${perspective.name} perspective - Alerting > Alerts page - Filtering`, () => { cy.log('1.1 Header components'); - listPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.PENDING); + alertsListPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.PENDING); // Verify Source filter does not exist in namespace view cy.byOUIAID('DataViewFilters').find('.pf-v6-c-menu-toggle').first().click(); cy.get('.pf-v6-c-menu__item').should('not.contain', 'Source'); cy.byOUIAID('DataViewFilters').find('.pf-v6-c-menu-toggle').first().click(); - listPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.SILENCED); - listPage.filter.selectFilterOption('Severity', Severity.CRITICAL); - listPage.filter.selectFilterOption('Severity', Severity.WARNING); - listPage.filter.selectFilterOption('Severity', Severity.INFO); - listPage.filter.selectFilterOption('Severity', Severity.NONE); - - listPage.filter.removeIndividualTag(AlertingRulesAlertState.FIRING); - listPage.filter.removeIndividualTag(AlertingRulesAlertState.PENDING); - listPage.filter.removeIndividualTag(AlertingRulesAlertState.SILENCED); - listPage.filter.clearAllFilters(); - - listPage.exportAsCSV(true, /openshift.csv/); - - listPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`); - listPage.filter.removeIndividualTag('alertname=' + `${WatchdogAlert.ALERTNAME}`); - listPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`); - listPage.filter.removeIndividualTag('alertname=' + `${WatchdogAlert.ALERTNAME}`); + alertsListPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.SILENCED); + alertsListPage.filter.selectFilterOption('Severity', Severity.CRITICAL); + alertsListPage.filter.selectFilterOption('Severity', Severity.WARNING); + alertsListPage.filter.selectFilterOption('Severity', Severity.INFO); + alertsListPage.filter.selectFilterOption('Severity', Severity.NONE); + + alertsListPage.filter.removeIndividualTag(AlertingRulesAlertState.FIRING); + alertsListPage.filter.removeIndividualTag(AlertingRulesAlertState.PENDING); + alertsListPage.filter.removeIndividualTag(AlertingRulesAlertState.SILENCED); + alertsListPage.filter.clearAllFilters(); + + alertsListPage.exportAsCSV(true, /openshift.csv/); + + alertsListPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`); + alertsListPage.filter.removeIndividualTag('alertname=' + `${WatchdogAlert.ALERTNAME}`); + alertsListPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`); + alertsListPage.filter.removeIndividualTag('alertname=' + `${WatchdogAlert.ALERTNAME}`); }); it(`${perspective.name} perspective - Alerting > Silences page > Create silence`, () => { @@ -83,12 +83,12 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { cy.log('3.1 use sidebar nav to go to Observe > Alerting'); cy.log('3.2 filter to Watchdog alert'); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); cy.log('3.3 silence alert'); - listPage.ARRows.expandRow(); - listPage.ARRows.silenceAlert(); + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.silenceAlert(); silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT); silenceAlertPage.clickSubmit(); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); @@ -96,22 +96,22 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { cy.log('3.4 Assert Kebab on Alert Details page'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); commonPages.titleShouldHaveText('Alerting'); - listPage.filter.clearAllFilters(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.expandRow(); - listPage.ARRows.assertNoKebab(); - listPage.ARRows.clickAlert(); + alertsListPage.filter.clearAllFilters(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.assertNoKebab(); + alertsListPage.ARRows.clickAlert(); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); - detailsPage.assertSilencedAlert(); + alertAndSilencesDetailsPage.assertSilencedAlert(); cy.log('3.5 Assert Kebab on Silence List page for Silenced alert'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Silences'); silencesListPage.shouldBeLoaded(); - listPage.filter.removeIndividualTag(SilenceState.ACTIVE); - listPage.filter.removeIndividualTag(SilenceState.PENDING); + alertsListPage.filter.removeIndividualTag(SilenceState.ACTIVE); + alertsListPage.filter.removeIndividualTag(SilenceState.PENDING); silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); silencesListPage.rows.assertSilencedAlertKebab(); cy.log('3.6 Click on Silenced alert and Assert Actions button'); @@ -129,11 +129,11 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { cy.log('3.8 Assert Kebab on Silence List page for Expired alert'); silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); silencesListPage.emptyState(); - listPage.filter.removeIndividualTag(SilenceState.ACTIVE); - listPage.filter.removeIndividualTag(SilenceState.PENDING); - listPage.filter.selectFilterOption('Silence State', SilenceState.EXPIRED); - listPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); - listPage.filter.selectFilterOption('Silence State', SilenceState.PENDING); + alertsListPage.filter.removeIndividualTag(SilenceState.ACTIVE); + alertsListPage.filter.removeIndividualTag(SilenceState.PENDING); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.EXPIRED); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.PENDING); silencesListPage.rows.assertExpiredAlertKebab('0'); cy.log('3.9 Click on Expired alert and Assert Actions button'); @@ -176,7 +176,7 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Silences'); silencesListPage.shouldBeLoaded(); - listPage.filter.removeIndividualTag(SilenceState.PENDING); + alertsListPage.filter.removeIndividualTag(SilenceState.PENDING); silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); silencesListPage.rows.editSilence(); commonPages.titleShouldHaveText('Edit silence'); @@ -213,26 +213,26 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Silences'); silencesListPage.shouldBeLoaded(); - listPage.filter.removeIndividualTag(SilenceState.ACTIVE); - listPage.filter.removeIndividualTag(SilenceState.PENDING); + alertsListPage.filter.removeIndividualTag(SilenceState.ACTIVE); + alertsListPage.filter.removeIndividualTag(SilenceState.PENDING); silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); silencesListPage.rows.expireSilence(true); cy.log('3.13 Alert Details > Silence alert button > Cancel'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); - listPage.ARRows.expandRow(); - listPage.ARRows.clickAlert(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); + alertsListPage.ARRows.expandRow(); + alertsListPage.ARRows.clickAlert(); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); - detailsPage.clickSilenceAlertButton(); + alertAndSilencesDetailsPage.clickSilenceAlertButton(); silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT); silenceAlertPage.clickCancelButton(); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); nav.sidenav.clickNavLink(['Observe', 'Alerting']); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); }, ); @@ -243,51 +243,51 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { listPage.filter.removeIndividualTag(Source.PLATFORM); cy.log('4.2 clear all filters, verify filters and tags'); - listPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.FIRING); - listPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.PENDING); - listPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.SILENCED); - listPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.NOT_FIRING); - listPage.filter.selectFilterOption('Severity', Severity.CRITICAL); - listPage.filter.selectFilterOption('Severity', Severity.WARNING); - listPage.filter.selectFilterOption('Severity', Severity.INFO); - listPage.filter.selectFilterOption('Severity', Severity.NONE); - listPage.filter.selectFilterOption('Source', Source.PLATFORM); - listPage.filter.selectFilterOption('Source', Source.USER); - - listPage.filter.clickOn1more(MainTagState.ALERT_STATE); - listPage.filter.clickOn1more(MainTagState.SEVERITY); - - listPage.filter.clickOnShowLess(MainTagState.ALERT_STATE); - listPage.filter.clickOnShowLess(MainTagState.SEVERITY); - - listPage.filter.clickOn1more(MainTagState.ALERT_STATE); - listPage.filter.clickOn1more(MainTagState.SEVERITY); - - listPage.filter.removeIndividualTag(AlertingRulesAlertState.FIRING); - listPage.filter.removeIndividualTag(AlertingRulesAlertState.PENDING); - listPage.filter.removeIndividualTag(AlertingRulesAlertState.SILENCED); - listPage.filter.removeIndividualTag(AlertingRulesAlertState.NOT_FIRING); - - listPage.filter.removeIndividualTag(Severity.CRITICAL); - listPage.filter.removeIndividualTag(Severity.WARNING); - listPage.filter.removeIndividualTag(Severity.INFO); - listPage.filter.removeIndividualTag(Severity.NONE); - listPage.filter.removeIndividualTag(Source.PLATFORM); - listPage.filter.removeIndividualTag(Source.USER); + alertsListPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.FIRING); + alertsListPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.PENDING); + alertsListPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.SILENCED); + alertsListPage.filter.selectFilterOption('Alert State', AlertingRulesAlertState.NOT_FIRING); + alertsListPage.filter.selectFilterOption('Severity', Severity.CRITICAL); + alertsListPage.filter.selectFilterOption('Severity', Severity.WARNING); + alertsListPage.filter.selectFilterOption('Severity', Severity.INFO); + alertsListPage.filter.selectFilterOption('Severity', Severity.NONE); + alertsListPage.filter.selectFilterOption('Source', Source.PLATFORM); + alertsListPage.filter.selectFilterOption('Source', Source.USER); + + alertsListPage.filter.clickOn1more(MainTagState.ALERT_STATE); + alertsListPage.filter.clickOn1more(MainTagState.SEVERITY); + + alertsListPage.filter.clickOnShowLess(MainTagState.ALERT_STATE); + alertsListPage.filter.clickOnShowLess(MainTagState.SEVERITY); + + alertsListPage.filter.clickOn1more(MainTagState.ALERT_STATE); + alertsListPage.filter.clickOn1more(MainTagState.SEVERITY); + + alertsListPage.filter.removeIndividualTag(AlertingRulesAlertState.FIRING); + alertsListPage.filter.removeIndividualTag(AlertingRulesAlertState.PENDING); + alertsListPage.filter.removeIndividualTag(AlertingRulesAlertState.SILENCED); + alertsListPage.filter.removeIndividualTag(AlertingRulesAlertState.NOT_FIRING); + + alertsListPage.filter.removeIndividualTag(Severity.CRITICAL); + alertsListPage.filter.removeIndividualTag(Severity.WARNING); + alertsListPage.filter.removeIndividualTag(Severity.INFO); + alertsListPage.filter.removeIndividualTag(Severity.NONE); + alertsListPage.filter.removeIndividualTag(Source.PLATFORM); + alertsListPage.filter.removeIndividualTag(Source.USER); alertingRuleListPage.filter.assertNoClearAllFilters(); cy.log('4.3 Search by Name'); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`, FilterOUIAIDs.RuleNameFilter); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`, FilterOUIAIDs.RuleNameFilter); alertingRuleListPage.countShouldBe(1); - listPage.filter.clearAllFilters(); + alertsListPage.filter.clearAllFilters(); cy.log('4.4 Search by Label'); - listPage.filter.byLabel(`namespace=${WatchdogAlert.NAMESPACE}`); - listPage.filter.clearAllFilters(); + alertsListPage.filter.byLabel(`namespace=${WatchdogAlert.NAMESPACE}`); + alertsListPage.filter.clearAllFilters(); cy.log('4.5 Search by Name and see details'); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`, FilterOUIAIDs.RuleNameFilter); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`, FilterOUIAIDs.RuleNameFilter); alertingRuleListPage.countShouldBe(1); alertingRuleListPage.clickAlertingRule(`${WatchdogAlert.ALERTNAME}`); alertingRuleDetailsPage.assertAlertingRuleDetailsPage(`${WatchdogAlert.ALERTNAME}`); @@ -301,8 +301,8 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { cy.log('4.7 Alerting rule details > Assert Kebab'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Alerting rules'); - listPage.filter.clearAllFilters(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`, FilterOUIAIDs.RuleNameFilter); + alertsListPage.filter.clearAllFilters(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`, FilterOUIAIDs.RuleNameFilter); alertingRuleListPage.clickAlertingRule(`${WatchdogAlert.ALERTNAME}`); alertingRuleDetailsPage.assertNoKebab(); @@ -310,17 +310,17 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) { nav.sidenav.clickNavLink(['Observe', 'Alerting']); nav.tabs.switchTab('Silences'); silencesListPage.shouldBeLoaded(); - listPage.filter.removeIndividualTag(SilenceState.ACTIVE); - listPage.filter.removeIndividualTag(SilenceState.PENDING); + alertsListPage.filter.removeIndividualTag(SilenceState.ACTIVE); + alertsListPage.filter.removeIndividualTag(SilenceState.PENDING); silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); + alertsListPage.filter.selectFilterOption('Silence State', SilenceState.ACTIVE); silencesListPage.rows.expireSilence(true); }); it(`${perspective.name} perspective - Alerting > Empty state`, () => { cy.log('5.1 Empty state'); cy.changeNamespace('default'); - listPage.emptyState(); + alertsListPage.emptyState(); nav.tabs.switchTab('Silences'); silencesListPage.firstTimeEmptyState(); }); diff --git a/web/cypress/support/incidents/prometheus-mocks.ts b/web/cypress/support/incidents/prometheus-mocks.ts index eb9872db6..c2c69debf 100644 --- a/web/cypress/support/incidents/prometheus-mocks.ts +++ b/web/cypress/support/incidents/prometheus-mocks.ts @@ -1,7 +1,7 @@ import { IncidentDefinition, IncidentScenarioFixture, PrometheusResponse } from './types'; import { createAlertDetailsMock, createIncidentMock } from './mock-generators'; import { convertFixtureToIncidents, parseYamlFixture } from './schema/fixture-converter'; -import { incidentsPage } from '../../views/incidents-page'; +import { incidentsPage } from '../../views/incidents/incidents-page'; declare global { // eslint-disable-next-line @typescript-eslint/no-namespace diff --git a/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions.cy.ts b/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions.cy.ts index 00ee44a9d..884aeb2b2 100644 --- a/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions.cy.ts +++ b/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions.cy.ts @@ -1,16 +1,16 @@ -import { nav } from '../../views/nav'; -import { legacyDashboardsPage } from '../../views/legacy-dashboards'; +import { nav } from '../../views/shared/nav'; +import { legacyDashboardsPage } from '../../views/legacy-dashboards/legacy-dashboards'; import { LegacyDashboardsDashboardDropdown, MetricsPageQueryInput, WatchdogAlert, } from '../../fixtures/shared/cluster-monitoring-operator/constants'; import { Classes, DataTestIDs, LegacyDashboardPageTestIDs } from '@/shared/constants/data-test'; -import { metricsPage } from '../../views/metrics'; -import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page'; +import { metricsPage } from '../../views/metrics/metrics'; +import { alertingRuleDetailsPage } from '../../views/alerts/alerting-rule-details-page'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { listPage } from '../../views/list-page'; -import { commonPages } from '../../views/common'; +import { alertsListPage } from '../../views/alerts/alerts-list-page'; +import { commonPages } from '../../views/shared/common'; export interface PerspectiveConfig { name: string; @@ -103,9 +103,9 @@ export function testLegacyDashboardsRegression(perspective: PerspectiveConfig) { nav.sidenav.clickNavLink(['Observe', 'Alerting']); commonPages.titleShouldHaveText('Alerting'); alerts.interceptWatchdogAlert(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); - listPage.ARRows.clickAlertingRule(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); + alertsListPage.ARRows.clickAlertingRule(); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); alertingRuleDetailsPage.clickHideGraphButton(); cy.byTestID(DataTestIDs.MetricGraph).should('not.exist'); diff --git a/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy.ts b/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy.ts index 76a268ffb..1955a6c8c 100644 --- a/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy.ts +++ b/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy.ts @@ -1,16 +1,16 @@ -import { nav } from '../../views/nav'; -import { legacyDashboardsPage } from '../../views/legacy-dashboards'; +import { nav } from '../../views/shared/nav'; +import { legacyDashboardsPage } from '../../views/legacy-dashboards/legacy-dashboards'; import { LegacyDashboardsDashboardDropdownNamespace, MetricsPageQueryInputByNamespace, WatchdogAlert, } from '../../fixtures/shared/cluster-monitoring-operator/constants'; import { Classes, DataTestIDs, LegacyDashboardPageTestIDs } from '@/shared/constants/data-test'; -import { metricsPage } from '../../views/metrics'; -import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page'; +import { metricsPage } from '../../views/metrics/metrics'; +import { alertingRuleDetailsPage } from '../../views/alerts/alerting-rule-details-page'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { listPage } from '../../views/list-page'; -import { commonPages } from '../../views/common'; +import { alertsListPage } from '../../views/alerts/alerts-list-page'; +import { commonPages } from '../../views/shared/common'; export interface PerspectiveConfig { name: string; @@ -102,9 +102,9 @@ export function testLegacyDashboardsRegressionNamespace(perspective: Perspective cy.log('4.3 Observe > Alerting rule details - Verify graph is visible'); nav.sidenav.clickNavLink(['Observe', 'Alerting']); alerts.interceptWatchdogAlert(); - listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); - listPage.ARRows.countShouldBe(1); - listPage.ARRows.clickAlertingRule(); + alertsListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`); + alertsListPage.ARRows.countShouldBe(1); + alertsListPage.ARRows.clickAlertingRule(); commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`); alertingRuleDetailsPage.clickHideGraphButton(); cy.byTestID(DataTestIDs.MetricGraph).should('not.exist'); diff --git a/web/cypress/support/metrics/metrics_regressions.cy.ts b/web/cypress/support/metrics/metrics_regressions.cy.ts index 49b7438e3..273b15f39 100644 --- a/web/cypress/support/metrics/metrics_regressions.cy.ts +++ b/web/cypress/support/metrics/metrics_regressions.cy.ts @@ -1,4 +1,4 @@ -import { metricsPage } from '../../views/metrics'; +import { metricsPage } from '../../views/metrics/metrics'; import { Classes, DataTestIDs } from '@/shared/constants/data-test'; import { GraphTimespan, diff --git a/web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts b/web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts index b63eaca51..c96035cd5 100644 --- a/web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts +++ b/web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts @@ -1,4 +1,4 @@ -import { metricsPage } from '../../views/metrics'; +import { metricsPage } from '../../views/metrics/metrics'; import { Classes, DataTestIDs } from '@/shared/constants/data-test'; import { GraphTimespan, diff --git a/web/cypress/support/perses/commands/perses-commands.ts b/web/cypress/support/perses/commands/perses-commands.ts index 7ed1914fd..135597be8 100644 --- a/web/cypress/support/perses/commands/perses-commands.ts +++ b/web/cypress/support/perses/commands/perses-commands.ts @@ -1,7 +1,7 @@ export {}; -import { nav } from '../../../views/nav'; -import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { nav } from '../../../views/shared/nav'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-list-dashboards'; import { listPersesDashboardsOUIAIDs } from '@/shared/constants/data-test'; import { PERSES_E2E_DASHBOARDS_DIR, diff --git a/web/cypress/support/perses/perses_bvt_admin.cy.ts b/web/cypress/support/perses/perses_bvt_admin.cy.ts index 1f65659d5..73cb5cfca 100644 --- a/web/cypress/support/perses/perses_bvt_admin.cy.ts +++ b/web/cypress/support/perses/perses_bvt_admin.cy.ts @@ -4,18 +4,18 @@ import { persesDashboardsDashboardDropdownPersesDev, persesDashboardsEmptyDashboard, } from '../../fixtures/perses/constants'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; import { persesMUIDataTestIDs } from '@/shared/constants/data-test'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup'; -import { persesDashboardsPanel } from '../../views/perses-dashboards-panel'; -import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables'; -import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPanelGroup } from '../../views/perses-dashboards/perses-dashboards-panelgroup'; +import { persesDashboardsPanel } from '../../views/perses-dashboards/perses-dashboards-panel'; +import { persesDashboardsEditVariables } from '../../views/perses-dashboards/perses-dashboards-edit-variables'; +import { persesCreateDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-create-dashboard'; import { persesDashboardsAddListVariableSource } from '../../fixtures/perses/constants'; import { persesDashboardSampleQueries } from '../../fixtures/perses/constants'; import { persesDashboardsAddListPanelType } from '../../fixtures/perses/constants'; -import { commonPages } from '../../views/common'; -import { nav } from '../../views/nav'; +import { commonPages } from '../../views/shared/common'; +import { nav } from '../../views/shared/nav'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/perses_create_admin.cy.ts b/web/cypress/support/perses/perses_create_admin.cy.ts index 48c3ae489..6051f36fa 100644 --- a/web/cypress/support/perses/perses_create_admin.cy.ts +++ b/web/cypress/support/perses/perses_create_admin.cy.ts @@ -1,14 +1,14 @@ -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; import { persesDashboardsAddListPanelType, persesDashboardSampleQueries, persesDashboardsEmptyDashboard, } from '../../fixtures/perses/constants'; -import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard'; -import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup'; -import { persesDashboardsPanel } from '../../views/perses-dashboards-panel'; -import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables'; +import { persesCreateDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-create-dashboard'; +import { persesDashboardsPanelGroup } from '../../views/perses-dashboards/perses-dashboards-panelgroup'; +import { persesDashboardsPanel } from '../../views/perses-dashboards/perses-dashboards-panel'; +import { persesDashboardsEditVariables } from '../../views/perses-dashboards/perses-dashboards-edit-variables'; import { persesDashboardsAddListVariableSource } from '../../fixtures/perses/constants'; export interface PerspectiveConfig { diff --git a/web/cypress/support/perses/perses_create_import_admin.cy.ts b/web/cypress/support/perses/perses_create_import_admin.cy.ts index a118100ee..ab67415c7 100644 --- a/web/cypress/support/perses/perses_create_import_admin.cy.ts +++ b/web/cypress/support/perses/perses_create_import_admin.cy.ts @@ -1,10 +1,10 @@ -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; import { persesDashboardsAddListPanelType } from '../../fixtures/perses/constants'; -import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard'; -import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup'; -import { persesDashboardsPanel } from '../../views/perses-dashboards-panel'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; +import { persesCreateDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-create-dashboard'; +import { persesDashboardsPanelGroup } from '../../views/perses-dashboards/perses-dashboards-panelgroup'; +import { persesDashboardsPanel } from '../../views/perses-dashboards/perses-dashboards-panel'; +import { persesImportDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-import-dashboard'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/perses_edit_admin.cy.ts b/web/cypress/support/perses/perses_edit_admin.cy.ts index 773d8bad1..094dfcb10 100644 --- a/web/cypress/support/perses/perses_edit_admin.cy.ts +++ b/web/cypress/support/perses/perses_edit_admin.cy.ts @@ -7,11 +7,11 @@ import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, } from '../../fixtures/perses/constants'; -import { commonPages } from '../../views/common'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; -import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup'; -import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables'; +import { commonPages } from '../../views/shared/common'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; +import { persesDashboardsPanelGroup } from '../../views/perses-dashboards/perses-dashboards-panelgroup'; +import { persesDashboardsEditVariables } from '../../views/perses-dashboards/perses-dashboards-edit-variables'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/perses_edit_admin_1.cy.ts b/web/cypress/support/perses/perses_edit_admin_1.cy.ts index 4b36e45a4..4f63322e1 100644 --- a/web/cypress/support/perses/perses_edit_admin_1.cy.ts +++ b/web/cypress/support/perses/perses_edit_admin_1.cy.ts @@ -3,12 +3,12 @@ import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, } from '../../fixtures/perses/constants'; -import { commonPages } from '../../views/common'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; -import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables'; -import { persesDashboardsPanel } from '../../views/perses-dashboards-panel'; -import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup'; +import { commonPages } from '../../views/shared/common'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; +import { persesDashboardsEditVariables } from '../../views/perses-dashboards/perses-dashboards-edit-variables'; +import { persesDashboardsPanel } from '../../views/perses-dashboards/perses-dashboards-panel'; +import { persesDashboardsPanelGroup } from '../../views/perses-dashboards/perses-dashboards-panelgroup'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/perses_import_admin.cy.ts b/web/cypress/support/perses/perses_import_admin.cy.ts index 975147214..dbcf2069d 100644 --- a/web/cypress/support/perses/perses_import_admin.cy.ts +++ b/web/cypress/support/perses/perses_import_admin.cy.ts @@ -1,7 +1,7 @@ -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; -import { nav } from '../../views/nav'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; +import { persesImportDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-import-dashboard'; +import { nav } from '../../views/shared/nav'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/perses_list_admin.cy.ts b/web/cypress/support/perses/perses_list_admin.cy.ts index 09026436b..6fb43313e 100644 --- a/web/cypress/support/perses/perses_list_admin.cy.ts +++ b/web/cypress/support/perses/perses_list_admin.cy.ts @@ -2,10 +2,10 @@ import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, } from '../../fixtures/perses/constants'; -import { commonPages } from '../../views/common'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; -import { nav } from '../../views/nav'; +import { commonPages } from '../../views/shared/common'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; +import { nav } from '../../views/shared/nav'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/perses_list_admin_namespace.cy.ts b/web/cypress/support/perses/perses_list_admin_namespace.cy.ts index 5ca0b95e7..04c60cf60 100644 --- a/web/cypress/support/perses/perses_list_admin_namespace.cy.ts +++ b/web/cypress/support/perses/perses_list_admin_namespace.cy.ts @@ -2,10 +2,10 @@ import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, } from '../../fixtures/perses/constants'; -import { commonPages } from '../../views/common'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesDashboardsPage } from '../../views/perses-dashboards'; -import { nav } from '../../views/nav'; +import { commonPages } from '../../views/shared/common'; +import { listPersesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../views/perses-dashboards/perses-dashboards'; +import { nav } from '../../views/shared/nav'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/rbac/perses_user1.cy.ts b/web/cypress/support/perses/rbac/perses_user1.cy.ts index beee7d0e5..1160f98a9 100644 --- a/web/cypress/support/perses/rbac/perses_user1.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user1.cy.ts @@ -1,6 +1,6 @@ -import { persesDashboardsPage } from '../../../views/perses-dashboards'; -import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; -import { persesCreateDashboardsPage } from '../../../views/perses-dashboards-create-dashboard'; +import { persesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-create-dashboard'; import { persesDashboardsAddListVariableSource, persesDashboardSampleQueries, @@ -8,13 +8,13 @@ import { persesDashboardsDashboardDropdownPersesDev, persesDashboardsEmptyDashboard, } from '../../../fixtures/perses/constants'; -import { persesDashboardsEditVariables } from '../../../views/perses-dashboards-edit-variables'; -import { persesDashboardsPanelGroup } from '../../../views/perses-dashboards-panelgroup'; +import { persesDashboardsEditVariables } from '../../../views/perses-dashboards/perses-dashboards-edit-variables'; +import { persesDashboardsPanelGroup } from '../../../views/perses-dashboards/perses-dashboards-panelgroup'; import { persesAriaLabels } from '@/shared/constants/data-test'; -import { persesDashboardsPanel } from '../../../views/perses-dashboards-panel'; +import { persesDashboardsPanel } from '../../../views/perses-dashboards/perses-dashboards-panel'; import { persesDashboardsAddListPanelType } from '../../../fixtures/perses/constants'; -import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; -import { nav } from '../../../views/nav'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-import-dashboard'; +import { nav } from '../../../views/shared/nav'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/rbac/perses_user2.cy.ts b/web/cypress/support/perses/rbac/perses_user2.cy.ts index 4494ad7d8..0d4568ccb 100644 --- a/web/cypress/support/perses/rbac/perses_user2.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user2.cy.ts @@ -1,5 +1,5 @@ -import { persesDashboardsPage } from '../../../views/perses-dashboards'; -import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-list-dashboards'; import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, diff --git a/web/cypress/support/perses/rbac/perses_user3.cy.ts b/web/cypress/support/perses/rbac/perses_user3.cy.ts index a2c7d2323..81ae87b8b 100644 --- a/web/cypress/support/perses/rbac/perses_user3.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user3.cy.ts @@ -1,18 +1,18 @@ -import { persesDashboardsPage } from '../../../views/perses-dashboards'; -import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; -import { persesCreateDashboardsPage } from '../../../views/perses-dashboards-create-dashboard'; +import { persesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-create-dashboard'; import { persesDashboardsAddListVariableSource, persesDashboardSampleQueries, persesDashboardsEmptyDashboard, persesDashboardsTimeRange, } from '../../../fixtures/perses/constants'; -import { persesDashboardsEditVariables } from '../../../views/perses-dashboards-edit-variables'; -import { persesDashboardsPanelGroup } from '../../../views/perses-dashboards-panelgroup'; -import { persesDashboardsPanel } from '../../../views/perses-dashboards-panel'; +import { persesDashboardsEditVariables } from '../../../views/perses-dashboards/perses-dashboards-edit-variables'; +import { persesDashboardsPanelGroup } from '../../../views/perses-dashboards/perses-dashboards-panelgroup'; +import { persesDashboardsPanel } from '../../../views/perses-dashboards/perses-dashboards-panel'; import { persesDashboardsAddListPanelType } from '../../../fixtures/perses/constants'; -import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; -import { nav } from '../../../views/nav'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-import-dashboard'; +import { nav } from '../../../views/shared/nav'; import { persesAriaLabels } from '@/shared/constants/data-test'; export interface PerspectiveConfig { diff --git a/web/cypress/support/perses/rbac/perses_user4.cy.ts b/web/cypress/support/perses/rbac/perses_user4.cy.ts index f9abca8cc..4ae274db6 100644 --- a/web/cypress/support/perses/rbac/perses_user4.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user4.cy.ts @@ -1,4 +1,4 @@ -import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-list-dashboards'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/rbac/perses_user5.cy.ts b/web/cypress/support/perses/rbac/perses_user5.cy.ts index 27f921523..463a53970 100644 --- a/web/cypress/support/perses/rbac/perses_user5.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user5.cy.ts @@ -1,17 +1,17 @@ -import { persesDashboardsPage } from '../../../views/perses-dashboards'; -import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; -import { persesCreateDashboardsPage } from '../../../views/perses-dashboards-create-dashboard'; +import { persesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-create-dashboard'; import { persesDashboardsAddListVariableSource, persesDashboardSampleQueries, persesDashboardsEmptyDashboard, } from '../../../fixtures/perses/constants'; -import { persesDashboardsEditVariables } from '../../../views/perses-dashboards-edit-variables'; -import { persesDashboardsPanelGroup } from '../../../views/perses-dashboards-panelgroup'; -import { persesDashboardsPanel } from '../../../views/perses-dashboards-panel'; +import { persesDashboardsEditVariables } from '../../../views/perses-dashboards/perses-dashboards-edit-variables'; +import { persesDashboardsPanelGroup } from '../../../views/perses-dashboards/perses-dashboards-panelgroup'; +import { persesDashboardsPanel } from '../../../views/perses-dashboards/perses-dashboards-panel'; import { persesDashboardsAddListPanelType } from '../../../fixtures/perses/constants'; -import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; -import { nav } from '../../../views/nav'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-import-dashboard'; +import { nav } from '../../../views/shared/nav'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/perses/rbac/perses_user6.cy.ts b/web/cypress/support/perses/rbac/perses_user6.cy.ts index ea8fc27b3..d5a5fb1af 100644 --- a/web/cypress/support/perses/rbac/perses_user6.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user6.cy.ts @@ -1,4 +1,4 @@ -import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards/perses-dashboards-list-dashboards'; export interface PerspectiveConfig { name: string; diff --git a/web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts b/web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts index fbffb6009..df809cffb 100644 --- a/web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts +++ b/web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts @@ -1,6 +1,6 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../../views/operator-hub-page'; -import { nav } from '../../../views/nav'; +import { operatorHubPage } from '../../../views/shared/operator-hub-page'; +import { nav } from '../../../views/shared/nav'; export {}; diff --git a/web/cypress/support/shared/commands/auth-commands.ts b/web/cypress/support/shared/commands/auth-commands.ts index e86912f9c..6840625af 100644 --- a/web/cypress/support/shared/commands/auth-commands.ts +++ b/web/cypress/support/shared/commands/auth-commands.ts @@ -1,5 +1,5 @@ -import { nav } from '../../../views/nav'; -import { guidedTour } from '../../../views/tour'; +import { nav } from '../../../views/shared/nav'; +import { guidedTour } from '../../../views/shared/tour'; export {}; declare global { diff --git a/web/cypress/support/shared/commands/traces-logging-commands.ts b/web/cypress/support/shared/commands/traces-logging-commands.ts index 6c5b55441..97aaa5e10 100644 --- a/web/cypress/support/shared/commands/traces-logging-commands.ts +++ b/web/cypress/support/shared/commands/traces-logging-commands.ts @@ -1,6 +1,6 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../../views/operator-hub-page'; -import { nav } from '../../../views/nav'; +import { operatorHubPage } from '../../../views/shared/operator-hub-page'; +import { nav } from '../../../views/shared/nav'; import { operatorAuthUtils } from './auth-commands'; export {}; diff --git a/web/cypress/support/shared/commands/virtualization-commands.ts b/web/cypress/support/shared/commands/virtualization-commands.ts index a4ccac294..61500587a 100644 --- a/web/cypress/support/shared/commands/virtualization-commands.ts +++ b/web/cypress/support/shared/commands/virtualization-commands.ts @@ -1,8 +1,8 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../../views/operator-hub-page'; -import { nav } from '../../../views/nav'; +import { operatorHubPage } from '../../../views/shared/operator-hub-page'; +import { nav } from '../../../views/shared/nav'; import { operatorAuthUtils } from './auth-commands'; -import { guidedTour } from '../../../views/tour'; +import { guidedTour } from '../../../views/shared/tour'; export {}; diff --git a/web/cypress/views/acm-alerting-page.ts b/web/cypress/views/alerts/acm-alerting-page.ts similarity index 100% rename from web/cypress/views/acm-alerting-page.ts rename to web/cypress/views/alerts/acm-alerting-page.ts diff --git a/web/cypress/views/alerts/alert-and-silence-details-page.ts b/web/cypress/views/alerts/alert-and-silence-details-page.ts new file mode 100644 index 000000000..5e8502b61 --- /dev/null +++ b/web/cypress/views/alerts/alert-and-silence-details-page.ts @@ -0,0 +1,125 @@ +import { commonPages } from '../shared/common'; +import { Classes, DataTestIDs } from '@/shared/constants/data-test'; + +export const alertAndSilencesDetailsPage = { + sectionHeaderShouldExist: (sectionHeading: string) => { + cy.log('detailsPage.sectionHeaderShouldExist'); + cy.get(Classes.SectionHeader).contains(sectionHeading).should('be.visible'); + }, + + labelShouldExist: (labelName: string) => { + cy.log('detailsPage.labelShouldExist'); + cy.get(Classes.LabelTag).contains(labelName); + }, + + clickAlertRule: (alert: string) => { + cy.log('detailsPage.clickAlertRule'); + cy.byTestID(DataTestIDs.AlertingRuleResourceLink).scrollIntoView(); + try { + cy.byTestID(DataTestIDs.AlertingRuleResourceLink) + .contains(alert) + .should('be.visible') + .click(); + commonPages.detailsPage.alertRule(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + + clickAlertDesc: (desc: string) => { + cy.log('detailsPage.clickAlertDesc'); + cy.byTestID(DataTestIDs.AlertResourceLink).scrollIntoView(); + try { + cy.byTestID(DataTestIDs.AlertResourceLink).contains(desc).should('be.visible').click(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + + clickInspectAlertPage: () => { + cy.log('detailsPage.clickInspectAlertPage'); + try { + cy.byAriaLabel('Inspect').should('be.visible'); + cy.get(`a[aria-label="Inspect"]`, { timeout: 10000 }).click(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + + clickOnSilencedBy: (alertname: string) => { + cy.log('detailsPage.clickOnSilencedBy'); + try { + cy.byLegacyTestID(DataTestIDs.SilenceResourceLink).contains(alertname).scrollIntoView(); + cy.byLegacyTestID(DataTestIDs.SilenceResourceLink).contains(alertname).click({ force: true }); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + + assertSilencedAlert: () => { + cy.log('detailsPage.assertSilencedAlert'); + try { + cy.byTestID(DataTestIDs.SilenceButton).should('not.exist'); + alertAndSilencesDetailsPage.clickOnSilenceByKebab(); + cy.byPFRole('menuitem').contains('Edit silence').should('be.visible'); + cy.byPFRole('menuitem').contains('Expire silence').should('be.visible'); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + + clickOnSilenceByKebab: () => { + cy.log('detailsPage.clickOnSilenceByKebab'); + try { + cy.byLegacyTestID(DataTestIDs.SilenceResourceLink).scrollIntoView(); + cy.get('table').should('be.visible'); + cy.wait(2000); + cy.get('table').find(Classes.SilenceKebabDropdown).should('be.visible'); + cy.get('table') + .find(Classes.SilenceKebabDropdown) + .should('be.visible') + .click({ force: true }); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + + editSilence: () => { + cy.log('detailsPage.editSilence'); + try { + alertAndSilencesDetailsPage.clickOnSilenceByKebab(); + cy.byPFRole('menuitem').contains('Edit silence').should('be.visible').click(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + /** + * + * @param yes boolean: true to expire and false to cancel + */ + expireSilence: (yes: boolean) => { + cy.log('detailsPage.expireSilence'); + try { + alertAndSilencesDetailsPage.clickOnSilenceByKebab(); + cy.byPFRole('menuitem') + .contains('Expire silence') + .should('be.visible') + .click({ force: true }); + commonPages.confirmExpireAlert(yes); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + clickSilenceAlertButton: () => { + cy.log('detailsPage.clickSilenceAlertButton'); + cy.byTestID(DataTestIDs.SilenceButton).should('be.visible').click(); + }, +}; diff --git a/web/cypress/views/alerting-rule-details-page.ts b/web/cypress/views/alerts/alerting-rule-details-page.ts similarity index 90% rename from web/cypress/views/alerting-rule-details-page.ts rename to web/cypress/views/alerts/alerting-rule-details-page.ts index eef8226a3..8e069f82f 100644 --- a/web/cypress/views/alerting-rule-details-page.ts +++ b/web/cypress/views/alerts/alerting-rule-details-page.ts @@ -1,5 +1,5 @@ -import { commonPages } from './common'; -import { detailsPage } from './details-page'; +import { commonPages } from '../shared/common'; +import { alertAndSilencesDetailsPage } from './alert-and-silence-details-page'; import { DataTestIDs } from '@/shared/constants/data-test'; export const alertingRuleDetailsPage = { @@ -7,8 +7,8 @@ export const alertingRuleDetailsPage = { cy.log('alertingRuleDetailsPage.assertAlertingRuleDetailsPage'); commonPages.titleShouldHaveText(title); cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).contains('AR').should('be.visible'); - detailsPage.sectionHeaderShouldExist('Alerting rule details'); - detailsPage.sectionHeaderShouldExist('Active alerts'); + alertAndSilencesDetailsPage.sectionHeaderShouldExist('Alerting rule details'); + alertAndSilencesDetailsPage.sectionHeaderShouldExist('Active alerts'); cy.byTestID(DataTestIDs.Expression).should('be.visible'); cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible'); cy.byTestID(DataTestIDs.MetricGraph).scrollIntoView().should('be.visible'); diff --git a/web/cypress/views/alerting-rule-list-page.ts b/web/cypress/views/alerts/alerting-rule-list-page.ts similarity index 91% rename from web/cypress/views/alerting-rule-list-page.ts rename to web/cypress/views/alerts/alerting-rule-list-page.ts index fc81a50f9..d743201ba 100644 --- a/web/cypress/views/alerting-rule-list-page.ts +++ b/web/cypress/views/alerts/alerting-rule-list-page.ts @@ -1,9 +1,11 @@ import { Classes, DataTestIDs, FilterOUIAIDs } from '@/shared/constants/data-test'; -import { listPage } from './list-page'; +import { Source } from '../../fixtures/shared/cluster-monitoring-operator/constants'; +import { alertsListPage } from './alerts-list-page'; export const alertingRuleListPage = { shouldBeLoaded: () => { cy.log('alertingRuleListPage.shouldBeLoaded'); + alertsListPage.filter.removeIndividualTag(Source.PLATFORM); cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).contains('AR'); cy.get(Classes.TableHeaderColumn).contains('Name').should('be.visible'); cy.get(Classes.TableHeaderColumn).contains('Severity').should('be.visible'); @@ -29,7 +31,7 @@ export const alertingRuleListPage = { byName: (name: string, ouiaId: string = FilterOUIAIDs.RuleNameFilter) => { cy.log('listPage.filter.byName'); try { - listPage.filter.selectAttribute('Name'); + alertsListPage.filter.selectAttribute('Name'); cy.byOUIAID(`${ouiaId}-input`) .find('input') .scrollIntoView() diff --git a/web/cypress/views/alerts/alerts-list-page.ts b/web/cypress/views/alerts/alerts-list-page.ts new file mode 100644 index 000000000..68f7c13e8 --- /dev/null +++ b/web/cypress/views/alerts/alerts-list-page.ts @@ -0,0 +1,291 @@ +import { Classes, DataTestIDs, FilterOUIAIDs, LegacyTestIDs } from '@/shared/constants/data-test'; + +const escapeRegExp = (s: string) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + +export const alertsListPage = { + /** + * + * @param tab + */ + tabShouldHaveText: (tab: string) => { + cy.log('listPage.tabShouldHaveText'); + cy.get(Classes.HorizontalNav).contains(tab).should('exist'); + }, + + /** + * + * @param clearFolder true = clear folder, false = do not clear folder + * @param fileNameExp i.e openshift.csv + */ + exportAsCSV: (clearFolder: boolean, fileNameExp: RegExp) => { + cy.log('listPage.exportAsCSV'); + let downloadedFileName: string | null = null; + const downloadsFolder = Cypress.config('downloadsFolder'); + const expectedFileNamePattern = fileNameExp; + if (clearFolder) { + cy.task('clearDownloads'); + } + cy.byTestID(DataTestIDs.DownloadCSVButton).should('be.visible').click(); + + cy.waitUntil( + () => { + return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => { + const matchingFile = currentFiles.find((file) => expectedFileNamePattern.test(file)); + if (matchingFile) { + downloadedFileName = matchingFile; + return true; + } + return false; + }); + }, + { + timeout: 20000, + interval: 1000, + errorMsg: [ + `CSV file matching "${expectedFileNamePattern}"`, + 'was not downloaded within timeout.', + ].join(' '), + }, + ); + + cy.then(() => { + expect(downloadedFileName).to.not.equal(null); + cy.task('doesFileExist', { fileName: downloadedFileName }).should('be.true'); + }); + }, + + filter: { + selectAttribute: (attributeName: string) => { + cy.log('listPage.filter.selectAttribute'); + cy.byOUIAID('DataViewFilters').scrollIntoView(); + cy.byOUIAID('DataViewFilters') + .find('.pf-v6-c-menu-toggle') + .first() + .then(($toggle) => { + if (!$toggle.text().includes(attributeName)) { + cy.wrap($toggle).click(); + cy.get('.pf-v6-c-menu__item').contains(attributeName).click(); + } + }); + }, + + /** + * @param name + */ + byName: (name: string, ouiaId: string = FilterOUIAIDs.AlertNameFilter) => { + cy.log('listPage.filter.byName'); + try { + alertsListPage.filter.selectAttribute('Name'); + cy.byOUIAID(`${ouiaId}-input`) + .find('input') + .scrollIntoView() + .as('input') + .should('be.visible'); + cy.get('@input', { timeout: 10000 }) + .scrollIntoView() + .type(name + '{enter}'); + cy.get('@input', { timeout: 10000 }).scrollIntoView().should('have.attr', 'value', name); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + /** + * @param label + */ + byLabel: (label: string) => { + cy.log('listPage.filter.byLabel'); + alertsListPage.filter.selectAttribute('Label'); + cy.byLegacyTestID(LegacyTestIDs.ItemFilter).scrollIntoView().as('input').should('be.visible'); + cy.get('@input', { timeout: 10000 }) + .scrollIntoView() + .type(label + '{enter}') + .should('have.attr', 'value', label); + cy.byTestID(DataTestIDs.LabelSuggestion).contains(label).click(); + }, + + clearAllFilters: () => { + cy.log('listPage.filter.clearAllFilters'); + cy.byOUIAID('DataViewFilters').scrollIntoView(); + cy.get('body').then(($body) => { + if ($body.find('[data-ouia-component-id="DataViewToolbar-clear-all-filters"]').length > 0) { + cy.byOUIAID('DataViewToolbar-clear-all-filters').first().click(); + } + }); + }, + + /** + * Select a filter option from a checkbox filter. + * First selects the filter attribute, then opens the checkbox dropdown and clicks the option. + * + * @param filterCategory The filter attribute name + * ie. 'Alert State', 'Severity', 'Source', 'Silence State' + * @param option The option value to select (e.g., 'Firing', 'Critical', 'Platform') + */ + selectFilterOption: (filterCategory: string, option: string) => { + cy.log('listPage.filter.selectFilterOption'); + alertsListPage.filter.selectAttribute(filterCategory); + cy.byOUIAID('DataViewFilters').scrollIntoView(); + cy.byOUIAID('DataViewFilters') + .find(Classes.FilterDropdown) + .filter(':visible') + .last() + .scrollIntoView() + .click(); + cy.get(Classes.FilterDropdownOption).contains(option).should('be.visible').click(); + cy.byOUIAID('DataViewFilters').scrollIntoView(); + cy.byOUIAID('DataViewFilters') + .find(Classes.FilterDropdown) + .filter(':visible') + .last() + .scrollIntoView() + .click(); + }, + + /** + * + * @param tagName alerts-tab: Firing, Pending, Silenced, Critical, Warning, Info, None, + * Platform, User + * silences: Active, Pending, Expired + * alerting-rules: Firing, Pending, Silenced, Not Firing, Critical, Warning, Info, None, + * Platform, User + */ + removeIndividualTag: (tagName: string) => { + cy.log('listPage.filter.removeIndividualTag'); + cy.byOUIAID('DataViewFilters').scrollIntoView(); + cy.get(Classes.IndividualTag) + .contains(new RegExp(`^${escapeRegExp(tagName)}$`)) + .parent() + .next('span') + .children('button') + .click(); + }, + + /** + * + * @param groupTagName alerts-tab (Alert State, Severity, Source), Silence State, + * alerting-rules (Alert State, Severity, Source) + */ + clickOn1more: (groupTagName: string) => { + cy.log('listPage.filter.clickOn1more'); + cy.byOUIAID('DataViewFilters').scrollIntoView(); + cy.get(Classes.MoreLessTag) + .contains(groupTagName) + .siblings('ul') + .children('li') + .contains('1 more') + .click(); + }, + + /** + * + * @param groupTagName alerts-tab (Alert State, Severity, Source), Silence State, + * alerting-rules (Alert State, Severity, Source) + */ + clickOnShowLess: (groupTagName: string) => { + cy.log('listPage.filter.clickOnShowLess'); + cy.byOUIAID('DataViewFilters').scrollIntoView(); + cy.get(Classes.MoreLessTag) + .contains(groupTagName) + .siblings('ul') + .children('li') + .contains('Show Less') + .click(); + }, + }, + ARRows: { + shouldBeLoaded: () => { + cy.log('listPage.ARRows.shouldBeLoaded'); + cy.byOUIAID(DataTestIDs.Table).should('be.visible'); + }, + countShouldBe: (count: number) => { + cy.log('listPage.ARRows.countShouldBe'); + cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).should('have.length', count); + }, + + //pf-6 only + ARShouldBe: (alert: string, severity: string, total: number, state: string) => { + cy.log('listPage.ARRows.ARShouldBe'); + cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).contains('AR'); + cy.byTestID(DataTestIDs.AlertingRuleResourceLink).contains(alert).should('exist'); + cy.byTestID(DataTestIDs.AlertingRuleSeverityBadge).contains(severity).should('exist'); + cy.byTestID(DataTestIDs.AlertingRuleTotalAlertsBadge).contains(total).should('exist'); + cy.byTestID(DataTestIDs.AlertingRuleStateBadge).contains(state).should('exist'); + }, + AShouldBe: (alert: string, severity: string, namespace: string) => { + cy.log('listPage.ARRows.AShouldBe'); + cy.byTestID(DataTestIDs.AlertResourceIcon).should('exist'); + cy.byTestID(DataTestIDs.AlertResourceLink).contains(alert).should('exist'); + cy.byTestID(DataTestIDs.SeverityBadge).contains(severity).should('exist'); + cy.byTestID(DataTestIDs.AlertNamespace).contains(namespace).should('exist'); + }, + //pf-6 only + expandRow: () => { + cy.log('listPage.ARRows.expandRow'); + try { + cy.get('body').then(($provider) => { + if ($provider.find(Classes.ExpandedRow).length > 0) { + cy.log('Already expanded'); + } else { + cy.byTestID(DataTestIDs.AlertingRuleArrow).first().find('button').click(); + } + }); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + //pf-6 only + clickAlertingRule: () => { + cy.log('listPage.ARRows.clickAlertingRule'); + try { + cy.byTestID(DataTestIDs.AlertingRuleResourceLink).should('be.visible').click(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + clickAlert: () => { + cy.log('listPage.ARRows.clickAlert'); + try { + cy.byTestID(DataTestIDs.AlertResourceLink).should('be.visible').click(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + assertNoKebab: () => { + cy.log('listPage.ARRows.assertNoKebab'); + try { + cy.byAriaLabel('toggle menu').should('not.exist'); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + clickAlertKebab: () => { + cy.log('listPage.ARRows.clickAlertKebab'); + try { + cy.byTestID(DataTestIDs.KebabDropdownButton).should('be.visible').click(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + silenceAlert: () => { + cy.log('listPage.ARRows.silentAlert'); + try { + alertsListPage.ARRows.clickAlertKebab(); + cy.byTestID(DataTestIDs.SilenceAlertDropdownItem).should('be.visible').click(); + } catch (error) { + cy.log(`${error.message}`); + throw error; + } + }, + }, + emptyState: () => { + cy.log('listPage.emptyState'); + cy.byTestID(DataTestIDs.EmptyBoxBody).contains('No alerts found').should('be.visible'); + cy.byOUIAID(DataTestIDs.Table).should('not.exist'); + }, +}; diff --git a/web/cypress/views/silence-alert-page.ts b/web/cypress/views/alerts/silence-alert-page.ts similarity index 100% rename from web/cypress/views/silence-alert-page.ts rename to web/cypress/views/alerts/silence-alert-page.ts diff --git a/web/cypress/views/silence-details-page.ts b/web/cypress/views/alerts/silence-details-page.ts similarity index 90% rename from web/cypress/views/silence-details-page.ts rename to web/cypress/views/alerts/silence-details-page.ts index 83475b2b3..3b25e07b2 100644 --- a/web/cypress/views/silence-details-page.ts +++ b/web/cypress/views/alerts/silence-details-page.ts @@ -1,13 +1,13 @@ -import { commonPages } from './common'; -import { detailsPage } from './details-page'; +import { commonPages } from '../shared/common'; +import { alertAndSilencesDetailsPage } from './alert-and-silence-details-page'; import { DataTestIDs } from '@/shared/constants/data-test'; export const silenceDetailsPage = { assertSilenceDetailsPage: (title: string, section: string, labelname: string) => { cy.log('silenceDetailsPage.assertSilenceDetailsPage'); commonPages.titleShouldHaveText(title); - detailsPage.sectionHeaderShouldExist(section); - detailsPage.labelShouldExist(labelname); + alertAndSilencesDetailsPage.sectionHeaderShouldExist(section); + alertAndSilencesDetailsPage.labelShouldExist(labelname); }, clickOnFiringAlerts: (alertname: string) => { diff --git a/web/cypress/views/silences-list-page.ts b/web/cypress/views/alerts/silences-list-page.ts similarity index 98% rename from web/cypress/views/silences-list-page.ts rename to web/cypress/views/alerts/silences-list-page.ts index 48e14efa3..093ed1b15 100644 --- a/web/cypress/views/silences-list-page.ts +++ b/web/cypress/views/alerts/silences-list-page.ts @@ -1,4 +1,4 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { Classes, DataTestIDs, FilterOUIAIDs } from '@/shared/constants/data-test'; export const silencesListPage = { diff --git a/web/cypress/views/incidents-page.ts b/web/cypress/views/incidents/incidents-page.ts similarity index 99% rename from web/cypress/views/incidents-page.ts rename to web/cypress/views/incidents/incidents-page.ts index f4d459e7c..5ae9cc51a 100644 --- a/web/cypress/views/incidents-page.ts +++ b/web/cypress/views/incidents/incidents-page.ts @@ -1,4 +1,4 @@ -import { nav } from './nav'; +import { nav } from '../shared/nav'; import { Classes, DataTestIDs } from '@/shared/constants/data-test'; // Hard timeout safety net for findIncidentWithAlert retry loops. diff --git a/web/cypress/views/legacy-dashboards.ts b/web/cypress/views/legacy-dashboards/legacy-dashboards.ts similarity index 98% rename from web/cypress/views/legacy-dashboards.ts rename to web/cypress/views/legacy-dashboards/legacy-dashboards.ts index f577e56e4..b617bbdcd 100644 --- a/web/cypress/views/legacy-dashboards.ts +++ b/web/cypress/views/legacy-dashboards/legacy-dashboards.ts @@ -1,4 +1,4 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { Classes, DataTestIDs, LegacyDashboardPageTestIDs } from '@/shared/constants/data-test'; import { API_PERFORMANCE_DASHBOARD_PANELS, @@ -8,7 +8,7 @@ import { LegacyDashboardsTimeRange, MonitoringPageTitles, MonitoringRefreshInterval, -} from '../fixtures/shared/cluster-monitoring-operator/constants'; +} from '../../fixtures/shared/cluster-monitoring-operator/constants'; export const legacyDashboardsPage = { shouldBeLoaded: () => { cy.log('legacyDashboardsPage.shouldBeLoaded'); diff --git a/web/cypress/views/metrics.ts b/web/cypress/views/metrics/metrics.ts similarity index 99% rename from web/cypress/views/metrics.ts rename to web/cypress/views/metrics/metrics.ts index 3b0fa6662..681d02eae 100644 --- a/web/cypress/views/metrics.ts +++ b/web/cypress/views/metrics/metrics.ts @@ -1,4 +1,4 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { Classes, DataTestIDs, IDs } from '@/shared/constants/data-test'; import { GraphTimespan, @@ -9,7 +9,7 @@ import { MetricsPageQueryKebabDropdown, MetricsPageUnits, MonitoringRefreshInterval, -} from '../fixtures/shared/cluster-monitoring-operator/constants'; +} from '../../fixtures/shared/cluster-monitoring-operator/constants'; export const metricsPage = { shouldBeLoaded: () => { diff --git a/web/cypress/views/perses-dashboards-create-dashboard.ts b/web/cypress/views/perses-dashboards/perses-dashboards-create-dashboard.ts similarity index 96% rename from web/cypress/views/perses-dashboards-create-dashboard.ts rename to web/cypress/views/perses-dashboards/perses-dashboards-create-dashboard.ts index b3c549672..58ab5a2e0 100644 --- a/web/cypress/views/perses-dashboards-create-dashboard.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards-create-dashboard.ts @@ -1,5 +1,8 @@ import { Classes, IDs, persesAriaLabels } from '@/shared/constants/data-test'; -import { persesCreateDashboard, persesDashboardsModalTitles } from '../fixtures/perses/constants'; +import { + persesCreateDashboard, + persesDashboardsModalTitles, +} from '../../fixtures/perses/constants'; export const persesCreateDashboardsPage = { createDashboardShouldBeLoaded: () => { diff --git a/web/cypress/views/perses-dashboards-edit-datasources.ts b/web/cypress/views/perses-dashboards/perses-dashboards-edit-datasources.ts similarity index 98% rename from web/cypress/views/perses-dashboards-edit-datasources.ts rename to web/cypress/views/perses-dashboards/perses-dashboards-edit-datasources.ts index f9032a84a..4acd72adc 100644 --- a/web/cypress/views/perses-dashboards-edit-datasources.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards-edit-datasources.ts @@ -1,4 +1,4 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { editPersesDashboardsAddDatasource, IDs, @@ -8,7 +8,7 @@ import { import { persesDashboardsModalTitles, persesDashboardsRequiredFields, -} from '../fixtures/perses/constants'; +} from '../../fixtures/perses/constants'; export const persesDashboardsEditDatasources = { shouldBeLoaded: () => { diff --git a/web/cypress/views/perses-dashboards-edit-variables.ts b/web/cypress/views/perses-dashboards/perses-dashboards-edit-variables.ts similarity index 99% rename from web/cypress/views/perses-dashboards-edit-variables.ts rename to web/cypress/views/perses-dashboards/perses-dashboards-edit-variables.ts index 5fbe9f387..405bbb634 100644 --- a/web/cypress/views/perses-dashboards-edit-variables.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards-edit-variables.ts @@ -1,4 +1,4 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { editPersesDashboardsAddVariable, IDs, @@ -10,7 +10,7 @@ import { persesDashboardsAddListVariableSource, persesDashboardsModalTitles, persesDashboardsRequiredFields, -} from '../fixtures/perses/constants'; +} from '../../fixtures/perses/constants'; export const persesDashboardsEditVariables = { shouldBeLoaded: () => { diff --git a/web/cypress/views/perses-dashboards-import-dashboard.ts b/web/cypress/views/perses-dashboards/perses-dashboards-import-dashboard.ts similarity index 99% rename from web/cypress/views/perses-dashboards-import-dashboard.ts rename to web/cypress/views/perses-dashboards/perses-dashboards-import-dashboard.ts index 9c6a89eb6..b641a843d 100644 --- a/web/cypress/views/perses-dashboards-import-dashboard.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards-import-dashboard.ts @@ -2,7 +2,7 @@ import { Classes, IDs, persesAriaLabels } from '@/shared/constants/data-test'; import { persesDashboardsImportDashboard, persesDashboardsModalTitles, -} from '../fixtures/perses/constants'; +} from '../../fixtures/perses/constants'; export const persesImportDashboardsPage = { importDashboardShouldBeLoaded: () => { diff --git a/web/cypress/views/perses-dashboards-list-dashboards.ts b/web/cypress/views/perses-dashboards/perses-dashboards-list-dashboards.ts similarity index 98% rename from web/cypress/views/perses-dashboards-list-dashboards.ts rename to web/cypress/views/perses-dashboards/perses-dashboards-list-dashboards.ts index c8371c6b4..124915fdd 100644 --- a/web/cypress/views/perses-dashboards-list-dashboards.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards-list-dashboards.ts @@ -1,4 +1,4 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { Classes, DataTestIDs, @@ -14,8 +14,8 @@ import { listPersesDashboardsPageSubtitle, persesDashboardsDuplicateDashboard, persesDashboardsRenameDashboard, -} from '../fixtures/perses/constants'; -import { MonitoringPageTitles } from '../fixtures/shared/cluster-monitoring-operator/constants'; +} from '../../fixtures/perses/constants'; +import { MonitoringPageTitles } from '../../fixtures/shared/cluster-monitoring-operator/constants'; export const listPersesDashboardsPage = { emptyState: () => { diff --git a/web/cypress/views/perses-dashboards-panel.ts b/web/cypress/views/perses-dashboards/perses-dashboards-panel.ts similarity index 99% rename from web/cypress/views/perses-dashboards-panel.ts rename to web/cypress/views/perses-dashboards/perses-dashboards-panel.ts index 0f5653e2e..b95b9e204 100644 --- a/web/cypress/views/perses-dashboards-panel.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards-panel.ts @@ -1,10 +1,10 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { editPersesDashboardsAddPanel, IDs, persesAriaLabels } from '@/shared/constants/data-test'; import { persesDashboardsAddListPanelType, persesDashboardsAddPanelAddQueryType, persesDashboardsModalTitles, -} from '../fixtures/perses/constants'; +} from '../../fixtures/perses/constants'; export const persesDashboardsPanel = { addPanelShouldBeLoaded: () => { diff --git a/web/cypress/views/perses-dashboards-panelgroup.ts b/web/cypress/views/perses-dashboards/perses-dashboards-panelgroup.ts similarity index 98% rename from web/cypress/views/perses-dashboards-panelgroup.ts rename to web/cypress/views/perses-dashboards/perses-dashboards-panelgroup.ts index 1400c7028..80efb02d2 100644 --- a/web/cypress/views/perses-dashboards-panelgroup.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards-panelgroup.ts @@ -1,9 +1,9 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { IDs, persesAriaLabels, persesMUIDataTestIDs } from '@/shared/constants/data-test'; import { persesDashboardsModalTitles, persesDashboardsRequiredFields, -} from '../fixtures/perses/constants'; +} from '../../fixtures/perses/constants'; export const persesDashboardsPanelGroup = { addPanelGroupShouldBeLoaded: () => { diff --git a/web/cypress/views/perses-dashboards.ts b/web/cypress/views/perses-dashboards/perses-dashboards.ts similarity index 99% rename from web/cypress/views/perses-dashboards.ts rename to web/cypress/views/perses-dashboards/perses-dashboards.ts index e49b67fa1..add58a496 100644 --- a/web/cypress/views/perses-dashboards.ts +++ b/web/cypress/views/perses-dashboards/perses-dashboards.ts @@ -1,4 +1,4 @@ -import { commonPages } from './common'; +import { commonPages } from '../shared/common'; import { Classes, DataTestIDs, @@ -10,19 +10,19 @@ import { persesDashboardDataTestIDs, persesMUIDataTestIDs, } from '@/shared/constants/data-test'; -import { MonitoringPageTitles } from '../fixtures/shared/cluster-monitoring-operator/constants'; +import { MonitoringPageTitles } from '../../fixtures/shared/cluster-monitoring-operator/constants'; import { listPersesDashboardsPageSubtitle, persesDashboardsEmptyDashboard, persesDashboardsModalTitles, -} from '../fixtures/perses/constants'; +} from '../../fixtures/perses/constants'; import { persesDashboardsAcceleratorsCommonMetricsPanels, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, persesDashboardsRefreshInterval, persesDashboardsTimeRange, -} from '../fixtures/perses/constants'; +} from '../../fixtures/perses/constants'; export const persesDashboardsPage = { shouldBeLoaded: () => { diff --git a/web/cypress/views/common.ts b/web/cypress/views/shared/common.ts similarity index 95% rename from web/cypress/views/common.ts rename to web/cypress/views/shared/common.ts index 1ec4e250c..72e9b0e4c 100644 --- a/web/cypress/views/common.ts +++ b/web/cypress/views/shared/common.ts @@ -1,4 +1,4 @@ -import { detailsPage } from './details-page'; +import { alertAndSilencesDetailsPage } from '../alerts/alert-and-silence-details-page'; import { DataTestIDs } from '@/shared/constants/data-test'; export const commonPages = { @@ -57,7 +57,7 @@ export const commonPages = { cy.log('commonPages.detailsPage.alert'); cy.byTestID(DataTestIDs.AlertResourceIcon).contains('A'); cy.byTestID(DataTestIDs.SilenceButton).should('be.visible'); - detailsPage.sectionHeaderShouldExist('Alert details'); + alertAndSilencesDetailsPage.sectionHeaderShouldExist('Alert details'); cy.byTestID(DataTestIDs.AlertingRuleResourceLink).scrollIntoView(); cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).contains('AR').should('be.visible'); cy.byTestID(DataTestIDs.AlertingRuleResourceLink).contains(alert).should('be.visible'); diff --git a/web/cypress/views/details-page.ts b/web/cypress/views/shared/details-page.ts similarity index 100% rename from web/cypress/views/details-page.ts rename to web/cypress/views/shared/details-page.ts diff --git a/web/cypress/views/list-page.ts b/web/cypress/views/shared/list-page.ts similarity index 100% rename from web/cypress/views/list-page.ts rename to web/cypress/views/shared/list-page.ts diff --git a/web/cypress/views/nav.ts b/web/cypress/views/shared/nav.ts similarity index 100% rename from web/cypress/views/nav.ts rename to web/cypress/views/shared/nav.ts diff --git a/web/cypress/views/operator-hub-page.ts b/web/cypress/views/shared/operator-hub-page.ts similarity index 95% rename from web/cypress/views/operator-hub-page.ts rename to web/cypress/views/shared/operator-hub-page.ts index 584f07656..be108704e 100644 --- a/web/cypress/views/operator-hub-page.ts +++ b/web/cypress/views/shared/operator-hub-page.ts @@ -1,4 +1,4 @@ -import * as helperfuncs from '../views/utils'; +import * as helperfuncs from './utils'; export const operatorHubPage = { installOperator: (operatorName, csName, installNamespace?) => { diff --git a/web/cypress/views/overview-page.ts b/web/cypress/views/shared/overview-page.ts similarity index 100% rename from web/cypress/views/overview-page.ts rename to web/cypress/views/shared/overview-page.ts diff --git a/web/cypress/views/tour.ts b/web/cypress/views/shared/tour.ts similarity index 100% rename from web/cypress/views/tour.ts rename to web/cypress/views/shared/tour.ts diff --git a/web/cypress/views/troubleshooting-panel.ts b/web/cypress/views/shared/troubleshooting-panel.ts similarity index 100% rename from web/cypress/views/troubleshooting-panel.ts rename to web/cypress/views/shared/troubleshooting-panel.ts diff --git a/web/cypress/views/utils.ts b/web/cypress/views/shared/utils.ts similarity index 100% rename from web/cypress/views/utils.ts rename to web/cypress/views/shared/utils.ts