From a6aa72c2e84296e48914915d35d7bd8c8cff1bd4 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:15:37 -0400 Subject: [PATCH 1/7] refactor: move incidents support files --- .cursor/commands/fixture-schema-reference.md | 12 +- .cursor/commands/generate-incident-fixture.md | 19 +- .cursor/commands/generate-regression-test.md | 2 +- .cursor/commands/refactor-regression-test.md | 377 +++++++++++------- .../commands/validate-incident-fixtures.md | 10 +- .../rules/incidents-testing-guidelines.mdc | 8 +- .../tests/1.filtering_flows.md | 41 +- .../tests/2.ui_display_flows.md | 2 + .../tests/3.api_calls_data_loading_flows.md | 2 + .../tests/4.redux_state_and_effects_flows.md | 45 ++- .../tests/6.table_interactions.md | 4 + .../performance/03.endurance_test_source.md | 2 + .../tests/performance/overview.md | 24 +- .../performance/performance_benchmark.cy.ts | 4 +- .../performance/performance_walkthrough.cy.ts | 4 +- .../incidents/regression/ui_regressions.cy.ts | 2 +- .../README.md | 4 +- .../commands/incident-commands.ts | 0 .../index.ts | 0 .../mock-generators.ts | 0 .../prometheus-mocks.ts | 0 .../schema/fixture-converter.ts | 0 .../schema/fixture-schema.json | 0 .../schema/schema-validator.ts | 0 .../schema/validate-fixtures.ts | 4 +- .../schema/yaml-fixture-snippets.json | 0 .../types.ts | 0 .../utils.ts | 0 28 files changed, 348 insertions(+), 218 deletions(-) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/README.md (96%) rename web/cypress/support/{ => incidents}/commands/incident-commands.ts (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/index.ts (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/mock-generators.ts (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/prometheus-mocks.ts (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/schema/fixture-converter.ts (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/schema/fixture-schema.json (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/schema/schema-validator.ts (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/schema/validate-fixtures.ts (95%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/schema/yaml-fixture-snippets.json (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/types.ts (100%) rename web/cypress/support/{incidents_prometheus_query_mocks => incidents}/utils.ts (100%) diff --git a/.cursor/commands/fixture-schema-reference.md b/.cursor/commands/fixture-schema-reference.md index 21fb548fc..a67185d1e 100644 --- a/.cursor/commands/fixture-schema-reference.md +++ b/.cursor/commands/fixture-schema-reference.md @@ -189,16 +189,16 @@ cy.mockIncidentFixture( ### CLI Validation ```bash -cd web/cypress/support/incidents_prometheus_query_mocks -node validate-fixtures.js --all -node validate-fixtures.js specific-file.yaml +cd web +npm run ts-node -- cypress/support/incidents/schema/validate-fixtures.ts --all +npm run ts-node -- cypress/support/incidents/schema/validate-fixtures.ts cypress/fixtures/incidents/scenarios/single-incident-firing-critical-and-warning-alerts.yaml ``` ### Schema Files -- Schema: `web/cypress/support/incidents_prometheus_query_mocks/fixture-schema.json` -- Validator: `web/cypress/support/incidents_prometheus_query_mocks/schema-validator.ts` -- CLI Tool: `web/cypress/support/incidents_prometheus_query_mocks/validate-fixtures.js` +- Schema: `web/cypress/support/incidents/schema/fixture-schema.json` +- Validator: `web/cypress/support/incidents/schema/schema-validator.ts` +- CLI Tool: `web/cypress/support/incidents/schema/validate-fixtures.ts` ## Best Practices diff --git a/.cursor/commands/generate-incident-fixture.md b/.cursor/commands/generate-incident-fixture.md index 68f637c54..90ed4d875 100644 --- a/.cursor/commands/generate-incident-fixture.md +++ b/.cursor/commands/generate-incident-fixture.md @@ -9,12 +9,14 @@ Generate valid YAML fixtures for incident scenarios based on text descriptions o ## Process ### 1. Analyze Input + - **Text Description**: Extract incident components, alert names, severities, and timeline - **Screenshot**: Identify visible incidents, alerts, and timeline - **CONVERT ALL DATES TO RELATIVE TIME**. There will be usually one chart 'Incident Timeline' displaying the incident timelines and second one 'Alert Timelines' which displays alerts for **a single particular incident**. When the Alert timeline is visible, include timestamps for the individual alerts within the incident, which may differ from the incident one. - Focus on capturing the precise start and end dates for incidents and individual alerts so that the variability from the screenshot is preserved. ### 2. Generate YAML Structure -Create fixture following the schema in [fixture-schema.json](mdc:web/cypress/support/incidents_prometheus_query_mocks/fixture-schema.json). Prefer this schema over existing fixtures. + +Create fixture following the schema in [fixture-schema.json](mdc:web/cypress/support/incidents/schema/fixture-schema.json). Prefer this schema over existing fixtures. ```yaml name: "[Scenario Name]" @@ -36,6 +38,7 @@ incidents: ``` ### 3. Apply Constraints + - **Name and Description**: Use generic name capturing the essence of the scenario - **File name**: Use generic name capturing the essence of the scenario - **Components**: `monitoring`, `storage`, `network`, `compute`, `api-server`, `etcd`, `version`, `Others` @@ -45,12 +48,19 @@ incidents: - **Alert Names**: Use descriptive, artificial names with unique indices (e.g., `"MonitoringAlertmanagerReceiversCritical001"`) ### 4. Time Conversion Rules + - **NEVER use absolute dates/timestamps** - Convert screenshot dates to relative durations from the end of the chart - Example: If screenshot shows "2024-01-15 14:30" and current time is "2024-01-15 16:30", use `"2h"` ### 5. Run validation -- run the validation using [fixture-schema.json](mdc:web/cypress/support/incident_prometheus_query_mocks/validate_fixture.js) + +- run the validation using [validate-fixtures.ts](mdc:web/cypress/support/incidents/schema/validate-fixtures.ts) + +```bash +cd web +npm run ts-node -- cypress/support/incidents/schema/validate-fixtures.ts --all +``` ```yaml @@ -65,7 +75,8 @@ incidents: - [ ] Namespaces follow OpenShift conventions - [ ] Severity levels are valid (critical, warning, info) - [ ] YAML syntax is correct with proper indentation -- [ ] Schema validation passes against [fixture-schema.json](mdc:web/cypress/support/incidents_prometheus_query_mocks/fixture-schema.json) +- [ ] Schema validation passes against [fixture-schema.json](mdc:web/cypress/support/incidents/schema/fixture-schema.json) ## Output -Provide complete YAML fixture ready for use with `cy.mockIncidentFixture()` in Cypress tests. \ No newline at end of file +Provide complete YAML fixture ready for use with `cy.mockIncidentFixture()` in Cypress tests. +``` diff --git a/.cursor/commands/generate-regression-test.md b/.cursor/commands/generate-regression-test.md index 306872270..d65e512ed 100644 --- a/.cursor/commands/generate-regression-test.md +++ b/.cursor/commands/generate-regression-test.md @@ -623,7 +623,7 @@ describe("Regression: Tooltip Positioning", () => { 3. **Design comprehensive flow**: Instead of separate tests for each filter type, create complete filtering workflows - Flow 1: User applies multiple filters in sequence, verifies each step, then clears all - Flow 2: User changes time range while filters are active, verifies data updates -4. Generate `01.reg_filtering.cy.ts` with **comprehensive multi-step tests** +4. Generate `filtering.cy.ts` with **comprehensive multi-step tests** 5. Each test should have 5-8 steps covering realistic filter combinations and transitions ## Output Format diff --git a/.cursor/commands/refactor-regression-test.md b/.cursor/commands/refactor-regression-test.md index f865a7ed3..5523c1573 100644 --- a/.cursor/commands/refactor-regression-test.md +++ b/.cursor/commands/refactor-regression-test.md @@ -2,6 +2,8 @@ description: Refactor and clean up existing regression test for improved readability and maintainability --- +TODO: UPDATE THIS WITH NEW STRUCTURE + # Refactor Regression Test Refactor an existing regression test to improve code quality, eliminate duplication, and enhance readability. This command should be run after initial test generation and manual verification. @@ -9,6 +11,7 @@ Refactor an existing regression test to improve code quality, eliminate duplicat ## Purpose After generating and verifying a regression test works correctly, this command: + - Extracts repetitive patterns into helper functions - Improves test readability (makes `it()` blocks read like user stories) - Consolidates similar assertions @@ -22,6 +25,7 @@ After generating and verifying a regression test works correctly, this command: **Input**: Path to test file (e.g., `web/cypress/e2e/incidents/regression/05.reg_tooltip_positioning.cy.ts`) **Read and analyze**: + - Test structure and flow - Repetitive assertion patterns - Complex multi-step verifications @@ -34,25 +38,36 @@ After generating and verifying a regression test works correctly, this command: **Look for**: #### Repeated Assertion Patterns + ```typescript // Example: Repeated opacity checks -incidentsPage.elements.alertsChartBarsPaths().eq(0).then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); - expect(opacity).to.equal(0.3); -}); +incidentsPage.elements + .alertsChartBarsPaths() + .eq(0) + .then(($bar) => { + const opacity = parseFloat($bar.css("opacity") || "1"); + expect(opacity).to.equal(0.3); + }); -incidentsPage.elements.alertsChartBarsPaths().eq(1).then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); - expect(opacity).to.equal(1.0); -}); +incidentsPage.elements + .alertsChartBarsPaths() + .eq(1) + .then(($bar) => { + const opacity = parseFloat($bar.css("opacity") || "1"); + expect(opacity).to.equal(1.0); + }); ``` #### Complex Multi-Step Verifications + ```typescript // Example: Complex tooltip verification repeated multiple times -incidentsPage.elements.incidentsChartBarsVisiblePaths().eq(0).trigger('mouseover'); -cy.get('[role="tooltip"]').should('be.visible'); -cy.get('[role="tooltip"]').should('contain.text', 'Expected text'); +incidentsPage.elements + .incidentsChartBarsVisiblePaths() + .eq(0) + .trigger("mouseover"); +cy.get('[role="tooltip"]').should("be.visible"); +cy.get('[role="tooltip"]').should("contain.text", "Expected text"); cy.get('[role="tooltip"]').then(($tooltip) => { const rect = $tooltip[0].getBoundingClientRect(); expect(rect.top).to.be.greaterThan(0); @@ -60,26 +75,32 @@ cy.get('[role="tooltip"]').then(($tooltip) => { ``` #### Inline Calculations + ```typescript // Example: Calculations within test body -incidentsPage.elements.component().invoke('text').then((text) => { - const cleaned = text.trim().toLowerCase(); - const parts = cleaned.split(','); - expect(parts).to.have.length(3); -}); +incidentsPage.elements + .component() + .invoke("text") + .then((text) => { + const cleaned = text.trim().toLowerCase(); + const parts = cleaned.split(","); + expect(parts).to.have.length(3); + }); ``` #### Custom Selectors Used Multiple Times + ```typescript // Example: Direct selector usage instead of page object -cy.get('[role="tooltip"]').should('be.visible'); -cy.get('[role="tooltip"]').should('contain.text', 'Text'); +cy.get('[role="tooltip"]').should("be.visible"); +cy.get('[role="tooltip"]').should("contain.text", "Text"); // Repeated many times in the test ``` ### 3. Create Helper Functions **Guidelines**: + - Place helper functions within the test file (inside or outside `describe()` block) - Use descriptive names that explain what they verify - Keep helpers focused on a single responsibility @@ -88,50 +109,70 @@ cy.get('[role="tooltip"]').should('contain.text', 'Text'); **Helper Function Patterns**: #### Simple Assertion Helper + ```typescript const verifyElementProperty = ( selector: Cypress.Chainable>, property: string, - expectedValue: any + expectedValue: any, ) => { selector.then(($el) => { const value = $el.css(property); - expect(parseFloat(value || '0')).to.equal(expectedValue); + expect(parseFloat(value || "0")).to.equal(expectedValue); }); }; ``` #### Multi-Step Verification Helper + ```typescript -const verifyTooltipContent = (expectedTexts: string[], shouldBeSilenced: boolean = false) => { - const tooltip = cy.get('[role="tooltip"]').should('be.visible'); - expectedTexts.forEach(text => tooltip.should('contain.text', text)); - tooltip.should(shouldBeSilenced ? 'contain.text' : 'not.contain.text', '(silenced)'); +const verifyTooltipContent = ( + expectedTexts: string[], + shouldBeSilenced: boolean = false, +) => { + const tooltip = cy.get('[role="tooltip"]').should("be.visible"); + expectedTexts.forEach((text) => tooltip.should("contain.text", text)); + tooltip.should( + shouldBeSilenced ? "contain.text" : "not.contain.text", + "(silenced)", + ); }; ``` #### Interaction + Verification Helper + ```typescript -const hoverAndVerifyTooltipPosition = (barIndex: number, expectedPosition: 'top' | 'bottom') => { - incidentsPage.elements.incidentsChartBarsVisiblePaths() +const hoverAndVerifyTooltipPosition = ( + barIndex: number, + expectedPosition: "top" | "bottom", +) => { + incidentsPage.elements + .incidentsChartBarsVisiblePaths() .eq(barIndex) - .trigger('mouseover', { force: true }); - - cy.get('[role="tooltip"]').should('be.visible').then(($tooltip) => { - const rect = $tooltip[0].getBoundingClientRect(); - if (expectedPosition === 'top') { - expect(rect.bottom).to.be.lessThan(Cypress.$(window).height()); - } else { - expect(rect.top).to.be.greaterThan(0); - } - }); + .trigger("mouseover", { force: true }); + + cy.get('[role="tooltip"]') + .should("be.visible") + .then(($tooltip) => { + const rect = $tooltip[0].getBoundingClientRect(); + if (expectedPosition === "top") { + expect(rect.bottom).to.be.lessThan(Cypress.$(window).height()); + } else { + expect(rect.top).to.be.greaterThan(0); + } + }); }; ``` #### Data Processing Helper + ```typescript const parseComponentList = (text: string): string[] => { - return text.trim().split(',').map(s => s.trim()).filter(s => s.length > 0); + return text + .trim() + .split(",") + .map((s) => s.trim()) + .filter((s) => s.length > 0); }; ``` @@ -140,73 +181,94 @@ const parseComponentList = (text: string): string[] => { **Goal**: The `it()` block should read like a user story, with implementation details hidden in helpers. **Before**: + ```typescript -it('1. Verify alert opacity and tooltips', () => { - cy.log('1.1 Check first alert opacity'); - incidentsPage.elements.alertsChartBarsPaths().eq(0).then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); - expect(opacity).to.equal(0.3); - }); - - cy.log('1.2 Check first alert tooltip'); - incidentsPage.elements.alertsChartBarsPaths().eq(0).trigger('mouseover'); - cy.get('[role="tooltip"]').should('be.visible'); - cy.get('[role="tooltip"]').should('contain.text', 'Alert 1'); - cy.get('[role="tooltip"]').should('contain.text', '(silenced)'); - - cy.log('1.3 Check second alert opacity'); - incidentsPage.elements.alertsChartBarsPaths().eq(1).then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); - expect(opacity).to.equal(1.0); - }); - - cy.log('1.4 Check second alert tooltip'); - incidentsPage.elements.alertsChartBarsPaths().eq(1).trigger('mouseover'); - cy.get('[role="tooltip"]').should('be.visible'); - cy.get('[role="tooltip"]').should('contain.text', 'Alert 2'); - cy.get('[role="tooltip"]').should('not.contain.text', '(silenced)'); +it("1. Verify alert opacity and tooltips", () => { + cy.log("1.1 Check first alert opacity"); + incidentsPage.elements + .alertsChartBarsPaths() + .eq(0) + .then(($bar) => { + const opacity = parseFloat($bar.css("opacity") || "1"); + expect(opacity).to.equal(0.3); + }); + + cy.log("1.2 Check first alert tooltip"); + incidentsPage.elements.alertsChartBarsPaths().eq(0).trigger("mouseover"); + cy.get('[role="tooltip"]').should("be.visible"); + cy.get('[role="tooltip"]').should("contain.text", "Alert 1"); + cy.get('[role="tooltip"]').should("contain.text", "(silenced)"); + + cy.log("1.3 Check second alert opacity"); + incidentsPage.elements + .alertsChartBarsPaths() + .eq(1) + .then(($bar) => { + const opacity = parseFloat($bar.css("opacity") || "1"); + expect(opacity).to.equal(1.0); + }); + + cy.log("1.4 Check second alert tooltip"); + incidentsPage.elements.alertsChartBarsPaths().eq(1).trigger("mouseover"); + cy.get('[role="tooltip"]').should("be.visible"); + cy.get('[role="tooltip"]').should("contain.text", "Alert 2"); + cy.get('[role="tooltip"]').should("not.contain.text", "(silenced)"); }); ``` **After**: + ```typescript const verifyAlertOpacity = (alertIndex: number, expectedOpacity: number) => { - incidentsPage.elements.alertsChartBarsPaths() + incidentsPage.elements + .alertsChartBarsPaths() .eq(alertIndex) .then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); + const opacity = parseFloat($bar.css("opacity") || "1"); expect(opacity).to.equal(expectedOpacity); }); }; -const verifyAlertTooltip = (alertIndex: number, expectedTexts: string[], shouldBeSilenced: boolean) => { - incidentsPage.elements.alertsChartBarsPaths().eq(alertIndex).trigger('mouseover'); - const tooltip = cy.get('[role="tooltip"]').should('be.visible'); - expectedTexts.forEach(text => tooltip.should('contain.text', text)); - tooltip.should(shouldBeSilenced ? 'contain.text' : 'not.contain.text', '(silenced)'); +const verifyAlertTooltip = ( + alertIndex: number, + expectedTexts: string[], + shouldBeSilenced: boolean, +) => { + incidentsPage.elements + .alertsChartBarsPaths() + .eq(alertIndex) + .trigger("mouseover"); + const tooltip = cy.get('[role="tooltip"]').should("be.visible"); + expectedTexts.forEach((text) => tooltip.should("contain.text", text)); + tooltip.should( + shouldBeSilenced ? "contain.text" : "not.contain.text", + "(silenced)", + ); }; -it('1. Verify alert opacity and tooltips', () => { - cy.log('1.1 Verify silenced alert has reduced opacity and indicator'); +it("1. Verify alert opacity and tooltips", () => { + cy.log("1.1 Verify silenced alert has reduced opacity and indicator"); verifyAlertOpacity(0, 0.3); - verifyAlertTooltip(0, ['Alert 1'], true); - - cy.log('1.2 Verify non-silenced alert has full opacity without indicator'); + verifyAlertTooltip(0, ["Alert 1"], true); + + cy.log("1.2 Verify non-silenced alert has full opacity without indicator"); verifyAlertOpacity(1, 1.0); - verifyAlertTooltip(1, ['Alert 2'], false); - - cy.log('Verified: Alert silence indicators work correctly'); + verifyAlertTooltip(1, ["Alert 2"], false); + + cy.log("Verified: Alert silence indicators work correctly"); }); ``` ### 5. Suggest Page Object Additions **When to suggest page object additions**: + - Helper functionality could be reused across multiple test files - Custom selectors are used repeatedly (e.g., `cy.get('[role="tooltip"]')`) - Complex interactions that represent common user actions **Format suggestion**: + ``` The following functionality could be added to incidents-page.ts for reusability: @@ -235,36 +297,41 @@ Should I add these to incidents-page.ts? **Important**: Only remove `cy.pause()` statements if user explicitly requests it or confirms. **When to remove**: + - User says "remove pauses" - User says "cleanup test" or "finalize test" - Test has been verified and is working correctly **When NOT to remove**: + - User just generated the test (they need to verify first) - User hasn't confirmed the test works - Not explicitly requested **Process**: + 1. Identify all `cy.pause()` statements 2. Check if they're still needed for manual verification 3. If removing, preserve the surrounding assertions 4. Update `cy.log()` messages to reflect completed verification **Example removal**: + ```typescript // Before -cy.log('1.1 Verify incidents loaded'); -incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 12); +cy.log("1.1 Verify incidents loaded"); +incidentsPage.elements.incidentsChartBarsGroups().should("have.length", 12); cy.pause(); // Manual verification point // After -cy.log('1.1 Verify incidents loaded'); -incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 12); +cy.log("1.1 Verify incidents loaded"); +incidentsPage.elements.incidentsChartBarsGroups().should("have.length", 12); ``` ### 7. Ensure E2E Best Practices **Verify the refactored test follows**: + - [ ] Tests cover complete user flows, not isolated actions - [ ] Each `it()` block represents a realistic user journey - [ ] Test body is readable as a story (implementation details in helpers) @@ -277,6 +344,7 @@ incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 12); ### 8. Output Refactored Test **Provide**: + 1. **Complete refactored test file**: Full content with helpers and cleaned-up test body 2. **Summary of changes**: - List of helper functions added @@ -291,23 +359,26 @@ incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 12); ### Example 1: Tooltip Verification **Before** (repetitive): + ```typescript -it('1. Verify tooltips', () => { - cy.log('1.1 Bottom bar tooltip'); - incidentsPage.elements.incidentsChartBarsVisiblePaths() +it("1. Verify tooltips", () => { + cy.log("1.1 Bottom bar tooltip"); + incidentsPage.elements + .incidentsChartBarsVisiblePaths() .first() - .trigger('mouseover', { force: true }); - cy.get('[role="tooltip"]').should('be.visible'); + .trigger("mouseover", { force: true }); + cy.get('[role="tooltip"]').should("be.visible"); cy.get('[role="tooltip"]').then(($tooltip) => { const rect = $tooltip[0].getBoundingClientRect(); expect(rect.top).to.be.greaterThan(0); }); - - cy.log('1.2 Top bar tooltip'); - incidentsPage.elements.incidentsChartBarsVisiblePaths() + + cy.log("1.2 Top bar tooltip"); + incidentsPage.elements + .incidentsChartBarsVisiblePaths() .last() - .trigger('mouseover', { force: true }); - cy.get('[role="tooltip"]').should('be.visible'); + .trigger("mouseover", { force: true }); + cy.get('[role="tooltip"]').should("be.visible"); cy.get('[role="tooltip"]').then(($tooltip) => { const rect = $tooltip[0].getBoundingClientRect(); const viewportHeight = Cypress.$(window).height(); @@ -317,92 +388,113 @@ it('1. Verify tooltips', () => { ``` **After** (clean): + ```typescript -const verifyTooltipPosition = (barIndex: number, position: 'top' | 'bottom') => { - incidentsPage.elements.incidentsChartBarsVisiblePaths() +const verifyTooltipPosition = ( + barIndex: number, + position: "top" | "bottom", +) => { + incidentsPage.elements + .incidentsChartBarsVisiblePaths() .eq(barIndex) - .trigger('mouseover', { force: true }); - - cy.get('[role="tooltip"]').should('be.visible').then(($tooltip) => { - const rect = $tooltip[0].getBoundingClientRect(); - if (position === 'bottom') { - expect(rect.top).to.be.greaterThan(0); - } else { - const viewportHeight = Cypress.$(window).height(); - expect(rect.bottom).to.be.lessThan(viewportHeight); - } - }); + .trigger("mouseover", { force: true }); + + cy.get('[role="tooltip"]') + .should("be.visible") + .then(($tooltip) => { + const rect = $tooltip[0].getBoundingClientRect(); + if (position === "bottom") { + expect(rect.top).to.be.greaterThan(0); + } else { + const viewportHeight = Cypress.$(window).height(); + expect(rect.bottom).to.be.lessThan(viewportHeight); + } + }); }; -it('1. Verify tooltips', () => { - cy.log('1.1 Verify bottom and top bar tooltip positioning'); - verifyTooltipPosition(0, 'bottom'); - verifyTooltipPosition(-1, 'top'); - cy.log('Verified: Tooltips positioned correctly at all chart positions'); +it("1. Verify tooltips", () => { + cy.log("1.1 Verify bottom and top bar tooltip positioning"); + verifyTooltipPosition(0, "bottom"); + verifyTooltipPosition(-1, "top"); + cy.log("Verified: Tooltips positioned correctly at all chart positions"); }); ``` ### Example 2: Opacity and Tooltip Combined **Before** (verbose): + ```typescript -it('1. Alert silence indicators', () => { - cy.log('1.1 Check silenced alert'); - incidentsPage.elements.alertsChartBarsPaths().eq(0).then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); - expect(opacity).to.equal(0.3); - }); - incidentsPage.elements.alertsChartBarsPaths().eq(0).trigger('mouseover'); - cy.get('[role="tooltip"]').should('be.visible'); - cy.get('[role="tooltip"]').should('contain.text', '(silenced)'); - - cy.log('1.2 Check non-silenced alert'); - incidentsPage.elements.alertsChartBarsPaths().eq(1).then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); - expect(opacity).to.equal(1.0); - }); - incidentsPage.elements.alertsChartBarsPaths().eq(1).trigger('mouseover'); - cy.get('[role="tooltip"]').should('be.visible'); - cy.get('[role="tooltip"]').should('not.contain.text', '(silenced)'); +it("1. Alert silence indicators", () => { + cy.log("1.1 Check silenced alert"); + incidentsPage.elements + .alertsChartBarsPaths() + .eq(0) + .then(($bar) => { + const opacity = parseFloat($bar.css("opacity") || "1"); + expect(opacity).to.equal(0.3); + }); + incidentsPage.elements.alertsChartBarsPaths().eq(0).trigger("mouseover"); + cy.get('[role="tooltip"]').should("be.visible"); + cy.get('[role="tooltip"]').should("contain.text", "(silenced)"); + + cy.log("1.2 Check non-silenced alert"); + incidentsPage.elements + .alertsChartBarsPaths() + .eq(1) + .then(($bar) => { + const opacity = parseFloat($bar.css("opacity") || "1"); + expect(opacity).to.equal(1.0); + }); + incidentsPage.elements.alertsChartBarsPaths().eq(1).trigger("mouseover"); + cy.get('[role="tooltip"]').should("be.visible"); + cy.get('[role="tooltip"]').should("not.contain.text", "(silenced)"); }); ``` **After** (concise): + ```typescript const verifyAlertSilenceIndicator = ( alertIndex: number, isSilenced: boolean, - alertName: string + alertName: string, ) => { const expectedOpacity = isSilenced ? 0.3 : 1.0; - - incidentsPage.elements.alertsChartBarsPaths() + + incidentsPage.elements + .alertsChartBarsPaths() .eq(alertIndex) .then(($bar) => { - const opacity = parseFloat($bar.css('opacity') || '1'); + const opacity = parseFloat($bar.css("opacity") || "1"); expect(opacity).to.equal(expectedOpacity); }); - - incidentsPage.elements.alertsChartBarsPaths() + + incidentsPage.elements + .alertsChartBarsPaths() .eq(alertIndex) - .trigger('mouseover'); - - const tooltip = cy.get('[role="tooltip"]').should('be.visible'); - tooltip.should('contain.text', alertName); - tooltip.should(isSilenced ? 'contain.text' : 'not.contain.text', '(silenced)'); + .trigger("mouseover"); + + const tooltip = cy.get('[role="tooltip"]').should("be.visible"); + tooltip.should("contain.text", alertName); + tooltip.should( + isSilenced ? "contain.text" : "not.contain.text", + "(silenced)", + ); }; -it('1. Alert silence indicators', () => { - cy.log('1.1 Verify silence indicators on silenced and non-silenced alerts'); - verifyAlertSilenceIndicator(0, true, 'SilencedAlert'); - verifyAlertSilenceIndicator(1, false, 'ActiveAlert'); - cy.log('Verified: Silence indicators work correctly'); +it("1. Alert silence indicators", () => { + cy.log("1.1 Verify silence indicators on silenced and non-silenced alerts"); + verifyAlertSilenceIndicator(0, true, "SilencedAlert"); + verifyAlertSilenceIndicator(1, false, "ActiveAlert"); + cy.log("Verified: Silence indicators work correctly"); }); ``` ## Validation Checklist Before outputting refactored test: + - [ ] Helper functions eliminate all significant code duplication - [ ] Helper functions have descriptive, clear names - [ ] Test body (`it()` blocks) reads like a user story @@ -423,4 +515,3 @@ Before outputting refactored test: - **Keep helpers simple**: Each helper should have a single, clear purpose - **Test-specific vs. reusable**: Keep test-specific helpers in test file, suggest page object additions for reusable functionality - **Respect user's verification process**: Don't remove `cy.pause()` unless explicitly asked - diff --git a/.cursor/commands/validate-incident-fixtures.md b/.cursor/commands/validate-incident-fixtures.md index 440f3ff13..326b1ceea 100644 --- a/.cursor/commands/validate-incident-fixtures.md +++ b/.cursor/commands/validate-incident-fixtures.md @@ -17,8 +17,8 @@ Validate existing YAML incident fixture files against the JSON Schema to ensure Use the validation tool to check each fixture: ```bash -cd web/cypress/support/incidents_prometheus_query_mocks -node validate-fixtures.js --all +cd web +npm run ts-node -- cypress/support/incidents/schema/validate-fixtures.ts --all ``` ### 3. Analyze Results @@ -138,6 +138,6 @@ Provide: ## Tools Available -- Schema validator: `web/cypress/support/incidents_prometheus_query_mocks/schema-validator.ts` -- CLI validator: `web/cypress/support/incidents_prometheus_query_mocks/validate-fixtures.js` -- JSON Schema: `web/cypress/support/incidents_prometheus_query_mocks/fixture-schema.json` +- Schema validator: `web/cypress/support/incidents/schema/schema-validator.ts` +- CLI validator: `web/cypress/support/incidents/schema/validate-fixtures.ts` +- JSON Schema: `web/cypress/support/incidents/schema/fixture-schema.json` diff --git a/.cursor/rules/incidents-testing-guidelines.mdc b/.cursor/rules/incidents-testing-guidelines.mdc index f8c8e58cc..c55542b03 100644 --- a/.cursor/rules/incidents-testing-guidelines.mdc +++ b/.cursor/rules/incidents-testing-guidelines.mdc @@ -88,8 +88,8 @@ getData: (): Cypress.Chainable => { ### File Naming Convention - Location: `web/cypress/e2e/incidents/regression/` -- Pattern: `XX.reg_.cy.ts` -- Examples: `05.reg_tooltip_positioning.cy.ts`, `01.reg_filtering.cy.ts` +- Pattern: `.cy.ts` +- Examples: `tooltip_positioning.cy.ts`, `filtering.cy.ts` ### Test File Structure ```typescript @@ -252,7 +252,7 @@ cy.mockIncidents([]); ### Creating Fixtures - Use `generate-incident-fixture` command for new fixtures -- Follow schema from `web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-schema.json` +- Follow schema from `web/cypress/support/incidents/schema/fixture-schema.json` - Validate fixtures before committing - Prefer single scenario per test file for focused regression testing @@ -297,7 +297,7 @@ cy.mockIncidents([]); import { incidentsPage } from '../../../views/incidents-page'; // Import types when needed -import { IncidentDefinition } from '../../support/incidents_prometheus_query_mocks'; +import { IncidentDefinition } from '../../../support/incidents'; ``` ### Comments diff --git a/docs/incident_detection/tests/1.filtering_flows.md b/docs/incident_detection/tests/1.filtering_flows.md index aee4d9cb8..889c9389b 100644 --- a/docs/incident_detection/tests/1.filtering_flows.md +++ b/docs/incident_detection/tests/1.filtering_flows.md @@ -1,6 +1,6 @@ ## 1. CRITICAL: Filtering Bugs -**Automation Status**: AUTOMATED in `01.reg_filtering.cy.ts` +**Automation Status**: AUTOMATED in `filtering.cy.ts` ### Prerequisites: Test Data Setup for Filtering Tests @@ -19,43 +19,46 @@ start,end,alertname,namespace,severity,silenced,labels ``` **Quick Reference**: -| Incident | Component | Severity History | State | Time Range | -|----------|-----------|------------------|-------|------------| -| A | logging | Info | Resolved | 0-180 | -| B | storage | Warning | Resolved | 240-360 | -| D | monitoring | Info→Warning→Critical | Firing | 480-780 | -| H | network | Critical | Firing | 1560-1740 | + +| Incident | Component | Severity History | State | Time Range | +| -------- | ---------- | --------------------- | -------- | ---------- | +| A | logging | Info | Resolved | 0-180 | +| B | storage | Warning | Resolved | 240-360 | +| D | monitoring | Info→Warning→Critical | Firing | 480-780 | +| H | network | Critical | Firing | 1560-1740 | ### 1.1 Incident Severity Filtering (Not Alert Severity) + **BUG**: Incidents were being filtered by underlying alert severities instead of the incident's own severity history. -- [ ] **Filter by "Critical"**: - -- [ ] **Filter by "Warning"**: - -- [ ] **Filter by "Informative"**: - +- [ ] **Filter by "Critical"**: + +- [ ] **Filter by "Warning"**: + +- [ ] **Filter by "Informative"**: + - [ ] **Multiple Severity Filters (e.g., Critical + Warning)**: For each, ensure that the correct incidents are shown. The particular numbers may be slightly off if additional alerts are firing in the cluster. ### 1.2 Resolved Incident Filter Not Working + **BUG**: "Resolved" state filter wasn't working correctly. -- [ ] **Filter by "Resolved"**: -- [ ] **Filter by "Firing"**: +- [ ] **Filter by "Resolved"**: +- [ ] **Filter by "Firing"**: - [ ] **Verify Resolution Logic**: - Firing: `currentTime - lastTimestamp <= 10 minutes` - Resolved: `currentTime - lastTimestamp > 10 minutes` - Check Incidents that are resolved have last activity > 10 min ago ### 1.3 Combined Filtering (AND Logic Between Categories) -- [ ] **Critical + Resolved**: -- [ ] **Warning + Resolved**: -- [ ] **Critical + Firing**: +- [ ] **Critical + Resolved**: +- [ ] **Warning + Resolved**: +- [ ] **Critical + Firing**: - [ ] **Filter Persistence on URL**: Apply filters, refresh page - Apply: Warning + Resolved - Check URL: `?days=7+days&severity=Warning&state=Resolved` - - Refresh page → verify Incident B still shown \ No newline at end of file + - Refresh page → verify Incident B still shown diff --git a/docs/incident_detection/tests/2.ui_display_flows.md b/docs/incident_detection/tests/2.ui_display_flows.md index 57d9bdad5..4dcaaef87 100644 --- a/docs/incident_detection/tests/2.ui_display_flows.md +++ b/docs/incident_detection/tests/2.ui_display_flows.md @@ -1,5 +1,7 @@ ## 2. CRITICAL: Charts – UI Bugs +TODO: UPDATE THIS WITH NEW STRUCTURE + **Automation Status**: AUTOMATED in `02.reg_ui_charts_comprehensive.cy.ts` apart from 2.3.1 and 2.4 - Uses fixture: `incidents/scenarios/charts-ui-comprehensive.yaml` diff --git a/docs/incident_detection/tests/3.api_calls_data_loading_flows.md b/docs/incident_detection/tests/3.api_calls_data_loading_flows.md index d8db0992e..cfdf9987a 100644 --- a/docs/incident_detection/tests/3.api_calls_data_loading_flows.md +++ b/docs/incident_detection/tests/3.api_calls_data_loading_flows.md @@ -1,5 +1,7 @@ ## 3. CRITICAL: Data Loading – API Call Bugs +TODO: UPDATE THIS WITH NEW STRUCTURE + **Automation Status**: PARTIALLY AUTOMATED (Sections 3.1 and 3.2) ### Prerequisites: Test Data Setup for Data Loading Tests diff --git a/docs/incident_detection/tests/4.redux_state_and_effects_flows.md b/docs/incident_detection/tests/4.redux_state_and_effects_flows.md index 9f793b5bb..2fee421e9 100644 --- a/docs/incident_detection/tests/4.redux_state_and_effects_flows.md +++ b/docs/incident_detection/tests/4.redux_state_and_effects_flows.md @@ -1,5 +1,7 @@ ## 4. CRITICAL: Effects / Redux State Management Bugs +TODO: UPDATE THIS WITH NEW STRUCTURE + **Automation Status**: PARTIALLY AUTOMATED (4.5, 4.6, dropdown closure) ### Prerequisites: Test Data Setup for State Management Tests @@ -7,8 +9,10 @@ Use the complete set of incidents (A-J). These tests focus on how the UI responds to state changes rather than specific data values. ### 4.1 Basic Element Rendering + **Automation Status**: AUTOMATED -- Covered by `01.incidents.cy.ts` (tests 2, 3) and `04.reg_redux_effects.cy.ts` (test 3) + +- Covered by `incidents.cy.ts` (tests 2, 3) and `reg_redux_effects.cy.ts` (test 3) - Tests days filter changes and severity filter updates - Verifies chart updates immediately without page reload @@ -16,15 +20,17 @@ Use the complete set of incidents (A-J). These tests focus on how the UI respond - Start with "Last 7 days" (showing all 10 incidents A-J) - Change to "Last 1 day" (should show only recent incidents) - Verify incidents chart updates, loading spinner shows, new data displayed - + - [x] **Filtered Data Updates on Filter Change**: AUTOMATED in `01.incidents.cy.ts` test 3 and `04.reg_redux_effects.cy.ts` test 3 - Apply "Critical" filter → verify only D, E, H shown - Add "Warning" filter → verify B, F, G, I, J also appear - Verify chart updates immediately (no page reload) ### 4.2 Selected Incident Does Not Survive State Changes + **BUG**: Selected incident was being lost when changing filters or toggling graphs. **Automation Status**: PARTIALLY AUTOMATED (filter changes covered, graph toggle not covered) + - Covered by `04.reg_redux_effects.cy.ts` test 3 - Tests incident ID filter persistence when non-matching severity filter applied - Graph toggle test not automated @@ -33,12 +39,12 @@ Use the complete set of incidents (A-J). These tests focus on how the UI respond - Select Incident D (has Info, Warning, Critical in history) - Apply "Warning" filter (D matches because it had Warning) - Verify: Incident D still selected, URL has `?groupId=D`, alerts still shown - + - [x] **Selection Lost When Filtered Out (but ID filter persists)**: AUTOMATED in `04.reg_redux_effects.cy.ts` test 3 - Select Incident A (Info only) - Apply "Critical" filter (A doesn't match) - Verify: Incident A disappears, but Incident ID filter chip remains, appropriate state - + - [ ] **Selection Survives Graph Toggle**: NOT AUTOMATED - Select Incident H - Click "Hide graph" @@ -46,37 +52,41 @@ Use the complete set of incidents (A-J). These tests focus on how the UI respond - Click "Show graph" → verify chart renders correctly ### 4.3 Stale Alerts Displayed on Incident Reselection + **BUG**: When switching between incidents, stale alerts from previous incident shown briefly. **Automation Status**: INDIRECTLY COVERED by `01.incidents.cy.ts` (test 5: Traverse Incident Table) + - The `findIncidentWithAlert` method would fail if stale alerts from previous selections are displayed - Not explicitly tested with dedicated assertions, but functionality breaks if bug exists -- [ ] **Incident Switching**: +- [ ] **Incident Switching**: - Select Incident D (with 3 alerts: Info, Warning, Critical) - Deselect Incident D - Immediately select Incident E (3 different component alerts) - Verify: NO brief flash of D's alerts; loading state shown immediately - Verify: Only E's alerts displayed after fetch completes - -- [ ] **Deselect Incident**: + +- [ ] **Deselect Incident**: - Select Incident F - Click on Incident F again to deselect - Verify: Alerts chart shows "select an incident" empty state - Verify: No stale alerts remain ### 4.4 Incident Dropdown Staying Open After Page Refresh + **BUG**: Dropdowns remained open after page refresh (Incidents Display / not F5). **Automation Status**: AUTOMATED in `04.reg_redux_effects.cy.ts` (Test 2: Dropdown closure on deselection) -- [ ] **Dropdown State After Refresh**: +- [ ] **Dropdown State After Refresh**: - Select a particular Incident - ~~Toggle filters that cause deselection of the incident and page reload~~ - NOTE: This won't happen, as the page will not be reloaded in new update + NOTE: This won't happen, as the page will not be reloaded in new update - Verify: Dropdown is closed after reload - Verify: Dropdown does not jump to 0,0 coordinates - Verify: Filter state restored from URL but dropdown collapsed ### 4.5 Dropdown Staying open after deselection + **BUG**: Deselection of incident causes reposition of the dropdown **Automation Status**: AUTOMATED in `04.reg_redux_effects.cy.ts` (Test 2: Dropdown closure on deselection) - Select a particular incident @@ -84,31 +94,34 @@ Use the complete set of incidents (A-J). These tests focus on how the UI respond - Deselect the incident by clicking on the bar, the site data should reload - Verify: The dropdown should not reposition to 0.0 and should be closed - Verify: Do the same also with the right toolbar. - - -- [ ] **Dropdowns Auto-Close After Selection**: +- [ ] **Dropdowns Auto-Close After Selection**: - Open "Days" dropdown → select "3 days" → verify closes - Open "Incident ID" filter → select an incident → verify closes ### 4.5 Adding filter when incident selected does not remove the incident filter + **BUG:** When incident-id was filtered and additional filter (severity) applied, then if the filter was not matching the selected issue, the id filter was removed. **Automation Status**: AUTOMATED in `04.reg_redux_effects.cy.ts` (Test 3: Filter state preservation) + - [ ] Select a "critical" incident by id - [ ] Apply waring filter. - [ ] Verify incident is filtered out -- [ ] Verify the filters "warning", and "incident id" are applied. +- [ ] Verify the filters "warning", and "incident id" are applied. ### 4.6 Incidents Not Loaded Initially + **BUG**: Old Redux state was being used for effects fired at the beginning of page load. When the page loaded, only several issues were displayed. **Automation Status**: AUTOMATED in `04.reg_redux_effects.cy.ts` (Test 1: Fresh load verification) **NOTE:** Hard to replicate, requires fresh browser instance -### 4.7 Cached end time for prometheus query +### 4.7 Cached end time for prometheus query + **BUG**: End Time parameter for the prometheus query request uses the time of the initial load of the page instead of the current time, which causes firing alerts to be marked as resolved. **Automation Status**: NOT AUTOMATED (requires live firing alerts) -**NOTE**: The issue is conceptually very similiar to 3.3, but is caused by the redux state caching, so it belongs to this section. +**NOTE**: The issue is conceptually very similiar to 3.3, but is caused by the redux state caching, so it belongs to this section. + - **WARNING Not possible to test on Injected Data, requires continously firing alert, mocked (firing) data might be applicable though.** - Trigger a real firing alert (Pod CrashLooping...) - Verify that the alert is firing @@ -116,5 +129,3 @@ Use the complete set of incidents (A-J). These tests focus on how the UI respond - Refresh the days filter. - Verify that the end time in the query to prometheus is updated to the current time value. - Verify - - diff --git a/docs/incident_detection/tests/6.table_interactions.md b/docs/incident_detection/tests/6.table_interactions.md index dbffef8dd..00494a7fa 100644 --- a/docs/incident_detection/tests/6.table_interactions.md +++ b/docs/incident_detection/tests/6.table_interactions.md @@ -1,5 +1,9 @@ ### 6.1 Table Interactions + +TODO: UPDATE THIS WITH NEW STRUCTURE + **Automation Status**: INDIRECTLY COVERED by existing tests + - Indirectly tested by `01.incidents.cy.ts` (test 5: Traverse Incident Table) and `02.reg_ui_charts_comprehensive.cy.ts` - Table expansion, row interactions, and data display are exercised during incident selection and traversal 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 41e82c792..77d88e013 100644 --- a/docs/incident_detection/tests/performance/03.endurance_test_source.md +++ b/docs/incident_detection/tests/performance/03.endurance_test_source.md @@ -1,5 +1,7 @@ # 03. Endurance Test — Shelved Source +TODO: UPDATE THIS WITH NEW STRUCTURE + Shelved due to Cypress DOM snapshot accumulation causing ~10x degradation over 100 cycles regardless of application performance. See [overview.md](./overview.md) for details. **To re-enable:** save the code block below as `web/cypress/e2e/incidents/performance/03.performance_endurance.cy.ts`. diff --git a/docs/incident_detection/tests/performance/overview.md b/docs/incident_detection/tests/performance/overview.md index f4d4b5913..0445b1d70 100644 --- a/docs/incident_detection/tests/performance/overview.md +++ b/docs/incident_detection/tests/performance/overview.md @@ -1,15 +1,18 @@ # Performance Testing - Incidents Page +TODO: UPDATE THIS WITH NEW STRUCTURE + Location: `web/cypress/e2e/incidents/performance/` Verifies: OBSINTA-1006 ## Test Suite -### 01. Performance Benchmark (`01.performance_benchmark.cy.ts`) +### 01. Performance Benchmark (`performance_benchmark.cy.ts`) Measures wall-clock render time for chart operations under escalating data loads. Uses `performance.mark()`/`performance.measure()` for timing. **What it tests:** + - Incidents chart render: 100, 200, 500 alerts (single incident) - Alerts detail chart render after incident selection: 100, 200, 500 alerts - Multi-incident chart: 20 uniform incidents, 12 mixed-size incidents (67 alerts) @@ -19,8 +22,8 @@ Measures wall-clock render time for chart operations under escalating data loads **Known limitation:** 1000-alert tests are disabled — mocking that volume triggers a maximum call stack error in the mock generator, though equivalent non-mocked simulated data renders without issue. To re-enable, apply: ```diff ---- a/web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts -+++ b/web/cypress/e2e/incidents/performance/01.performance_benchmark.cy.ts +--- a/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts ++++ b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts @@ end of it('6.1 ...') + cy.log('6.1.4 Incidents chart with 1000 alerts (single incident)'); + benchmarkIncidentsChart( @@ -42,11 +45,12 @@ Measures wall-clock render time for chart operations under escalating data loads + ); ``` -### 02. Interactive Walkthrough (`02.performance_walkthrough.cy.ts`) +### 02. Interactive Walkthrough (`performance_walkthrough.cy.ts`) Measures incremental re-render cost during a realistic user session (as opposed to 01 which measures initial render). **What it tests:** + - Filter apply/clear cycle times with 20 incidents loaded - Time range switching (1d → 3d → 7d → 15d → 1d) - Table row expansion with 100 and 500 alerts @@ -71,12 +75,12 @@ Cypress captures a full DOM snapshot for every logged command (to enable time-tr ### Mitigation attempts and findings -| Approach | Result | -|----------|--------| -| `{ log: false }` on commands | ~20% total time reduction, ~34% faster by cycle 100. Gap widens over time, confirming snapshot accumulation contributes. But `.should()` assertions have no `log` option and still snapshot. | -| `numTestsKeptInMemory: 0` | Only purges between `it()` blocks, not within a single long-running test. | -| Split into multiple `it()` blocks | `testIsolation: false` preserves page state, but fixture/mock setup between blocks adds complexity and the shared state management is fragile. | -| Override `Cypress.log` with no-op | Cypress internally chains `.snapshot()`, `.end()`, `.set()` on the log return value. Stubbing all methods is brittle across Cypress versions. | +| Approach | Result | +| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `{ log: false }` on commands | ~20% total time reduction, ~34% faster by cycle 100. Gap widens over time, confirming snapshot accumulation contributes. But `.should()` assertions have no `log` option and still snapshot. | +| `numTestsKeptInMemory: 0` | Only purges between `it()` blocks, not within a single long-running test. | +| Split into multiple `it()` blocks | `testIsolation: false` preserves page state, but fixture/mock setup between blocks adds complexity and the shared state management is fragile. | +| Override `Cypress.log` with no-op | Cypress internally chains `.snapshot()`, `.end()`, `.set()` on the log return value. Stubbing all methods is brittle across Cypress versions. | ### Implication for the endurance test diff --git a/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts index 45407a3c4..39772ec3f 100644 --- a/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts +++ b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts @@ -15,7 +15,7 @@ Verifies: OBSINTA-1006 */ import { incidentsPage } from '../../../views/incidents-page'; -import { BenchmarkCollector } from '../../../support/benchmark-utils'; +import { BenchmarkCollector } from '../../../support/shared/commands/benchmark-utils'; // Wall-clock thresholds in ms. Includes Cypress overhead (navigation, intercept // wait, command scheduling). Set conservatively for initial calibration — tighten @@ -35,7 +35,7 @@ const THRESHOLDS = { INCIDENTS_CHART_MIXED_12: 5_000, }; -const collector = new BenchmarkCollector('01.performance_benchmark.cy.ts'); +const collector = new BenchmarkCollector('performance_benchmark.cy.ts'); describe( 'Regression: Performance Benchmark', diff --git a/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts b/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts index 7c2cc9c9d..fe07cda41 100644 --- a/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts +++ b/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts @@ -9,7 +9,7 @@ Verifies: OBSINTA-1006 */ import { incidentsPage } from '../../../views/incidents-page'; -import { BenchmarkCollector } from '../../../support/benchmark-utils'; +import { BenchmarkCollector } from '../../../support/shared/commands/benchmark-utils'; const THRESHOLDS = { FILTER_APPLY: 3_000, @@ -19,7 +19,7 @@ const THRESHOLDS = { TABLE_EXPAND_500: 20_000, }; -const collector = new BenchmarkCollector('02.performance_walkthrough.cy.ts'); +const collector = new BenchmarkCollector('performance_walkthrough.cy.ts'); describe( 'Performance: Interactive Walkthrough', diff --git a/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts b/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts index 4748c4c94..a8c20cda8 100644 --- a/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts +++ b/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts @@ -99,7 +99,7 @@ describe( }); beforeEach(() => { - cy.mockIncidentFixture('incident/scenarios/12-charts-ui-comprehensive.yaml'); + cy.mockIncidentFixture('incidents/scenarios/charts-ui-comprehensive.yaml'); }); describe('Section 2.1: Tooltip Positioning', () => { diff --git a/web/cypress/support/incidents_prometheus_query_mocks/README.md b/web/cypress/support/incidents/README.md similarity index 96% rename from web/cypress/support/incidents_prometheus_query_mocks/README.md rename to web/cypress/support/incidents/README.md index 6190f9815..1d898c529 100644 --- a/web/cypress/support/incidents_prometheus_query_mocks/README.md +++ b/web/cypress/support/incidents/README.md @@ -99,8 +99,8 @@ Validate fixtures using the CLI tool: ```bash cd web -npm run ts-node cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts -- --all -npm run ts-node cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts -- specific-file.yaml +npm run ts-node cypress/support/incidents/schema/validate-fixtures.ts -- --all +npm run ts-node cypress/support/incidents/schema/validate-fixtures.ts -- specific-file.yaml ``` ## Configuration diff --git a/web/cypress/support/commands/incident-commands.ts b/web/cypress/support/incidents/commands/incident-commands.ts similarity index 100% rename from web/cypress/support/commands/incident-commands.ts rename to web/cypress/support/incidents/commands/incident-commands.ts diff --git a/web/cypress/support/incidents_prometheus_query_mocks/index.ts b/web/cypress/support/incidents/index.ts similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/index.ts rename to web/cypress/support/incidents/index.ts diff --git a/web/cypress/support/incidents_prometheus_query_mocks/mock-generators.ts b/web/cypress/support/incidents/mock-generators.ts similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/mock-generators.ts rename to web/cypress/support/incidents/mock-generators.ts diff --git a/web/cypress/support/incidents_prometheus_query_mocks/prometheus-mocks.ts b/web/cypress/support/incidents/prometheus-mocks.ts similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/prometheus-mocks.ts rename to web/cypress/support/incidents/prometheus-mocks.ts diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-converter.ts b/web/cypress/support/incidents/schema/fixture-converter.ts similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-converter.ts rename to web/cypress/support/incidents/schema/fixture-converter.ts diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-schema.json b/web/cypress/support/incidents/schema/fixture-schema.json similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-schema.json rename to web/cypress/support/incidents/schema/fixture-schema.json diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/schema-validator.ts b/web/cypress/support/incidents/schema/schema-validator.ts similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/schema/schema-validator.ts rename to web/cypress/support/incidents/schema/schema-validator.ts diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts b/web/cypress/support/incidents/schema/validate-fixtures.ts similarity index 95% rename from web/cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts rename to web/cypress/support/incidents/schema/validate-fixtures.ts index 8e4b17ae2..4f8865351 100755 --- a/web/cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts +++ b/web/cypress/support/incidents/schema/validate-fixtures.ts @@ -4,7 +4,7 @@ * CLI tool to validate YAML fixture files against the JSON schema * Usage: npm run ts-node validate-fixtures.ts * Or from web directory: - * npm run ts-node cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts + * npm run ts-node cypress/support/incidents/schema/validate-fixtures.ts */ import * as fs from 'fs'; @@ -62,7 +62,7 @@ if (args.length === 0) { ' or: npm run ts-node validate-fixtures.ts --all (validates all .yaml files in fixtures directory)', ); console.log( - 'From web directory: npm run ts-node cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts -- --all', + 'From web directory: npm run ts-node cypress/support/incidents/schema/validate-fixtures.ts -- --all', ); process.exit(1); } diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/yaml-fixture-snippets.json b/web/cypress/support/incidents/schema/yaml-fixture-snippets.json similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/schema/yaml-fixture-snippets.json rename to web/cypress/support/incidents/schema/yaml-fixture-snippets.json diff --git a/web/cypress/support/incidents_prometheus_query_mocks/types.ts b/web/cypress/support/incidents/types.ts similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/types.ts rename to web/cypress/support/incidents/types.ts diff --git a/web/cypress/support/incidents_prometheus_query_mocks/utils.ts b/web/cypress/support/incidents/utils.ts similarity index 100% rename from web/cypress/support/incidents_prometheus_query_mocks/utils.ts rename to web/cypress/support/incidents/utils.ts From a8663d7dab9c5097870c4e6a948a557258b30c9e Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:23:34 -0400 Subject: [PATCH 2/7] refactor: move alerts support files --- web/cypress/e2e/alerts/alerts_acm.cy.ts | 3 +-- web/cypress/e2e/alerts/alerts_bvt.cy.ts | 2 +- web/cypress/e2e/alerts/alerts_ivt.cy.ts | 2 +- web/cypress/e2e/alerts/alerts_regression.cy.ts | 4 ++-- web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts | 4 ++-- web/cypress/e2e/shared/admin_perspective_bvt.cy.ts | 5 ++--- .../00.bvt_monitoring.cy.ts => alerts/alerts_bvt.cy.ts} | 2 +- .../alerts_bvt_namespaced.cy.ts} | 0 .../01.reg_alerts.cy.ts => alerts/alerts_regressions.cy.ts} | 0 .../alerts_regressions_namespaced.cy.ts} | 0 10 files changed, 10 insertions(+), 12 deletions(-) rename web/cypress/support/{monitoring/00.bvt_monitoring.cy.ts => alerts/alerts_bvt.cy.ts} (99%) rename web/cypress/support/{monitoring/00.bvt_monitoring_namespace.cy.ts => alerts/alerts_bvt_namespaced.cy.ts} (100%) rename web/cypress/support/{monitoring/01.reg_alerts.cy.ts => alerts/alerts_regressions.cy.ts} (100%) rename web/cypress/support/{monitoring/04.reg_alerts_namespace.cy.ts => alerts/alerts_regressions_namespaced.cy.ts} (100%) diff --git a/web/cypress/e2e/alerts/alerts_acm.cy.ts b/web/cypress/e2e/alerts/alerts_acm.cy.ts index b8491137c..1ebf24f31 100644 --- a/web/cypress/e2e/alerts/alerts_acm.cy.ts +++ b/web/cypress/e2e/alerts/alerts_acm.cy.ts @@ -1,4 +1,3 @@ -// 02.acm_alerting_ui.cy.ts // E2E test for validating ACM Alerting UI integration with Cluster Observability Operator (COO) import '../../support/commands/auth-commands'; import { commonPages } from '../../views/common'; @@ -10,7 +9,7 @@ import { incidentsPage } from 'cypress/views/incidents-page'; import { testAlertsFleetManagementRegression, testAlertsRegression, -} from 'cypress/support/monitoring/01.reg_alerts.cy'; +} from 'cypress/support/alerts/alerts_regressions.cy'; import { listPage } from 'cypress/views/list-page'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; import { CustomerPerspectiveName } from '@/shared/constants/perspective'; diff --git a/web/cypress/e2e/alerts/alerts_bvt.cy.ts b/web/cypress/e2e/alerts/alerts_bvt.cy.ts index acd288325..911f96ddd 100644 --- a/web/cypress/e2e/alerts/alerts_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_bvt.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { testBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt_monitoring_namespace.cy'; +import { testBVTMonitoringTestsNamespace } from '../../support/alerts/alerts_bvt_namespaced.cy'; import { commonPages } from '../../views/common'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; diff --git a/web/cypress/e2e/alerts/alerts_ivt.cy.ts b/web/cypress/e2e/alerts/alerts_ivt.cy.ts index 4791dec89..ab340863f 100644 --- a/web/cypress/e2e/alerts/alerts_ivt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_ivt.cy.ts @@ -1,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { testAlertsRegression } from '../../support/monitoring/01.reg_alerts.cy'; +import { testAlertsRegression } from '../../support/alerts/alerts_regressions.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { guidedTour } from '../../views/tour'; diff --git a/web/cypress/e2e/alerts/alerts_regression.cy.ts b/web/cypress/e2e/alerts/alerts_regression.cy.ts index 71bfbbc57..4b54241e4 100644 --- a/web/cypress/e2e/alerts/alerts_regression.cy.ts +++ b/web/cypress/e2e/alerts/alerts_regression.cy.ts @@ -2,9 +2,9 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { testAlertsCorePlatformHeaderRegression, testAlertsRegression, -} from '../../support/monitoring/01.reg_alerts.cy'; +} from '../../support/alerts/alerts_regressions.cy'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { testAlertsRegressionNamespace } from '../../support/monitoring/04.reg_alerts_namespace.cy'; +import { testAlertsRegressionNamespace } from '../../support/alerts/alerts_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; diff --git a/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts index 06d796dc2..13be4f2ff 100644 --- a/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts @@ -1,5 +1,5 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { testBVTMonitoring } from '../../support/monitoring/00.bvt_monitoring.cy'; +import { testBVTAlerts } from '../../support/alerts/alerts_bvt.cy'; import { guidedTour } from '../../views/tour'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { nav } from '../../views/nav'; @@ -34,6 +34,6 @@ describe( alerts.interceptWatchdogAlert(); }); - testBVTMonitoring(CustomerPerspectiveName.Virtualization); + testBVTAlerts(CustomerPerspectiveName.Virtualization); }, ); diff --git a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts index d50900d3d..0b252ff1e 100644 --- a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts +++ b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { testBVTMonitoring } from '../../support/monitoring/00.bvt_monitoring.cy'; +import { testBVTAlerts } from '../../support/alerts/alerts_bvt.cy'; import { commonPages } from '../../views/common'; import { overviewPage } from '../../views/overview-page'; @@ -70,7 +70,6 @@ describe( commonPages.projectDropdownShouldExist(); }); - // Run tests in Administrator perspective - testBVTMonitoring(CustomerPerspectiveName.CorePlatform); + testBVTAlerts(CustomerPerspectiveName.CorePlatform); }, ); diff --git a/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts b/web/cypress/support/alerts/alerts_bvt.cy.ts similarity index 99% rename from web/cypress/support/monitoring/00.bvt_monitoring.cy.ts rename to web/cypress/support/alerts/alerts_bvt.cy.ts index d28fbb7bb..b746e4e19 100644 --- a/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts +++ b/web/cypress/support/alerts/alerts_bvt.cy.ts @@ -15,7 +15,7 @@ import { import { alertingRuleListPage } from '../../views/alerting-rule-list-page'; import type { CustomerPerspective } from '@/shared/constants/perspective'; -export function testBVTMonitoring(perspectiveName: CustomerPerspective) { +export function testBVTAlerts(perspectiveName: CustomerPerspective) { it( `${perspectiveName} perspective - ` + 'Alerting > Alerting Details page > Alerting Rule > Metrics', diff --git a/web/cypress/support/monitoring/00.bvt_monitoring_namespace.cy.ts b/web/cypress/support/alerts/alerts_bvt_namespaced.cy.ts similarity index 100% rename from web/cypress/support/monitoring/00.bvt_monitoring_namespace.cy.ts rename to web/cypress/support/alerts/alerts_bvt_namespaced.cy.ts diff --git a/web/cypress/support/monitoring/01.reg_alerts.cy.ts b/web/cypress/support/alerts/alerts_regressions.cy.ts similarity index 100% rename from web/cypress/support/monitoring/01.reg_alerts.cy.ts rename to web/cypress/support/alerts/alerts_regressions.cy.ts diff --git a/web/cypress/support/monitoring/04.reg_alerts_namespace.cy.ts b/web/cypress/support/alerts/alerts_regressions_namespaced.cy.ts similarity index 100% rename from web/cypress/support/monitoring/04.reg_alerts_namespace.cy.ts rename to web/cypress/support/alerts/alerts_regressions_namespaced.cy.ts From 916b71edc898643415bd51ea1b0802e302c24a88 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:25:00 -0400 Subject: [PATCH 3/7] refactor: move legacy-dashboards support files --- .../e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts | 4 ++-- .../legacy_dashboards_virtualization_regression.cy.ts | 4 ++-- .../legacy_dashboards_regressions.cy.ts} | 0 .../legacy_dashboards_regressions_namespaced.cy.ts} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename web/cypress/support/{monitoring/03.reg_legacy_dashboards.cy.ts => legacy-dashboards/legacy_dashboards_regressions.cy.ts} (100%) rename web/cypress/support/{monitoring/06.reg_legacy_dashboards_namespace.cy.ts => legacy-dashboards/legacy_dashboards_regressions_namespaced.cy.ts} (100%) 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 44828c083..56b29cc93 100644 --- a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; -import { testLegacyDashboardsRegression } from '../../support/monitoring/03.reg_legacy_dashboards.cy'; -import { testLegacyDashboardsRegressionNamespace } from '../../support/monitoring/06.reg_legacy_dashboards_namespace.cy'; +import { testLegacyDashboardsRegression } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; +import { testLegacyDashboardsRegressionNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; 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 282252033..80f200a1e 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 @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; -import { testLegacyDashboardsRegression } from '../../support/monitoring/03.reg_legacy_dashboards.cy'; -import { testLegacyDashboardsRegressionNamespace } from '../../support/monitoring/06.reg_legacy_dashboards_namespace.cy'; +import { testLegacyDashboardsRegression } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; +import { testLegacyDashboardsRegressionNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { guidedTour } from '../../views/tour'; diff --git a/web/cypress/support/monitoring/03.reg_legacy_dashboards.cy.ts b/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions.cy.ts similarity index 100% rename from web/cypress/support/monitoring/03.reg_legacy_dashboards.cy.ts rename to web/cypress/support/legacy-dashboards/legacy_dashboards_regressions.cy.ts diff --git a/web/cypress/support/monitoring/06.reg_legacy_dashboards_namespace.cy.ts b/web/cypress/support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy.ts similarity index 100% rename from web/cypress/support/monitoring/06.reg_legacy_dashboards_namespace.cy.ts rename to web/cypress/support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy.ts From 75ed5c0ab013e15f69a2e4c7cc28f8391401e011 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:26:22 -0400 Subject: [PATCH 4/7] refactor: move metrics support files --- .../e2e/metrics/metrics_regression.cy.ts | 12 +- .../metrics/metrics_virtualization_ivt.cy.ts | 12 +- .../metrics_regressions.cy.ts} | 219 +++++++++++++++++ .../metrics_regressions_namespaced.cy.ts} | 219 +++++++++++++++++ .../support/monitoring/02.reg_metrics_1.cy.ts | 225 ------------------ .../05.reg_metrics_namespace_1.cy.ts | 225 ------------------ 6 files changed, 454 insertions(+), 458 deletions(-) rename web/cypress/support/{monitoring/02.reg_metrics_2.cy.ts => metrics/metrics_regressions.cy.ts} (69%) rename web/cypress/support/{monitoring/05.reg_metrics_namespace_2.cy.ts => metrics/metrics_regressions_namespaced.cy.ts} (69%) delete mode 100644 web/cypress/support/monitoring/02.reg_metrics_1.cy.ts delete mode 100644 web/cypress/support/monitoring/05.reg_metrics_namespace_1.cy.ts diff --git a/web/cypress/e2e/metrics/metrics_regression.cy.ts b/web/cypress/e2e/metrics/metrics_regression.cy.ts index 06a9528f9..beb1ca99f 100644 --- a/web/cypress/e2e/metrics/metrics_regression.cy.ts +++ b/web/cypress/e2e/metrics/metrics_regression.cy.ts @@ -1,10 +1,14 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { testMetricsRegression2 } from '../../support/monitoring/02.reg_metrics_2.cy'; -import { testMetricsRegression1 } from '../../support/monitoring/02.reg_metrics_1.cy'; -import { testMetricsRegressionNamespace1 } from '../../support/monitoring/05.reg_metrics_namespace_1.cy'; +import { + testMetricsRegression1, + testMetricsRegression2, +} from '../../support/metrics/metrics_regressions.cy'; +import { + testMetricsRegressionNamespace1, + testMetricsRegressionNamespace2, +} from '../../support/metrics/metrics_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; -import { testMetricsRegressionNamespace2 } from '../../support/monitoring/05.reg_metrics_namespace_2.cy'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; // Test suite for Administrator perspective diff --git a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts index ec0e2b8c2..4c41291be 100644 --- a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts +++ b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts @@ -1,12 +1,16 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { testMetricsRegression2 } from '../../support/monitoring/02.reg_metrics_2.cy'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { testMetricsRegression1 } from '../../support/monitoring/02.reg_metrics_1.cy'; -import { testMetricsRegressionNamespace1 } from '../../support/monitoring/05.reg_metrics_namespace_1.cy'; +import { + testMetricsRegression1, + testMetricsRegression2, +} from '../../support/metrics/metrics_regressions.cy'; +import { + testMetricsRegressionNamespace1, + testMetricsRegressionNamespace2, +} from '../../support/metrics/metrics_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { guidedTour } from '../../views/tour'; -import { testMetricsRegressionNamespace2 } from '../../support/monitoring/05.reg_metrics_namespace_2.cy'; import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; describe('Regression: Monitoring - Metrics (Virtualization)', () => { diff --git a/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts b/web/cypress/support/metrics/metrics_regressions.cy.ts similarity index 69% rename from web/cypress/support/monitoring/02.reg_metrics_2.cy.ts rename to web/cypress/support/metrics/metrics_regressions.cy.ts index ec0079566..3ed14a4e3 100644 --- a/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts +++ b/web/cypress/support/metrics/metrics_regressions.cy.ts @@ -1,13 +1,232 @@ import { metricsPage } from '../../views/metrics'; import { Classes, DataTestIDs } from '@/shared/constants/data-test'; import { + GraphTimespan, MetricGraphEmptyState, MetricsPagePredefinedQueries, MetricsPageQueryInput, MetricsPageQueryKebabDropdown, + MetricsPageUnits, } from '../../fixtures/shared/cluster-monitoring-operator/constants'; import type { CustomerPerspective } from '@/shared/constants/perspective'; +export function testMetricsRegression1(perspectiveName: CustomerPerspective) { + const perspective = { name: perspectiveName }; + it(`${perspective.name} perspective - Metrics`, () => { + cy.log('1.1 Metrics page loaded'); + metricsPage.shouldBeLoaded(); + + cy.log('1.2 Units dropdown'); + metricsPage.unitsDropdownAssertion(); + + cy.log('1.3 Refresh interval dropdown'); + metricsPage.refreshIntervalDropdownAssertion(); + + cy.log('1.4 Actions dropdown'); + metricsPage.actionsDropdownAssertion(); + + cy.log('1.5 Predefined queries'); + metricsPage.predefinedQueriesAssertion(); + + cy.log('1.6 Kebab dropdown'); + metricsPage.kebabDropdownAssertionWithoutQuery(); + }); + + it(`${perspective.name} perspective - Metrics > Actions - No query added`, () => { + cy.log('2.1 Only one query loaded'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); + + cy.log('2.2 Actions >Add query'); + metricsPage.clickActionsAddQuery(); + + cy.log('2.3 Only one query added, resulting in 2 rows'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); + + cy.log('2.3.1 Assert 2 rows - Empty state'); + metricsPage.addQueryAssertion(); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.expandCollapseRowAssertion(true, 1, false, false); + + cy.log('2.4 Actions > Collapse all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(false); + + cy.log('2.5 All queries collapsed'); + metricsPage.expandCollapseAllQueryAssertion(false); + metricsPage.expandCollapseRowAssertion(false, 0, false, false); + metricsPage.expandCollapseRowAssertion(false, 1, false, false); + + cy.log('2.6 Actions > Expand all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(true); + + cy.log('2.7 All queries expanded'); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.shouldBeLoaded(); + + cy.log('2.8 Actions > Delete all queries'); + metricsPage.clickActionsDeleteAllQueries(); + + cy.log('2.9 Only one query deleted, resulting in 1 row'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + }); + + it(`${perspective.name} perspective - Metrics > Actions - One query added`, () => { + cy.log('3.1 Only one query loaded'); + metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.FILESYSTEM_USAGE); + metricsPage.shouldBeLoadedWithGraph(); + + cy.log('3.2 Kebab dropdown'); + metricsPage.kebabDropdownAssertionWithQuery(); + + cy.log('3.3 Actions >Add query'); + metricsPage.clickActionsAddQuery(); + + cy.log('3.4 Only one query added, resulting in 2 rows'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(1) + .should('have.attr', 'aria-expanded', 'true'); + + cy.log('3.4.1 Assert 2 rows'); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.expandCollapseRowAssertion(true, 0, false, false); + metricsPage.expandCollapseRowAssertion(true, 1, true, false); + + cy.log('3.5 Actions > Collapse all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(false); + + cy.log('3.6 All queries collapsed'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'false'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(1) + .should('have.attr', 'aria-expanded', 'false'); + + cy.log('3.6.1 Assert 2 rows - Empty state'); + metricsPage.expandCollapseAllQueryAssertion(false); + metricsPage.expandCollapseRowAssertion(false, 0, false, false); + metricsPage.expandCollapseRowAssertion(false, 1, true, false); + + cy.log('3.7 Actions > Expand all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(true); + + cy.log('3.8 All queries expanded'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(1) + .should('have.attr', 'aria-expanded', 'true'); + + cy.log('3.8.1 Assert 2 rows'); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.expandCollapseRowAssertion(true, 0, false, false); + metricsPage.expandCollapseRowAssertion(true, 1, true, false); + + cy.log('3.9 Actions > Delete all queries'); + metricsPage.clickActionsDeleteAllQueries(); + + cy.log('3.10 Only one query deleted, resulting in 1 row'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + metricsPage.shouldBeLoaded(); + }); + + it(`${perspective.name} perspective - Metrics > Insert Example Query`, () => { + cy.log('4.1 Insert Example Query'); + metricsPage.clickInsertExampleQuery(); + metricsPage.shouldBeLoadedWithGraph(); + cy.get(Classes.MetricsPageQueryInput) + .eq(0) + .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY); + metricsPage.graphAxisXAssertion(GraphTimespan.THIRTY_MINUTES); + + cy.log('4.2 Graph Timespan Dropdown'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); + metricsPage.clickRunQueriesButton(); + metricsPage.graphTimespanDropdownAssertion(); + + cy.log('4.3 Select and Assert each timespan'); + Object.values(GraphTimespan).forEach((timespan) => { + metricsPage.clickGraphTimespanDropdown(timespan); + metricsPage.graphAxisXAssertion(timespan); + }); + + cy.log('4.4 Enter Graph Timespan'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); + metricsPage.clickRunQueriesButton(); + Object.values(GraphTimespan).forEach((timespan) => { + metricsPage.enterGraphTimespan(timespan); + metricsPage.graphAxisXAssertion(timespan); + }); + + cy.log('4.5 Prepare to test Reset Zoom Button'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.CPU_USAGE); + metricsPage.clickGraphTimespanDropdown(GraphTimespan.ONE_WEEK); + + cy.log('4.6 Reset Zoom Button'); + metricsPage.clickResetZoomButton(); + cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should( + 'have.attr', + 'value', + GraphTimespan.THIRTY_MINUTES, + ); + + cy.log('4.7 Hide Graph Button'); + metricsPage.clickHideGraphButton(); + cy.byTestID(DataTestIDs.MetricGraph).should('not.exist'); + + cy.log('4.8 Show Graph Button'); + metricsPage.clickShowGraphButton(); + cy.byTestID(DataTestIDs.MetricGraph).should('be.visible'); + + cy.log('4.9 Disconnected Checkbox'); + cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible'); + + cy.log('4.10 Prepare to test Stacked Checkbox'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.clickInsertExampleQuery(); + + cy.log('4.11 Stacked Checkbox'); + metricsPage.clickStackedCheckboxAndAssert(); + + cy.log('4.12 Delete All Queries'); + metricsPage.clickActionsDeleteAllQueries(); + }); + + //https://issues.redhat.com/browse/OU-974 - [Metrics] - Units - undefined showing in Y axis and tooltip + it(`${perspective.name} perspective - Metrics > Units`, () => { + cy.log('5.1 Preparation to test Units dropdown'); + metricsPage.clickInsertExampleQuery(); + metricsPage.unitsDropdownAssertion(); + + cy.log('5.2 Units dropdown'); + Object.values(MetricsPageUnits).forEach((unit) => { + metricsPage.clickUnitsDropdown(unit); + metricsPage.unitsAxisYAssertion(unit); + }); + }); +} + export function testMetricsRegression2(perspectiveName: CustomerPerspective) { it(`${perspectiveName} perspective - Metrics > Add Query - Run Queries - Kebab icon`, () => { cy.log('6.1 Preparation to test Add Query button'); diff --git a/web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts b/web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts similarity index 69% rename from web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts rename to web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts index 4898461f9..87ecb14ef 100644 --- a/web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts +++ b/web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts @@ -1,13 +1,232 @@ import { metricsPage } from '../../views/metrics'; import { Classes, DataTestIDs } from '@/shared/constants/data-test'; import { + GraphTimespan, MetricsPagePredefinedQueries, MetricsPageQueryInput, MetricsPageQueryInputByNamespace, MetricsPageQueryKebabDropdown, + MetricsPageUnits, } from '../../fixtures/shared/cluster-monitoring-operator/constants'; import type { CustomerPerspective } from '@/shared/constants/perspective'; +export function testMetricsRegressionNamespace1(perspectiveName: CustomerPerspective) { + const perspective = { name: perspectiveName }; + it(`${perspective.name} perspective - Metrics`, () => { + cy.log('1.1 Metrics page loaded'); + metricsPage.shouldBeLoaded(); + + cy.log('1.2 Units dropdown'); + metricsPage.unitsDropdownAssertion(); + + cy.log('1.3 Refresh interval dropdown'); + metricsPage.refreshIntervalDropdownAssertion(); + + cy.log('1.4 Actions dropdown'); + metricsPage.actionsDropdownAssertion(); + + cy.log('1.5 Predefined queries'); + metricsPage.predefinedQueriesAssertion(); + + cy.log('1.6 Kebab dropdown'); + metricsPage.kebabDropdownAssertionWithoutQuery(); + }); + + it(`${perspective.name} perspective - Metrics > Actions - No query added`, () => { + cy.log('2.1 Only one query loaded'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); + + cy.log('2.2 Actions >Add query'); + metricsPage.clickActionsAddQuery(); + + cy.log('2.3 Only one query added, resulting in 2 rows'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); + + cy.log('2.3.1 Assert 2 rows - Empty state'); + metricsPage.addQueryAssertion(); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.expandCollapseRowAssertion(true, 1, false, false); + + cy.log('2.4 Actions > Collapse all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(false); + + cy.log('2.5 All queries collapsed'); + metricsPage.expandCollapseAllQueryAssertion(false); + metricsPage.expandCollapseRowAssertion(false, 0, false, false); + metricsPage.expandCollapseRowAssertion(false, 1, false, false); + + cy.log('2.6 Actions > Expand all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(true); + + cy.log('2.7 All queries expanded'); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.shouldBeLoaded(); + + cy.log('2.8 Actions > Delete all queries'); + metricsPage.clickActionsDeleteAllQueries(); + + cy.log('2.9 Only one query deleted, resulting in 1 row'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + }); + + it(`${perspective.name} perspective - Metrics > Actions - One query added`, () => { + cy.log('3.1 Only one query loaded'); + metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.FILESYSTEM_USAGE); + metricsPage.shouldBeLoadedWithGraph(); + + cy.log('3.2 Kebab dropdown'); + metricsPage.kebabDropdownAssertionWithQuery(); + + cy.log('3.3 Actions >Add query'); + metricsPage.clickActionsAddQuery(); + + cy.log('3.4 Only one query added, resulting in 2 rows'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(1) + .should('have.attr', 'aria-expanded', 'true'); + + cy.log('3.4.1 Assert 2 rows'); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.expandCollapseRowAssertion(true, 0, false, false); + metricsPage.expandCollapseRowAssertion(true, 1, true, false); + + cy.log('3.5 Actions > Collapse all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(false); + + cy.log('3.6 All queries collapsed'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'false'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(1) + .should('have.attr', 'aria-expanded', 'false'); + + cy.log('3.6.1 Assert 2 rows - Empty state'); + metricsPage.expandCollapseAllQueryAssertion(false); + metricsPage.expandCollapseRowAssertion(false, 0, false, false); + metricsPage.expandCollapseRowAssertion(false, 1, true, false); + + cy.log('3.7 Actions > Expand all query tables'); + metricsPage.clickActionsExpandCollapseAllQuery(true); + + cy.log('3.8 All queries expanded'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(1) + .should('have.attr', 'aria-expanded', 'true'); + + cy.log('3.8.1 Assert 2 rows'); + metricsPage.expandCollapseAllQueryAssertion(true); + metricsPage.expandCollapseRowAssertion(true, 0, false, false); + metricsPage.expandCollapseRowAssertion(true, 1, true, false); + + cy.log('3.9 Actions > Delete all queries'); + metricsPage.clickActionsDeleteAllQueries(); + + cy.log('3.10 Only one query deleted, resulting in 1 row'); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); + cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) + .find('button') + .eq(0) + .should('have.attr', 'aria-expanded', 'true'); + metricsPage.shouldBeLoaded(); + }); + + it(`${perspective.name} perspective - Metrics > Insert Example Query`, () => { + cy.log('4.1 Insert Example Query'); + metricsPage.clickInsertExampleQuery(); + metricsPage.shouldBeLoadedWithGraph(); + cy.get(Classes.MetricsPageQueryInput) + .eq(0) + .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE); + metricsPage.graphAxisXAssertion(GraphTimespan.THIRTY_MINUTES); + + cy.log('4.2 Graph Timespan Dropdown'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); + metricsPage.clickRunQueriesButton(); + metricsPage.graphTimespanDropdownAssertion(); + + cy.log('4.3 Select and Assert each timespan'); + Object.values(GraphTimespan).forEach((timespan) => { + metricsPage.clickGraphTimespanDropdown(timespan); + metricsPage.graphAxisXAssertion(timespan); + }); + + cy.log('4.4 Enter Graph Timespan'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); + metricsPage.clickRunQueriesButton(); + Object.values(GraphTimespan).forEach((timespan) => { + metricsPage.enterGraphTimespan(timespan); + metricsPage.graphAxisXAssertion(timespan); + }); + + cy.log('4.5 Prepare to test Reset Zoom Button'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.clickPredefinedQuery( + MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED, + ); + metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.RATE_OF_RECEIVED_PACKETS_DROPPED); + metricsPage.clickGraphTimespanDropdown(GraphTimespan.ONE_WEEK); + + cy.log('4.6 Reset Zoom Button'); + metricsPage.clickResetZoomButton(); + cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should( + 'have.attr', + 'value', + GraphTimespan.THIRTY_MINUTES, + ); + + cy.log('4.7 Hide Graph Button'); + metricsPage.clickHideGraphButton(); + cy.byTestID(DataTestIDs.MetricGraph).should('not.exist'); + + cy.log('4.8 Show Graph Button'); + metricsPage.clickShowGraphButton(); + cy.byTestID(DataTestIDs.MetricGraph).should('be.visible'); + + cy.log('4.9 Disconnected Checkbox'); + cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible'); + + cy.log('4.10 Prepare to test Stacked Checkbox'); + metricsPage.clickActionsDeleteAllQueries(); + metricsPage.clickInsertExampleQuery(); + + cy.log('4.11 Stacked Checkbox'); + metricsPage.clickStackedCheckboxAndAssert(); + }); + + //https://issues.redhat.com/browse/OU-974 - [Metrics] - Units - undefined showing in Y axis and tooltip + it(`${perspective.name} perspective - Metrics > Units`, () => { + cy.log('5.1 Preparation to test Units dropdown'); + metricsPage.clickInsertExampleQuery(); + metricsPage.unitsDropdownAssertion(); + + cy.log('5.2 Units dropdown'); + Object.values(MetricsPageUnits).forEach((unit) => { + metricsPage.clickUnitsDropdown(unit); + metricsPage.unitsAxisYAssertion(unit); + }); + }); +} + export function testMetricsRegressionNamespace2(perspectiveName: CustomerPerspective) { it(`${perspectiveName} perspective - Metrics > Add Query - Run Queries - Kebab icon`, () => { cy.log('6.1 Preparation to test Add Query button'); diff --git a/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts b/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts deleted file mode 100644 index d7c6d5c90..000000000 --- a/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { metricsPage } from '../../views/metrics'; -import { Classes, DataTestIDs } from '@/shared/constants/data-test'; -import { - GraphTimespan, - MetricsPagePredefinedQueries, - MetricsPageQueryInput, - MetricsPageUnits, -} from '../../fixtures/shared/cluster-monitoring-operator/constants'; -import type { CustomerPerspective } from '@/shared/constants/perspective'; - -export function testMetricsRegression1(perspectiveName: CustomerPerspective) { - it(`${perspectiveName} perspective - Metrics`, () => { - cy.log('1.1 Metrics page loaded'); - metricsPage.shouldBeLoaded(); - - cy.log('1.2 Units dropdown'); - metricsPage.unitsDropdownAssertion(); - - cy.log('1.3 Refresh interval dropdown'); - metricsPage.refreshIntervalDropdownAssertion(); - - cy.log('1.4 Actions dropdown'); - metricsPage.actionsDropdownAssertion(); - - cy.log('1.5 Predefined queries'); - metricsPage.predefinedQueriesAssertion(); - - cy.log('1.6 Kebab dropdown'); - metricsPage.kebabDropdownAssertionWithoutQuery(); - }); - - it(`${perspectiveName} perspective - Metrics > Actions - No query added`, () => { - cy.log('2.1 Only one query loaded'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); - - cy.log('2.2 Actions >Add query'); - metricsPage.clickActionsAddQuery(); - - cy.log('2.3 Only one query added, resulting in 2 rows'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); - - cy.log('2.3.1 Assert 2 rows - Empty state'); - metricsPage.addQueryAssertion(); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.expandCollapseRowAssertion(true, 1, false, false); - - cy.log('2.4 Actions > Collapse all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(false); - - cy.log('2.5 All queries collapsed'); - metricsPage.expandCollapseAllQueryAssertion(false); - metricsPage.expandCollapseRowAssertion(false, 0, false, false); - metricsPage.expandCollapseRowAssertion(false, 1, false, false); - - cy.log('2.6 Actions > Expand all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(true); - - cy.log('2.7 All queries expanded'); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.shouldBeLoaded(); - - cy.log('2.8 Actions > Delete all queries'); - metricsPage.clickActionsDeleteAllQueries(); - - cy.log('2.9 Only one query deleted, resulting in 1 row'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - }); - - it(`${perspectiveName} perspective - Metrics > Actions - One query added`, () => { - cy.log('3.1 Only one query loaded'); - metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.FILESYSTEM_USAGE); - metricsPage.shouldBeLoadedWithGraph(); - - cy.log('3.2 Kebab dropdown'); - metricsPage.kebabDropdownAssertionWithQuery(); - - cy.log('3.3 Actions >Add query'); - metricsPage.clickActionsAddQuery(); - - cy.log('3.4 Only one query added, resulting in 2 rows'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(1) - .should('have.attr', 'aria-expanded', 'true'); - - cy.log('3.4.1 Assert 2 rows'); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.expandCollapseRowAssertion(true, 0, false, false); - metricsPage.expandCollapseRowAssertion(true, 1, true, false); - - cy.log('3.5 Actions > Collapse all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(false); - - cy.log('3.6 All queries collapsed'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'false'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(1) - .should('have.attr', 'aria-expanded', 'false'); - - cy.log('3.6.1 Assert 2 rows - Empty state'); - metricsPage.expandCollapseAllQueryAssertion(false); - metricsPage.expandCollapseRowAssertion(false, 0, false, false); - metricsPage.expandCollapseRowAssertion(false, 1, true, false); - - cy.log('3.7 Actions > Expand all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(true); - - cy.log('3.8 All queries expanded'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(1) - .should('have.attr', 'aria-expanded', 'true'); - - cy.log('3.8.1 Assert 2 rows'); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.expandCollapseRowAssertion(true, 0, false, false); - metricsPage.expandCollapseRowAssertion(true, 1, true, false); - - cy.log('3.9 Actions > Delete all queries'); - metricsPage.clickActionsDeleteAllQueries(); - - cy.log('3.10 Only one query deleted, resulting in 1 row'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - metricsPage.shouldBeLoaded(); - }); - - it(`${perspectiveName} perspective - Metrics > Insert Example Query`, () => { - cy.log('4.1 Insert Example Query'); - metricsPage.clickInsertExampleQuery(); - metricsPage.shouldBeLoadedWithGraph(); - cy.get(Classes.MetricsPageQueryInput) - .eq(0) - .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY); - metricsPage.graphAxisXAssertion(GraphTimespan.THIRTY_MINUTES); - - cy.log('4.2 Graph Timespan Dropdown'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); - metricsPage.clickRunQueriesButton(); - metricsPage.graphTimespanDropdownAssertion(); - - cy.log('4.3 Select and Assert each timespan'); - Object.values(GraphTimespan).forEach((timespan) => { - metricsPage.clickGraphTimespanDropdown(timespan); - metricsPage.graphAxisXAssertion(timespan); - }); - - cy.log('4.4 Enter Graph Timespan'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); - metricsPage.clickRunQueriesButton(); - Object.values(GraphTimespan).forEach((timespan) => { - metricsPage.enterGraphTimespan(timespan); - metricsPage.graphAxisXAssertion(timespan); - }); - - cy.log('4.5 Prepare to test Reset Zoom Button'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.CPU_USAGE); - metricsPage.clickGraphTimespanDropdown(GraphTimespan.ONE_WEEK); - - cy.log('4.6 Reset Zoom Button'); - metricsPage.clickResetZoomButton(); - cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should( - 'have.attr', - 'value', - GraphTimespan.THIRTY_MINUTES, - ); - - cy.log('4.7 Hide Graph Button'); - metricsPage.clickHideGraphButton(); - cy.byTestID(DataTestIDs.MetricGraph).should('not.exist'); - - cy.log('4.8 Show Graph Button'); - metricsPage.clickShowGraphButton(); - cy.byTestID(DataTestIDs.MetricGraph).should('be.visible'); - - cy.log('4.9 Disconnected Checkbox'); - cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible'); - - cy.log('4.10 Prepare to test Stacked Checkbox'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.clickInsertExampleQuery(); - - cy.log('4.11 Stacked Checkbox'); - metricsPage.clickStackedCheckboxAndAssert(); - - cy.log('4.12 Delete All Queries'); - metricsPage.clickActionsDeleteAllQueries(); - }); - - //https://issues.redhat.com/browse/OU-974 - [Metrics] - Units - undefined showing in Y axis and tooltip - it(`${perspectiveName} perspective - Metrics > Units`, () => { - cy.log('5.1 Preparation to test Units dropdown'); - metricsPage.clickInsertExampleQuery(); - metricsPage.unitsDropdownAssertion(); - - cy.log('5.2 Units dropdown'); - Object.values(MetricsPageUnits).forEach((unit) => { - metricsPage.clickUnitsDropdown(unit); - metricsPage.unitsAxisYAssertion(unit); - }); - }); -} diff --git a/web/cypress/support/monitoring/05.reg_metrics_namespace_1.cy.ts b/web/cypress/support/monitoring/05.reg_metrics_namespace_1.cy.ts deleted file mode 100644 index 9704de504..000000000 --- a/web/cypress/support/monitoring/05.reg_metrics_namespace_1.cy.ts +++ /dev/null @@ -1,225 +0,0 @@ -import { metricsPage } from '../../views/metrics'; -import { Classes, DataTestIDs } from '@/shared/constants/data-test'; -import { - GraphTimespan, - MetricsPagePredefinedQueries, - MetricsPageQueryInput, - MetricsPageUnits, -} from '../../fixtures/shared/cluster-monitoring-operator/constants'; -import type { CustomerPerspective } from '@/shared/constants/perspective'; - -export function testMetricsRegressionNamespace1(perspectiveName: CustomerPerspective) { - it(`${perspectiveName} perspective - Metrics`, () => { - cy.log('1.1 Metrics page loaded'); - metricsPage.shouldBeLoaded(); - - cy.log('1.2 Units dropdown'); - metricsPage.unitsDropdownAssertion(); - - cy.log('1.3 Refresh interval dropdown'); - metricsPage.refreshIntervalDropdownAssertion(); - - cy.log('1.4 Actions dropdown'); - metricsPage.actionsDropdownAssertion(); - - cy.log('1.5 Predefined queries'); - metricsPage.predefinedQueriesAssertion(); - - cy.log('1.6 Kebab dropdown'); - metricsPage.kebabDropdownAssertionWithoutQuery(); - }); - - it(`${perspectiveName} perspective - Metrics > Actions - No query added`, () => { - cy.log('2.1 Only one query loaded'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); - - cy.log('2.2 Actions >Add query'); - metricsPage.clickActionsAddQuery(); - - cy.log('2.3 Only one query added, resulting in 2 rows'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); - - cy.log('2.3.1 Assert 2 rows - Empty state'); - metricsPage.addQueryAssertion(); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.expandCollapseRowAssertion(true, 1, false, false); - - cy.log('2.4 Actions > Collapse all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(false); - - cy.log('2.5 All queries collapsed'); - metricsPage.expandCollapseAllQueryAssertion(false); - metricsPage.expandCollapseRowAssertion(false, 0, false, false); - metricsPage.expandCollapseRowAssertion(false, 1, false, false); - - cy.log('2.6 Actions > Expand all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(true); - - cy.log('2.7 All queries expanded'); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.shouldBeLoaded(); - - cy.log('2.8 Actions > Delete all queries'); - metricsPage.clickActionsDeleteAllQueries(); - - cy.log('2.9 Only one query deleted, resulting in 1 row'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - }); - - it(`${perspectiveName} perspective - Metrics > Actions - One query added`, () => { - cy.log('3.1 Only one query loaded'); - metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.FILESYSTEM_USAGE); - metricsPage.shouldBeLoadedWithGraph(); - - cy.log('3.2 Kebab dropdown'); - metricsPage.kebabDropdownAssertionWithQuery(); - - cy.log('3.3 Actions >Add query'); - metricsPage.clickActionsAddQuery(); - - cy.log('3.4 Only one query added, resulting in 2 rows'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(1) - .should('have.attr', 'aria-expanded', 'true'); - - cy.log('3.4.1 Assert 2 rows'); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.expandCollapseRowAssertion(true, 0, false, false); - metricsPage.expandCollapseRowAssertion(true, 1, true, false); - - cy.log('3.5 Actions > Collapse all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(false); - - cy.log('3.6 All queries collapsed'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'false'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(1) - .should('have.attr', 'aria-expanded', 'false'); - - cy.log('3.6.1 Assert 2 rows - Empty state'); - metricsPage.expandCollapseAllQueryAssertion(false); - metricsPage.expandCollapseRowAssertion(false, 0, false, false); - metricsPage.expandCollapseRowAssertion(false, 1, true, false); - - cy.log('3.7 Actions > Expand all query tables'); - metricsPage.clickActionsExpandCollapseAllQuery(true); - - cy.log('3.8 All queries expanded'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(1) - .should('have.attr', 'aria-expanded', 'true'); - - cy.log('3.8.1 Assert 2 rows'); - metricsPage.expandCollapseAllQueryAssertion(true); - metricsPage.expandCollapseRowAssertion(true, 0, false, false); - metricsPage.expandCollapseRowAssertion(true, 1, true, false); - - cy.log('3.9 Actions > Delete all queries'); - metricsPage.clickActionsDeleteAllQueries(); - - cy.log('3.10 Only one query deleted, resulting in 1 row'); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1); - cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton) - .find('button') - .eq(0) - .should('have.attr', 'aria-expanded', 'true'); - metricsPage.shouldBeLoaded(); - }); - - it(`${perspectiveName} perspective - Metrics > Insert Example Query`, () => { - cy.log('4.1 Insert Example Query'); - metricsPage.clickInsertExampleQuery(); - metricsPage.shouldBeLoadedWithGraph(); - cy.get(Classes.MetricsPageQueryInput) - .eq(0) - .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE); - metricsPage.graphAxisXAssertion(GraphTimespan.THIRTY_MINUTES); - - cy.log('4.2 Graph Timespan Dropdown'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); - metricsPage.clickRunQueriesButton(); - metricsPage.graphTimespanDropdownAssertion(); - - cy.log('4.3 Select and Assert each timespan'); - Object.values(GraphTimespan).forEach((timespan) => { - metricsPage.clickGraphTimespanDropdown(timespan); - metricsPage.graphAxisXAssertion(timespan); - }); - - cy.log('4.4 Enter Graph Timespan'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.enterQueryInput(0, MetricsPageQueryInput.VECTOR_QUERY); - metricsPage.clickRunQueriesButton(); - Object.values(GraphTimespan).forEach((timespan) => { - metricsPage.enterGraphTimespan(timespan); - metricsPage.graphAxisXAssertion(timespan); - }); - - cy.log('4.5 Prepare to test Reset Zoom Button'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.clickPredefinedQuery( - MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED, - ); - metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.RATE_OF_RECEIVED_PACKETS_DROPPED); - metricsPage.clickGraphTimespanDropdown(GraphTimespan.ONE_WEEK); - - cy.log('4.6 Reset Zoom Button'); - metricsPage.clickResetZoomButton(); - cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should( - 'have.attr', - 'value', - GraphTimespan.THIRTY_MINUTES, - ); - - cy.log('4.7 Hide Graph Button'); - metricsPage.clickHideGraphButton(); - cy.byTestID(DataTestIDs.MetricGraph).should('not.exist'); - - cy.log('4.8 Show Graph Button'); - metricsPage.clickShowGraphButton(); - cy.byTestID(DataTestIDs.MetricGraph).should('be.visible'); - - cy.log('4.9 Disconnected Checkbox'); - cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible'); - - cy.log('4.10 Prepare to test Stacked Checkbox'); - metricsPage.clickActionsDeleteAllQueries(); - metricsPage.clickInsertExampleQuery(); - - cy.log('4.11 Stacked Checkbox'); - metricsPage.clickStackedCheckboxAndAssert(); - }); - - //https://issues.redhat.com/browse/OU-974 - [Metrics] - Units - undefined showing in Y axis and tooltip - it(`${perspectiveName} perspective - Metrics > Units`, () => { - cy.log('5.1 Preparation to test Units dropdown'); - metricsPage.clickInsertExampleQuery(); - metricsPage.unitsDropdownAssertion(); - - cy.log('5.2 Units dropdown'); - Object.values(MetricsPageUnits).forEach((unit) => { - metricsPage.clickUnitsDropdown(unit); - metricsPage.unitsAxisYAssertion(unit); - }); - }); -} From e7b8dee83c5886de355b9d021d82b1abb7daf590 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:27:50 -0400 Subject: [PATCH 5/7] refactor: move perses support files --- .../perses_dashboards_acm.cy.ts | 2 +- .../perses_dashboards_bvt.cy.ts | 2 +- .../perses_dashboards_create.cy.ts | 2 +- .../perses_dashboards_datasources.cy.ts | 2 +- .../perses_dashboards_edit.cy.ts | 4 ++-- .../perses_dashboards_import.cy.ts | 2 +- .../perses_dashboards_list.cy.ts | 4 ++-- ...perses_dashboards_virtualization_ivt.cy.ts | 2 +- .../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 +- .../commands/dashboards-commands.ts | 8 ++++---- .../{ => perses}/commands/perses-commands.ts | 6 +++--- ...ses_admin.cy.ts => perses_bvt_admin.cy.ts} | 0 ..._admin.cy.ts => perses_create_admin.cy.ts} | 0 ...cy.ts => perses_create_import_admin.cy.ts} | 0 ...es_admin.cy.ts => perses_edit_admin.cy.ts} | 0 ...dmin_1.cy.ts => perses_edit_admin_1.cy.ts} | 0 ..._admin.cy.ts => perses_import_admin.cy.ts} | 0 ...es_admin.cy.ts => perses_list_admin.cy.ts} | 0 ...y.ts => perses_list_admin_namespace.cy.ts} | 0 .../perses_user1.cy.ts} | 20 +++++++++---------- .../perses_user2.cy.ts} | 10 +++++----- .../perses_user3.cy.ts} | 20 +++++++++---------- .../perses_user4.cy.ts} | 6 +++--- .../perses_user5.cy.ts} | 20 +++++++++---------- .../perses_user6.cy.ts} | 6 +++--- 30 files changed, 64 insertions(+), 64 deletions(-) rename web/cypress/support/{ => perses}/commands/dashboards-commands.ts (97%) rename web/cypress/support/{ => perses}/commands/perses-commands.ts (97%) rename web/cypress/support/perses/{00.coo_bvt_perses_admin.cy.ts => perses_bvt_admin.cy.ts} (100%) rename web/cypress/support/perses/{03.coo_create_perses_admin.cy.ts => perses_create_admin.cy.ts} (100%) rename web/cypress/support/perses/{05.coo_create_import_perses_admin.cy.ts => perses_create_import_admin.cy.ts} (100%) rename web/cypress/support/perses/{02.coo_edit_perses_admin.cy.ts => perses_edit_admin.cy.ts} (100%) rename web/cypress/support/perses/{02.coo_edit_perses_admin_1.cy.ts => perses_edit_admin_1.cy.ts} (100%) rename web/cypress/support/perses/{04.coo_import_perses_admin.cy.ts => perses_import_admin.cy.ts} (100%) rename web/cypress/support/perses/{01.coo_list_perses_admin.cy.ts => perses_list_admin.cy.ts} (100%) rename web/cypress/support/perses/{01.coo_list_perses_admin_namespace.cy.ts => perses_list_admin_namespace.cy.ts} (100%) rename web/cypress/support/perses/{99.coo_rbac_perses_user1.cy.ts => rbac/perses_user1.cy.ts} (97%) rename web/cypress/support/perses/{99.coo_rbac_perses_user2.cy.ts => rbac/perses_user2.cy.ts} (94%) rename web/cypress/support/perses/{99.coo_rbac_perses_user3.cy.ts => rbac/perses_user3.cy.ts} (96%) rename web/cypress/support/perses/{99.coo_rbac_perses_user4.cy.ts => rbac/perses_user4.cy.ts} (92%) rename web/cypress/support/perses/{99.coo_rbac_perses_user5.cy.ts => rbac/perses_user5.cy.ts} (96%) rename web/cypress/support/perses/{99.coo_rbac_perses_user6.cy.ts => rbac/perses_user6.cy.ts} (88%) diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts index 4d436272c..b042ba579 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts @@ -2,7 +2,7 @@ // E2E test for validating ACM Perses integration with Cluster Observability Operator (COO) import { nav } from 'cypress/views/nav'; import '../../support/commands/auth-commands'; -import { testBVTCOOPerses1 } from 'cypress/support/perses/00.coo_bvt_perses_admin.cy'; +import { testBVTCOOPerses1 } from 'cypress/support/perses/perses_bvt_admin.cy'; import { CustomerPerspectiveName } from '@/shared/constants/perspective'; describe('ACM - Perses', { tags: ['@perses-dashboards', '@acm', '@coo'] }, () => { 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 22ad0c228..3b074512e 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; //TODO: rename after customizable-dashboards gets merged -import { testBVTCOOPerses1 } from '../../support/perses/00.coo_bvt_perses_admin.cy'; +import { testBVTCOOPerses1 } from '../../support/perses/perses_bvt_admin.cy'; describe( 'BVT: COO - Dashboards (Perses) - Core platform perspective', 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 96bcb417a..f533bdf15 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; -import { testCOOCreatePerses } from '../../support/perses/03.coo_create_perses_admin.cy'; import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { testCOOCreatePerses } from '../../support/perses/perses_create_admin.cy'; describe( 'COO - Dashboards (Perses) - Create perses dashboard', 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 0787932e7..492c2e8e4 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts @@ -1,5 +1,5 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { testCOOCreateImportPerses } from '../../support/perses/05.coo_create_import_perses_admin.cy'; +import { testCOOCreateImportPerses } from '../../support/perses/perses_create_import_admin.cy'; import { nav } from '../../views/nav'; describe( 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 5ceb625cb..48247e1ff 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts @@ -1,8 +1,8 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; -import { testCOOEditPerses1 } from '../../support/perses/02.coo_edit_perses_admin_1.cy'; -import { testCOOEditPerses } from '../../support/perses/02.coo_edit_perses_admin.cy'; import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { testCOOEditPerses } from '../../support/perses/perses_edit_admin.cy'; +import { testCOOEditPerses1 } from '../../support/perses/perses_edit_admin_1.cy'; describe( 'COO - Dashboards (Perses) - Edit perses dashboard', 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 b08a6d969..993bf6d9e 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts @@ -1,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; -import { testCOOImportPerses } from '../../support/perses/04.coo_import_perses_admin.cy'; import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { testCOOImportPerses } from '../../support/perses/perses_import_admin.cy'; describe( 'COO - Dashboards (Perses) - Import perses dashboard', 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 d1784c1ea..d73ef7e50 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts @@ -3,8 +3,8 @@ import { nav } from '../../views/nav'; import { testCOOListPerses, testCOOListPersesDuplicateDashboard, -} from '../../support/perses/01.coo_list_perses_admin.cy'; -import { testCOOListPersesNamespace } from '../../support/perses/01.coo_list_perses_admin_namespace.cy'; +} from '../../support/perses/perses_list_admin.cy'; +import { testCOOListPersesNamespace } from '../../support/perses/perses_list_admin_namespace.cy'; //TODO: change tag to @dashboards when customizable-dashboards gets merged describe( 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 073333f14..f609a2e41 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,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; -import { testBVTCOOPerses1 } from '../../support/perses/00.coo_bvt_perses_admin.cy'; +import { testBVTCOOPerses1 } from '../../support/perses/perses_bvt_admin.cy'; import { guidedTour } from '../../views/tour'; import { commonPages } from '../../views/common'; 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 a49b8c073..3b238087a 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,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { testCOORBACPersesTestsDevUser1 } from '../../../support/perses/99.coo_rbac_perses_user1.cy'; +import { testCOORBACPersesTestsDevUser1 } from '../../../support/perses/rbac/perses_user1.cy'; describe( 'RBAC User1: COO - Dashboards (Perses) - Administrator perspective', 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 1bd69bfa8..8f9d85f7f 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,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { testCOORBACPersesTestsDevUser2 } from '../../../support/perses/99.coo_rbac_perses_user2.cy'; import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { testCOORBACPersesTestsDevUser2 } from '../../../support/perses/rbac/perses_user2.cy'; describe( 'RBAC User2: COO - Dashboards (Perses) - Administrator perspective', 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 8f6b114e1..b4cdd4f96 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,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { testCOORBACPersesTestsDevUser3 } from '../../../support/perses/99.coo_rbac_perses_user3.cy'; import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { testCOORBACPersesTestsDevUser3 } from '../../../support/perses/rbac/perses_user3.cy'; describe( 'RBAC User3: COO - Dashboards (Perses) - Administrator perspective', 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 4b92c57de..0533c56c1 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,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { testCOORBACPersesTestsDevUser4 } from '../../../support/perses/99.coo_rbac_perses_user4.cy'; import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { testCOORBACPersesTestsDevUser4 } from '../../../support/perses/rbac/perses_user4.cy'; describe( 'RBAC User4: COO - Dashboards (Perses) - Administrator perspective', 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 a03f4f577..f2c2dad48 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,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { testCOORBACPersesTestsDevUser5 } from '../../../support/perses/99.coo_rbac_perses_user5.cy'; import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { testCOORBACPersesTestsDevUser5 } from '../../../support/perses/rbac/perses_user5.cy'; describe( 'RBAC User5: COO - Dashboards (Perses) - Administrator perspective', 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 fe7cc92e1..522590582 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,7 +1,7 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { testCOORBACPersesTestsDevUser6 } from '../../../support/perses/99.coo_rbac_perses_user6.cy'; import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { testCOORBACPersesTestsDevUser6 } from '../../../support/perses/rbac/perses_user6.cy'; describe( 'RBAC User6: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/support/commands/dashboards-commands.ts b/web/cypress/support/perses/commands/dashboards-commands.ts similarity index 97% rename from web/cypress/support/commands/dashboards-commands.ts rename to web/cypress/support/perses/commands/dashboards-commands.ts index cd5da17e6..34403de75 100644 --- a/web/cypress/support/commands/dashboards-commands.ts +++ b/web/cypress/support/perses/commands/dashboards-commands.ts @@ -1,9 +1,9 @@ import 'cypress-wait-until'; import { DataTestIDs, LegacyTestIDs } from '@/shared/constants/data-test'; -import { waitForPodsReady, waitForResourceCondition } from './wait-utils'; -import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../timeouts'; -import { CLUSTER_OBSERVABILITY_OPERATOR } from '../operators'; -import { PERSES_E2E_DASHBOARDS_DIR, PERSES_E2E_DATASOURCES_DIR } from '../perses/constants'; +import { waitForPodsReady, waitForResourceCondition } from '../../commands/wait-utils'; +import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../../timeouts'; +import { CLUSTER_OBSERVABILITY_OPERATOR } from '../../operators'; +import { PERSES_E2E_DASHBOARDS_DIR, PERSES_E2E_DATASOURCES_DIR } from '../constants'; export {}; diff --git a/web/cypress/support/commands/perses-commands.ts b/web/cypress/support/perses/commands/perses-commands.ts similarity index 97% rename from web/cypress/support/commands/perses-commands.ts rename to web/cypress/support/perses/commands/perses-commands.ts index 92e345efb..c4b333245 100644 --- a/web/cypress/support/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/nav'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; import { listPersesDashboardsOUIAIDs } from '@/shared/constants/data-test'; import { PERSES_E2E_DASHBOARDS_DIR, @@ -10,7 +10,7 @@ import { PERSES_TEST_DASHBOARD_NAME_PREFIXES, SED_OCP_NS_TO_OBS_TEST, SED_PERSES_DEV_TO_OBS_TEST, -} from '../perses/constants'; +} from '../constants'; // Display name prefixes/exact matches for test-created PersesDashboards to delete before // Perses tests. diff --git a/web/cypress/support/perses/00.coo_bvt_perses_admin.cy.ts b/web/cypress/support/perses/perses_bvt_admin.cy.ts similarity index 100% rename from web/cypress/support/perses/00.coo_bvt_perses_admin.cy.ts rename to web/cypress/support/perses/perses_bvt_admin.cy.ts diff --git a/web/cypress/support/perses/03.coo_create_perses_admin.cy.ts b/web/cypress/support/perses/perses_create_admin.cy.ts similarity index 100% rename from web/cypress/support/perses/03.coo_create_perses_admin.cy.ts rename to web/cypress/support/perses/perses_create_admin.cy.ts diff --git a/web/cypress/support/perses/05.coo_create_import_perses_admin.cy.ts b/web/cypress/support/perses/perses_create_import_admin.cy.ts similarity index 100% rename from web/cypress/support/perses/05.coo_create_import_perses_admin.cy.ts rename to web/cypress/support/perses/perses_create_import_admin.cy.ts diff --git a/web/cypress/support/perses/02.coo_edit_perses_admin.cy.ts b/web/cypress/support/perses/perses_edit_admin.cy.ts similarity index 100% rename from web/cypress/support/perses/02.coo_edit_perses_admin.cy.ts rename to web/cypress/support/perses/perses_edit_admin.cy.ts diff --git a/web/cypress/support/perses/02.coo_edit_perses_admin_1.cy.ts b/web/cypress/support/perses/perses_edit_admin_1.cy.ts similarity index 100% rename from web/cypress/support/perses/02.coo_edit_perses_admin_1.cy.ts rename to web/cypress/support/perses/perses_edit_admin_1.cy.ts diff --git a/web/cypress/support/perses/04.coo_import_perses_admin.cy.ts b/web/cypress/support/perses/perses_import_admin.cy.ts similarity index 100% rename from web/cypress/support/perses/04.coo_import_perses_admin.cy.ts rename to web/cypress/support/perses/perses_import_admin.cy.ts diff --git a/web/cypress/support/perses/01.coo_list_perses_admin.cy.ts b/web/cypress/support/perses/perses_list_admin.cy.ts similarity index 100% rename from web/cypress/support/perses/01.coo_list_perses_admin.cy.ts rename to web/cypress/support/perses/perses_list_admin.cy.ts diff --git a/web/cypress/support/perses/01.coo_list_perses_admin_namespace.cy.ts b/web/cypress/support/perses/perses_list_admin_namespace.cy.ts similarity index 100% rename from web/cypress/support/perses/01.coo_list_perses_admin_namespace.cy.ts rename to web/cypress/support/perses/perses_list_admin_namespace.cy.ts diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user1.cy.ts b/web/cypress/support/perses/rbac/perses_user1.cy.ts similarity index 97% rename from web/cypress/support/perses/99.coo_rbac_perses_user1.cy.ts rename to web/cypress/support/perses/rbac/perses_user1.cy.ts index 94403cfe5..b38cb9989 100644 --- a/web/cypress/support/perses/99.coo_rbac_perses_user1.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user1.cy.ts @@ -1,20 +1,20 @@ -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'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../../views/perses-dashboards-create-dashboard'; import { persesDashboardsAddListVariableSource, persesDashboardSampleQueries, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, persesDashboardsEmptyDashboard, -} from '../../fixtures/perses/constants'; -import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables'; -import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup'; +} from '../../../fixtures/perses/constants'; +import { persesDashboardsEditVariables } from '../../../views/perses-dashboards-edit-variables'; +import { persesDashboardsPanelGroup } from '../../../views/perses-dashboards-panelgroup'; import { persesAriaLabels } from '@/shared/constants/data-test'; -import { persesDashboardsPanel } from '../../views/perses-dashboards-panel'; -import { persesDashboardsAddListPanelType } from '../../fixtures/perses/constants'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; -import { nav } from '../../views/nav'; +import { persesDashboardsPanel } from '../../../views/perses-dashboards-panel'; +import { persesDashboardsAddListPanelType } from '../../../fixtures/perses/constants'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; +import { nav } from '../../../views/nav'; import type { CustomerPerspective } from '@/shared/constants/perspective'; /** diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts b/web/cypress/support/perses/rbac/perses_user2.cy.ts similarity index 94% rename from web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts rename to web/cypress/support/perses/rbac/perses_user2.cy.ts index b9a7a604c..efa8ec0eb 100644 --- a/web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user2.cy.ts @@ -1,11 +1,11 @@ -import { persesDashboardsPage } from '../../views/perses-dashboards'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; -import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; +import { persesDashboardsPage } from '../../../views/perses-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../../views/perses-dashboards-create-dashboard'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, -} from '../../fixtures/perses/constants'; +} from '../../../fixtures/perses/constants'; import type { CustomerPerspective } from '@/shared/constants/perspective'; /** diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user3.cy.ts b/web/cypress/support/perses/rbac/perses_user3.cy.ts similarity index 96% rename from web/cypress/support/perses/99.coo_rbac_perses_user3.cy.ts rename to web/cypress/support/perses/rbac/perses_user3.cy.ts index 3150ae075..09a30b348 100644 --- a/web/cypress/support/perses/99.coo_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'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../../views/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 { persesDashboardsAddListPanelType } from '../../fixtures/perses/constants'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; -import { nav } from '../../views/nav'; +} 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 { persesDashboardsAddListPanelType } from '../../../fixtures/perses/constants'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; +import { nav } from '../../../views/nav'; import { persesAriaLabels } from '@/shared/constants/data-test'; import type { CustomerPerspective } from '@/shared/constants/perspective'; diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts b/web/cypress/support/perses/rbac/perses_user4.cy.ts similarity index 92% rename from web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts rename to web/cypress/support/perses/rbac/perses_user4.cy.ts index 753c7e2eb..fa08cc8d2 100644 --- a/web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user4.cy.ts @@ -1,7 +1,7 @@ -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; import type { CustomerPerspective } from '@/shared/constants/perspective'; -import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; +import { persesCreateDashboardsPage } from '../../../views/perses-dashboards-create-dashboard'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; /** * User4 has access to: diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user5.cy.ts b/web/cypress/support/perses/rbac/perses_user5.cy.ts similarity index 96% rename from web/cypress/support/perses/99.coo_rbac_perses_user5.cy.ts rename to web/cypress/support/perses/rbac/perses_user5.cy.ts index e2f095443..62fe0f87e 100644 --- a/web/cypress/support/perses/99.coo_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'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; +import { persesCreateDashboardsPage } from '../../../views/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 { persesDashboardsAddListPanelType } from '../../fixtures/perses/constants'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; -import { nav } from '../../views/nav'; +} 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 { persesDashboardsAddListPanelType } from '../../../fixtures/perses/constants'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; +import { nav } from '../../../views/nav'; import type { CustomerPerspective } from '@/shared/constants/perspective'; let dashboardName = 'Testing Dashboard - UP '; diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts b/web/cypress/support/perses/rbac/perses_user6.cy.ts similarity index 88% rename from web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts rename to web/cypress/support/perses/rbac/perses_user6.cy.ts index b2062d9fa..1a2e0ae15 100644 --- a/web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user6.cy.ts @@ -1,7 +1,7 @@ -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; import type { CustomerPerspective } from '@/shared/constants/perspective'; -import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard'; -import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard'; +import { persesCreateDashboardsPage } from '../../../views/perses-dashboards-create-dashboard'; +import { persesImportDashboardsPage } from '../../../views/perses-dashboards-import-dashboard'; /** * User6 has access to: From 346551efaeab83b49ae6ac314e10723e94eee0f5 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:28:26 -0400 Subject: [PATCH 6/7] refactor: move shared support files --- web/cypress/e2e/alerts/alerts_acm.cy.ts | 4 +-- web/cypress/e2e/alerts/alerts_bvt.cy.ts | 2 +- .../e2e/alerts/alerts_regression.cy.ts | 2 +- .../legacy_dashboards_regression.cy.ts | 2 +- ...dashboards_virtualization_regression.cy.ts | 2 +- .../e2e/metrics/metrics_regression.cy.ts | 2 +- .../metrics/metrics_virtualization_ivt.cy.ts | 2 +- .../lightspeed_integration.cy.ts | 2 +- .../perses_dashboards_acm.cy.ts | 2 +- .../perses_dashboards_create.cy.ts | 2 +- .../perses_dashboards_edit.cy.ts | 2 +- .../perses_dashboards_import.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 +- web/cypress/support/index.ts | 26 +++++++++---------- .../perses/commands/dashboards-commands.ts | 4 +-- .../coo-install-commands.ts | 6 ++--- .../{ => shared}/commands/auth-commands.ts | 4 +-- .../{ => shared/commands}/benchmark-utils.ts | 0 .../commands/image-patch-commands.ts | 2 +- .../commands/operator-commands.ts | 4 +-- .../commands/selector-commands.ts | 0 .../{ => shared/commands}/selectors.ts | 0 .../commands/traces-logging-commands.ts | 6 ++--- .../{ => shared}/commands/utility-commands.ts | 0 .../commands/virtualization-commands.ts | 8 +++--- .../{ => shared}/commands/wait-utils.ts | 2 +- web/cypress/support/{ => shared}/operators.ts | 0 31 files changed, 49 insertions(+), 49 deletions(-) rename web/cypress/support/{commands => shared/cluster-observability-operator}/coo-install-commands.ts (99%) rename web/cypress/support/{ => shared}/commands/auth-commands.ts (99%) rename web/cypress/support/{ => shared/commands}/benchmark-utils.ts (100%) rename web/cypress/support/{ => shared}/commands/image-patch-commands.ts (99%) rename web/cypress/support/{ => shared}/commands/operator-commands.ts (98%) rename web/cypress/support/{ => shared}/commands/selector-commands.ts (100%) rename web/cypress/support/{ => shared/commands}/selectors.ts (100%) rename web/cypress/support/{ => shared}/commands/traces-logging-commands.ts (99%) rename web/cypress/support/{ => shared}/commands/utility-commands.ts (100%) rename web/cypress/support/{ => shared}/commands/virtualization-commands.ts (98%) rename web/cypress/support/{ => shared}/commands/wait-utils.ts (97%) rename web/cypress/support/{ => shared}/operators.ts (100%) diff --git a/web/cypress/e2e/alerts/alerts_acm.cy.ts b/web/cypress/e2e/alerts/alerts_acm.cy.ts index 1ebf24f31..c572aa918 100644 --- a/web/cypress/e2e/alerts/alerts_acm.cy.ts +++ b/web/cypress/e2e/alerts/alerts_acm.cy.ts @@ -1,5 +1,5 @@ // E2E test for validating ACM Alerting UI integration with Cluster Observability Operator (COO) -import '../../support/commands/auth-commands'; +import '../../support/shared/commands/auth-commands'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { acmAlertingPage } from '../../views/acm-alerting-page'; @@ -11,7 +11,7 @@ import { testAlertsRegression, } from 'cypress/support/alerts/alerts_regressions.cy'; import { listPage } from 'cypress/views/list-page'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; import { CustomerPerspectiveName } from '@/shared/constants/perspective'; const expectedAlerts = ['Watchdog', 'Watchdog-spoke', 'ClusterCPUHealth-jb']; diff --git a/web/cypress/e2e/alerts/alerts_bvt.cy.ts b/web/cypress/e2e/alerts/alerts_bvt.cy.ts index 911f96ddd..3c4e361d7 100644 --- a/web/cypress/e2e/alerts/alerts_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_bvt.cy.ts @@ -3,7 +3,7 @@ import { nav } from '../../views/nav'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { testBVTMonitoringTestsNamespace } from '../../support/alerts/alerts_bvt_namespaced.cy'; import { commonPages } from '../../views/common'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; describe('BVT: Monitoring - Namespaced', { tags: ['@alerting', '@metrics'] }, () => { before(() => { diff --git a/web/cypress/e2e/alerts/alerts_regression.cy.ts b/web/cypress/e2e/alerts/alerts_regression.cy.ts index 4b54241e4..b280ccc08 100644 --- a/web/cypress/e2e/alerts/alerts_regression.cy.ts +++ b/web/cypress/e2e/alerts/alerts_regression.cy.ts @@ -7,7 +7,7 @@ import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { testAlertsRegressionNamespace } from '../../support/alerts/alerts_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; // Test suite for Core platform perspective describe( 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 56b29cc93..63e141ad7 100644 --- a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts @@ -1,5 +1,5 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; import { testLegacyDashboardsRegression } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; import { testLegacyDashboardsRegressionNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; 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 80f200a1e..4d3611524 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 @@ -1,5 +1,5 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; import { testLegacyDashboardsRegression } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; import { testLegacyDashboardsRegressionNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; diff --git a/web/cypress/e2e/metrics/metrics_regression.cy.ts b/web/cypress/e2e/metrics/metrics_regression.cy.ts index beb1ca99f..61111153f 100644 --- a/web/cypress/e2e/metrics/metrics_regression.cy.ts +++ b/web/cypress/e2e/metrics/metrics_regression.cy.ts @@ -9,7 +9,7 @@ import { } from '../../support/metrics/metrics_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; // Test suite for Administrator perspective describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@metrics'] }, () => { diff --git a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts index 4c41291be..327e19812 100644 --- a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts +++ b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts @@ -11,7 +11,7 @@ import { import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { guidedTour } from '../../views/tour'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; describe('Regression: Monitoring - Metrics (Virtualization)', () => { before(() => { diff --git a/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts b/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts index b0b2d2fbd..22c8c324c 100644 --- a/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts +++ b/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts @@ -1,4 +1,4 @@ -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +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'; diff --git a/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts index b042ba579..050757a1c 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_acm.cy.ts @@ -1,7 +1,7 @@ // 02.acm_perses.cy.ts // E2E test for validating ACM Perses integration with Cluster Observability Operator (COO) import { nav } from 'cypress/views/nav'; -import '../../support/commands/auth-commands'; +import '../../support/shared/commands/auth-commands'; import { testBVTCOOPerses1 } from 'cypress/support/perses/perses_bvt_admin.cy'; import { CustomerPerspectiveName } from '@/shared/constants/perspective'; 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 f533bdf15..755633d77 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_create.cy.ts @@ -1,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; import { testCOOCreatePerses } from '../../support/perses/perses_create_admin.cy'; describe( 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 48247e1ff..ee09f847c 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts @@ -1,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; import { testCOOEditPerses } from '../../support/perses/perses_edit_admin.cy'; import { testCOOEditPerses1 } from '../../support/perses/perses_edit_admin_1.cy'; 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 993bf6d9e..c8dd81110 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_import.cy.ts @@ -1,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../views/nav'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; import { testCOOImportPerses } from '../../support/perses/perses_import_admin.cy'; describe( 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 8f9d85f7f..f2a9f7708 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,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; import { testCOORBACPersesTestsDevUser2 } from '../../../support/perses/rbac/perses_user2.cy'; describe( 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 b4cdd4f96..7113c51b9 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,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; import { testCOORBACPersesTestsDevUser3 } from '../../../support/perses/rbac/perses_user3.cy'; describe( 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 0533c56c1..c9e89769b 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,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; import { testCOORBACPersesTestsDevUser4 } from '../../../support/perses/rbac/perses_user4.cy'; describe( 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 f2c2dad48..10ab6e7ae 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,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; import { testCOORBACPersesTestsDevUser5 } from '../../../support/perses/rbac/perses_user5.cy'; describe( 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 522590582..ca5973a72 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,6 +1,6 @@ import { CustomerPerspectiveName } from '@/shared/constants/perspective'; import { nav } from '../../../views/nav'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; import { testCOORBACPersesTestsDevUser6 } from '../../../support/perses/rbac/perses_user6.cy'; describe( diff --git a/web/cypress/support/index.ts b/web/cypress/support/index.ts index a545f29bc..2b459de47 100644 --- a/web/cypress/support/index.ts +++ b/web/cypress/support/index.ts @@ -1,18 +1,18 @@ import '@cypress/grep'; -import './selectors'; -import './commands/selector-commands'; -import './commands/auth-commands'; -import './commands/coo-install-commands'; -import './commands/image-patch-commands'; -import './commands/dashboards-commands'; -import './commands/operator-commands'; -import './commands/incident-commands'; -import './commands/utility-commands'; -import './incidents_prometheus_query_mocks'; -import './commands/virtualization-commands'; -import './commands/perses-commands'; -import './commands/traces-logging-commands'; +import './shared/commands/selectors'; +import './shared/commands/selector-commands'; +import './shared/commands/auth-commands'; +import './shared/cluster-observability-operator/coo-install-commands'; +import './shared/commands/image-patch-commands'; +import './perses/commands/dashboards-commands'; +import './shared/commands/operator-commands'; +import './incidents/commands/incident-commands'; +import './shared/commands/utility-commands'; +import './incidents'; +import './shared/commands/virtualization-commands'; +import './perses/commands/perses-commands'; +import './shared/commands/traces-logging-commands'; export const checkErrors = () => cy.window().then((win) => { diff --git a/web/cypress/support/perses/commands/dashboards-commands.ts b/web/cypress/support/perses/commands/dashboards-commands.ts index 34403de75..6ffd8c7b7 100644 --- a/web/cypress/support/perses/commands/dashboards-commands.ts +++ b/web/cypress/support/perses/commands/dashboards-commands.ts @@ -1,8 +1,8 @@ import 'cypress-wait-until'; import { DataTestIDs, LegacyTestIDs } from '@/shared/constants/data-test'; -import { waitForPodsReady, waitForResourceCondition } from '../../commands/wait-utils'; +import { waitForPodsReady, waitForResourceCondition } from '../../shared/commands/wait-utils'; import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../../timeouts'; -import { CLUSTER_OBSERVABILITY_OPERATOR } from '../../operators'; +import { CLUSTER_OBSERVABILITY_OPERATOR } from '../../shared/operators'; import { PERSES_E2E_DASHBOARDS_DIR, PERSES_E2E_DATASOURCES_DIR } from '../constants'; export {}; diff --git a/web/cypress/support/commands/coo-install-commands.ts b/web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts similarity index 99% rename from web/cypress/support/commands/coo-install-commands.ts rename to web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts index b0c62e1d6..ac9479ab4 100644 --- a/web/cypress/support/commands/coo-install-commands.ts +++ b/web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts @@ -1,7 +1,7 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../views/operator-hub-page'; -import { nav } from '../../views/nav'; -import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../timeouts'; +import { operatorHubPage } from '../../../views/operator-hub-page'; +import { nav } from '../../../views/nav'; +import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../../timeouts'; import { CLUSTER_OBSERVABILITY_OPERATOR } from '../operators'; export {}; diff --git a/web/cypress/support/commands/auth-commands.ts b/web/cypress/support/shared/commands/auth-commands.ts similarity index 99% rename from web/cypress/support/commands/auth-commands.ts rename to web/cypress/support/shared/commands/auth-commands.ts index 4c8f4a973..62936f059 100644 --- a/web/cypress/support/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/nav'; +import { guidedTour } from '../../../views/tour'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, diff --git a/web/cypress/support/benchmark-utils.ts b/web/cypress/support/shared/commands/benchmark-utils.ts similarity index 100% rename from web/cypress/support/benchmark-utils.ts rename to web/cypress/support/shared/commands/benchmark-utils.ts diff --git a/web/cypress/support/commands/image-patch-commands.ts b/web/cypress/support/shared/commands/image-patch-commands.ts similarity index 99% rename from web/cypress/support/commands/image-patch-commands.ts rename to web/cypress/support/shared/commands/image-patch-commands.ts index 77c0eff1c..260efab60 100644 --- a/web/cypress/support/commands/image-patch-commands.ts +++ b/web/cypress/support/shared/commands/image-patch-commands.ts @@ -1,5 +1,5 @@ import { waitForPodsReady, waitForPodsReadyOrAbsent } from './wait-utils'; -import { readyTimeoutMilliseconds } from '../timeouts'; +import { readyTimeoutMilliseconds } from '../../timeouts'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR } from '../operators'; export {}; diff --git a/web/cypress/support/commands/operator-commands.ts b/web/cypress/support/shared/commands/operator-commands.ts similarity index 98% rename from web/cypress/support/commands/operator-commands.ts rename to web/cypress/support/shared/commands/operator-commands.ts index b7204622c..756c1c31f 100644 --- a/web/cypress/support/commands/operator-commands.ts +++ b/web/cypress/support/shared/commands/operator-commands.ts @@ -1,8 +1,8 @@ import 'cypress-wait-until'; import { operatorAuthUtils } from './auth-commands'; -import { cooInstallUtils } from './coo-install-commands'; +import { cooInstallUtils } from '../cluster-observability-operator/coo-install-commands'; import { imagePatchUtils } from './image-patch-commands'; -import { dashboardsUtils } from './dashboards-commands'; +import { dashboardsUtils } from '../../perses/commands/dashboards-commands'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR } from '../operators'; export {}; diff --git a/web/cypress/support/commands/selector-commands.ts b/web/cypress/support/shared/commands/selector-commands.ts similarity index 100% rename from web/cypress/support/commands/selector-commands.ts rename to web/cypress/support/shared/commands/selector-commands.ts diff --git a/web/cypress/support/selectors.ts b/web/cypress/support/shared/commands/selectors.ts similarity index 100% rename from web/cypress/support/selectors.ts rename to web/cypress/support/shared/commands/selectors.ts diff --git a/web/cypress/support/commands/traces-logging-commands.ts b/web/cypress/support/shared/commands/traces-logging-commands.ts similarity index 99% rename from web/cypress/support/commands/traces-logging-commands.ts rename to web/cypress/support/shared/commands/traces-logging-commands.ts index de6ed4fb1..bb72a772a 100644 --- a/web/cypress/support/commands/traces-logging-commands.ts +++ b/web/cypress/support/shared/commands/traces-logging-commands.ts @@ -1,7 +1,7 @@ import 'cypress-wait-until'; -import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../timeouts'; -import { operatorHubPage } from '../../views/operator-hub-page'; -import { nav } from '../../views/nav'; +import { operatorHubPage } from '../../../views/operator-hub-page'; +import { nav } from '../../../views/nav'; +import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../../timeouts'; import { operatorAuthUtils } from './auth-commands'; import { CLUSTER_LOGGING_OPERATOR, diff --git a/web/cypress/support/commands/utility-commands.ts b/web/cypress/support/shared/commands/utility-commands.ts similarity index 100% rename from web/cypress/support/commands/utility-commands.ts rename to web/cypress/support/shared/commands/utility-commands.ts diff --git a/web/cypress/support/commands/virtualization-commands.ts b/web/cypress/support/shared/commands/virtualization-commands.ts similarity index 98% rename from web/cypress/support/commands/virtualization-commands.ts rename to web/cypress/support/shared/commands/virtualization-commands.ts index b2e206327..7bab06ec9 100644 --- a/web/cypress/support/commands/virtualization-commands.ts +++ b/web/cypress/support/shared/commands/virtualization-commands.ts @@ -1,9 +1,9 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../views/operator-hub-page'; -import { nav } from '../../views/nav'; +import { operatorHubPage } from '../../../views/operator-hub-page'; +import { nav } from '../../../views/nav'; import { operatorAuthUtils } from './auth-commands'; -import { guidedTour } from '../../views/tour'; -import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../timeouts'; +import { guidedTour } from '../../../views/tour'; +import { installTimeoutMilliseconds, readyTimeoutMilliseconds } from '../../timeouts'; import { KUBEVIRT_HYPERCONVERGED_OPERATOR } from '../operators'; export {}; diff --git a/web/cypress/support/commands/wait-utils.ts b/web/cypress/support/shared/commands/wait-utils.ts similarity index 97% rename from web/cypress/support/commands/wait-utils.ts rename to web/cypress/support/shared/commands/wait-utils.ts index d5fdffa2d..8dc826025 100644 --- a/web/cypress/support/commands/wait-utils.ts +++ b/web/cypress/support/shared/commands/wait-utils.ts @@ -1,5 +1,5 @@ import 'cypress-wait-until'; -import { readyTimeoutMilliseconds } from '../timeouts'; +import { readyTimeoutMilliseconds } from '../../timeouts'; /** * Poll until pods matching a label selector reach the Ready condition. diff --git a/web/cypress/support/operators.ts b/web/cypress/support/shared/operators.ts similarity index 100% rename from web/cypress/support/operators.ts rename to web/cypress/support/shared/operators.ts From 2af92253fa0737529835ea5b9b12b068dc592329 Mon Sep 17 00:00:00 2001 From: PeterYurkovich Date: Wed, 12 Aug 2026 14:28:54 -0400 Subject: [PATCH 7/7] refactor: update documentation with moved shared files --- .cursor/commands/generate-regression-test.md | 4 +- web/cypress/CYPRESS_TESTING_GUIDE.md | 130 ++++++++++--------- web/cypress/E2E_TEST_SCENARIOS.md | 10 +- web/cypress/README.md | 25 +--- 4 files changed, 81 insertions(+), 88 deletions(-) diff --git a/.cursor/commands/generate-regression-test.md b/.cursor/commands/generate-regression-test.md index d65e512ed..f60d4958a 100644 --- a/.cursor/commands/generate-regression-test.md +++ b/.cursor/commands/generate-regression-test.md @@ -2,6 +2,8 @@ description: Generate automated regression test from test documentation --- +TODO: UPDATE THIS WITH NEW STRUCTURE + # Generate Regression Test Generate automated regression tests from test documentation in [`docs/incident_detection/tests/`](../../docs/incident_detection/tests/), following the style of existing tests in `@incidents/` and using `@incidents-page.ts` Page Object Model. @@ -395,7 +397,7 @@ Which to follow? **Actions**: -1. Search likely locations: `web/cypress/views/`, `web/cypress/support/page-objects/` +1. Search likely locations: `web/cypress/views/` 2. If different structure, attempt to adapt 3. If not found: ``` diff --git a/web/cypress/CYPRESS_TESTING_GUIDE.md b/web/cypress/CYPRESS_TESTING_GUIDE.md index 4acf4e13c..d27d98517 100644 --- a/web/cypress/CYPRESS_TESTING_GUIDE.md +++ b/web/cypress/CYPRESS_TESTING_GUIDE.md @@ -5,6 +5,7 @@ --- ## Table of Contents + - [Quick Start](#quick-start) - [Test Architecture](#test-architecture) - [Creating Tests](#creating-tests) @@ -16,11 +17,13 @@ ## Quick Start ### Prerequisites + - Node.js >= 18 - OpenShift cluster with kubeconfig - Environment variables configured ### 30-Second Setup + ```bash cd web/cypress source ./configure-env.sh # Interactive configuration @@ -48,7 +51,7 @@ The Monitoring Plugin uses a 3-layer architecture for test organization: │ imports ┌────────────────▼────────────────────────────────┐ │ Layer 2: Support Scenarios │ -│ (cypress/support/monitoring or perses │ +│ (cypress/support/* │ │ - Reusable test scenarios │ │ - Work across multiple perspectives │ │ - Export functions with perspective parameter │ @@ -67,28 +70,41 @@ The Monitoring Plugin uses a 3-layer architecture for test organization: ``` cypress/ -├── component/ # Component tests (isolated, no cluster needed) +├── component/ # Component tests (isolated, no cluster needed) ├── e2e/ -│ ├── monitoring/ # Core monitoring tests (Administrator) -│ │ ├── 00.bvt_admin.cy.ts +│ ├── alerts/ # Alerts tests +│ │ ├── alerts_acm.cy.ts +│ │ └── alerts_regression.cy.ts +│ ├── incidents/ # Incidents tests +│ │ ├── incidents_bvt.cy.ts │ │ └── regression/ -│ ├── coo/ # COO-specific tests -│ │ ├── 01.coo_bvt.cy.ts -│ │ └── 02.acm_alerting_ui.cy.ts -│ └── virtualization/ # Integration tests (Virtualization) +│ ├── legacy-dashboards/ # Legacy dashboards tests +│ │ ├── legacy_dashboards_regression.cy.ts +│ │ └── legacy_dashboards_virtualization_regression.cy.ts +│ └── shared/ # Shared test runs +│ ├── admin_perspective_bvt.cy.ts +│ └── coo_submenus.cy.ts ├── support/ -│ ├── monitoring/ # Reusable test scenarios -│ │ ├── 01.reg_alerts.cy.ts -│ │ ├── 02.reg_metrics.cy.ts -│ │ └── 03.reg_legacy_dashboards.cy.ts -│ ├── perses/ # COO/Perses scenarios -│ ├── commands/ # Custom Cypress commands -│ ├── component.ts # Component test support (mount command) -│ └── component-index.html # HTML template for component mounting -└── views/ # Page object models (reusable actions) +│ ├── alerts/ # Reusable test scenarios +│ │ ├── alerts_bvt.cy.ts +│ │ └── alerts_regressions.cy.ts +│ ├── incidents/ # Incidents test scenarios +│ ├── legacy-dashboards/ # Legacy Dashboards test scenarios +│ ├── metrics/ # Metrics test scenarios +│ ├── perses/ # Perses Dashboards test scenarios +│ ├── shared/ # Shared testing utils +│ │ ├── cluster-observability-operator +│ │ │ └── coo-install-commands.ts # coo and related operator install utils +│ │ ├── commands +│ │ │ └── benchmark-utils.ts # various cypress commands +│ │ └── operator.ts # Operator definitions +│ ├── component.ts # Component test support (mount command) +│ └── component-index.html # HTML template for component mounting +└── views/ # Page object models (reusable actions) ``` **Benefits**: + - Test scenarios reusable across Administrator, Virtualization, and Fleet Management perspectives - Page actions separated from test logic for better maintainability - UI changes only require updating views, not individual tests @@ -101,12 +117,12 @@ Component tests mount individual React components in isolation using Cypress, wi ### When to Use Component Tests vs E2E Tests -| Use Component Tests When | Use E2E Tests When | -|---|---| -| Testing rendering and visual output | Testing full user workflows | -| Verifying props and conditional display | Testing navigation between pages | -| Validating empty/error states | Testing API integration | -| Fast feedback during development | Testing cross-component interactions | +| Use Component Tests When | Use E2E Tests When | +| --------------------------------------- | ------------------------------------ | +| Testing rendering and visual output | Testing full user workflows | +| Verifying props and conditional display | Testing navigation between pages | +| Validating empty/error states | Testing API integration | +| Fast feedback during development | Testing cross-component interactions | ### Writing Component Tests @@ -159,12 +175,10 @@ npx cypress run --component --spec cypress/component/labels.cy.tsx 1. **Layer 1 - Views**: Check/add page actions in `cypress/views/` - Under `views/` folder, find pre-defined actions per page - If none fits your needs, add new ones - -2. **Layer 2 - Support**: Add test scenarios to `cypress/support/monitoring/` +2. **Layer 2 - Support**: Add test scenarios to `cypress/support/*` - Add test scenarios to cypress files under `support/` folder - Make scenarios reusable across perspectives (Administrator, Virtualization, Fleet Management) - If it is not applicable, in some cases for Incidents or Fleet Management, test scenarios will be written directly into Layer 3 - 3. **Layer 3 - E2E**: Verify e2e files call your scenario (usually pre-configured) - Administrator: `e2e/monitoring/` - Virtualization: `e2e/virtualization/` @@ -173,13 +187,12 @@ npx cypress run --component --spec cypress/component/labels.cy.tsx ### Example: Support Scenario Structure ```typescript -// In support/monitoring/01.reg_alerts.cy.ts +// In support/monitoring/alerts_regression.cy.ts import { nav } from '../../views/nav'; import { silencesListPage } from '../../views/silences-list-page'; export const runAlertTests = (perspective: string) => { describe(`${perspective} perspective - Alerting > Alerts page`, () => { - it('should filter alerts by severity', () => { // Use page object actions from views/ silencesListPage.filter.byName('test-alert'); @@ -191,14 +204,14 @@ export const runAlertTests = (perspective: string) => { ### When to Create New Tests -| Scenario | Action | -|----------|--------| -| New UI feature | Create new E2E test scenario in support/ | -| Bug fix | Add test case to existing support file | -| Component update | Update existing test scenarios | -| New Perses feature | Create new E2E test scenario in support/ | -| ACM integration | Add E2E test in e2e/coo/ | -| Isolated component logic | Add component test in component/ | +| Scenario | Action | +| ------------------------ | ---------------------------------------- | +| New UI feature | Create new E2E test scenario in support/ | +| Bug fix | Add test case to existing support file | +| Component update | Update existing test scenarios | +| New Perses feature | Create new E2E test scenario in support/ | +| ACM integration | Add E2E test in e2e/coo/ | +| Isolated component logic | Add component test in component/ | ### Best Practices @@ -217,22 +230,9 @@ export const runAlertTests = (perspective: string) => { ```bash cd web/cypress -# Run all regression tests -npm run cypress:run -- --spec "cypress/e2e/**/regression/**" - -# Run specific feature regression -npm run cypress:run -- --spec "cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts" -npm run cypress:run -- --spec "cypress/e2e/monitoring/regression/02.reg_metrics_admin.cy.ts" -npm run cypress:run -- --spec "cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts" - -# Run BVT (Build Verification Tests) -npm run cypress:run -- --spec "cypress/e2e/monitoring/00.bvt_admin.cy.ts" - -# Run COO tests -npm run cypress:run -- --spec "cypress/e2e/coo/01.coo_bvt.cy.ts" - -# Run ACM Alerting tests -npm run cypress:run -- --spec "cypress/e2e/coo/02.acm_alerting_ui.cy.ts" +# Run specific tests +npm run cypress:run -- --spec "cypress/e2e/alerts/alerts_regression.cy.ts" +npm run cypress:run -- --spec "cypress/e2e/metrics/metrics_regression.cy.ts" # Interactive mode (GUI) npm run cypress:open @@ -241,6 +241,7 @@ npm run cypress:open ### Environment Setup **Interactive** (Recommended): + ```bash cd web/cypress source ./configure-env.sh @@ -250,12 +251,12 @@ source ./configure-env.sh ### Regression Testing Strategy -| Change Type | Required Tests | -|-------------|---------------| -| **UI Component Change** | Feature-specific regression + BVT | -| **API Integration Change** | Full regression suite | -| **Console Extension Change** | BVT + Navigation tests | -| **Bug Fix** | New test + Related regression | +| Change Type | Required Tests | +| ---------------------------- | --------------------------------- | +| **UI Component Change** | Feature-specific regression + BVT | +| **API Integration Change** | Full regression suite | +| **Console Extension Change** | BVT + Navigation tests | +| **Bug Fix** | New test + Related regression | ### Pre-PR Checklist @@ -286,12 +287,12 @@ source ./configure-env.sh ### Common Test Issues -| Issue | Solution | -|-------|----------| -| Test fails intermittently | Check for timing issues, add proper waits | -| Element not found | Verify data-test attributes exist, check page object | -| Assertion fails | Review expected vs actual values, update test | -| Test hangs | Check for infinite loops or missing assertions | +| Issue | Solution | +| ------------------------- | ---------------------------------------------------- | +| Test fails intermittently | Check for timing issues, add proper waits | +| Element not found | Verify data-test attributes exist, check page object | +| Assertion fails | Review expected vs actual values, update test | +| Test hangs | Check for infinite loops or missing assertions | ### Setup & Configuration Issues @@ -300,6 +301,7 @@ For environment variable issues, login problems, kubeconfig errors, and installa ### CI/CD Integration Cypress tests run automatically in the CI pipeline: + - **Pre-merge**: BVT tests run on every PR - **Post-merge**: Full regression suite runs on main branch - **Konflux Pipeline**: Automated testing for release candidates diff --git a/web/cypress/E2E_TEST_SCENARIOS.md b/web/cypress/E2E_TEST_SCENARIOS.md index 2989645ba..4d26bc7a8 100644 --- a/web/cypress/E2E_TEST_SCENARIOS.md +++ b/web/cypress/E2E_TEST_SCENARIOS.md @@ -1,5 +1,7 @@ # E2E Test Scenarios Overview +TODO: UPDATE THIS WITH NEW STRUCTURE + This document provides a comprehensive overview of all End-to-End (E2E) test scenarios for the Monitoring Plugin, including COO (Cluster Observability Operator) and standard Monitoring tests. ## Table of Contents @@ -29,10 +31,10 @@ Located in `e2e/coo/` ### OLS (OpenShift LightSpeed) Integration Tests -| File | Test Suite | Test Scenario | Description | -| ----------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `03.coo_lightspeed_show_timeseries.cy.ts` | COO-LightSpeed: show_timeseries | switches to troubleshooting mode, sends a prompt, and renders a Perses dashboard | **Non-deterministic** — sends a natural-language prompt to the live OLS AI and asserts it responds with a `show_timeseries` tool call that renders a Perses chart. | -| `03.coo_lightspeed_show_timeseries.cy.ts` | COO-LightSpeed: show_timeseries | adds the rendered chart to a new Perses dashboard via Add to Dashboard button | **Non-deterministic** — creates a new Perses dashboard, sends a prompt to OLS, then uses the "Add to Dashboard" button to add the rendered chart to the dashboard. Verifies the panel appears and persists after save. | +| File | Test Suite | Test Scenario | Description | +| ----------------------------------------- | ------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `03.coo_lightspeed_show_timeseries.cy.ts` | COO-LightSpeed: show_timeseries | switches to troubleshooting mode, sends a prompt, and renders a Perses dashboard | **Non-deterministic** — sends a natural-language prompt to the live OLS AI and asserts it responds with a `show_timeseries` tool call that renders a Perses chart. Tagged `@ols`, must not gate CI. | +| `03.coo_lightspeed_show_timeseries.cy.ts` | COO-LightSpeed: show_timeseries | adds the rendered chart to a new Perses dashboard via Add to Dashboard button | **Non-deterministic** — creates a new Perses dashboard, sends a prompt to OLS, then uses the "Add to Dashboard" button to add the rendered chart to the dashboard. Verifies the panel appears and persists after save. Tagged `@ols`, must not gate CI. | --- diff --git a/web/cypress/README.md b/web/cypress/README.md index c786ceae4..55f0cfe55 100644 --- a/web/cypress/README.md +++ b/web/cypress/README.md @@ -1,5 +1,7 @@ # Cypress Setup & Configuration Guide +TODO: UPDATE THIS WITH NEW STRUCTURE + > **Technical setup and environment configuration for Monitoring Plugin Cypress tests** For testing workflows, test architecture, and creating tests, see **[CYPRESS_TESTING_GUIDE.md](CYPRESS_TESTING_GUIDE.md)** @@ -184,22 +186,7 @@ npm run cypress:run ```bash # COO BVT tests -npm run cypress:run -- --spec "cypress/e2e/coo/01.coo_bvt.cy.ts" - -# ACM Alerting tests -npm run cypress:run -- --spec "cypress/e2e/coo/02.acm_alerting_ui.cy.ts" - -# Monitoring BVT tests -npm run cypress:run -- --spec "cypress/e2e/monitoring/00.bvt_admin.cy.ts" - -# All Monitoring Regression tests -npm run cypress:run -- --spec "cypress/e2e/monitoring/regression/**" - -# All Virtualization IVT tests -npm run cypress:run -- --spec "cypress/e2e/virtualization/**" - -# Incidents tests (requires CYPRESS_TIMEZONE and optionally CYPRESS_MOCK_NEW_METRICS) -npm run cypress:run -- --spec "cypress/e2e/**/incidents*.cy.ts" +npm run cypress:run -- --spec "cypress/e2e/alerts/alerts_bvt.cy.ts" ``` **Note**: Incidents tests require `CYPRESS_TIMEZONE` to be set to match your cluster's timezone configuration. See [Incidents Testing Configuration](#incidents-testing-configuration) for details. @@ -376,9 +363,9 @@ Component testing is configured in the `component` section of `web/cypress.confi cypress/ ├── component/ # Component test files (.cy.tsx) ├── e2e/ # E2E test files by perspective -│ ├── monitoring/ # Core monitoring (Administrator) -│ ├── coo/ # COO-specific tests -│ └── virtualization/ # Virtualization integration +│ ├── alerts/ # Alert tests +│ ├── legacy-dashboards/ # Module tests +│ └── shared/ # Shared common tests ├── support/ # Reusable test scenarios │ ├── monitoring/ # Test scenario modules │ ├── perses/ # Perses scenarios