diff --git a/.cursor/commands/fixture-schema-reference.md b/.cursor/commands/fixture-schema-reference.md index 21fb548fc..9c454c249 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 +cd web/cypress/support/incidents node validate-fixtures.js --all node validate-fixtures.js specific-file.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/fixture-schema.json` +- Validator: `web/cypress/support/incidents/schema-validator.ts` +- CLI Tool: `web/cypress/support/incidents/validate-fixtures.js` ## Best Practices diff --git a/.cursor/commands/generate-incident-fixture.md b/.cursor/commands/generate-incident-fixture.md index 68f637c54..e2f4a9fca 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/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,14 @@ 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 [fixture-schema.json](mdc:web/cypress/support/incidents/validate_fixture.js) ```yaml @@ -65,7 +70,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/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 e60fef0ce..3462a99ed 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. @@ -94,7 +96,7 @@ import { incidentsPage } from "../../../views/incidents-page"; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from "../../../support/operators"; +} from "../../../support/shared/operators"; describe("Regression: [Section Name]", () => { before(() => { @@ -402,7 +404,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: ``` @@ -534,7 +536,7 @@ import { incidentsPage } from "../../../views/incidents-page"; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from "../../../support/operators"; +} from "../../../support/shared/operators"; describe("Regression: Tooltip Positioning", () => { before(() => { @@ -638,7 +640,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..28cf05c94 100644 --- a/.cursor/commands/validate-incident-fixtures.md +++ b/.cursor/commands/validate-incident-fixtures.md @@ -17,7 +17,7 @@ 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 +cd web/cypress/support/incidents node validate-fixtures.js --all ``` @@ -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-validator.ts` +- CLI validator: `web/cypress/support/incidents/validate-fixtures.js` +- JSON Schema: `web/cypress/support/incidents/fixture-schema.json` diff --git a/.cursor/rules/incidents-testing-guidelines.mdc b/.cursor/rules/incidents-testing-guidelines.mdc index 91f3dd1dd..8b564040c 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 @@ -254,7 +254,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 @@ -299,7 +299,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 c83a4c324..282bcde15 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`. @@ -9,7 +11,7 @@ import { incidentsPage } from "../../../views/incidents-page"; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from "../../../support/operators"; +} from "../../../support/shared/operators"; const INCIDENT_COUNT = 20; const CYCLES_PER_INCIDENT = 5; 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/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 6898f8d49..4d26bc7a8 100644 --- a/web/cypress/E2E_TEST_SCENARIOS.md +++ b/web/cypress/E2E_TEST_SCENARIOS.md @@ -1,8 +1,11 @@ # 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 + - [COO (Cluster Observability Operator) Tests](#coo-cluster-observability-operator-tests) - [Virtualization Tests](#virtualization-tests) - [Monitoring Tests](#monitoring-tests) @@ -16,22 +19,22 @@ Located in `e2e/coo/` ### Build Verification Tests (BVT) -| File | Test Suite | Test Scenario | Description | -|------|------------|---------------|-------------| -| `01.coo_bvt.cy.ts` | BVT: COO | 1. Admin perspective - Observe Menu | Verifies Observe menu navigation and submenus (Alerting, Silences, Alerting rules, Dashboards (Perses)) | +| File | Test Suite | Test Scenario | Description | +| ------------------ | ---------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `01.coo_bvt.cy.ts` | BVT: COO | 1. Admin perspective - Observe Menu | Verifies Observe menu navigation and submenus (Alerting, Silences, Alerting rules, Dashboards (Perses)) | ### ACM Alerting UI Tests -| File | Test Suite | Test Scenario | Description | -|------|------------|---------------|-------------| +| File | Test Suite | Test Scenario | Description | +| -------------------------- | --------------- | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `02.acm_alerting_ui.cy.ts` | ACM Alerting UI | 1. Fleet Management perspective - ACM Alerting | Validates ACM integration with COO, Fleet Management perspective navigation, local-cluster access, and ACM alert visibility (Watchdog, Watchdog-spoke, ClusterCPUHealth) | ### 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. 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. | +| 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. | --- @@ -43,27 +46,27 @@ These tests verify the Monitoring Plugin functionality within the Virtualization ### Integration Verification Tests (IVT) -| File | Test Suite | Test Scenario | Perspective | Namespace Scope | -|------|------------|---------------|-------------|-----------------| -| `01.coo_ivt.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | -| `01.coo_ivt.cy.ts` | Installation: Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | -| `01.coo_ivt.cy.ts` | IVT: Monitoring + Virtualization | *Runs BVT Monitoring Tests* | Virtualization | All Projects | -| `01.coo_ivt.cy.ts` | IVT: Monitoring + Virtualization - Namespaced | *Runs BVT Monitoring Tests (Namespace)* | Virtualization | openshift-monitoring | -| | | | | -| `02.coo_ivt_alerts.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | -| `02.coo_ivt_alerts.cy.ts` | IVT: Monitoring UIPlugin + Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | -| `02.coo_ivt_alerts.cy.ts` | Regression: Monitoring - Alerts (Virtualization) | *Runs All Regression Alerts Tests* | Virtualization | All Projects | -| `02.coo_ivt_alerts.cy.ts` | Regression: Monitoring - Alerts Namespaced (Virtualization) | *Runs All Regression Alerts Tests (Namespace)* | Virtualization | openshift-monitoring | -| | | | | -| `03.coo_ivt_metrics.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | -| `03.coo_ivt_metrics.cy.ts` | IVT: Monitoring UIPlugin + Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | -| `03.coo_ivt_metrics.cy.ts` | Regression: Monitoring - Metrics (Virtualization) | *Runs All Regression Metrics Tests* | Virtualization | All Projects | -| `03.coo_ivt_metrics.cy.ts` | Regression: Monitoring - Metrics Namespaced (Virtualization) | *Runs All Regression Metrics Tests (Namespace)* | Virtualization | openshift-monitoring | -| | | | | -| `04.coo_ivt_legacy_dashboards.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | -| `04.coo_ivt_legacy_dashboards.cy.ts` | IVT: Monitoring UIPlugin + Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | -| `04.coo_ivt_legacy_dashboards.cy.ts` | Regression: Monitoring - Legacy Dashboards (Virtualization) | *Runs All Regression Legacy Dashboards Tests* | Virtualization | All Projects | -| `04.coo_ivt_legacy_dashboards.cy.ts` | Regression: Monitoring - Legacy Dashboards Namespaced (Virtualization) | *Runs All Regression Legacy Dashboards Tests (Namespace)* | Virtualization | openshift-monitoring | +| File | Test Suite | Test Scenario | Perspective | Namespace Scope | +| ------------------------------------ | ---------------------------------------------------------------------- | --------------------------------------------------------- | -------------- | -------------------- | +| `01.coo_ivt.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | +| `01.coo_ivt.cy.ts` | Installation: Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | +| `01.coo_ivt.cy.ts` | IVT: Monitoring + Virtualization | _Runs BVT Monitoring Tests_ | Virtualization | All Projects | +| `01.coo_ivt.cy.ts` | IVT: Monitoring + Virtualization - Namespaced | _Runs BVT Monitoring Tests (Namespace)_ | Virtualization | openshift-monitoring | +| | | | | +| `02.coo_ivt_alerts.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | +| `02.coo_ivt_alerts.cy.ts` | IVT: Monitoring UIPlugin + Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | +| `02.coo_ivt_alerts.cy.ts` | Regression: Monitoring - Alerts (Virtualization) | _Runs All Regression Alerts Tests_ | Virtualization | All Projects | +| `02.coo_ivt_alerts.cy.ts` | Regression: Monitoring - Alerts Namespaced (Virtualization) | _Runs All Regression Alerts Tests (Namespace)_ | Virtualization | openshift-monitoring | +| | | | | +| `03.coo_ivt_metrics.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | +| `03.coo_ivt_metrics.cy.ts` | IVT: Monitoring UIPlugin + Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | +| `03.coo_ivt_metrics.cy.ts` | Regression: Monitoring - Metrics (Virtualization) | _Runs All Regression Metrics Tests_ | Virtualization | All Projects | +| `03.coo_ivt_metrics.cy.ts` | Regression: Monitoring - Metrics Namespaced (Virtualization) | _Runs All Regression Metrics Tests (Namespace)_ | Virtualization | openshift-monitoring | +| | | | | +| `04.coo_ivt_legacy_dashboards.cy.ts` | Setting up Monitoring Plugin | 1. Setting up Monitoring Plugin | N/A | N/A | +| `04.coo_ivt_legacy_dashboards.cy.ts` | IVT: Monitoring UIPlugin + Virtualization | 1. Virtualization perspective - Observe Menu | Virtualization | N/A | +| `04.coo_ivt_legacy_dashboards.cy.ts` | Regression: Monitoring - Legacy Dashboards (Virtualization) | _Runs All Regression Legacy Dashboards Tests_ | Virtualization | All Projects | +| `04.coo_ivt_legacy_dashboards.cy.ts` | Regression: Monitoring - Legacy Dashboards Namespaced (Virtualization) | _Runs All Regression Legacy Dashboards Tests (Namespace)_ | Virtualization | openshift-monitoring | --- @@ -73,30 +76,30 @@ Located in `e2e/monitoring/` ### Basic Verification Tests (BVT) -| File | Test Suite | Test Scenario | Description | Namespace Scope | -|------|------------|---------------|-------------|-----------------| -| `00.bvt_admin.cy.ts` | BVT: Monitoring | 1. Admin perspective - Observe Menu | Verifies all Observe submenus navigation | All Projects | -| `00.bvt_admin.cy.ts` | BVT: Monitoring | 2. Admin perspective - Overview Page > Status - View alerts | Verifies navigation from Overview status card to Alerting page | All Projects | -| `00.bvt_admin.cy.ts` | BVT: Monitoring | 3. Admin perspective - Cluster Utilization - Metrics | Verifies navigation from cluster utilization to Metrics page | All Projects | -| `00.bvt_admin.cy.ts` | BVT: Monitoring | *Runs BVT Monitoring Tests* | Additional monitoring scenarios from support module | All Projects | -| | | | | | -| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | Admin perspective - Observe Menu | Verifies all Observe submenus navigation with namespace scope | openshift-monitoring | -| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | Admin perspective - Overview Page > Status - View alerts | Verifies navigation from Overview status card to Alerting page | openshift-monitoring | -| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | Admin perspective - Cluster Utilization - Metrics | Verifies navigation from cluster utilization to Metrics page | openshift-monitoring | -| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | *Runs BVT Monitoring Tests (Namespace)* | Additional monitoring scenarios from support module | openshift-monitoring | +| File | Test Suite | Test Scenario | Description | Namespace Scope | +| -------------------- | ---------------------------- | ----------------------------------------------------------- | -------------------------------------------------------------- | -------------------- | +| `00.bvt_admin.cy.ts` | BVT: Monitoring | 1. Admin perspective - Observe Menu | Verifies all Observe submenus navigation | All Projects | +| `00.bvt_admin.cy.ts` | BVT: Monitoring | 2. Admin perspective - Overview Page > Status - View alerts | Verifies navigation from Overview status card to Alerting page | All Projects | +| `00.bvt_admin.cy.ts` | BVT: Monitoring | 3. Admin perspective - Cluster Utilization - Metrics | Verifies navigation from cluster utilization to Metrics page | All Projects | +| `00.bvt_admin.cy.ts` | BVT: Monitoring | _Runs BVT Monitoring Tests_ | Additional monitoring scenarios from support module | All Projects | +| | | | | | +| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | Admin perspective - Observe Menu | Verifies all Observe submenus navigation with namespace scope | openshift-monitoring | +| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | Admin perspective - Overview Page > Status - View alerts | Verifies navigation from Overview status card to Alerting page | openshift-monitoring | +| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | Admin perspective - Cluster Utilization - Metrics | Verifies navigation from cluster utilization to Metrics page | openshift-monitoring | +| `00.bvt_admin.cy.ts` | BVT: Monitoring - Namespaced | _Runs BVT Monitoring Tests (Namespace)_ | Additional monitoring scenarios from support module | openshift-monitoring | ### Regression Tests -| File | Test Suite | Test Scenario | Feature Area | Namespace Scope | -|------|------------|---------------|--------------|-----------------| -| `regression/01.reg_alerts_admin.cy.ts` | Regression: Monitoring - Alerts (Administrator) | *Runs All Regression Alerts Tests* | Alerts | All Projects | -| `regression/01.reg_alerts_admin.cy.ts` | Regression: Monitoring - Alerts Namespaced (Administrator) | *Runs All Regression Alerts Tests (Namespace)* | Alerts | openshift-monitoring | -| | | | | | -| `regression/02.reg_metrics_admin.cy.ts` | Regression: Monitoring - Metrics (Administrator) | *Runs All Regression Metrics Tests* | Metrics | All Projects | -| `regression/02.reg_metrics_admin.cy.ts` | Regression: Monitoring - Metrics Namespaced (Administrator) | *Runs All Regression Metrics Tests (Namespace)* | Metrics | openshift-monitoring | -| | | | | | -| `regression/03.reg_legacy_dashboards_admin.cy.ts` | Regression: Monitoring - Legacy Dashboards (Administrator) | *Runs All Regression Legacy Dashboards Tests* | Dashboards | All Projects | -| `regression/03.reg_legacy_dashboards_admin.cy.ts` | Regression: Monitoring - Legacy Dashboards Namespaced (Administrator) | *Runs All Regression Legacy Dashboards Tests (Namespace)* | Dashboards | openshift-monitoring | +| File | Test Suite | Test Scenario | Feature Area | Namespace Scope | +| ------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------- | ------------ | -------------------- | +| `regression/01.reg_alerts_admin.cy.ts` | Regression: Monitoring - Alerts (Administrator) | _Runs All Regression Alerts Tests_ | Alerts | All Projects | +| `regression/01.reg_alerts_admin.cy.ts` | Regression: Monitoring - Alerts Namespaced (Administrator) | _Runs All Regression Alerts Tests (Namespace)_ | Alerts | openshift-monitoring | +| | | | | | +| `regression/02.reg_metrics_admin.cy.ts` | Regression: Monitoring - Metrics (Administrator) | _Runs All Regression Metrics Tests_ | Metrics | All Projects | +| `regression/02.reg_metrics_admin.cy.ts` | Regression: Monitoring - Metrics Namespaced (Administrator) | _Runs All Regression Metrics Tests (Namespace)_ | Metrics | openshift-monitoring | +| | | | | | +| `regression/03.reg_legacy_dashboards_admin.cy.ts` | Regression: Monitoring - Legacy Dashboards (Administrator) | _Runs All Regression Legacy Dashboards Tests_ | Dashboards | All Projects | +| `regression/03.reg_legacy_dashboards_admin.cy.ts` | Regression: Monitoring - Legacy Dashboards Namespaced (Administrator) | _Runs All Regression Legacy Dashboards Tests (Namespace)_ | Dashboards | openshift-monitoring | --- @@ -108,44 +111,44 @@ These test scenarios are reusable test suites called by the main E2E test files. #### Non-Namespaced Alerts (`01.reg_alerts.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| -| `{perspective} perspective - Alerting > Alerts page - Filtering` | Tests all filtering options: Alert State, Severity, Source filters; Export CSV; Search by name and label | -| `{perspective} perspective - Alerting > Silences page > Create silence` | Tests silence creation form validation: comment validation, creator validation, label name/value validation | +| Test Scenario | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| `{perspective} perspective - Alerting > Alerts page - Filtering` | Tests all filtering options: Alert State, Severity, Source filters; Export CSV; Search by name and label | +| `{perspective} perspective - Alerting > Silences page > Create silence` | Tests silence creation form validation: comment validation, creator validation, label name/value validation | | `{perspective} perspective - Alerting > Alerts / Silences > Kebab icon on List and Details` | Comprehensive test covering: silence creation, silence expiration, kebab menu actions on alerts and silences, recreate/edit silence functionality | -| `{perspective} perspective - Alerting > Alerting Rules` | Tests alerting rules page: filtering, searching, silence creation from alerting rule, kebab menu validation | +| `{perspective} perspective - Alerting > Alerting Rules` | Tests alerting rules page: filtering, searching, silence creation from alerting rule, kebab menu validation | #### Namespaced Alerts (`04.reg_alerts_namespace.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| -| `{perspective} perspective - Alerting > Alerts page - Filtering` | Same as non-namespaced but validates Source filter is not available in namespace scope | -| `{perspective} perspective - Alerting > Silences page > Create silence` | Tests silence creation with namespace scope validation (namespace label should be disabled) | -| `{perspective} perspective - Alerting > Alerts / Silences > Kebab icon on List and Details` | Same comprehensive tests as non-namespaced with namespace context | -| `{perspective} perspective - Alerting > Alerting Rules` | Same alerting rules tests with namespace scope | -| `{perspective} perspective - Alerting > Empty state` | Tests empty state for Alerts, Silences, and Alerting Rules when switching to empty namespace | +| Test Scenario | Description | +| ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `{perspective} perspective - Alerting > Alerts page - Filtering` | Same as non-namespaced but validates Source filter is not available in namespace scope | +| `{perspective} perspective - Alerting > Silences page > Create silence` | Tests silence creation with namespace scope validation (namespace label should be disabled) | +| `{perspective} perspective - Alerting > Alerts / Silences > Kebab icon on List and Details` | Same comprehensive tests as non-namespaced with namespace context | +| `{perspective} perspective - Alerting > Alerting Rules` | Same alerting rules tests with namespace scope | +| `{perspective} perspective - Alerting > Empty state` | Tests empty state for Alerts, Silences, and Alerting Rules when switching to empty namespace | ### Metrics Tests #### Non-Namespaced Metrics (`02.reg_metrics.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| -| `{perspective} perspective - Metrics` | Validates Metrics page loading, Units dropdown, Refresh interval, Actions dropdown, Predefined queries, Kebab menu | -| `{perspective} perspective - Metrics > Actions - No query added` | Tests Add query, Collapse/Expand all queries, Delete all queries when no query is entered | -| `{perspective} perspective - Metrics > Actions - One query added` | Tests same actions with an active query loaded | -| `{perspective} perspective - Metrics > Insert Example Query` | Tests example query insertion, graph timespan dropdown/input, Reset zoom, Hide/Show graph, Stacked/Disconnected checkbox | +| Test Scenario | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | +| `{perspective} perspective - Metrics` | Validates Metrics page loading, Units dropdown, Refresh interval, Actions dropdown, Predefined queries, Kebab menu | +| `{perspective} perspective - Metrics > Actions - No query added` | Tests Add query, Collapse/Expand all queries, Delete all queries when no query is entered | +| `{perspective} perspective - Metrics > Actions - One query added` | Tests same actions with an active query loaded | +| `{perspective} perspective - Metrics > Insert Example Query` | Tests example query insertion, graph timespan dropdown/input, Reset zoom, Hide/Show graph, Stacked/Disconnected checkbox | | `{perspective} perspective - Metrics > Add Query - Run Queries - Kebab icon` | Comprehensive test: Add/run queries, Disable/Enable query via kebab and switch, Hide/Show all series, Select/Unselect series, Delete/Duplicate query | -| `{perspective} perspective - Metrics > Predefined Queries > Export as CSV` | Tests CSV export for all 9 predefined queries (CPU, Memory, Filesystem, Network metrics) | -| `{perspective} perspective - Metrics > Ungraphable results` | Tests ungraphable results error state when too many queries are added | -| `{perspective} perspective - Metrics > No Datapoints` | Tests empty state when query returns no data | -| `{perspective} perspective - Metrics > No Datapoints with alert` | Tests error alert display for invalid queries | +| `{perspective} perspective - Metrics > Predefined Queries > Export as CSV` | Tests CSV export for all 9 predefined queries (CPU, Memory, Filesystem, Network metrics) | +| `{perspective} perspective - Metrics > Ungraphable results` | Tests ungraphable results error state when too many queries are added | +| `{perspective} perspective - Metrics > No Datapoints` | Tests empty state when query returns no data | +| `{perspective} perspective - Metrics > No Datapoints with alert` | Tests error alert display for invalid queries | #### Namespaced Metrics (`05.reg_metrics_namespace.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| -| All scenarios from non-namespaced | Same 9 test scenarios as non-namespaced metrics | +| Test Scenario | Description | +| --------------------------------------------------- | ----------------------------------------------------------------- | +| All scenarios from non-namespaced | Same 9 test scenarios as non-namespaced metrics | | `{perspective} perspective - Metrics > Empty state` | Additional test for empty state when switching to empty namespace | **Total Metrics Scenarios:** 9 (non-namespaced), 10 (namespaced) @@ -154,37 +157,37 @@ These test scenarios are reusable test suites called by the main E2E test files. #### Non-Namespaced Legacy Dashboards (`03.reg_legacy_dashboards.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| -| `{perspective} perspective - Dashboards (legacy)` | Tests dashboard page loading, time range dropdown, refresh interval, dashboard dropdown, API Performance dashboard panels, Inspect functionality | -| `{perspective} perspective - Dashboards (legacy) - Inspect and Export as CSV` | Tests Export CSV functionality and disabled state for empty data | -| `{perspective} perspective - Dashboards (legacy) - No kebab dropdown` | Validates that Single Stat and Table panels don't show kebab menu | -| `{perspective} perspective - OU-897 - Hide Graph / Show Graph on Metrics, Alert Details and Dashboards` | Tests Hide/Show graph state persistence across Metrics, Dashboards, Alert details, and Alerting rule details pages | +| Test Scenario | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `{perspective} perspective - Dashboards (legacy)` | Tests dashboard page loading, time range dropdown, refresh interval, dashboard dropdown, API Performance dashboard panels, Inspect functionality | +| `{perspective} perspective - Dashboards (legacy) - Inspect and Export as CSV` | Tests Export CSV functionality and disabled state for empty data | +| `{perspective} perspective - Dashboards (legacy) - No kebab dropdown` | Validates that Single Stat and Table panels don't show kebab menu | +| `{perspective} perspective - OU-897 - Hide Graph / Show Graph on Metrics, Alert Details and Dashboards` | Tests Hide/Show graph state persistence across Metrics, Dashboards, Alert details, and Alerting rule details pages | #### Namespaced Legacy Dashboards (`06.reg_legacy_dashboards_namespace.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| -| `{perspective} perspective - Dashboards (legacy)` | Tests Kubernetes Compute Resources Namespace Pods dashboard with namespace scope | -| `{perspective} perspective - Dashboards (legacy) - Export as CSV` | Tests CSV export with namespace scope and empty state validation | -| `{perspective} perspective - Dashboards (legacy) - No kebab dropdown` | Validates kebab menu absence for specific chart types | -| `{perspective} perspective - OU-897 - Hide Graph / Show Graph on Metrics, Alert Details and Dashboards` | Same Hide/Show graph tests with namespace context | +| Test Scenario | Description | +| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `{perspective} perspective - Dashboards (legacy)` | Tests Kubernetes Compute Resources Namespace Pods dashboard with namespace scope | +| `{perspective} perspective - Dashboards (legacy) - Export as CSV` | Tests CSV export with namespace scope and empty state validation | +| `{perspective} perspective - Dashboards (legacy) - No kebab dropdown` | Validates kebab menu absence for specific chart types | +| `{perspective} perspective - OU-897 - Hide Graph / Show Graph on Metrics, Alert Details and Dashboards` | Same Hide/Show graph tests with namespace context | ### BVT Monitoring Tests #### Non-Namespaced BVT (`00.bvt_monitoring.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| +| Test Scenario | Description | +| ---------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- | | `{perspective} perspective - Alerting > Alerting Details page > Alerting Rule > Metrics` | Tests full navigation flow: Alerts list → Alert details → Alerting rule details → Metrics page, validates expression query | -| `{perspective} perspective - Creates and expires a Silence` | Tests complete silence lifecycle: creation, validation on multiple pages (Alerts, Silences, Alerting Rules), expiration | +| `{perspective} perspective - Creates and expires a Silence` | Tests complete silence lifecycle: creation, validation on multiple pages (Alerts, Silences, Alerting Rules), expiration | #### Namespaced BVT (`00.bvt_monitoring_namespace.cy.ts`) -| Test Scenario | Description | -|---------------|-------------| -| `{perspective} perspective - Alerting > Alerting Details page > Alerting Rule > Metrics` | Same flow as non-namespaced with namespace scope validation | -| `{perspective} perspective - Creates and expires a Silence` | Same silence lifecycle with namespace scope, validates namespace label is disabled in forms | +| Test Scenario | Description | +| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `{perspective} perspective - Alerting > Alerting Details page > Alerting Rule > Metrics` | Same flow as non-namespaced with namespace scope validation | +| `{perspective} perspective - Creates and expires a Silence` | Same silence lifecycle with namespace scope, validates namespace label is disabled in forms | --- @@ -204,9 +207,8 @@ These test scenarios are reusable test suites called by the main E2E test files. ## Notes -1. **Support Module Tests**: Test scenarios marked with *Runs X Tests* are implemented in support files and called by the main E2E test files with different perspectives. +1. **Support Module Tests**: Test scenarios marked with _Runs X Tests_ are implemented in support files and called by the main E2E test files with different perspectives. 2. **Perspective Parameter**: `{perspective}` is dynamically replaced with the actual perspective name (Administrator, Virtualization) when tests run. 3. **Empty State Tests**: Namespaced tests include additional empty state validation by switching to empty namespaces like `default`. - diff --git a/web/cypress/README.md b/web/cypress/README.md index d01adc2c3..cd7297bc2 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. @@ -391,9 +378,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 diff --git a/web/cypress/e2e/alerts/alerts_acm.cy.ts b/web/cypress/e2e/alerts/alerts_acm.cy.ts index bb7de4227..933cd5693 100644 --- a/web/cypress/e2e/alerts/alerts_acm.cy.ts +++ b/web/cypress/e2e/alerts/alerts_acm.cy.ts @@ -1,13 +1,12 @@ -// 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 '../../support/shared/commands/auth-commands'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { acmAlertingPage } from '../../views/acm-alerting-page'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; 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 4b43def45..42193caa3 100644 --- a/web/cypress/e2e/alerts/alerts_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_bvt.cy.ts @@ -1,8 +1,8 @@ import { nav } from '../../views/nav'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { runBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt_monitoring_namespace.cy'; +import { runBVTMonitoringTestsNamespace } 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_ivt.cy.ts b/web/cypress/e2e/alerts/alerts_ivt.cy.ts index 8ca1fdbfd..407af0874 100644 --- a/web/cypress/e2e/alerts/alerts_ivt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_ivt.cy.ts @@ -2,9 +2,9 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, KUBEVIRT_HYPERCONVERGED_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { runAllRegressionAlertsTests } from '../../support/monitoring/01.reg_alerts.cy'; +import { runAllRegressionAlertsTests } 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 0180969f1..2b30fb83c 100644 --- a/web/cypress/e2e/alerts/alerts_regression.cy.ts +++ b/web/cypress/e2e/alerts/alerts_regression.cy.ts @@ -1,9 +1,9 @@ -import { runAllRegressionAlertsTests } from '../../support/monitoring/01.reg_alerts.cy'; +import { runAllRegressionAlertsTests } from '../../support/alerts/alerts_regressions.cy'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { runAllRegressionAlertsTestsNamespace } from '../../support/monitoring/04.reg_alerts_namespace.cy'; +import { runAllRegressionAlertsTestsNamespace } 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 Administrator perspective describe( diff --git a/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts index bdb00778a..4f043618f 100644 --- a/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts +++ b/web/cypress/e2e/alerts/alerts_virtualization_bvt.cy.ts @@ -1,4 +1,4 @@ -import { runBVTMonitoringTests } from '../../support/monitoring/00.bvt_monitoring.cy'; +import { runBVTAlertsTests } from '../../support/alerts/alerts_bvt.cy'; import { guidedTour } from '../../views/tour'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; import { nav } from '../../views/nav'; @@ -8,7 +8,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, KUBEVIRT_HYPERCONVERGED_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; describe('IVT: Monitoring + Virtualization', { tags: ['@metrics', '@alerting', '@slow'] }, () => { before(() => { @@ -36,7 +36,7 @@ describe('IVT: Monitoring + Virtualization', { tags: ['@metrics', '@alerting', ' }); // Run tests in Administrator perspective - runBVTMonitoringTests({ + runBVTAlertsTests({ name: 'Virtualization', }); }); diff --git a/web/cypress/e2e/incidents/incidents_bvt.cy.ts b/web/cypress/e2e/incidents/incidents_bvt.cy.ts index 76f37a47d..b6844dc1b 100644 --- a/web/cypress/e2e/incidents/incidents_bvt.cy.ts +++ b/web/cypress/e2e/incidents/incidents_bvt.cy.ts @@ -10,7 +10,7 @@ mid-test for empty state and traversal scenarios. import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; import { incidentsPage } from '../../views/incidents-page'; describe('BVT: Incidents - UI', { tags: ['@cluster-health-analyzer'] }, () => { diff --git a/web/cypress/e2e/incidents/incidents_e2e.cy.ts b/web/cypress/e2e/incidents/incidents_e2e.cy.ts index 5ea7361fc..70d2ec3ac 100644 --- a/web/cypress/e2e/incidents/incidents_e2e.cy.ts +++ b/web/cypress/e2e/incidents/incidents_e2e.cy.ts @@ -5,7 +5,7 @@ The run time can be 15 - 20 minutes. (Waiting untill the incident detection capt import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; import { incidentsPage } from '../../views/incidents-page'; describe('BVT: Incidents - e2e', { tags: ['@slow', '@cluster-health-analyzer'] }, () => { diff --git a/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts b/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts index d10d3e10e..a66a678e1 100644 --- a/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts +++ b/web/cypress/e2e/incidents/incidents_mocking_example.cy.ts @@ -10,7 +10,7 @@ This test showcases different mocking approaches: import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; import { incidentsPage } from '../../views/incidents-page'; describe('Incidents - Mocking Examples', { tags: ['@cluster-health-analyzer'] }, () => { diff --git a/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts index ced5c8741..536c7d5ee 100644 --- a/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts +++ b/web/cypress/e2e/incidents/performance/performance_benchmark.cy.ts @@ -15,11 +15,11 @@ Verifies: OBSINTA-1006 */ import { incidentsPage } from '../../../views/incidents-page'; -import { BenchmarkCollector } from '../../../support/benchmark-utils'; +import { BenchmarkCollector } from '../../../support/shared/commands/benchmark-utils'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; // Wall-clock thresholds in ms. Includes Cypress overhead (navigation, intercept // wait, command scheduling). Set conservatively for initial calibration — tighten @@ -39,7 +39,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 570085434..d162e1b03 100644 --- a/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts +++ b/web/cypress/e2e/incidents/performance/performance_walkthrough.cy.ts @@ -9,11 +9,11 @@ Verifies: OBSINTA-1006 */ import { incidentsPage } from '../../../views/incidents-page'; -import { BenchmarkCollector } from '../../../support/benchmark-utils'; +import { BenchmarkCollector } from '../../../support/shared/commands/benchmark-utils'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; const THRESHOLDS = { FILTER_APPLY: 3_000, @@ -23,7 +23,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/end_and_resolution.cy.ts b/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts index 08ada85df..e661abd32 100644 --- a/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts +++ b/web/cypress/e2e/incidents/regression/end_and_resolution.cy.ts @@ -20,7 +20,7 @@ Verifies: OU-XXX (time-based resolution bugs) import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; import { incidentsPage } from '../../../views/incidents-page'; describe( diff --git a/web/cypress/e2e/incidents/regression/filtering.cy.ts b/web/cypress/e2e/incidents/regression/filtering.cy.ts index 2d29b6c7e..6eb454c04 100644 --- a/web/cypress/e2e/incidents/regression/filtering.cy.ts +++ b/web/cypress/e2e/incidents/regression/filtering.cy.ts @@ -11,7 +11,7 @@ Verifies: OU-727 import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; import { incidentsPage } from '../../../views/incidents-page'; describe('Regression: Incidents Filtering', { tags: ['@cluster-health-analyzer'] }, () => { diff --git a/web/cypress/e2e/incidents/regression/interval.cy.ts b/web/cypress/e2e/incidents/regression/interval.cy.ts index 28f2102c5..b40e2697d 100644 --- a/web/cypress/e2e/incidents/regression/interval.cy.ts +++ b/web/cypress/e2e/incidents/regression/interval.cy.ts @@ -14,7 +14,7 @@ with no 5-minute gap between End of one segment and Start of the next. import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; import { incidentsPage } from '../../../views/incidents-page'; describe( diff --git a/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts b/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts index 23ea4ab7e..4b3e34a8f 100644 --- a/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts +++ b/web/cypress/e2e/incidents/regression/permission_and_silences.cy.ts @@ -16,7 +16,7 @@ Verifies: OU-1020, OU-706, OU-1213 import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; import { incidentsPage } from '../../../views/incidents-page'; import { nav } from '../../../views/nav'; diff --git a/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts b/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts index ed9e61c3a..7ba61a874 100644 --- a/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts +++ b/web/cypress/e2e/incidents/regression/stress_test_ui.cy.ts @@ -14,7 +14,7 @@ the overflow with the original 5d timeline. import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; import { incidentsPage } from '../../../views/incidents-page'; const MAX_GAP_STANDARD = 250; diff --git a/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts b/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts index 2a457f87e..5bbae7da8 100644 --- a/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts +++ b/web/cypress/e2e/incidents/regression/ui_interaction.cy.ts @@ -16,7 +16,7 @@ Test cases: import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; import { incidentsPage } from '../../../views/incidents-page'; describe('Regression: Redux State Management', { tags: ['@cluster-health-analyzer'] }, () => { diff --git a/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts b/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts index 98ffb1636..4046992ea 100644 --- a/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts +++ b/web/cypress/e2e/incidents/regression/ui_regressions.cy.ts @@ -13,7 +13,7 @@ This test loads comprehensive test data covering: import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; import { incidentsPage } from '../../../views/incidents-page'; const ARROW_HEIGHT = 12; 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 3e4e8b6ad..f8465e5ec 100644 --- a/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts +++ b/web/cypress/e2e/legacy-dashboards/legacy_dashboards_regression.cy.ts @@ -1,6 +1,6 @@ -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; -import { runAllRegressionLegacyDashboardsTests } from '../../support/monitoring/03.reg_legacy_dashboards.cy'; -import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../support/monitoring/06.reg_legacy_dashboards_namespace.cy'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; +import { runAllRegressionLegacyDashboardsTests } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; +import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; 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 d281836d0..b8d9e0820 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 @@ -2,9 +2,9 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, KUBEVIRT_HYPERCONVERGED_OPERATOR, -} from '../../support/operators'; -import { runAllRegressionLegacyDashboardsTests } from '../../support/monitoring/03.reg_legacy_dashboards.cy'; -import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../support/monitoring/06.reg_legacy_dashboards_namespace.cy'; +} from '../../support/shared/operators'; +import { runAllRegressionLegacyDashboardsTests } from '../../support/legacy-dashboards/legacy_dashboards_regressions.cy'; +import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../support/legacy-dashboards/legacy_dashboards_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { guidedTour } from '../../views/tour'; diff --git a/web/cypress/e2e/metrics/metrics_regression.cy.ts b/web/cypress/e2e/metrics/metrics_regression.cy.ts index 9d36dfee2..1a9e4af1a 100644 --- a/web/cypress/e2e/metrics/metrics_regression.cy.ts +++ b/web/cypress/e2e/metrics/metrics_regression.cy.ts @@ -1,10 +1,14 @@ -import { runAllRegressionMetricsTests2 } from '../../support/monitoring/02.reg_metrics_2.cy'; -import { runAllRegressionMetricsTests1 } from '../../support/monitoring/02.reg_metrics_1.cy'; -import { runAllRegressionMetricsTestsNamespace1 } from '../../support/monitoring/05.reg_metrics_namespace_1.cy'; +import { + runAllRegressionMetricsTests1, + runAllRegressionMetricsTests2, +} from '../../support/metrics/metrics_regressions.cy'; +import { + runAllRegressionMetricsTestsNamespace1, + runAllRegressionMetricsTestsNamespace2, +} from '../../support/metrics/metrics_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; -import { runAllRegressionMetricsTestsNamespace2 } from '../../support/monitoring/05.reg_metrics_namespace_2.cy'; -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 9a2b0a140..44eb44130 100644 --- a/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts +++ b/web/cypress/e2e/metrics/metrics_virtualization_ivt.cy.ts @@ -1,16 +1,20 @@ -import { runAllRegressionMetricsTests2 } from '../../support/monitoring/02.reg_metrics_2.cy'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { runAllRegressionMetricsTests1 } from '../../support/monitoring/02.reg_metrics_1.cy'; -import { runAllRegressionMetricsTestsNamespace1 } from '../../support/monitoring/05.reg_metrics_namespace_1.cy'; +import { + runAllRegressionMetricsTests1, + runAllRegressionMetricsTests2, +} from '../../support/metrics/metrics_regressions.cy'; +import { + runAllRegressionMetricsTestsNamespace1, + runAllRegressionMetricsTestsNamespace2, +} from '../../support/metrics/metrics_regressions_namespaced.cy'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { guidedTour } from '../../views/tour'; -import { runAllRegressionMetricsTestsNamespace2 } from '../../support/monitoring/05.reg_metrics_namespace_2.cy'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, KUBEVIRT_HYPERCONVERGED_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; describe( 'Regression: Monitoring - Metrics (Virtualization)', diff --git a/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts b/web/cypress/e2e/perses-dashboards/lightspeed_integration.cy.ts index ad00df7ca..0dc92abdb 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_bvt.cy.ts b/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts index 10311683a..7943ef3cf 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_bvt.cy.ts @@ -1,10 +1,10 @@ import { nav } from '../../views/nav'; //TODO: rename after customizable-dashboards gets merged -import { runBVTCOOPersesTests1 } from '../../support/perses/00.coo_bvt_perses_admin.cy'; +import { runBVTCOOPersesTests1 } from '../../support/perses/perses_bvt_admin.cy'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; describe( 'BVT: COO - Dashboards (Perses) - Administrator 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 d383250fb..9b46dd202 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 { nav } from '../../views/nav'; -import { runCOOCreatePersesTests } from '../../support/perses/03.coo_create_perses_admin.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { runCOOCreatePersesTests } from '../../support/perses/perses_create_admin.cy'; +import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; 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 ad175555f..1da320ec4 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_datasources.cy.ts @@ -5,8 +5,8 @@ import { LOKI_OPERATOR, OPENTELEMETRY_OPERATOR, TEMPO_OPERATOR, -} from '../../support/operators'; -import { runCOOCreateImportPersesTests } from '../../support/perses/05.coo_create_import_perses_admin.cy'; +} from '../../support/shared/operators'; +import { runCOOCreateImportPersesTests } 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 bcf175cb1..72d214bb2 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_edit.cy.ts @@ -1,7 +1,7 @@ import { nav } from '../../views/nav'; -import { runCOOEditPersesTests1 } from '../../support/perses/02.coo_edit_perses_admin_1.cy'; -import { runCOOEditPersesTests } from '../../support/perses/02.coo_edit_perses_admin.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { runCOOEditPersesTests1 } from '../../support/perses/perses_edit_admin_1.cy'; +import { runCOOEditPersesTests } from '../../support/perses/perses_edit_admin.cy'; +import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; 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 efc01364b..c6eec6628 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 { nav } from '../../views/nav'; -import { runCOOImportPersesTests } from '../../support/perses/04.coo_import_perses_admin.cy'; -import { operatorAuthUtils } from '../../support/commands/auth-commands'; +import { runCOOImportPersesTests } from '../../support/perses/perses_import_admin.cy'; +import { operatorAuthUtils } from '../../support/shared/commands/auth-commands'; 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 dd4df8c25..d37854336 100644 --- a/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts +++ b/web/cypress/e2e/perses-dashboards/perses_dashboards_list.cy.ts @@ -2,12 +2,12 @@ import { nav } from '../../views/nav'; import { runCOOListPersesDuplicateDashboardTests, runCOOListPersesTests, -} from '../../support/perses/01.coo_list_perses_admin.cy'; -import { runCOOListPersesTestsNamespace } from '../../support/perses/01.coo_list_perses_admin_namespace.cy'; +} from '../../support/perses/perses_list_admin.cy'; +import { runCOOListPersesTestsNamespace } from '../../support/perses/perses_list_admin_namespace.cy'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; //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 74932f874..9557514be 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,13 +1,13 @@ // Not finished import { nav } from '../../views/nav'; -import { runBVTCOOPersesTests1 } from '../../support/perses/00.coo_bvt_perses_admin.cy'; +import { runBVTCOOPersesTests1 } from '../../support/perses/perses_bvt_admin.cy'; import { guidedTour } from '../../views/tour'; import { commonPages } from '../../views/common'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, KUBEVIRT_HYPERCONVERGED_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; describe( 'IVT: COO - Dashboards (Perses) - Virtualization perspective', 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 6b03dae0f..00623ece9 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,9 +1,9 @@ import { nav } from '../../../views/nav'; -import { runCOORBACPersesTestsDevUser1 } from '../../../support/perses/99.coo_rbac_perses_user1.cy'; +import { runCOORBACPersesTestsDevUser1 } from '../../../support/perses/rbac/perses_user1.cy'; import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../../support/operators'; +} from '../../../support/shared/operators'; 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 a1974080f..3ce9f5f78 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 { nav } from '../../../views/nav'; -import { runCOORBACPersesTestsDevUser2 } from '../../../support/perses/99.coo_rbac_perses_user2.cy'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { runCOORBACPersesTestsDevUser2 } from '../../../support/perses/rbac/perses_user2.cy'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; 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 db842b079..4accfdbf5 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 { nav } from '../../../views/nav'; -import { runCOORBACPersesTestsDevUser3 } from '../../../support/perses/99.coo_rbac_perses_user3.cy'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { runCOORBACPersesTestsDevUser3 } from '../../../support/perses/rbac/perses_user3.cy'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; 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 da0658906..cb8e361b6 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 { nav } from '../../../views/nav'; -import { runCOORBACPersesTestsDevUser4 } from '../../../support/perses/99.coo_rbac_perses_user4.cy'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { runCOORBACPersesTestsDevUser4 } from '../../../support/perses/rbac/perses_user4.cy'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; 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 a299252f1..3d9e7747e 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 { nav } from '../../../views/nav'; -import { runCOORBACPersesTestsDevUser5 } from '../../../support/perses/99.coo_rbac_perses_user5.cy'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { runCOORBACPersesTestsDevUser5 } from '../../../support/perses/rbac/perses_user5.cy'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; 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 49161f10f..22437396b 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 { nav } from '../../../views/nav'; -import { runCOORBACPersesTestsDevUser6 } from '../../../support/perses/99.coo_rbac_perses_user6.cy'; -import { operatorAuthUtils } from '../../../support/commands/auth-commands'; +import { runCOORBACPersesTestsDevUser6 } from '../../../support/perses/rbac/perses_user6.cy'; +import { operatorAuthUtils } from '../../../support/shared/commands/auth-commands'; describe( 'RBAC User6: COO - Dashboards (Perses) - Administrator perspective', diff --git a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts index 8902d8fa2..4d8eab2d7 100644 --- a/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts +++ b/web/cypress/e2e/shared/admin_perspective_bvt.cy.ts @@ -1,9 +1,9 @@ import { nav } from '../../views/nav'; import { alerts } from '../../fixtures/alerts/interceptWatchdogAlert'; -import { runBVTMonitoringTests } from '../../support/monitoring/00.bvt_monitoring.cy'; +import { runBVTAlertsTests } from '../../support/alerts/alerts_bvt.cy'; import { commonPages } from '../../views/common'; import { overviewPage } from '../../views/overview-page'; -import { CLUSTER_MONITORING_OPERATOR } from '../../support/operators'; +import { CLUSTER_MONITORING_OPERATOR } from '../../support/shared/operators'; describe( 'BVT: Monitoring', @@ -71,7 +71,7 @@ describe( }); // Run tests in Administrator perspective - runBVTMonitoringTests({ + runBVTAlertsTests({ name: 'Administrator', }); }, diff --git a/web/cypress/e2e/shared/coo_submenus.cy.ts b/web/cypress/e2e/shared/coo_submenus.cy.ts index 6f9173512..be38aa8f5 100644 --- a/web/cypress/e2e/shared/coo_submenus.cy.ts +++ b/web/cypress/e2e/shared/coo_submenus.cy.ts @@ -1,7 +1,7 @@ import { CLUSTER_MONITORING_OPERATOR, CLUSTER_OBSERVABILITY_OPERATOR, -} from '../../support/operators'; +} from '../../support/shared/operators'; import { commonPages } from '../../views/common'; import { nav } from '../../views/nav'; import { troubleshootingPanelPage } from '../../views/troubleshooting-panel'; diff --git a/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts b/web/cypress/support/alerts/alerts_bvt.cy.ts similarity index 98% rename from web/cypress/support/monitoring/00.bvt_monitoring.cy.ts rename to web/cypress/support/alerts/alerts_bvt.cy.ts index 696dbf275..c6efd2bfb 100644 --- a/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts +++ b/web/cypress/support/alerts/alerts_bvt.cy.ts @@ -19,11 +19,11 @@ export interface PerspectiveConfig { beforeEach?: () => void; } -export function runBVTMonitoringTests(perspective: PerspectiveConfig) { - testBVTMonitoring(perspective); +export function runBVTAlertsTests(perspective: PerspectiveConfig) { + testBVTAlerts(perspective); } -export function testBVTMonitoring(perspective: PerspectiveConfig) { +export function testBVTAlerts(perspective: PerspectiveConfig) { it( `${perspective.name} 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 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 diff --git a/web/cypress/support/index.ts b/web/cypress/support/index.ts index a59b4cec5..a23278b1b 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/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 diff --git a/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts b/web/cypress/support/metrics/metrics_regressions.cy.ts similarity index 68% rename from web/cypress/support/monitoring/02.reg_metrics_2.cy.ts rename to web/cypress/support/metrics/metrics_regressions.cy.ts index d8d8ea74c..49b7438e3 100644 --- a/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts +++ b/web/cypress/support/metrics/metrics_regressions.cy.ts @@ -1,10 +1,12 @@ 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'; export interface PerspectiveConfig { @@ -12,11 +14,231 @@ export interface PerspectiveConfig { beforeEach?: () => void; } +export function runAllRegressionMetricsTests1(perspective: PerspectiveConfig) { + testMetricsRegression1(perspective); +} + +export function testMetricsRegression1(perspective: PerspectiveConfig) { + 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 runAllRegressionMetricsTests2(perspective: PerspectiveConfig) { testMetricsRegression2(perspective); } -export function testMetricsRegression2(perspective: PerspectiveConfig) { +function testMetricsRegression2(perspective: PerspectiveConfig) { it(`${perspective.name} perspective - Metrics > Add Query - Run Queries - Kebab icon`, () => { cy.log('6.1 Preparation to test Add Query button'); metricsPage.clickActionsDeleteAllQueries(); 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 ca089535a..b63eaca51 100644 --- a/web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts +++ b/web/cypress/support/metrics/metrics_regressions_namespaced.cy.ts @@ -1,10 +1,12 @@ 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'; export interface PerspectiveConfig { @@ -12,11 +14,231 @@ export interface PerspectiveConfig { beforeEach?: () => void; } +export function runAllRegressionMetricsTestsNamespace1(perspective: PerspectiveConfig) { + testMetricsRegressionNamespace1(perspective); +} + +export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig) { + 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 runAllRegressionMetricsTestsNamespace2(perspective: PerspectiveConfig) { testMetricsRegressionNamespace2(perspective); } -export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig) { +function testMetricsRegressionNamespace2(perspective: PerspectiveConfig) { it(`${perspective.name} perspective - Metrics > Add Query - Run Queries - Kebab icon`, () => { cy.log('6.1 Preparation to test Add Query button'); metricsPage.shouldBeLoaded(); 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 9d96a131f..000000000 --- a/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts +++ /dev/null @@ -1,233 +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'; - -export interface PerspectiveConfig { - name: string; - beforeEach?: () => void; -} - -export function runAllRegressionMetricsTests1(perspective: PerspectiveConfig) { - testMetricsRegression1(perspective); -} - -export function testMetricsRegression1(perspective: PerspectiveConfig) { - 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); - }); - }); -} 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 b833f566a..000000000 --- a/web/cypress/support/monitoring/05.reg_metrics_namespace_1.cy.ts +++ /dev/null @@ -1,233 +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'; - -export interface PerspectiveConfig { - name: string; - beforeEach?: () => void; -} - -export function runAllRegressionMetricsTestsNamespace1(perspective: PerspectiveConfig) { - testMetricsRegressionNamespace1(perspective); -} - -export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig) { - 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); - }); - }); -} diff --git a/web/cypress/support/commands/dashboards-commands.ts b/web/cypress/support/perses/commands/dashboards-commands.ts similarity index 98% rename from web/cypress/support/commands/dashboards-commands.ts rename to web/cypress/support/perses/commands/dashboards-commands.ts index 3b93d38c6..8b0b34ba9 100644 --- a/web/cypress/support/commands/dashboards-commands.ts +++ b/web/cypress/support/perses/commands/dashboards-commands.ts @@ -1,7 +1,7 @@ import 'cypress-wait-until'; import { DataTestIDs, LegacyTestIDs } from '@/shared/constants/data-test'; -import { waitForPodsReady, waitForResourceCondition } from './wait-utils'; -import { PERSES_E2E_DASHBOARDS_DIR, PERSES_E2E_DATASOURCES_DIR } from '../perses/constants'; +import { waitForPodsReady, waitForResourceCondition } from '../../shared/commands/wait-utils'; +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 114cd2ffd..38a7eabf8 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 99% 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 index fc7df22dc..358644237 100644 --- a/web/cypress/support/perses/02.coo_edit_perses_admin_1.cy.ts +++ b/web/cypress/support/perses/perses_edit_admin_1.cy.ts @@ -19,7 +19,7 @@ export function runCOOEditPersesTests1(perspective: PerspectiveConfig) { testCOOEditPerses1(perspective); } -export function testCOOEditPerses1(perspective: PerspectiveConfig) { +function testCOOEditPerses1(perspective: PerspectiveConfig) { it(`10.${perspective.name} perspective - Edit Toolbar - Add Panel`, () => { cy.log(`10.1. use sidebar nav to go to Observe > Dashboards (Perses)`); commonPages.titleShouldHaveText('Dashboards'); 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 367c37dfb..f22b623cc 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'; export interface PerspectiveConfig { name: string; 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 97% 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 5813b627f..319ce9552 100644 --- a/web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user2.cy.ts @@ -1,9 +1,9 @@ -import { persesDashboardsPage } from '../../views/perses-dashboards'; -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; +import { persesDashboardsPage } from '../../../views/perses-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, -} from '../../fixtures/perses/constants'; +} from '../../../fixtures/perses/constants'; export interface PerspectiveConfig { name: string; 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 c34a57259..547ec30cb 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'; export interface PerspectiveConfig { 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 96% 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 b5e1690ab..b6318f8b9 100644 --- a/web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user4.cy.ts @@ -1,4 +1,4 @@ -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; export interface PerspectiveConfig { name: string; 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 d0b6c4eec..db5bd4c96 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'; export interface PerspectiveConfig { name: string; 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 93% 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 ae54b1bfd..cbdc5d1e9 100644 --- a/web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts +++ b/web/cypress/support/perses/rbac/perses_user6.cy.ts @@ -1,4 +1,4 @@ -import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards'; +import { listPersesDashboardsPage } from '../../../views/perses-dashboards-list-dashboards'; export interface PerspectiveConfig { name: string; 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 a3cdd8e78..fbffb6009 100644 --- a/web/cypress/support/commands/coo-install-commands.ts +++ b/web/cypress/support/shared/cluster-observability-operator/coo-install-commands.ts @@ -1,6 +1,6 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../views/operator-hub-page'; -import { nav } from '../../views/nav'; +import { operatorHubPage } from '../../../views/operator-hub-page'; +import { nav } from '../../../views/nav'; 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 7df8a6d4f..1876c7d0f 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'; export {}; declare global { 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 100% rename from web/cypress/support/commands/image-patch-commands.ts rename to web/cypress/support/shared/commands/image-patch-commands.ts 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 ec9822f41..913867f92 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'; 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 16eb49ace..6c5b55441 100644 --- a/web/cypress/support/commands/traces-logging-commands.ts +++ b/web/cypress/support/shared/commands/traces-logging-commands.ts @@ -1,6 +1,6 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../views/operator-hub-page'; -import { nav } from '../../views/nav'; +import { operatorHubPage } from '../../../views/operator-hub-page'; +import { nav } from '../../../views/nav'; import { operatorAuthUtils } from './auth-commands'; export {}; 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 5fb3d459a..67f1999ee 100644 --- a/web/cypress/support/commands/virtualization-commands.ts +++ b/web/cypress/support/shared/commands/virtualization-commands.ts @@ -1,8 +1,8 @@ import 'cypress-wait-until'; -import { operatorHubPage } from '../../views/operator-hub-page'; -import { nav } from '../../views/nav'; +import { operatorHubPage } from '../../../views/operator-hub-page'; +import { nav } from '../../../views/nav'; import { operatorAuthUtils } from './auth-commands'; -import { guidedTour } from '../../views/tour'; +import { guidedTour } from '../../../views/tour'; export {}; diff --git a/web/cypress/support/commands/wait-utils.ts b/web/cypress/support/shared/commands/wait-utils.ts similarity index 100% rename from web/cypress/support/commands/wait-utils.ts rename to web/cypress/support/shared/commands/wait-utils.ts 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