Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .cursor/commands/generate-regression-test.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ import { incidentsPage } from "../../../views/incidents-page";

describe("Regression: [Section Name]", () => {
before(() => {
cy.beforeBlockCOO();
cy.ensureMonitoringConsolePlugin();
});

beforeEach(() => {
Expand Down Expand Up @@ -475,7 +475,7 @@ Continue? (y/n/specify)
**Automated checks (AI should verify):**

- [ ] File naming matches `XX.reg_<section-name>.cy.ts`
- [ ] Uses `cy.beforeBlockCOO()` in `before()` hook
- [ ] Uses `cy.ensureMonitoringConsolePlugin()` in `before()` hook
- [ ] Uses `incidentsPage.goTo()` in `beforeEach()`
- [ ] Uses `cy.mockIncidentFixture()` with valid fixture path
- [ ] No emojis in cy.log() statements
Expand Down Expand Up @@ -526,7 +526,7 @@ import { incidentsPage } from "../../../views/incidents-page";

describe("Regression: Tooltip Positioning", () => {
before(() => {
cy.beforeBlockCOO();
cy.ensureMonitoringConsolePlugin();
});

beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions .cursor/rules/incidents-testing-guidelines.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import { incidentsPage } from '../../../views/incidents-page';

describe('Regression: <Section Name>', () => {
before(() => {
cy.beforeBlockCOO();
cy.ensureMonitoringConsolePlugin();
});

beforeEach(() => {
Expand All @@ -125,7 +125,7 @@ describe('Regression: <Section Name>', () => {
### Required Elements
- File header comment with purpose and issue reference (e.g., "Verifies: OU-XXX")
- Import `incidentsPage` from relative path
- Use `cy.beforeBlockCOO()` in `before()` hook
- Use `cy.ensureMonitoringConsolePlugin()` in `before()` hook
- Use `incidentsPage.goTo()` in `beforeEach()`
- Use `cy.mockIncidentFixture()` for test data

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ i18n-frontend:
.PHONY: lint-frontend
lint-frontend:
cd web && npm run lint
cd web && npm run lint:tsc:cypress

.PHONY: install-backend
install-backend:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe(
{ tags: ["@cluster-health-analyzer", "@coo"] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/component/labels.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Labels } from '@/shared/components/labels';
import { Labels } from '@/shared/components/Labels';

describe('Labels', () => {
it('renders "No labels" when labels is empty', () => {
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/coo/01.coo_bvt.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { troubleshootingPanelPage } from '../../views/troubleshooting-panel';

describe('BVT: COO', { tags: ['@alerting', '@coo'] }, () => {
before(() => {
cy.beforeBlockCOO();
cy.ensureMonitoringConsolePlugin();
});

it('1. Admin perspective - Observe Menu', () => {
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
testAlertsRegression,
} from 'cypress/support/monitoring/01.reg_alerts.cy';
import { listPage } from 'cypress/views/list-page';
import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators';
import { CustomerPerspectiveName } from '@/shared/constants/perspective';
import { CLUSTER_MONITORING_OPERATOR } from 'cypress/support/operators';

const expectedAlerts = ['Watchdog', 'Watchdog-spoke', 'ClusterCPUHealth-jb'];

Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('BVT: Incidents - e2e', { tags: ['@cluster-health-analyzer', '@coo', '@
let currentAlertName: string;

before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/incidents/01.incidents.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { incidentsPage } from '../../views/incidents-page';

describe('BVT: Incidents - UI', { tags: ['@cluster-health-analyzer', '@coo'] }, () => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { incidentsPage } from '../../views/incidents-page';

describe('Incidents - Mocking Examples', { tags: ['@cluster-health-analyzer', '@coo'] }, () => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe(
{ tags: ['@cluster-health-analyzer', '@coo'], numTestsKeptInMemory: 0 },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe(
{ tags: ['@cluster-health-analyzer', '@coo'], numTestsKeptInMemory: 0 },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { incidentsPage } from '../../../views/incidents-page';

describe('Regression: Incidents Filtering', { tags: ['@cluster-health-analyzer', '@coo'] }, () => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe(
{ tags: ['@cluster-health-analyzer', '@coo'] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe(
{ tags: ['@cluster-health-analyzer', '@coo', '@xfail'] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe(
let currentAlertName: string;

before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
4 changes: 2 additions & 2 deletions web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe(
{ tags: ['@cluster-health-analyzer', '@coo'] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down Expand Up @@ -134,7 +134,7 @@ describe(
{ tags: ['@cluster-health-analyzer', '@coo'] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(
{ tags: ['@cluster-health-analyzer', '@coo'] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const MAX_GAP_RELAXED = 500;

describe('Regression: Stress Testing UI', { tags: ['@cluster-health-analyzer', '@coo'] }, () => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: false,
troubleshootingPanel: false,
});
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/monitoring/00.bvt_admin.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe(
{ tags: ['@alerting', '@legacy-dashboards', '@metrics', '@targets'] },
() => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/monitoring/00.bvt_dev.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators';

describe('BVT: Monitoring - Namespaced', { tags: ['@alerting'] }, () => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand Down
25 changes: 24 additions & 1 deletion web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { CLUSTER_MONITORING_OPERATOR } from 'cypress/support/operators';
import { alerts } from '../../../fixtures/monitoring/alert';
import {
testAlertsCorePlatformHeaderRegression,
testAlertsRegression,
} from '../../../support/monitoring/01.reg_alerts.cy';
import { testAlertsRegressionNamespace } from '../../../support/monitoring/04.reg_alerts_namespace.cy';
import { commonPages } from '../../../views/common';
import { nav } from '../../../views/nav';
import { CustomerPerspectiveName } from '@/shared/constants/perspective';
Expand All @@ -13,7 +15,7 @@ describe(
{ tags: ['@alerting', '@metrics'] },
() => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
cy.switchPerspective('Core platform');
});

Expand All @@ -32,3 +34,24 @@ describe(
testAlertsRegression(CustomerPerspectiveName.CorePlatform);
},
);

describe(
'Regression: Monitoring - Alerts Namespaced (Administrator)',
{ tags: ['@alerting'] },
() => {
before(() => {
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
alerts.interceptWatchdogAlert();
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
commonPages.titleShouldHaveText('Alerting');
alerts.interceptWatchdogAlert();
cy.changeNamespace(CLUSTER_MONITORING_OPERATOR.namespace);
});

// Run tests in Administrator perspective
testAlertsRegressionNamespace(CustomerPerspectiveName.CorePlatform);
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe(
{ tags: ['@alerting'] },
() => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective';
// Test suite for Administrator perspective
describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand All @@ -27,7 +27,7 @@ describe(
{ tags: ['@metrics'] },
() => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective';
// Test suite for Administrator perspective
describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand All @@ -27,7 +27,7 @@ describe(
{ tags: ['@metrics'] },
() => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ describe(
{ tags: ['@legacy-dashboards'] },
() => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
// When running only this file, beforeBlock changes the namespace to openshift-monitoring so
// we need to change it back to All Projects before landing to Dashboards page in order to
// have API Performance dashboard loaded by default
// When running only this file, ensureMonitoringPlugin changes the namespace to
// openshift-monitoring so we need to change it back to All Projects before
// landing to Dashboards page in order to have API Performance dashboard loaded by default
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
commonPages.titleShouldHaveText('Metrics');
cy.changeNamespace('All Projects');
Expand All @@ -37,7 +37,7 @@ describe(
{ tags: ['@legacy-dashboards'] },
() => {
before(() => {
cy.beforeBlock();
cy.ensureMonitoringPlugin();
});

beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/perses/00.coo_bvt_perses_admin.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe(
{ tags: ['@perses-dashboards', '@coo'] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: true,
troubleshootingPanel: false,
});
Expand Down
4 changes: 2 additions & 2 deletions web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe(
{ tags: ['@perses-dashboards', '@coo'] },
() => {
before(() => {
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: true,
troubleshootingPanel: false,
});
Expand All @@ -38,7 +38,7 @@ describe(
{ tags: ['@perses-dashboards', '@coo'] },
() => {
before(() => {
cy.beforeBlockCOO();
cy.ensureMonitoringConsolePlugin();
cy.switchPerspective('Core platform');
cy.cleanupPersesTestDashboardsBeforeTests();
});
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/perses/05.coo_tempo_loki_admin.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe(
cy.cleanupLoggingUIPlugin();
cy.cleanupExtraDashboards();

cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: true,
troubleshootingPanel: false,
});
Expand Down
5 changes: 3 additions & 2 deletions web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe(
() => {
before(() => {
// Setup COO and Perses dashboards (requires admin privileges)
cy.beforeBlockCOO({
cy.ensureMonitoringConsolePlugin({
dashboards: true,
troubleshootingPanel: false,
});
Expand All @@ -17,7 +17,8 @@ describe(
cy.setupPersesRBACandExtraDashboards();

// Clear Cypress session cache and logout
// This is critical because beforeBlockCOO uses cy.session() which caches the login state
// This is critical because ensureMonitoringConsolePlugin uses cy.session()
// which caches login state
cy.log('Clearing Cypress session cache to ensure fresh login');
cy.then(() => {
Cypress.session.clearAllSavedSessions();
Expand Down
Loading