diff --git a/web/cypress/dummy.tsx b/web/cypress/dummy.tsx
index 1877b48c4..1cb4cdd6c 100644
--- a/web/cypress/dummy.tsx
+++ b/web/cypress/dummy.tsx
@@ -14,12 +14,11 @@ export {
YellowExclamationTriangleIcon,
} from '@openshift-console/dynamic-plugin-sdk';
-export const consoleFetchJSON = (url) => fetch(url)
- .then(response => response.json());
-consoleFetchJSON.delete = (url) => fetch(url, { method: 'DELETE' })
- .then(response => response.json());
-consoleFetchJSON.post = (url, json) => fetch(url, { body: JSON.stringify(json), method: 'POST'})
- .then(response => response.json());
+export const consoleFetchJSON = (url) => fetch(url).then((response) => response.json());
+consoleFetchJSON.delete = (url) =>
+ fetch(url, { method: 'DELETE' }).then((response) => response.json());
+consoleFetchJSON.post = (url, json) =>
+ fetch(url, { body: JSON.stringify(json), method: 'POST' }).then((response) => response.json());
export const ListPageFilter = () => ;
@@ -27,7 +26,9 @@ export const VirtualizedTable = ({ data, Row }) => (
- {data.map((obj, i) =>
)}
+ {data.map((obj, i) => (
+
+ ))}
@@ -36,4 +37,5 @@ export const VirtualizedTable = ({ data, Row }) => (
export const Timestamp = () => Mock_Timestamp
;
export const useActivePerspective = () => ['admin'];
-export const useListPageFilter = (data, rowFilters) => [data, data, () => {}];
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+export const useListPageFilter = (data, _rowFilters) => [data, data, () => {}];
diff --git a/web/cypress/e2e/coo/01.coo_bvt.cy.ts b/web/cypress/e2e/coo/01.coo_bvt.cy.ts
index fd997194f..53e9f41e7 100644
--- a/web/cypress/e2e/coo/01.coo_bvt.cy.ts
+++ b/web/cypress/e2e/coo/01.coo_bvt.cy.ts
@@ -2,7 +2,6 @@ import { commonPages } from '../../views/common';
import { nav } from '../../views/nav';
import { troubleshootingPanelPage } from '../../views/troubleshooting-panel';
-
// Set constants for the operators that need to be installed for tests.
const MCP = {
namespace: Cypress.env('COO_NAMESPACE'),
@@ -20,10 +19,8 @@ const MP = {
};
describe('BVT: COO', { tags: ['@smoke', '@coo'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP);
-
});
it('1. Admin perspective - Observe Menu', () => {
@@ -40,11 +37,9 @@ describe('BVT: COO', { tags: ['@smoke', '@coo'] }, () => {
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
troubleshootingPanelPage.openSignalCorrelation();
troubleshootingPanelPage.troubleshootingPanelPageShouldBeLoadedEnabled();
-
});
/**
* TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios
*/
-
});
diff --git a/web/cypress/e2e/coo/01.coo_ivt.cy.ts b/web/cypress/e2e/coo/01.coo_ivt.cy.ts
index b7f42206c..810791065 100644
--- a/web/cypress/e2e/coo/01.coo_ivt.cy.ts
+++ b/web/cypress/e2e/coo/01.coo_ivt.cy.ts
@@ -13,11 +13,10 @@ const KBV = {
crd: {
kubevirt: 'kubevirts.kubevirt.io',
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
- }
+ },
};
describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@smoke', '@coo'] }, () => {
-
before(() => {
cy.beforeBlockVirtualization(KBV);
});
@@ -28,11 +27,9 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@smoke', '@coo']
guidedTour.closeKubevirtTour();
troubleshootingPanelPage.signalCorrelationShouldNotBeVisible();
cy.switchPerspective('Core platform', 'Administrator');
-
});
/**
* TODO: To be replaced by COO validation such as Dashboards (Perses) scenarios
*/
-
});
diff --git a/web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts b/web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
index 6b15968cd..6324b404a 100644
--- a/web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
+++ b/web/cypress/e2e/coo/02.acm_alerting_ui.cy.ts
@@ -29,7 +29,7 @@ describe('ACM Alerting UI', { tags: ['@coo', '@alerts'] }, () => {
// check monitoring-plugin UI is not been affected
cy.switchPerspective('Core platform');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- commonPages.titleShouldHaveText('Alerting')
+ commonPages.titleShouldHaveText('Alerting');
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
commonPages.titleShouldHaveText('Metrics');
// switch to Fleet Management page
@@ -50,8 +50,9 @@ describe('ACM Alerting UI', { tags: ['@coo', '@alerts'] }, () => {
acmAlertingPage.shouldBeLoaded();
// check test alerts exist
expectedAlerts.forEach((alert) => {
- cy.contains('a[data-test-id="alert-resource-link"]', alert, { timeout: 120000 })
- .should('be.visible');
+ cy.contains('a[data-test-id="alert-resource-link"]', alert, { timeout: 120000 }).should(
+ 'be.visible',
+ );
});
cy.log('Verified all expected alerts are visible on the Alerting page');
cy.log('ACM Alerting UI test completed successfully');
diff --git a/web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts b/web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts
index 282a6e051..e35802392 100644
--- a/web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts
+++ b/web/cypress/e2e/incidents/00.coo_incidents_e2e.cy.ts
@@ -2,7 +2,6 @@
The test verifies the whole lifecycle of the Incident feature, without any external dependencies.
The run time can be 15 - 20 minutes. (Waiting untill the incident detection captures the new alert)
*/
-import { commonPages } from '../../views/common';
import { incidentsPage } from '../../views/incidents-page';
// Set constants for the operators that need to be installed for tests.
@@ -26,8 +25,8 @@ describe('BVT: Incidents - e2e', { tags: ['@smoke', '@slow', '@incidents', '@e2e
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
-
- cy.cleanupIncidentPrometheusRules();
+
+ cy.cleanupIncidentPrometheusRules();
// Create the alert and capture the random name
cy.createKubePodCrashLoopingAlert().then((alertName) => {
@@ -41,24 +40,17 @@ describe('BVT: Incidents - e2e', { tags: ['@smoke', '@slow', '@incidents', '@e2e
cy.log('1.1 Navigate to Incidents page and clear filters');
incidentsPage.goTo();
incidentsPage.clearAllFilters();
-
+
const intervalMs = 60_000;
- const maxMinutes = 30;
+ const maxMinutes = 30;
cy.log('1.2 Wait for incident with custom alert to appear');
- cy.waitUntil(
- () => incidentsPage.findIncidentWithAlert(currentAlertName),
- {
- interval: intervalMs,
- timeout: maxMinutes * intervalMs,
- }
- );
+ cy.waitUntil(() => incidentsPage.findIncidentWithAlert(currentAlertName), {
+ interval: intervalMs,
+ timeout: maxMinutes * intervalMs,
+ });
cy.log('1.3 Verify custom alert appears in alerts table');
- incidentsPage
- .elements
- .incidentsTable()
- .contains(currentAlertName)
- .should('exist');
+ incidentsPage.elements.incidentsTable().contains(currentAlertName).should('exist');
});
-});
\ No newline at end of file
+});
diff --git a/web/cypress/e2e/incidents/01.incidents.cy.ts b/web/cypress/e2e/incidents/01.incidents.cy.ts
index 29fdd6109..861c5aa21 100644
--- a/web/cypress/e2e/incidents/01.incidents.cy.ts
+++ b/web/cypress/e2e/incidents/01.incidents.cy.ts
@@ -27,16 +27,17 @@ const MP = {
describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
- cy.mockIncidentFixture('incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml');
+ cy.mockIncidentFixture(
+ 'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml',
+ );
});
-
it('1. Admin perspective - Incidents page - Toolbar and charts toggle functionality', () => {
cy.log('1.1 Verify toolbar and toggle charts button');
incidentsPage.elements.toolbar().should('be.visible');
incidentsPage.elements.toggleChartsButton().should('be.visible');
incidentsPage.elements.toggleChartsButton().click();
-
+
cy.log('1.2 Verify charts are hidden after toggle');
incidentsPage.elements.incidentsChartTitle().should('not.exist');
incidentsPage.elements.alertsChartTitle().should('not.exist');
@@ -46,7 +47,7 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
it('2. Admin perspective - Incidents page - Days filter functionality', () => {
cy.log('2.1 Set days filter to 3 days');
incidentsPage.setDays('3 days');
-
+
cy.log('2.2 Verify filter selection is updated');
incidentsPage.elements.daysSelectToggle().should('contain.text', '3 days');
});
@@ -55,7 +56,7 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
cy.log('3.1 Clear filters and toggle Critical filter');
incidentsPage.clearAllFilters();
incidentsPage.toggleFilter('Critical');
- // Visibility verification of the filter chip is too complex. The functionality will be
+ // Visibility verification of the filter chip is too complex. The functionality will be
// better verified in the filtering specific test.
cy.log('3.2 Verify filter can be removed');
incidentsPage.removeFilter('Severity', 'Critical');
@@ -63,10 +64,11 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
it('4. Admin perspective - Incidents page - Charts and alerts empty state', () => {
cy.mockIncidents([]);
-
+
cy.log('4.1 Verify chart titles are visible');
incidentsPage.elements.incidentsChartTitle().should('be.visible');
incidentsPage.elements.alertsChartTitle().should('be.visible');
+
cy.log('4.2 Verify alerts chart shows empty state');
incidentsPage.elements.alertsChartEmptyState().should('exist');
});
@@ -79,11 +81,13 @@ describe('BVT: Incidents - UI', { tags: ['@smoke', '@incidents'] }, () => {
incidentsPage.findIncidentWithAlert('TargetAlert').should('be.false');
cy.log('5.2 Verify traversing incident table works when the alert is not present');
- cy.mockIncidentFixture('incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml');
+ cy.mockIncidentFixture(
+ 'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml',
+ );
incidentsPage.findIncidentWithAlert('TargetAlert').should('be.false');
cy.log('5.3 Verify traversing incident table works when the alert is present');
cy.mockIncidentFixture('incident-scenarios/6-multi-incident-target-alert-scenario.yaml');
incidentsPage.findIncidentWithAlert('TargetAlert').should('be.true');
});
-});
\ No newline at end of file
+});
diff --git a/web/cypress/e2e/incidents/02.incidents-mocking-example.cy.ts b/web/cypress/e2e/incidents/02.incidents-mocking-example.cy.ts
index 862a35a19..e4cf69508 100644
--- a/web/cypress/e2e/incidents/02.incidents-mocking-example.cy.ts
+++ b/web/cypress/e2e/incidents/02.incidents-mocking-example.cy.ts
@@ -7,9 +7,7 @@ This test showcases different mocking approaches:
3. Demonstrating empty state handling
*/
-import { commonPages } from '../../views/common';
import { incidentsPage } from '../../views/incidents-page';
-import { IncidentDefinition } from '../../support/incidents_prometheus_query_mocks';
const MCP = {
namespace: Cypress.env('COO_NAMESPACE'),
@@ -27,7 +25,6 @@ const MP = {
};
describe('Incidents - Mocking Examples', { tags: ['@demo', '@incidents'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
});
@@ -40,29 +37,35 @@ describe('Incidents - Mocking Examples', { tags: ['@demo', '@incidents'] }, () =
it('1. Mock silenced and firing incidents with mixed severity', () => {
cy.log('Setting up silenced critical and firing warning incidents');
cy.mockIncidentFixture('incident-scenarios/silenced-and-firing-mixed-severity.yaml');
-
- cy.log('One silenced critical incident (resolved) and one firing warning incident should be visible');
+
+ cy.log(
+ 'One silenced critical incident (resolved) and one firing warning incident should be visible',
+ );
cy.pause();
});
it('2. Mock healthy cluster from fixture', () => {
cy.log('Setting up healthy cluster scenario from fixture');
cy.mockIncidentFixture('incident-scenarios/0-healthy-cluster.yaml');
-
+
cy.pause();
});
it('3. Mock single incident with critical and warning alerts', () => {
cy.log('Setting up single incident with critical and warning alerts from fixture');
- cy.mockIncidentFixture('incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml');
+ cy.mockIncidentFixture(
+ 'incident-scenarios/1-single-incident-firing-critical-and-warning-alerts.yaml',
+ );
cy.log('Single incident with mixed severity alerts should be visible');
cy.pause();
});
it('4. Mock multi-incidents with resolved and firing alerts', () => {
cy.log('Setting up multi-incidents with resolved and firing alerts from fixture');
- cy.mockIncidentFixture('incident-scenarios/2-multi-incidents-multi-alerts-resolved-and-firing.yaml');
-
+ cy.mockIncidentFixture(
+ 'incident-scenarios/2-multi-incidents-multi-alerts-resolved-and-firing.yaml',
+ );
+
cy.log('Multiple incidents with mixed alert states should be visible');
cy.pause();
});
@@ -70,7 +73,7 @@ describe('Incidents - Mocking Examples', { tags: ['@demo', '@incidents'] }, () =
it('5. Mock multi-severity overlapping incidents', () => {
cy.log('Setting up multi-severity overlapping incidents from fixture');
cy.mockIncidentFixture('incident-scenarios/3-multi-severity-overlapping-incidents.yaml');
-
+
cy.log('Overlapping incidents with different severity distributions should be visible');
cy.pause();
});
@@ -81,15 +84,13 @@ describe('Incidents - Mocking Examples', { tags: ['@demo', '@incidents'] }, () =
cy.log('Single incident with escalating severity alerts should be visible');
cy.pause();
-
});
it('7. Mock empty incident state', () => {
cy.log('Setting up empty incident state');
cy.mockIncidents([]);
-
+
cy.log('No incidents should be visible - empty state');
cy.pause();
});
-
-});
\ No newline at end of file
+});
diff --git a/web/cypress/e2e/incidents/regression/01.reg_filtering.cy.ts b/web/cypress/e2e/incidents/regression/01.reg_filtering.cy.ts
index c69542ed7..4cf51626c 100644
--- a/web/cypress/e2e/incidents/regression/01.reg_filtering.cy.ts
+++ b/web/cypress/e2e/incidents/regression/01.reg_filtering.cy.ts
@@ -26,7 +26,6 @@ const MP = {
};
describe('Regression: Incidents Filtering', { tags: ['@incidents'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
});
@@ -42,108 +41,100 @@ describe('Regression: Incidents Filtering', { tags: ['@incidents'] }, () => {
incidentsPage.setDays('1 day');
incidentsPage.setDays('7 days');
-
+
incidentsPage.elements.incidentsChartContainer().should('be.visible');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 12);
cy.log('All 12 incidents from comprehensive filtering scenarios are loaded');
-
-
+
cy.log('1.2 Active filters: Critical');
incidentsPage.toggleFilter('Critical');
-
+
incidentsPage.elements.severityFilterChip().should('be.visible');
incidentsPage.elements.incidentsChartContainer().should('be.visible');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 7);
-
+
cy.log('Verified: 7 incidents shown');
-
-
+
cy.log('1.3 Active filters: Warning');
- incidentsPage.toggleFilter('Critical'); // Deselect Critical
- incidentsPage.toggleFilter('Warning'); // Select Warning
+ incidentsPage.toggleFilter('Critical'); // Deselect Critical
+ incidentsPage.toggleFilter('Warning'); // Select Warning
incidentsPage.elements.severityFilterChip().should('be.visible');
incidentsPage.elements.incidentsChartContainer().should('be.visible');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 5);
-
+
cy.log('Verified: 5 incidents shown');
-
-
+
cy.log('1.4 Active filters: Informative');
- incidentsPage.toggleFilter('Warning'); // Deselect Warning
+ incidentsPage.toggleFilter('Warning'); // Deselect Warning
incidentsPage.toggleFilter('Informative'); // Select Info
incidentsPage.elements.severityFilterChip().should('be.visible');
incidentsPage.elements.incidentsChartContainer().should('be.visible');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 3);
-
+
cy.log('Verified: 3 incidents shown');
-
-
+
cy.log('1.6 Test severity filter combinations');
cy.log('1.6.1 Active filters: Critical + Informative');
- incidentsPage.toggleFilter('Critical'); // Add Critical to existing Info
+ incidentsPage.toggleFilter('Critical'); // Add Critical to existing Info
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 9);
cy.log('Verified: 9 incidents shown');
-
-
+
cy.log('1.6.2 Active filters: Warning + Informative');
- incidentsPage.toggleFilter('Critical'); // Deselect Critical
- incidentsPage.toggleFilter('Warning'); // Add Warning to existing Info
+ incidentsPage.toggleFilter('Critical'); // Deselect Critical
+ incidentsPage.toggleFilter('Warning'); // Add Warning to existing Info
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 7);
cy.log('Verified: 7 incidents shown');
-
cy.log('1.6.3 Active filters: Critical + Warning + Informative');
- incidentsPage.toggleFilter('Critical'); // Add Critical to existing Info + Warning
+ incidentsPage.toggleFilter('Critical'); // Add Critical to existing Info + Warning
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 12);
cy.log('Verified: 12 incidents shown');
-
-
- cy.log('1.7 Test state filter combinations - remove all severity filters and focus on Info + state');
+
+ cy.log(
+ '1.7 Test state filter combinations - remove all severity filters and focus on Info + state',
+ );
cy.log('1.7.1 Active filters: Informative + Resolved');
- incidentsPage.toggleFilter('Critical'); // Deselect Critical
- incidentsPage.toggleFilter('Warning'); // Deselect Warning
+ incidentsPage.toggleFilter('Critical'); // Deselect Critical
+ incidentsPage.toggleFilter('Warning'); // Deselect Warning
// Now we have only Informative selected
- incidentsPage.toggleFilter('Resolved'); // Add Resolved state filter
+ incidentsPage.toggleFilter('Resolved'); // Add Resolved state filter
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 1);
cy.log('Verified: 1 incident shown');
-
-
+
cy.log('1.7.2 Active filters: Informative + Firing');
incidentsPage.toggleFilter('Resolved'); // Deselect Resolved
- incidentsPage.toggleFilter('Firing'); // Select Firing
+ incidentsPage.toggleFilter('Firing'); // Select Firing
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 2);
cy.log('Verified: 2 incidents shown');
-
-
+
incidentsPage.clearAllFilters();
});
it('2. Chart interaction with active filters', () => {
cy.log('Setting up filters for chart interaction testing');
incidentsPage.clearAllFilters();
-
+
// Set up a specific filter state for testing
incidentsPage.toggleFilter('Informative');
incidentsPage.toggleFilter('Firing');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 2);
cy.log('Setup complete: Informative + Firing filters active, 2 incidents shown');
-
+
cy.log('2.1 Select incident bar while filters are active');
incidentsPage.selectIncidentByBarIndex(0);
incidentsPage.elements.incidentsTable().should('be.visible');
cy.log('Incident table displayed after bar selection');
-
+
cy.log('2.2 Verify just selected incident is shown in the chart');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 1);
cy.log('Verified: 1 incident shown');
-
+
cy.log('2.3 Deselect incident bar and verify filter persistence');
incidentsPage.deselectIncidentByBar();
incidentsPage.elements.incidentsTable().should('not.exist');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 2);
cy.log('Filters persisted after deselection: 2 incidents still shown');
-
+
incidentsPage.clearAllFilters();
});
-
});
diff --git a/web/cypress/e2e/incidents/regression/02.reg_ui_charts_comprehensive.cy.ts b/web/cypress/e2e/incidents/regression/02.reg_ui_charts_comprehensive.cy.ts
index 447b3838b..aa0fffbe5 100644
--- a/web/cypress/e2e/incidents/regression/02.reg_ui_charts_comprehensive.cy.ts
+++ b/web/cypress/e2e/incidents/regression/02.reg_ui_charts_comprehensive.cy.ts
@@ -28,19 +28,31 @@ function verifyTooltipPositioning(
tooltipRect: RectLike,
barRect: RectLike,
context: string,
- win?: Window
+ win?: Window,
) {
cy.log(`${context}: Bar rect: top=${barRect.top}, bottom=${barRect.bottom}`);
cy.log(`${context}: Tooltip rect: top=${tooltipRect.top}, bottom=${tooltipRect.bottom}`);
-
- expect(tooltipRect.top, `${context}: tooltip top should be above bar`).to.be.lessThan(barRect.top);
+
+ expect(tooltipRect.top, `${context}: tooltip top should be above bar`).to.be.lessThan(
+ barRect.top,
+ );
expect(tooltipRect.top, `${context}: tooltip should be in viewport`).to.be.greaterThan(0);
- expect(tooltipRect.bottom + ARROW_HEIGHT, `${context}: tooltip bottom with arrow`).to.be.lessThan(barRect.top);
- expect(tooltipRect.bottom + ARROW_HEIGHT + ALLOWED_MARGIN, `${context}: tooltip arrow should be near bar top`).to.be.greaterThan(barRect.top);
-
+ expect(tooltipRect.bottom + ARROW_HEIGHT, `${context}: tooltip bottom with arrow`).to.be.lessThan(
+ barRect.top,
+ );
+ expect(
+ tooltipRect.bottom + ARROW_HEIGHT + ALLOWED_MARGIN,
+ `${context}: tooltip arrow should be near bar top`,
+ ).to.be.greaterThan(barRect.top);
+
if (win) {
- expect(tooltipRect.right, `${context}: tooltip should not overflow viewport width`).to.be.lessThan(win.innerWidth);
- expect(tooltipRect.bottom, `${context}: tooltip should not overflow viewport`).to.be.lessThan(win.innerHeight);
+ expect(
+ tooltipRect.right,
+ `${context}: tooltip should not overflow viewport width`,
+ ).to.be.lessThan(win.innerWidth);
+ expect(tooltipRect.bottom, `${context}: tooltip should not overflow viewport`).to.be.lessThan(
+ win.innerHeight,
+ );
}
}
@@ -52,15 +64,19 @@ function verifyIncidentBarDimensions(index: number, context: string) {
}
function verifyIncidentBarHasVisiblePaths(index: number, context: string) {
- incidentsPage.elements.incidentsChartBarsGroups()
+ incidentsPage.elements
+ .incidentsChartBarsGroups()
.eq(index)
.find('path[role="presentation"]')
.then(($paths) => {
- const visiblePath = $paths.filter((i, el) => {
- const fillOpacity = Cypress.$(el).css('fill-opacity') || Cypress.$(el).attr('fill-opacity');
- return parseFloat(fillOpacity || '0') > 0;
- }).first();
-
+ const visiblePath = $paths
+ .filter((i, el) => {
+ const fillOpacity =
+ Cypress.$(el).css('fill-opacity') || Cypress.$(el).attr('fill-opacity');
+ return parseFloat(fillOpacity || '0') > 0;
+ })
+ .first();
+
expect(visiblePath.length, `${context} should have visible path`).to.be.greaterThan(0);
});
}
@@ -85,10 +101,8 @@ const MP = {
};
describe('Regression: Charts UI - Comprehensive', { tags: ['@incidents'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
-
});
beforeEach(() => {
@@ -96,128 +110,150 @@ describe('Regression: Charts UI - Comprehensive', { tags: ['@incidents'] }, () =
});
describe('Section 2.1: Tooltip Positioning', () => {
-
it('Tooltip positioning and content validation', () => {
cy.log('Setup: Clear filters and verify all incidents loaded');
incidentsPage.clearAllFilters();
incidentsPage.setDays('7 days');
incidentsPage.elements.incidentsChartContainer().should('be.visible');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 10);
-
+
cy.log('1.1 Get total incident count for dynamic indexing');
- incidentsPage.elements.incidentsChartBarsGroups().its('length').then((count) => {
- cy.log(`Total incidents loaded: ${count}`);
-
- const bottomIndex = 0;
- const topIndex = count - 1;
- const middleIndex = Math.floor(count / 2);
-
- cy.log(`1.2 Test bottom incident (newest, index ${bottomIndex}) tooltip positioning`);
- incidentsPage.getIncidentBarRect(bottomIndex).then((barRect) => {
- incidentsPage.hoverOverIncidentBar(bottomIndex);
- incidentsPage.elements.tooltip().then(($tooltip) => {
- verifyTooltipPositioning($tooltip[0].getBoundingClientRect(), barRect, 'Bottom incident');
- });
- });
- cy.log('Verified: Bottom incident tooltip appears above bar without overlapping');
-
- cy.log(`1.3 Test middle incident (index ${middleIndex}) tooltip positioning`);
- incidentsPage.getIncidentBarRect(middleIndex).then((barRect) => {
- incidentsPage.hoverOverIncidentBar(middleIndex);
- incidentsPage.elements.tooltip().then(($tooltip) => {
- verifyTooltipPositioning($tooltip[0].getBoundingClientRect(), barRect, 'Middle incident');
+ incidentsPage.elements
+ .incidentsChartBarsGroups()
+ .its('length')
+ .then((count) => {
+ cy.log(`Total incidents loaded: ${count}`);
+
+ const bottomIndex = 0;
+ const topIndex = count - 1;
+ const middleIndex = Math.floor(count / 2);
+
+ cy.log(`1.2 Test bottom incident (newest, index ${bottomIndex}) tooltip positioning`);
+ incidentsPage.getIncidentBarRect(bottomIndex).then((barRect) => {
+ incidentsPage.hoverOverIncidentBar(bottomIndex);
+ incidentsPage.elements.tooltip().then(($tooltip) => {
+ verifyTooltipPositioning(
+ $tooltip[0].getBoundingClientRect(),
+ barRect,
+ 'Bottom incident',
+ );
+ });
});
- });
- cy.log('Verified: Middle incident tooltip appears above bar without overlapping');
-
- cy.log(`1.4 Test top incident (oldest, index ${topIndex}) tooltip positioning`);
- incidentsPage.getIncidentBarRect(topIndex).then((barRect) => {
- incidentsPage.hoverOverIncidentBar(topIndex);
- cy.window().then((win) => {
+ cy.log('Verified: Bottom incident tooltip appears above bar without overlapping');
+
+ cy.log(`1.3 Test middle incident (index ${middleIndex}) tooltip positioning`);
+ incidentsPage.getIncidentBarRect(middleIndex).then((barRect) => {
+ incidentsPage.hoverOverIncidentBar(middleIndex);
incidentsPage.elements.tooltip().then(($tooltip) => {
- verifyTooltipPositioning($tooltip[0].getBoundingClientRect(), barRect, 'Top incident', win);
+ verifyTooltipPositioning(
+ $tooltip[0].getBoundingClientRect(),
+ barRect,
+ 'Middle incident',
+ );
+ });
+ });
+ cy.log('Verified: Middle incident tooltip appears above bar without overlapping');
+
+ cy.log(`1.4 Test top incident (oldest, index ${topIndex}) tooltip positioning`);
+ incidentsPage.getIncidentBarRect(topIndex).then((barRect) => {
+ incidentsPage.hoverOverIncidentBar(topIndex);
+ cy.window().then((win) => {
+ incidentsPage.elements
+ .tooltip()
+ .first()
+ .then(($tooltip) => {
+ verifyTooltipPositioning(
+ $tooltip[0].getBoundingClientRect(),
+ barRect,
+ 'Top incident',
+ win,
+ );
+ });
});
});
+ cy.log('Verified: Top incident tooltip appears above bar and stays within viewport');
});
- cy.log('Verified: Top incident tooltip appears above bar and stays within viewport');
+
+ cy.log('2-4: Multi-incident verification (single traversal optimization)');
+ cy.log('3.1 Firing vs resolved incident tooltips');
+ cy.log('3.2 Find and verify firing incident (network-firing-short-002)');
+ incidentsPage.hoverOverIncidentBar(0);
+ incidentsPage.elements
+ .tooltip()
+ .invoke('text')
+ .then((text) => {
+ expect(text).to.contain('network-firing-short-002');
+ expect(text).to.match(/End.*---/);
+ });
+ cy.log('Verified: Firing incident shows --- for end time');
+
+ let foundMultiComponent = false;
+ let foundResolved = false;
+ let foundLongName = false;
+
+ incidentsPage.elements.incidentsChartBarsGroups().each(($group, index) => {
+ if (!foundMultiComponent || !foundResolved || !foundLongName) {
+ incidentsPage.hoverOverIncidentBar(index);
+ incidentsPage.elements
+ .tooltip()
+ .invoke('text')
+ .then((text) => {
+ if (!foundMultiComponent && text.includes('network-three-alerts-001')) {
+ cy.log('2.1 Multi-component tooltip content');
+ cy.log(`Found network-three-alerts-001 at index ${index}`);
+ cy.log('2.3 Verify tooltip shows all 3 components');
+ expect(text).to.contain('network');
+ expect(text).to.contain('compute');
+ expect(text).to.contain('storage');
+ cy.log('Verified: Multi-component tooltip displays all components');
+ foundMultiComponent = true;
+ }
+
+ if (!foundResolved && text.includes('network-resolved-short-001')) {
+ cy.log('3.3 Find and verify resolved incident (network-resolved-short-001)');
+ cy.log(`Found network-resolved-short-001 at index ${index}`);
+ expect(text).to.contain('Start');
+ expect(text).to.contain('End');
+ expect(text).to.not.match(/End.*---/);
+ cy.log('Verified: Resolved incident shows actual end time');
+ foundResolved = true;
+ }
+
+ if (!foundLongName && text.includes('others-very-long-name-001')) {
+ cy.log('4.1 Long alert name tooltip handling');
+ cy.log(`Found others-very-long-name-001 at index ${index}`);
+ cy.log('4.2 Verify tooltip with long name stays within viewport');
+ cy.window().then((win) => {
+ incidentsPage.elements
+ .tooltip()
+ .first()
+ .then(($tooltip) => {
+ const tooltipRect = $tooltip[0].getBoundingClientRect();
+ expect(tooltipRect.right).to.be.lessThan(win.innerWidth);
+ expect(tooltipRect.bottom).to.be.lessThan(win.innerHeight);
+ expect(tooltipRect.left).to.be.greaterThan(0);
+ expect(tooltipRect.top).to.be.greaterThan(0);
+ });
+ });
+ cy.log('Verified: Tooltip with 180+ char alert name stays within viewport');
+ foundLongName = true;
+ }
+ });
+ }
});
-
- cy.log('2-4: Multi-incident verification (single traversal optimization)');
- cy.log('3.1 Firing vs resolved incident tooltips');
- cy.log('3.2 Find and verify firing incident (network-firing-short-002)');
- incidentsPage.hoverOverIncidentBar(0);
- incidentsPage.elements.tooltip()
- .invoke('text')
- .then((text) => {
- expect(text).to.contain('network-firing-short-002');
- expect(text).to.match(/End.*---/);
- });
- cy.log('Verified: Firing incident shows --- for end time');
-
- let foundMultiComponent = false;
- let foundResolved = false;
- let foundLongName = false;
-
- incidentsPage.elements.incidentsChartBarsGroups().each(($group, index) => {
- const groupId = $group.attr('data-test');
-
- if (!foundMultiComponent || !foundResolved || !foundLongName) {
- incidentsPage.hoverOverIncidentBar(index);
- incidentsPage.elements.tooltip().invoke('text').then((text) => {
-
- if (!foundMultiComponent && text.includes('network-three-alerts-001')) {
- cy.log('2.1 Multi-component tooltip content');
- cy.log(`Found network-three-alerts-001 at index ${index}`);
- cy.log('2.3 Verify tooltip shows all 3 components');
- expect(text).to.contain('network');
- expect(text).to.contain('compute');
- expect(text).to.contain('storage');
- cy.log('Verified: Multi-component tooltip displays all components');
- foundMultiComponent = true;
- }
-
- if (!foundResolved && text.includes('network-resolved-short-001')) {
- cy.log('3.3 Find and verify resolved incident (network-resolved-short-001)');
- cy.log(`Found network-resolved-short-001 at index ${index}`);
- expect(text).to.contain('Start');
- expect(text).to.contain('End');
- expect(text).to.not.match(/End.*---/);
- cy.log('Verified: Resolved incident shows actual end time');
- foundResolved = true;
- }
-
- if (!foundLongName && text.includes('others-very-long-name-001')) {
- cy.log('4.1 Long alert name tooltip handling');
- cy.log(`Found others-very-long-name-001 at index ${index}`);
- cy.log('4.2 Verify tooltip with long name stays within viewport');
- cy.window().then((win) => {
- incidentsPage.elements.tooltip().then(($tooltip) => {
- const tooltipRect = $tooltip[0].getBoundingClientRect();
- expect(tooltipRect.right).to.be.lessThan(win.innerWidth);
- expect(tooltipRect.bottom).to.be.lessThan(win.innerHeight);
- expect(tooltipRect.left).to.be.greaterThan(0);
- expect(tooltipRect.top).to.be.greaterThan(0);
- });
- });
- cy.log('Verified: Tooltip with 180+ char alert name stays within viewport');
- foundLongName = true;
- }
- });
- }
- });
-
+
cy.log('5.1 Alert chart tooltip positioning');
cy.log('5.2 Select incident with 6 alerts (etcd-six-alerts-001)');
-
+
incidentsPage.selectIncidentById('etcd-six-alerts-001');
-
+
cy.log('5.3 Verify alerts chart displays alerts');
incidentsPage.elements.alertsChartCard().should('be.visible');
- incidentsPage.elements.alertsChartBarsGroups()
- .should('have.length.greaterThan', 0);
-
+ incidentsPage.elements.alertsChartBarsGroups().should('have.length.greaterThan', 0);
+
cy.log('5.4 Test tooltip positioning for all alert bars');
- incidentsPage.elements.alertsChartBarsVisiblePaths()
+ incidentsPage.elements
+ .alertsChartBarsVisiblePaths()
.its('length')
.then((alertCount) => {
cy.log(`Found ${alertCount} alert bars in chart`);
@@ -228,9 +264,17 @@ describe('Regression: Charts UI - Comprehensive', { tags: ['@incidents'] }, () =
incidentsPage.getAlertBarRect(i).then((barRect) => {
incidentsPage.hoverOverAlertBar(i);
cy.window().then((win) => {
- incidentsPage.elements.alertsChartTooltip().first().then(($tooltip) => {
- verifyTooltipPositioning($tooltip[0].getBoundingClientRect(), barRect, `Alert ${i}`, win);
- });
+ incidentsPage.elements
+ .alertsChartTooltip()
+ .first()
+ .then(($tooltip) => {
+ verifyTooltipPositioning(
+ $tooltip[0].getBoundingClientRect(),
+ barRect,
+ `Alert ${i}`,
+ win,
+ );
+ });
});
});
}
@@ -240,104 +284,127 @@ describe('Regression: Charts UI - Comprehensive', { tags: ['@incidents'] }, () =
});
describe('Section 2.2: Bar Sorting & Visibility', () => {
-
it('Bar sorting, visibility, and filtering', () => {
cy.log('Setup: Clear filters and verify all incidents loaded');
incidentsPage.clearAllFilters();
incidentsPage.setDays('7 days');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 10);
-
+
cy.log('1.1 Get total incident count');
- incidentsPage.elements.incidentsChartBarsGroups().its('length').then((count) => {
- const bottomIndex = 0;
- const topIndex = count - 1;
-
- cy.log(`1.2 Verify newest incident is at bottom (index ${bottomIndex})`);
- incidentsPage.hoverOverIncidentBar(bottomIndex);
-
- incidentsPage.elements.tooltip()
- .invoke('text')
- .should('contain', 'network-firing-short-002');
-
- cy.log(`1.3 Verify oldest incident is at top (index ${topIndex})`);
- incidentsPage.hoverOverIncidentBar(topIndex);
-
- incidentsPage.elements.tooltip()
- .invoke('text')
- .should('contain', 'VSN-001');
-
- cy.log('Verified: Incidents are sorted chronologically with newest at bottom, oldest at top');
- });
-
+ incidentsPage.elements
+ .incidentsChartBarsGroups()
+ .its('length')
+ .then((count) => {
+ const bottomIndex = 0;
+ const topIndex = count - 1;
+
+ cy.log(`1.2 Verify newest incident is at bottom (index ${bottomIndex})`);
+ incidentsPage.hoverOverIncidentBar(bottomIndex);
+
+ incidentsPage.elements
+ .tooltip()
+ .invoke('text')
+ .should('contain', 'network-firing-short-002');
+
+ cy.log(`1.3 Verify oldest incident is at top (index ${topIndex})`);
+ incidentsPage.hoverOverIncidentBar(topIndex);
+
+ incidentsPage.elements.tooltip().invoke('text').should('contain', 'VSN-001');
+
+ cy.log(
+ 'Verified: Incidents are sorted chronologically with newest at bottom, oldest at top',
+ );
+ });
+
cy.log('2.1 Short duration incidents have visible bars');
cy.log('2.2 Check network-firing-short-002 (10 min duration, index 0)');
verifyIncidentBarIsVisible(0, 'Short duration firing incident');
cy.log('Verified: Short duration firing incident has visible bar and is not transparent');
-
+
cy.log('2.3 Find and check network-resolved-short-001 (10 min duration)');
incidentsPage.elements.incidentsChartBarsGroups().each(($group, index) => {
const groupId = $group.attr('data-test');
if (groupId && groupId.includes('network-resolved-short-001')) {
cy.log(`Found network-resolved-short-001 at index ${index}`);
-
+
verifyIncidentBarIsVisible(index, 'Short duration resolved incident');
- cy.log('Verified: Short duration resolved incident has visible bar and is not transparent');
-
+ cy.log(
+ 'Verified: Short duration resolved incident has visible bar and is not transparent',
+ );
+
return false;
}
});
-
+
cy.log('3.1 Filtered bars maintain uniform Y-axis spacing');
-
- const verifyUniformSpacing = (positions: number[], context: string, maxAllowedDeviation = 2) => {
+
+ const verifyUniformSpacing = (
+ positions: number[],
+ context: string,
+ maxAllowedDeviation = 2,
+ ) => {
const spacings: number[] = [];
for (let i = 0; i < positions.length - 1; i++) {
spacings.push(positions[i + 1] - positions[i]);
}
-
+
const avgSpacing = spacings.reduce((a, b) => a + b, 0) / spacings.length;
- const maxDeviation = Math.max(...spacings.map(s => Math.abs(s - avgSpacing)));
-
- cy.log(`${context}: ${positions.length} bars, avg spacing: ${avgSpacing.toFixed(2)}px, max deviation: ${maxDeviation.toFixed(2)}px`);
- expect(maxDeviation, `${context}: spacing should be uniform`).to.be.lessThan(maxAllowedDeviation);
+ const maxDeviation = Math.max(...spacings.map((s) => Math.abs(s - avgSpacing)));
+
+ cy.log(
+ `${context}: ${positions.length} bars, avg spacing: ${avgSpacing.toFixed(
+ 2,
+ )}px, max deviation: ${maxDeviation.toFixed(2)}px`,
+ );
+ expect(maxDeviation, `${context}: spacing should be uniform`).to.be.lessThan(
+ maxAllowedDeviation,
+ );
};
-
+
cy.log('3.2 Verify uniform spacing before filtering');
const barPositionsBefore: number[] = [];
- incidentsPage.elements.incidentsChartBarsGroups().each(($group) => {
- const rect = $group[0].getBoundingClientRect();
- barPositionsBefore.push(rect.top);
- }).then(() => {
- verifyUniformSpacing(barPositionsBefore, 'Before filter');
- });
-
+ incidentsPage.elements
+ .incidentsChartBarsGroups()
+ .each(($group) => {
+ const rect = $group[0].getBoundingClientRect();
+ barPositionsBefore.push(rect.top);
+ })
+ .then(() => {
+ verifyUniformSpacing(barPositionsBefore, 'Before filter');
+ });
+
cy.log('3.3 Apply Critical filter');
incidentsPage.toggleFilter('Critical');
incidentsPage.elements.severityFilterChip().should('be.visible');
-
+
cy.log('3.4 Verify uniform spacing after filtering');
const barPositionsAfter: number[] = [];
- incidentsPage.elements.incidentsChartBarsGroups().each(($group) => {
- const rect = $group[0].getBoundingClientRect();
- barPositionsAfter.push(rect.top);
- }).then(() => {
- verifyUniformSpacing(barPositionsAfter, 'After filter');
- });
-
- cy.log('Verified: Critical filter applied and visible bars maintain uniform spacing without gaps');
+ incidentsPage.elements
+ .incidentsChartBarsGroups()
+ .each(($group) => {
+ const rect = $group[0].getBoundingClientRect();
+ barPositionsAfter.push(rect.top);
+ })
+ .then(() => {
+ verifyUniformSpacing(barPositionsAfter, 'After filter');
+ });
+
+ cy.log(
+ 'Verified: Critical filter applied and visible bars maintain uniform spacing without gaps',
+ );
});
});
describe('Section 2.3: Date/Time Display', () => {
-
it('Date and time display validation', () => {
cy.log('Setup: Clear filters');
incidentsPage.clearAllFilters();
-
+
cy.log('1.2 Hover over firing incident and verify end shows ---');
incidentsPage.hoverOverIncidentBar(0);
-
- incidentsPage.elements.tooltip()
+
+ incidentsPage.elements
+ .tooltip()
.invoke('text')
.then((text) => {
expect(text).to.contain('network-firing-short-002');
@@ -345,15 +412,16 @@ describe('Regression: Charts UI - Comprehensive', { tags: ['@incidents'] }, () =
expect(text).to.match(/End.*---/);
});
cy.log('Verified: Firing incident shows start time and --- for end');
-
+
cy.log('1.3 Find and verify resolved incident shows both start and end times');
incidentsPage.elements.incidentsChartBarsGroups().each(($group, index) => {
const groupId = $group.attr('data-test');
if (groupId && groupId.includes('network-resolved-short-001')) {
cy.log(`Found network-resolved-short-001 at index ${index}`);
incidentsPage.hoverOverIncidentBar(index);
-
- incidentsPage.elements.tooltip()
+
+ incidentsPage.elements
+ .tooltip()
.invoke('text')
.then((text) => {
expect(text).to.contain('Start');
@@ -361,65 +429,70 @@ describe('Regression: Charts UI - Comprehensive', { tags: ['@incidents'] }, () =
expect(text).to.not.match(/End.*---/);
});
cy.log('Verified: Resolved incident shows both start and end times as timestamps');
-
+
return false;
}
});
-
+
cy.log('2.1 Multi-severity incident segments');
cy.log('2.2 Find monitoring-gradual-alerts-001 incident');
incidentsPage.elements.incidentsChartBarsGroups().each(($group, index) => {
const groupId = $group.attr('data-test');
if (groupId && groupId.includes('monitoring-gradual-alerts-001')) {
cy.log(`Found monitoring-gradual-alerts-001 at index ${index}`);
-
+
cy.log('2.3 Verify bar has multiple severity segments');
- cy.wrap($group)
- .find('path[role="presentation"]')
- .should('have.length.greaterThan', 1);
+ cy.wrap($group).find('path[role="presentation"]').should('have.length.greaterThan', 1);
cy.log('Verified: Multi-severity incident has multiple colored segments');
-
+
return false;
}
});
-
+
cy.log('3.1 Date format validation');
incidentsPage.hoverOverIncidentBar(0);
-
+
cy.log('3.2 Verify tooltip contains formatted timestamps');
- incidentsPage.elements.tooltip()
+ incidentsPage.elements
+ .tooltip()
.invoke('text')
.then((text) => {
expect(text).to.match(/\d{1,2}:\d{2}/);
});
cy.log('Verified: Tooltips display formatted date/time');
-
+
cy.log('4.1 Alert-level time verification in table');
cy.log('4.1.1 Select oldest incident for alert time verification');
incidentsPage.selectIncidentById('VSN-001');
cy.log('4.2 Expand all rows to see alert details');
incidentsPage.elements.incidentsTable().should('be.visible');
-
+
cy.log('4.3 Get alert information');
incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
expect(alerts.length).to.be.greaterThan(0);
-
+
cy.log('4.4 Verify each alert has start time');
alerts.forEach((alert, index) => {
- alert.getStartCell().invoke('text').then((startText) => {
- expect(startText.trim()).to.not.be.empty;
- expect(startText.trim()).to.not.equal('-');
- cy.log(`Alert ${index + 1} start time: ${startText.trim()}`);
- });
+ alert
+ .getStartCell()
+ .invoke('text')
+ .then((startText) => {
+ expect(startText.trim()).to.not.equal('');
+ expect(startText.trim()).to.not.be.equal('-');
+ cy.log(`Alert ${index + 1} start time: ${startText.trim()}`);
+ });
});
-
+
cy.log('4.5 Verify firing alerts show --- or Firing for end time');
alerts.forEach((alert, index) => {
- alert.getEndCell().invoke('text').then((endText) => {
- expect(endText.trim()).to.not.be.empty;
- cy.log(`Alert ${index + 1} end time: ${endText.trim()}`);
- });
+ alert
+ .getEndCell()
+ .invoke('text')
+ .then((endText) => {
+ expect(endText.trim()).to.not.equal('');
+ cy.log(`Alert ${index + 1} end time: ${endText.trim()}`);
+ });
});
});
cy.log('Verified: Alert times in table display correctly with valid timestamps');
@@ -427,37 +500,42 @@ describe('Regression: Charts UI - Comprehensive', { tags: ['@incidents'] }, () =
});
describe('Section 3.1: Short Duration Incidents Visibility', () => {
-
it('Very short duration incidents are visible and selectable', () => {
cy.log('Setup: Clear filters and verify all incidents loaded');
incidentsPage.clearAllFilters();
incidentsPage.setDays('7 days');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 10);
-
+
cy.log('1.1 Test 5-minute duration incident (api-server-transient-001)');
cy.log('1.2 Find the incident bar by ID and verify visibility');
incidentsPage.elements.incidentsChartBarsGroups().then(($groups) => {
- const index = $groups.toArray().findIndex((el) =>
- el.getAttribute('data-test')?.includes('api-server-transient-001')
- );
+ const index = $groups
+ .toArray()
+ .findIndex((el) => el.getAttribute('data-test')?.includes('api-server-transient-001'));
cy.log('1.3 Verify 1-min incident bar is visible and not transparent');
verifyIncidentBarIsVisible(index, '1-min incident');
});
-
+
cy.log('1.4 Verify incident can be selected and alerts load');
incidentsPage.selectIncidentById('api-server-transient-001');
incidentsPage.elements.incidentsTable().should('be.visible');
incidentsPage.elements.incidentsDetailsTableRows().should('have.length.greaterThan', 0);
-
+
cy.log('1.5 Verify alert details are displayed');
incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
expect(alerts.length, '1-min incident should have at least 1 alert').to.be.greaterThan(0);
- alerts[0].getAlertRuleCell().invoke('text').then((alertName) => {
- expect(alertName).to.contain('APIServerRequestLatencyBriefSpikeDetectedDuringHighTrafficPeriod001');
- });
- });
- cy.log('Verified: 1-minute duration incident is visible, not transparent, selectable, and loads alerts');
-
+ alerts[0]
+ .getAlertRuleCell()
+ .invoke('text')
+ .then((alertName) => {
+ expect(alertName).to.contain(
+ 'APIServerRequestLatencyBriefSpikeDetectedDuringHighTrafficPeriod001',
+ );
+ });
});
+ cy.log(
+ 'Verified: 1-minute duration incident is visible, not transparent, selectable, and loads alerts',
+ );
});
- });
\ No newline at end of file
+ });
+});
diff --git a/web/cypress/e2e/incidents/regression/02.reg_ui_tooltip_boundary_times.cy.ts b/web/cypress/e2e/incidents/regression/02.reg_ui_tooltip_boundary_times.cy.ts
index 8ad39e5ad..1ec15c0ce 100644
--- a/web/cypress/e2e/incidents/regression/02.reg_ui_tooltip_boundary_times.cy.ts
+++ b/web/cypress/e2e/incidents/regression/02.reg_ui_tooltip_boundary_times.cy.ts
@@ -10,6 +10,7 @@ alert tooltips and alerts table, and that consecutive segment boundaries align
with no 5-minute gap between End of one segment and Start of the next.
*/
+/* eslint-disable @typescript-eslint/no-unused-expressions */
import { incidentsPage } from '../../../views/incidents-page';
const MCP = {
@@ -27,139 +28,169 @@ const MP = {
operatorName: 'Cluster Monitoring Operator',
};
-describe('Regression: Mixed Severity Interval Boundary Times', { tags: ['@incidents', '@xfail'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
- });
-
- beforeEach(() => {
- cy.mockIncidentFixture('incident-scenarios/21-multi-severity-boundary-times.yaml');
- });
+describe(
+ 'Regression: Mixed Severity Interval Boundary Times',
+ { tags: ['@incidents', '@xfail'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
+ });
- const extractTime = (tooltipText: string, field: 'Start' | 'End'): string => {
- const afterField = tooltipText.split(field)[1] || '';
- const match = afterField.match(/(\d{1,2}:\d{2}(\s*[AP]M)?)/);
- return match ? match[1].trim() : '';
- };
+ beforeEach(() => {
+ cy.mockIncidentFixture('incident-scenarios/21-multi-severity-boundary-times.yaml');
+ });
- it('1. Tooltip End times at severity boundaries show 5-minute rounded values', () => {
- const verifyEndTimeRounded = (label: string) => {
- incidentsPage.elements.tooltip()
- .invoke('text')
- .then((text) => {
- cy.log(`${label} tooltip: "${text}"`);
+ const extractTime = (tooltipText: string, field: 'Start' | 'End'): string => {
+ const afterField = tooltipText.split(field)[1] || '';
+ const match = afterField.match(/(\d{1,2}:\d{2}(\s*[AP]M)?)/);
+ return match ? match[1].trim() : '';
+ };
- if (text.match(/End.*---/)) {
- cy.log(`${label}: Firing, End shows --- (skipped)`);
- return;
- }
+ it('1. Tooltip End times at severity boundaries show 5-minute rounded values', () => {
+ const verifyEndTimeRounded = (label: string) => {
+ incidentsPage.elements
+ .tooltip()
+ .invoke('text')
+ .then((text) => {
+ cy.log(`${label} tooltip: "${text}"`);
+
+ if (text.match(/End.*---/)) {
+ cy.log(`${label}: Firing, End shows --- (skipped)`);
+ return;
+ }
+
+ const endPart = text.split('End')[1];
+ expect(endPart, `${label}: should contain End time`).to.exist;
+
+ const timeMatch = endPart.match(/(\d{1,2}):(\d{2})/);
+ expect(timeMatch, `${label}: End time should be parseable`).to.not.be.null;
+
+ const minutes = parseInt(timeMatch[2], 10);
+ const remainder = minutes % 5;
+ expect(
+ remainder,
+ `${label}: End minutes (${minutes}) should be divisible by 5, remainder=${remainder}`,
+ ).to.equal(0);
+ cy.log(`${label}: End ${timeMatch[1]}:${timeMatch[2]} - minutes divisible by 5`);
+ });
+ };
+
+ cy.log('1.1 Verify multi-severity incident loaded');
+ incidentsPage.clearAllFilters();
+ incidentsPage.setDays('1 day');
+ incidentsPage.elements.incidentsChartContainer().should('be.visible');
+ incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 1);
+
+ cy.log('1.2 Verify bar has multiple severity segments');
+ incidentsPage.getIncidentBarVisibleSegments(0).then((segments) => {
+ expect(
+ segments.length,
+ 'Multi-severity bar should have at least 2 visible segments',
+ ).to.be.greaterThan(1);
+ cy.log(`Found ${segments.length} visible severity segments`);
+ });
- const endPart = text.split('End')[1];
- expect(endPart, `${label}: should contain End time`).to.exist;
+ cy.log('1.3 Check first segment end time (Info -> Warning boundary)');
+ incidentsPage.hoverOverIncidentBarSegment(0, 0);
+ verifyEndTimeRounded('First segment');
- const timeMatch = endPart.match(/(\d{1,2}):(\d{2})/);
- expect(timeMatch, `${label}: End time should be parseable`).to.not.be.null;
+ cy.log('1.4 Check second segment end time (Warning -> Critical boundary)');
+ incidentsPage.hoverOverIncidentBarSegment(0, 1);
+ verifyEndTimeRounded('Second segment');
- const minutes = parseInt(timeMatch[2], 10);
- const remainder = minutes % 5;
- expect(remainder, `${label}: End minutes (${minutes}) should be divisible by 5, remainder=${remainder}`).to.equal(0);
- cy.log(`${label}: End ${timeMatch[1]}:${timeMatch[2]} - minutes divisible by 5`);
- });
- };
+ cy.log('1.5 Check third segment end time (Critical end)');
+ incidentsPage.hoverOverIncidentBarSegment(0, 2);
+ verifyEndTimeRounded('Third segment');
- cy.log('1.1 Verify multi-severity incident loaded');
- incidentsPage.clearAllFilters();
- incidentsPage.setDays('1 day');
- incidentsPage.elements.incidentsChartContainer().should('be.visible');
- incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 1);
-
- cy.log('1.2 Verify bar has multiple severity segments');
- incidentsPage.getIncidentBarVisibleSegments(0).then((segments) => {
- expect(segments.length, 'Multi-severity bar should have at least 2 visible segments')
- .to.be.greaterThan(1);
- cy.log(`Found ${segments.length} visible severity segments`);
+ cy.log(
+ 'Verified: All tooltip End times at severity boundaries are at 5-minute precision (OU-1205)',
+ );
});
- cy.log('1.3 Check first segment end time (Info -> Warning boundary)');
- incidentsPage.hoverOverIncidentBarSegment(0, 0);
- verifyEndTimeRounded('First segment');
-
- cy.log('1.4 Check second segment end time (Warning -> Critical boundary)');
- incidentsPage.hoverOverIncidentBarSegment(0, 1);
- verifyEndTimeRounded('Second segment');
-
- cy.log('1.5 Check third segment end time (Critical end)');
- incidentsPage.hoverOverIncidentBarSegment(0, 2);
- verifyEndTimeRounded('Third segment');
-
- cy.log('Verified: All tooltip End times at severity boundaries are at 5-minute precision (OU-1205)');
- });
-
- it('2. Start times match between incident tooltip, alert tooltip, and table; consecutive boundaries align',
- () => {
- cy.log('2.1 Setup: verify multi-severity incident loaded');
- incidentsPage.clearAllFilters();
- incidentsPage.setDays('1 day');
- incidentsPage.elements.incidentsChartContainer().should('be.visible');
- incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 1);
- cy.pause();
-
- cy.log('2.2 Consecutive interval boundaries: End of segment 1 should equal Start of segment 2');
- incidentsPage.hoverOverIncidentBarSegment(0, 0);
- incidentsPage.elements.tooltip().invoke('text').then((firstText) => {
- const firstEnd = extractTime(firstText, 'End');
- cy.log(`First segment End: ${firstEnd}`);
- expect(firstEnd, 'First segment End should be parseable').to.not.be.empty;
-
- incidentsPage.hoverOverIncidentBarSegment(0, 1);
- incidentsPage.elements.tooltip().invoke('text').then((secondText) => {
- const secondStart = extractTime(secondText, 'Start');
- cy.log(`Second segment Start: ${secondStart}`);
- expect(secondStart, 'Second segment Start should be parseable').to.not.be.empty;
- expect(secondStart,
- `No 5-min gap: second Start (${secondStart}) should equal first End (${firstEnd})`
- ).to.equal(firstEnd);
- });
- });
- cy.pause();
-
- cy.log('2.3 Incident tooltip Start vs alert tooltip Start vs alerts table Start');
- incidentsPage.hoverOverIncidentBarSegment(0, 0);
- incidentsPage.elements.tooltip().invoke('text').then((incidentText) => {
- const incidentStart = extractTime(incidentText, 'Start');
- cy.log(`Incident tooltip Start: ${incidentStart}`);
- expect(incidentStart, 'Incident Start should be parseable').to.not.be.empty;
-
- cy.log('2.4 Select incident and get alert tooltip Start');
- incidentsPage.selectIncidentById('monitoring-multi-severity-boundary-001');
- incidentsPage.elements.alertsChartCard().should('be.visible');
-
- incidentsPage.hoverOverAlertBar(0);
- incidentsPage.elements.alertsChartTooltip().invoke('text').then((alertText) => {
- const alertStart = extractTime(alertText, 'Start');
- cy.log(`Alert tooltip Start: ${alertStart}`);
- expect(incidentStart,
- `Incident Start (${incidentStart}) should match alert Start (${alertStart})`
- ).to.equal(alertStart);
- });
+ it('2. Start times match between incident tooltip, alert tooltip, and table; consecutive boundaries align', () => {
+ cy.log('2.1 Setup: verify multi-severity incident loaded');
+ incidentsPage.clearAllFilters();
+ incidentsPage.setDays('1 day');
+ incidentsPage.elements.incidentsChartContainer().should('be.visible');
+ incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 1);
+ cy.pause();
+
+ cy.log(
+ '2.2 Consecutive interval boundaries: End of segment 1 should equal Start of segment 2',
+ );
+ incidentsPage.hoverOverIncidentBarSegment(0, 0);
+ incidentsPage.elements
+ .tooltip()
+ .invoke('text')
+ .then((firstText) => {
+ const firstEnd = extractTime(firstText, 'End');
+ cy.log(`First segment End: ${firstEnd}`);
+ expect(firstEnd, 'First segment End should be parseable').to.not.be.empty;
+
+ incidentsPage.hoverOverIncidentBarSegment(0, 1);
+ incidentsPage.elements
+ .tooltip()
+ .invoke('text')
+ .then((secondText) => {
+ const secondStart = extractTime(secondText, 'Start');
+ cy.log(`Second segment Start: ${secondStart}`);
+ expect(secondStart, 'Second segment Start should be parseable').to.not.be.empty;
+ expect(
+ secondStart,
+ `No 5-min gap: second Start (${secondStart}) should equal first End (${firstEnd})`,
+ ).to.equal(firstEnd);
+ });
+ });
+ cy.pause();
- cy.log('2.5 Compare incident tooltip Start with alerts table Start');
- incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
- expect(alerts.length, 'Should have at least 1 alert row').to.be.greaterThan(0);
- alerts[0].getStartCell().invoke('text').then((cellText) => {
- const tableMatch = cellText.trim().match(/(\d{1,2}:\d{2}(\s*[AP]M)?)/);
- expect(tableMatch, 'Table Start time should be parseable').to.not.be.null;
- const tableStart = tableMatch[1].trim();
- cy.log(`Alerts table Start: ${tableStart}`);
- expect(incidentStart,
- `Incident Start (${incidentStart}) should match table Start (${tableStart})`
- ).to.equal(tableStart);
+ cy.log('2.3 Incident tooltip Start vs alert tooltip Start vs alerts table Start');
+ incidentsPage.hoverOverIncidentBarSegment(0, 0);
+ incidentsPage.elements
+ .tooltip()
+ .invoke('text')
+ .then((incidentText) => {
+ const incidentStart = extractTime(incidentText, 'Start');
+ cy.log(`Incident tooltip Start: ${incidentStart}`);
+ expect(incidentStart, 'Incident Start should be parseable').to.not.be.empty;
+
+ cy.log('2.4 Select incident and get alert tooltip Start');
+ incidentsPage.selectIncidentById('monitoring-multi-severity-boundary-001');
+ incidentsPage.elements.alertsChartCard().should('be.visible');
+
+ incidentsPage.hoverOverAlertBar(0);
+ incidentsPage.elements
+ .alertsChartTooltip()
+ .invoke('text')
+ .then((alertText) => {
+ const alertStart = extractTime(alertText, 'Start');
+ cy.log(`Alert tooltip Start: ${alertStart}`);
+ expect(
+ incidentStart,
+ `Incident Start (${incidentStart}) should match alert Start (${alertStart})`,
+ ).to.equal(alertStart);
+ });
+
+ cy.log('2.5 Compare incident tooltip Start with alerts table Start');
+ incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
+ expect(alerts.length, 'Should have at least 1 alert row').to.be.greaterThan(0);
+ alerts[0]
+ .getStartCell()
+ .invoke('text')
+ .then((cellText) => {
+ const tableMatch = cellText.trim().match(/(\d{1,2}:\d{2}(\s*[AP]M)?)/);
+ expect(tableMatch, 'Table Start time should be parseable').to.not.be.null;
+ const tableStart = tableMatch[1].trim();
+ cy.log(`Alerts table Start: ${tableStart}`);
+ expect(
+ incidentStart,
+ `Incident Start (${incidentStart}) should match table Start (${tableStart})`,
+ ).to.equal(tableStart);
+ });
+ });
});
- });
- });
- cy.pause();
+ cy.pause();
- cy.log('Expected failure: Incident tooltip Start times are 5 minutes off (OU-1221)');
- });
-});
+ cy.log('Expected failure: Incident tooltip Start times are 5 minutes off (OU-1221)');
+ });
+ },
+);
diff --git a/web/cypress/e2e/incidents/regression/03-04.reg_e2e_firing_alerts.cy.ts b/web/cypress/e2e/incidents/regression/03-04.reg_e2e_firing_alerts.cy.ts
index a6537df66..923c3beed 100644
--- a/web/cypress/e2e/incidents/regression/03-04.reg_e2e_firing_alerts.cy.ts
+++ b/web/cypress/e2e/incidents/regression/03-04.reg_e2e_firing_alerts.cy.ts
@@ -33,277 +33,350 @@ const MP = {
operatorName: 'Cluster Monitoring Operator',
};
-describe('Regression: Time-Based Alert Resolution (E2E with Firing Alerts)', { tags: ['@incidents', '@slow', '@e2e-real'] }, () => {
- let currentAlertName: string;
-
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
-
- cy.log('Create firing alert for testing');
- cy.cleanupIncidentPrometheusRules();
- cy.createKubePodCrashLoopingAlert().then((alertName) => {
- currentAlertName = alertName;
- cy.log(`Test will monitor alert: ${currentAlertName}`);
+describe(
+ 'Regression: Time-Based Alert Resolution (E2E with Firing Alerts)',
+ { tags: ['@incidents', '@slow', '@e2e-real'] },
+ () => {
+ let currentAlertName: string;
+
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
+
+ cy.log('Create firing alert for testing');
+ cy.cleanupIncidentPrometheusRules();
+ cy.createKubePodCrashLoopingAlert().then((alertName) => {
+ currentAlertName = alertName;
+ cy.log(`Test will monitor alert: ${currentAlertName}`);
+ });
});
- });
-
-
- it('1. Section 3.3 - Alert not incorrectly marked as resolved after time passes', () => {
- cy.log('1.1 Navigate to Incidents page and clear filters');
- incidentsPage.goTo();
- cy.wait(10000);
- incidentsPage.clearAllFilters();
-
- const intervalMs = 60_000;
- const maxMinutes = 30;
-
- cy.log('1.2 Wait for incident with custom alert to appear and get selected');
- cy.waitUntil(
- () => incidentsPage.findIncidentWithAlert(currentAlertName),
- {
- interval: intervalMs,
+
+ it('1. Section 3.3 - Alert not incorrectly marked as resolved after time passes', () => {
+ cy.log('1.1 Navigate to Incidents page and clear filters');
+ incidentsPage.goTo();
+ cy.wait(10000);
+ incidentsPage.clearAllFilters();
+
+ const intervalMs = 60_000;
+ const maxMinutes = 30;
+
+ cy.log('1.2 Wait for incident with custom alert to appear and get selected');
+ cy.waitUntil(() => incidentsPage.findIncidentWithAlert(currentAlertName), {
+ interval: intervalMs,
timeout: maxMinutes * intervalMs,
- errorMsg: `Incident with alert ${currentAlertName} should appear within ${maxMinutes} minutes`
- }
- );
-
- incidentsPage.elements.incidentsDetailsTable().should('exist');
-
- cy.log('1.3 Verify alert is firing by checking end time shows "---"');
- cy.wrap(0).as('initialFiringCount');
-
- incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
- expect(alerts.length).to.be.greaterThan(0);
-
- alerts.forEach((alert, index) => {
- alert.getAlertRuleCell().invoke('text').then((alertRuleText) => {
- const cleanAlertName = alertRuleText.trim().replace("AlertRuleAR", "");
-
- if (cleanAlertName != currentAlertName) {
- cy.log(`Alert ${index + 1}: ${cleanAlertName} does not match ${currentAlertName}, skipping`);
- return;
- }
-
- cy.log(`Alert ${index + 1}: Found matching alert ${cleanAlertName}`);
-
- alert.getEndCell().invoke('text').then((endText) => {
- const cleanEndText = endText.trim();
- cy.log(`Alert ${index + 1} end time: "${cleanEndText}"`);
- const isFiring = cleanEndText === '---';
- if (isFiring) {
- cy.get('@initialFiringCount').then((count: any) => {
- cy.wrap(count + 1).as('initialFiringCount');
+ errorMsg: `Incident with alert ${currentAlertName} should appear within ${maxMinutes}
+ minutes`,
+ });
+
+ incidentsPage.elements.incidentsDetailsTable().should('exist');
+
+ cy.log('1.3 Verify alert is firing by checking end time shows "---"');
+ cy.wrap(0).as('initialFiringCount');
+
+ incidentsPage
+ .getSelectedIncidentAlerts()
+ .then((alerts) => {
+ expect(alerts.length).to.be.greaterThan(0);
+
+ alerts.forEach((alert, index) => {
+ alert
+ .getAlertRuleCell()
+ .invoke('text')
+ .then((alertRuleText) => {
+ const cleanAlertName = alertRuleText.trim().replace('AlertRuleAR', '');
+
+ if (cleanAlertName != currentAlertName) {
+ cy.log(
+ `Alert ${
+ index + 1
+ }: ${cleanAlertName} does not match ${currentAlertName}, skipping`,
+ );
+ return;
+ }
+
+ cy.log(`Alert ${index + 1}: Found matching alert ${cleanAlertName}`);
+
+ alert
+ .getEndCell()
+ .invoke('text')
+ .then((endText) => {
+ const cleanEndText = endText.trim();
+ cy.log(`Alert ${index + 1} end time: "${cleanEndText}"`);
+ const isFiring = cleanEndText === '---';
+ if (isFiring) {
+ cy.get('@initialFiringCount').then((count: any) => {
+ cy.wrap(count + 1).as('initialFiringCount');
+ });
+ cy.log(`Alert ${index + 1} is FIRING`);
+ } else {
+ cy.log(`Alert ${index + 1} is resolved`);
+ }
+ });
});
- cy.log(`Alert ${index + 1} is FIRING`);
- } else {
- cy.log(`Alert ${index + 1} is resolved`);
- }
+ });
+ })
+ .then(() => {
+ cy.get('@initialFiringCount').then((count: any) => {
+ cy.log(`Total firing alerts found: ${count}`);
+ expect(count).to.be.greaterThan(
+ 0,
+ `Expected at least 1 firing alert for ${currentAlertName}, but found ${count}`,
+ );
});
});
- });
- }).then(() => {
- cy.get('@initialFiringCount').then((count: any) => {
- cy.log(`Total firing alerts found: ${count}`);
- expect(count).to.be.greaterThan(0, `Expected at least 1 firing alert for ${currentAlertName}, but found ${count}`);
- });
- });
-
- cy.log('Verified: Alert initially shows firing state (end time = "---")');
-
-
- const waitMinutes = 0.1
- cy.log(`1.6 Wait ${waitMinutes} minutes without refreshing the incidents page`);
- cy.wait(waitMinutes * 60_000);
-
- cy.log('1.10 Verify alert is STILL firing (end time still shows "---", not resolved)');
- cy.wrap(0).as('currentFiringCount');
-
- incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
- expect(alerts.length).to.be.greaterThan(0);
-
- alerts.forEach((alert, index) => {
- alert.getAlertRuleCell().invoke('text').then((alertRuleText) => {
- const cleanAlertName = alertRuleText.trim().replace("AlertRuleAR", "");
-
- if (cleanAlertName != currentAlertName) {
- cy.log(`Alert ${index + 1}: ${cleanAlertName} does not match ${currentAlertName}, skipping`);
- return;
- }
-
- cy.log(`Alert ${index + 1}: Found matching alert ${cleanAlertName}`);
-
- alert.getEndCell().invoke('text').then((endText) => {
- const cleanEndText = endText.trim();
- cy.log(`Alert ${index + 1} end time: "${cleanEndText}"`);
- const isFiring = cleanEndText === '---';
- if (isFiring) {
- cy.get('@currentFiringCount').then((count: any) => {
- cy.wrap(count + 1).as('currentFiringCount');
+
+ cy.log('Verified: Alert initially shows firing state (end time = "---")');
+
+ const waitMinutes = 0.1;
+ cy.log(`1.6 Wait ${waitMinutes} minutes without refreshing the incidents page`);
+ cy.wait(waitMinutes * 60_000);
+
+ cy.log('1.10 Verify alert is STILL firing (end time still shows "---", not resolved)');
+ cy.wrap(0).as('currentFiringCount');
+
+ incidentsPage
+ .getSelectedIncidentAlerts()
+ .then((alerts) => {
+ expect(alerts.length).to.be.greaterThan(0);
+
+ alerts.forEach((alert, index) => {
+ alert
+ .getAlertRuleCell()
+ .invoke('text')
+ .then((alertRuleText) => {
+ const cleanAlertName = alertRuleText.trim().replace('AlertRuleAR', '');
+
+ if (cleanAlertName != currentAlertName) {
+ cy.log(
+ `Alert ${
+ index + 1
+ }: ${cleanAlertName} does not match ${currentAlertName}, skipping`,
+ );
+ return;
+ }
+
+ cy.log(`Alert ${index + 1}: Found matching alert ${cleanAlertName}`);
+
+ alert
+ .getEndCell()
+ .invoke('text')
+ .then((endText) => {
+ const cleanEndText = endText.trim();
+ cy.log(`Alert ${index + 1} end time: "${cleanEndText}"`);
+ const isFiring = cleanEndText === '---';
+ if (isFiring) {
+ cy.get('@currentFiringCount').then((count: any) => {
+ cy.wrap(count + 1).as('currentFiringCount');
+ });
+ cy.log(`Alert ${index + 1} is STILL FIRING`);
+ } else {
+ cy.log(`Alert ${index + 1} is now resolved (BUG!)`);
+ }
+ });
});
- cy.log(`Alert ${index + 1} is STILL FIRING`);
- } else {
- cy.log(`Alert ${index + 1} is now resolved (BUG!)`);
- }
+ });
+ })
+ .then(() => {
+ cy.get('@initialFiringCount').then((initialCount: any) => {
+ cy.get('@currentFiringCount').then((currentCount: any) => {
+ cy.log(
+ `Initial firing alerts: ${initialCount}, Current firing alerts: ${currentCount}`,
+ );
+ expect(currentCount).to.equal(
+ initialCount,
+ `Expected same number of firing alerts after wait (${initialCount}), ` +
+ `but got ${currentCount}`,
+ );
+ expect(currentCount).to.be.greaterThan(
+ 0,
+ `Expected at least 1 firing alert, but found ${currentCount}`,
+ );
+ });
});
});
- });
- }).then(() => {
- cy.get('@initialFiringCount').then((initialCount: any) => {
- cy.get('@currentFiringCount').then((currentCount: any) => {
- cy.log(`Initial firing alerts: ${initialCount}, Current firing alerts: ${currentCount}`);
- expect(currentCount).to.equal(initialCount, `Expected same number of firing alerts after wait (${initialCount}), but got ${currentCount}`);
- expect(currentCount).to.be.greaterThan(0, `Expected at least 1 firing alert, but found ${currentCount}`);
- });
- });
+
+ cy.log(
+ 'Verified: Alert maintains firing state after time passes and reselection (end time = "---")',
+ );
});
- cy.log('Verified: Alert maintains firing state after time passes and reselection (end time = "---")');
- });
-
- it('2. Section 4.7 - Prometheus query end time updates to current time on filter refresh', () => {
- cy.log('2.1 Navigate to Incidents page and clear filters');
- incidentsPage.goTo();
- cy.wait(10000);
- incidentsPage.clearAllFilters();
-
- cy.log('2.2 Capture initial page load time');
- const initialLoadTime = Date.now();
- cy.wrap(initialLoadTime).as('initialLoadTime');
-
- cy.log('2.3 Search for and select incident with custom alert');
- incidentsPage.findIncidentWithAlert(currentAlertName).should('eq', true);
-
- cy.log('2.4 Verify alert is firing (end time = "---")');
- cy.wrap(0).as('firingCountTest2');
-
- incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
- expect(alerts.length).to.be.greaterThan(0);
-
- alerts.forEach((alert, index) => {
- alert.getAlertRuleCell().invoke('text').then((alertRuleText) => {
- const cleanAlertName = alertRuleText.trim().replace("AlertRuleAR", "");
-
- if (cleanAlertName != currentAlertName) {
- return;
- }
-
- alert.getEndCell().invoke('text').then((endText) => {
- const cleanEndText = endText.trim();
- if (cleanEndText === '---') {
- cy.get('@firingCountTest2').then((count: any) => {
- cy.wrap(count + 1).as('firingCountTest2');
+ it('2. Section 4.7 - Prometheus query end time updates to current time on filter refresh', () => {
+ cy.log('2.1 Navigate to Incidents page and clear filters');
+ incidentsPage.goTo();
+ cy.wait(10000);
+ incidentsPage.clearAllFilters();
+
+ cy.log('2.2 Capture initial page load time');
+ const initialLoadTime = Date.now();
+ cy.wrap(initialLoadTime).as('initialLoadTime');
+
+ cy.log('2.3 Search for and select incident with custom alert');
+ incidentsPage.findIncidentWithAlert(currentAlertName).should('eq', true);
+
+ cy.log('2.4 Verify alert is firing (end time = "---")');
+ cy.wrap(0).as('firingCountTest2');
+
+ incidentsPage
+ .getSelectedIncidentAlerts()
+ .then((alerts) => {
+ expect(alerts.length).to.be.greaterThan(0);
+
+ alerts.forEach((alert) => {
+ alert
+ .getAlertRuleCell()
+ .invoke('text')
+ .then((alertRuleText) => {
+ const cleanAlertName = alertRuleText.trim().replace('AlertRuleAR', '');
+
+ if (cleanAlertName != currentAlertName) {
+ return;
+ }
+
+ alert
+ .getEndCell()
+ .invoke('text')
+ .then((endText) => {
+ const cleanEndText = endText.trim();
+ if (cleanEndText === '---') {
+ cy.get('@firingCountTest2').then((count: any) => {
+ cy.wrap(count + 1).as('firingCountTest2');
+ });
+ }
+ });
});
- }
+ });
+ })
+ .then(() => {
+ cy.get('@firingCountTest2').then((count: any) => {
+ expect(count).to.be.greaterThan(
+ 0,
+ `Expected at least 1 firing alert for ${currentAlertName}`,
+ );
});
});
- });
- }).then(() => {
- cy.get('@firingCountTest2').then((count: any) => {
- expect(count).to.be.greaterThan(0, `Expected at least 1 firing alert for ${currentAlertName}`);
- });
- });
-
- cy.log('Verified: Alert initially shows firing state');
-
- const waitMinutes = 11;
- const REFRESH_FREQUENCY = 300;
-
- cy.log(`2.5 Wait ${waitMinutes} minutes without refreshing incidents`);
- cy.wait(waitMinutes * 60_000);
-
- cy.log('2.6 Set up intercept to capture Prometheus query parameters');
- const queryEndTimes: number[] = [];
- cy.intercept('GET', '**/api/prometheus/api/v1/query_range*', (req) => {
- req.continue((res) => {
- const queryParams = new URLSearchParams(req.url.split('?')[1]);
- const endTimeParam = queryParams.get('end');
- if (endTimeParam) {
- queryEndTimes.push(parseFloat(endTimeParam));
+
+ cy.log('Verified: Alert initially shows firing state');
+
+ const waitMinutes = 11;
+ const REFRESH_FREQUENCY = 300;
+
+ cy.log(`2.5 Wait ${waitMinutes} minutes without refreshing incidents`);
+ cy.wait(waitMinutes * 60_000);
+
+ cy.log('2.6 Set up intercept to capture Prometheus query parameters');
+ const queryEndTimes: number[] = [];
+ cy.intercept('GET', '**/api/prometheus/api/v1/query_range*', (req) => {
+ req.continue(() => {
+ const queryParams = new URLSearchParams(req.url.split('?')[1]);
+ const endTimeParam = queryParams.get('end');
+ if (endTimeParam) {
+ queryEndTimes.push(parseFloat(endTimeParam));
+ }
+ });
+ }).as('prometheusQuery');
+
+ cy.log('2.7 Refresh the days filter to trigger new Prometheus queries');
+ incidentsPage.setDays('7 days');
+
+ cy.log('2.8 Wait for all Prometheus queries to complete');
+ cy.wait(2000);
+
+ cy.wrap(null).then(() => {
+ cy.log(`Captured ${queryEndTimes.length} Prometheus queries`);
+
+ if (queryEndTimes.length > 0) {
+ const mostRecentEndTime = Math.max(...queryEndTimes);
+ const oldestEndTime = Math.min(...queryEndTimes);
+ const currentTime = Date.now() / 1000;
+ const timeDifference = Math.abs(currentTime - mostRecentEndTime);
+
+ cy.log(`Query end times range: ${oldestEndTime} to ${mostRecentEndTime}`);
+ cy.log(
+ `Current time: ${currentTime}, Most recent query end time: ` +
+ `${mostRecentEndTime}, Difference: ${timeDifference}s`,
+ );
+
+ cy.get('@initialLoadTime').then((initialTime: any) => {
+ const initialTimeSeconds = initialTime / 1000;
+ const timePassedSinceLoad = currentTime - initialTimeSeconds;
+
+ cy.log(`Time passed since initial load: ${timePassedSinceLoad}s`);
+
+ expect(timeDifference).to.be.lessThan(
+ REFRESH_FREQUENCY,
+ `Most recent end time should be close to current time ` +
+ `(within ${REFRESH_FREQUENCY} seconds)`,
+ );
+
+ expect(mostRecentEndTime).to.be.greaterThan(
+ initialTimeSeconds + waitMinutes * 60 - REFRESH_FREQUENCY,
+ `End time should be updated to current time, not cached from initial load ` +
+ `(${waitMinutes} minutes ago)`,
+ );
+ });
+
+ cy.log(
+ 'Verified: Most recent end time parameter uses current time, not cached initial load time',
+ );
+ } else {
+ throw new Error('No Prometheus queries were captured');
}
});
- }).as('prometheusQuery');
-
- cy.log('2.7 Refresh the days filter to trigger new Prometheus queries');
- incidentsPage.setDays('7 days');
-
- cy.log('2.8 Wait for all Prometheus queries to complete');
- cy.wait(2000);
-
- cy.wrap(null).then(() => {
- cy.log(`Captured ${queryEndTimes.length} Prometheus queries`);
-
-
- if (queryEndTimes.length > 0) {
- const mostRecentEndTime = Math.max(...queryEndTimes);
- const oldestEndTime = Math.min(...queryEndTimes);
- const currentTime = Date.now() / 1000;
- const timeDifference = Math.abs(currentTime - mostRecentEndTime);
-
- cy.log(`Query end times range: ${oldestEndTime} to ${mostRecentEndTime}`);
- cy.log(`Current time: ${currentTime}, Most recent query end time: ${mostRecentEndTime}, Difference: ${timeDifference}s`);
-
- cy.get('@initialLoadTime').then((initialTime: any) => {
- const initialTimeSeconds = initialTime / 1000;
- const timePassedSinceLoad = currentTime - initialTimeSeconds;
-
- cy.log(`Time passed since initial load: ${timePassedSinceLoad}s`);
-
- expect(timeDifference).to.be.lessThan(REFRESH_FREQUENCY,
- `Most recent end time should be close to current time (within ${REFRESH_FREQUENCY} seconds)`);
-
- expect(mostRecentEndTime).to.be.greaterThan(initialTimeSeconds + (waitMinutes * 60) - REFRESH_FREQUENCY,
- `End time should be updated to current time, not cached from initial load (${waitMinutes} minutes ago)`);
- });
-
- cy.log('Verified: Most recent end time parameter uses current time, not cached initial load time');
- } else {
- throw new Error('No Prometheus queries were captured');
- }
});
- });
-
- it('3. Verify alert lifecycle - alert continues firing throughout test', () => {
- cy.log('3.1 Navigate to Incidents page');
- incidentsPage.goTo();
- cy.wait(10000);
- incidentsPage.clearAllFilters();
-
- cy.log('3.2 Search for and select incident with custom alert');
- incidentsPage.findIncidentWithAlert(currentAlertName).should('eq', true);
-
- cy.log('3.3 Verify end time shows "---" for firing alert');
- cy.wrap(0).as('firingCountTest3');
-
- incidentsPage.getSelectedIncidentAlerts().then((alerts) => {
- expect(alerts.length).to.be.greaterThan(0);
-
- alerts.forEach((alert, index) => {
- alert.getAlertRuleCell().invoke('text').then((alertRuleText) => {
- const cleanAlertName = alertRuleText.trim().replace("AlertRuleAR", "");
-
- if (cleanAlertName != currentAlertName) {
- return;
- }
-
- alert.getEndCell().invoke('text').then((endText) => {
- const cleanEndText = endText.trim();
- if (cleanEndText === '---') {
- cy.get('@firingCountTest3').then((count: any) => {
- cy.wrap(count + 1).as('firingCountTest3');
+
+ it('3. Verify alert lifecycle - alert continues firing throughout test', () => {
+ cy.log('3.1 Navigate to Incidents page');
+ incidentsPage.goTo();
+ cy.wait(10000);
+ incidentsPage.clearAllFilters();
+
+ cy.log('3.2 Search for and select incident with custom alert');
+ incidentsPage.findIncidentWithAlert(currentAlertName).should('eq', true);
+
+ cy.log('3.3 Verify end time shows "---" for firing alert');
+ cy.wrap(0).as('firingCountTest3');
+
+ incidentsPage
+ .getSelectedIncidentAlerts()
+ .then((alerts) => {
+ expect(alerts.length).to.be.greaterThan(0);
+
+ alerts.forEach((alert) => {
+ alert
+ .getAlertRuleCell()
+ .invoke('text')
+ .then((alertRuleText) => {
+ const cleanAlertName = alertRuleText.trim().replace('AlertRuleAR', '');
+
+ if (cleanAlertName != currentAlertName) {
+ return;
+ }
+
+ alert
+ .getEndCell()
+ .invoke('text')
+ .then((endText) => {
+ const cleanEndText = endText.trim();
+ if (cleanEndText === '---') {
+ cy.get('@firingCountTest3').then((count: any) => {
+ cy.wrap(count + 1).as('firingCountTest3');
+ });
+ }
+ });
});
- }
+ });
+ })
+ .then(() => {
+ cy.get('@firingCountTest3').then((count: any) => {
+ expect(count).to.be.greaterThan(
+ 0,
+ `Expected at least 1 firing alert for ${currentAlertName}`,
+ );
});
});
- });
- }).then(() => {
- cy.get('@firingCountTest3').then((count: any) => {
- expect(count).to.be.greaterThan(0, `Expected at least 1 firing alert for ${currentAlertName}`);
- });
- });
-
- cy.log('Verified: Alert lifecycle maintained correctly throughout test suite (end time = "---")');
- });
-});
-
+ cy.log(
+ 'Verified: Alert lifecycle maintained correctly throughout test suite (end time = "---")',
+ );
+ });
+ },
+);
diff --git a/web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts b/web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts
index 7fdb531b4..f38dc713d 100644
--- a/web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts
+++ b/web/cypress/e2e/incidents/regression/03.reg_api_calls.cy.ts
@@ -32,7 +32,6 @@ const MP = {
};
describe('Regression: Silences Not Applied Correctly', { tags: ['@incidents'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
});
@@ -50,12 +49,15 @@ describe('Regression: Silences Not Applied Correctly', { tags: ['@incidents'] },
incidentsPage.elements.alertsChartCard().should('be.visible');
if (expectedAlertCount !== undefined) {
- incidentsPage.elements.alertsChartBarsVisiblePaths().should('have.length', expectedAlertCount);
+ incidentsPage.elements
+ .alertsChartBarsVisiblePaths()
+ .should('have.length', expectedAlertCount);
}
};
const verifyAlertOpacity = (alertIndex: number, expectedOpacity: number) => {
- incidentsPage.elements.alertsChartBarsVisiblePaths()
+ incidentsPage.elements
+ .alertsChartBarsVisiblePaths()
.eq(alertIndex)
.then(($bar) => {
cy.log('Bar: ' + $bar);
@@ -65,10 +67,14 @@ describe('Regression: Silences Not Applied Correctly', { tags: ['@incidents'] },
});
};
- const verifyAlertTooltip = (alertIndex: number, expectedTexts: string[], shouldBeSilenced: boolean) => {
+ const verifyAlertTooltip = (
+ alertIndex: number,
+ expectedTexts: string[],
+ shouldBeSilenced: boolean,
+ ) => {
incidentsPage.hoverOverAlertBar(alertIndex);
const tooltip = incidentsPage.elements.alertsChartTooltip().should('be.visible');
- expectedTexts.forEach(text => {
+ expectedTexts.forEach((text) => {
tooltip.should('contain.text', text);
});
tooltip.should(shouldBeSilenced ? 'contain.text' : 'not.contain.text', '(silenced)');
@@ -77,59 +83,60 @@ describe('Regression: Silences Not Applied Correctly', { tags: ['@incidents'] },
cy.log('1.1 Verify all incidents loaded');
incidentsPage.clearAllFilters();
incidentsPage.elements.incidentsChartBarsGroups().should('have.length.greaterThan', 0);
-
+
cy.log('1.2 Select silenced alert incident (PAIR-2-storage-SILENCED)');
selectIncidentAndWaitForAlerts('PAIR-2-shared-alert-name-storage-SILENCED', 1);
-
- cy.log('1.4 Hover over silenced alert and verify tooltip shows (silenced)');
+
+ cy.log('1.3 Hover over silenced alert and verify tooltip shows (silenced)');
verifyAlertTooltip(0, ['SyntheticSharedFiring002'], true);
cy.log('Verified: Silenced alert has opacity 0.3 and tooltip shows (silenced)');
-
- cy.log('1.3 Hover over silenced alert and verify tooltip shows (silenced)');
+ cy.log('1.4 Hover over silenced alert and verify tooltip shows (silenced)');
verifyAlertTooltip(0, ['SyntheticSharedFiring002'], true);
cy.log('Verified: Silenced alert has opacity 0.3 and tooltip shows (silenced)');
-
cy.log('2.0 Deselect incident');
incidentsPage.deselectIncidentByBar();
- cy.log('2.1 Select non-silenced alert incident with same alert name (PAIR-2-network-UNSILENCED)');
+ cy.log(
+ '2.1 Select non-silenced alert incident with same alert name (PAIR-2-network-UNSILENCED)',
+ );
selectIncidentAndWaitForAlerts('PAIR-2-shared-alert-name-network-UNSILENCED', 1);
-
+
cy.log('2.2 Verify non-silenced alert has full opacity 1.0');
verifyAlertOpacity(0, 1.0);
-
+
cy.log('2.3 Hover over non-silenced alert and verify tooltip does not show (silenced)');
verifyAlertTooltip(0, ['SyntheticSharedFiring002'], false);
cy.log('Verified: Non-silenced alert has opacity 1.0 and tooltip does not show (silenced)');
-
cy.log('3.0 Deselect incident');
incidentsPage.deselectIncidentByBar();
cy.log('3.1 Select incident with both silenced and non-silenced alerts (CASE-3)');
- selectIncidentAndWaitForAlerts('CASE-3-shared-alert-single-incident-storage-network-SILENCED-UNSILENCED', 2);
-
+ selectIncidentAndWaitForAlerts(
+ 'CASE-3-shared-alert-single-incident-storage-network-SILENCED-UNSILENCED',
+ 2,
+ );
+
cy.log('3.2 Verify first alert (storage namespace / silenced) has opacity 0.3');
verifyAlertOpacity(0, 0.3);
-
+
cy.log('3.3 Verify second alert (network namespace / non-silenced) has opacity 1.0');
verifyAlertOpacity(1, 1.0);
-
+
cy.log('3.4 Hover over first alert and verify tooltip shows (silenced) with storage');
verifyAlertTooltip(0, ['storage'], true);
-
+
cy.log('3.5 Hover over second alert and verify tooltip shows network without (silenced)');
verifyAlertTooltip(1, ['network'], false);
-
+
cy.log('Verified: Same alert name with different namespaces handled correctly');
cy.log('Verified: Silence matching uses alertname + namespace + severity');
});
});
describe('Regression: Permission Denied Handling', { tags: ['@incidents'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
});
@@ -138,28 +145,37 @@ describe('Regression: Permission Denied Handling', { tags: ['@incidents'] }, ()
cy.log('Mock all API endpoints as 403 Forbidden');
cy.mockPermissionDenied();
cy.log('Navigate to Observe -> Incidents');
- // Using custom navigation commands to avoid waiting for the page to load which never happens in this test
+ // Using custom navigation commands to avoid waiting for the page
+ // to load which never happens in this test
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.tabs.switchTab('Incidents');
-
});
it('Page displays access denied state when all API endpoints return 403 Forbidden', () => {
cy.log('1.1 Verify 403 requests were intercepted');
const waitTimeout = { timeout: 120000 };
cy.wait('@rulesPermissionDenied', waitTimeout)
- .its('response').should('exist')
- .its('statusCode').should('eq', 403);
+ .its('response')
+ .should('exist')
+ .its('statusCode')
+ .should('eq', 403);
cy.wait('@silencesPermissionDenied', waitTimeout)
- .its('response').should('exist')
- .its('statusCode').should('eq', 403);
+ .its('response')
+ .should('exist')
+ .its('statusCode')
+ .should('eq', 403);
cy.wait('@prometheusQueryRangePermissionDenied', waitTimeout)
- .its('response').should('exist')
- .its('statusCode').should('eq', 403);
+ .its('response')
+ .should('exist')
+ .its('statusCode')
+ .should('eq', 403);
cy.log('1.2 Verify access denied empty state is displayed');
cy.byTestID('access-denied').should('be.visible');
- cy.byTestID('access-denied').should('contain.text', 'You don\'t have access to this section due to cluster policy');
+ cy.byTestID('access-denied').should(
+ 'contain.text',
+ "You don't have access to this section due to cluster policy",
+ );
cy.log('Verified: Page displays restricted access state for permission denied');
});
diff --git a/web/cypress/e2e/incidents/regression/04.reg_redux_effects.cy.ts b/web/cypress/e2e/incidents/regression/04.reg_redux_effects.cy.ts
index aa06dd737..9cf510e59 100644
--- a/web/cypress/e2e/incidents/regression/04.reg_redux_effects.cy.ts
+++ b/web/cypress/e2e/incidents/regression/04.reg_redux_effects.cy.ts
@@ -31,7 +31,6 @@ const MP = {
};
describe('Regression: Redux State Management', { tags: ['@incidents', '@incidents-redux'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
});
@@ -43,32 +42,32 @@ describe('Regression: Redux State Management', { tags: ['@incidents', '@incident
it('1. Fresh load should display all 12 incidents without days filter manipulation', () => {
cy.log('1.1 Verify all incidents load immediately on fresh page load');
-
+
incidentsPage.clearAllFilters();
incidentsPage.elements.incidentsChartContainer().should('be.visible');
-
+
// The bug: initially not all incidents are loaded, requiring days filter toggle
// Use waitUntil to give it time to load, but it should load quickly if working properly
cy.waitUntil(
- () => incidentsPage.elements.incidentsChartBarsGroups().then($groups => $groups.length === 12),
+ () =>
+ incidentsPage.elements.incidentsChartBarsGroups().then(($groups) => $groups.length === 12),
{
timeout: 10000,
interval: 500,
- errorMsg: 'All 12 incidents should load within 10 seconds on fresh page load'
- }
+ errorMsg: 'All 12 incidents should load within 10 seconds on fresh page load',
+ },
);
cy.log('SUCCESS: All 12 incidents loaded on fresh page load');
-
+
cy.log('1.2 Verify incident count remains stable without manipulation');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 12);
cy.log('Incident count stable: 12 incidents maintained');
-
+
cy.log('1.3 Verify days filter is set to default value');
incidentsPage.elements.daysSelectToggle().should('contain.text', '7 days');
cy.log('Default days filter confirmed: 7 days');
});
-
it('2. Dropdown should close and not reposition after incident deselection', () => {
const dropdownScenarios = [
{
@@ -91,24 +90,25 @@ describe('Regression: Redux State Management', { tags: ['@incidents', '@incident
setup: () => {},
toggleElement: () => incidentsPage.elements.daysSelectToggle(),
listElement: () => incidentsPage.elements.daysSelectList(),
- }
+ },
];
const deselectionMethods = [
{
name: 'bar click',
action: () => {
- incidentsPage.elements.incidentsChartBarsVisiblePathsNonEmpty()
+ incidentsPage.elements
+ .incidentsChartBarsVisiblePathsNonEmpty()
.first()
.click({ force: true });
- }
+ },
},
{
name: 'chip removal',
action: () => {
incidentsPage.removeFilterCategory('Incident ID');
- }
- }
+ },
+ },
];
incidentsPage.clearAllFilters();
@@ -116,23 +116,24 @@ describe('Regression: Redux State Management', { tags: ['@incidents', '@incident
dropdownScenarios.forEach((dropdown) => {
deselectionMethods.forEach((deselection) => {
cy.log(`Testing: ${dropdown.name} dropdown with ${deselection.name} deselection`);
-
- incidentsPage.elements.incidentsChartBarsVisiblePathsNonEmpty()
+
+ incidentsPage.elements
+ .incidentsChartBarsVisiblePathsNonEmpty()
.first()
.click({ force: true });
-
+
incidentsPage.elements.alertsChartContainer().should('be.visible');
incidentsPage.elements.incidentIdFilterChip().should('be.visible');
-
+
dropdown.setup();
-
+
dropdown.toggleElement().click();
dropdown.listElement().should('be.visible');
-
+
deselection.action();
- cy.wait(2000)
-
+ cy.wait(2000);
+
dropdown.listElement().should('not.exist');
cy.log(`SUCCESS: ${dropdown.name} dropdown closed after ${deselection.name}`);
});
@@ -142,44 +143,47 @@ describe('Regression: Redux State Management', { tags: ['@incidents', '@incident
it('3. Adding filter when incident selected should not remove the incident ID filter', () => {
cy.log('3.1 Clear all filters and ensure critical incidents exist');
incidentsPage.clearAllFilters();
+
cy.log('3.2 Apply critical severity filter');
incidentsPage.toggleFilter('Critical');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length.greaterThan', 0);
-
+
cy.log('3.3 Click on the first critical incident to select it by ID');
- incidentsPage.elements.incidentsChartBarsVisiblePathsNonEmpty()
- .first()
- .click({ force: true });
-
+ incidentsPage.elements.incidentsChartBarsVisiblePathsNonEmpty().first().click({ force: true });
+
cy.log('3.4 Verify incident ID filter chip appears');
incidentsPage.elements.incidentIdFilterChip().should('be.visible');
cy.log('3.5 Verify both Critical and Incident ID chips are present');
incidentsPage.elements.filterChipValue('Critical').should('be.visible');
incidentsPage.elements.incidentIdFilterChip().should('be.visible');
-
- cy.log('3.6 Deselect Critical and Apply Warning filter (which does not match the critical incident)');
+
+ cy.log(
+ '3.6 Deselect Critical and Apply Warning filter (which does not match the critical incident)',
+ );
cy.wait(500);
incidentsPage.toggleFilter('Critical');
incidentsPage.elements.filterChipValue('Critical').should('not.exist');
incidentsPage.toggleFilter('Warning');
-
+
cy.log('3.7 Verify incident is filtered out (no bars visible)');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 0);
cy.log('Incident correctly filtered out due to Warning filter');
-
+
cy.log('3.8 Verify BOTH Warning filter and Incident ID filter are still applied');
incidentsPage.elements.filterChipValue('Warning').should('be.visible');
incidentsPage.elements.incidentIdFilterChip().should('be.visible');
-
- cy.log('SUCCESS: Incident ID filter was not removed when non-matching severity filter was added');
-
+
+ cy.log(
+ 'SUCCESS: Incident ID filter was not removed when non-matching severity filter was added',
+ );
+
cy.log('3.9 Remove Warning filter and verify incident reappears');
// Legacy path for quick rollback:
// incidentsPage.toggleFilter('Warning');
incidentsPage.deselectFilterValue('Warning');
-
+
cy.log('3.10 With only Incident ID filter, incident should be visible again');
incidentsPage.elements.incidentsChartBarsGroups().should('have.length', 1);
incidentsPage.elements.incidentIdFilterChip().should('be.visible');
diff --git a/web/cypress/e2e/incidents/regression/05.reg_stress_testing_ui.cy.ts b/web/cypress/e2e/incidents/regression/05.reg_stress_testing_ui.cy.ts
index 47bc455d7..7ca34bba9 100644
--- a/web/cypress/e2e/incidents/regression/05.reg_stress_testing_ui.cy.ts
+++ b/web/cypress/e2e/incidents/regression/05.reg_stress_testing_ui.cy.ts
@@ -32,7 +32,6 @@ const MAX_GAP_STANDARD = 250;
const MAX_GAP_RELAXED = 500;
describe('Regression: Stress Testing UI', { tags: ['@incidents'] }, () => {
-
before(() => {
cy.beforeBlockCOO(MCP, MP, { dashboards: false, troubleshootingPanel: false });
});
@@ -42,7 +41,7 @@ describe('Regression: Stress Testing UI', { tags: ['@incidents'] }, () => {
fixtureFile: string,
incidentId: string,
maxGap: number,
- label: string
+ label: string,
) => {
cy.mockIncidentFixture(`incident-scenarios/${fixtureFile}`);
incidentsPage.clearAllFilters();
@@ -52,19 +51,23 @@ describe('Regression: Stress Testing UI', { tags: ['@incidents'] }, () => {
incidentsPage.selectIncidentById(incidentId);
incidentsPage.elements.alertsChartCard().should('be.visible');
- incidentsPage.elements.alertsChartBarsVisiblePaths()
- .should('have.length.greaterThan', 0);
+ incidentsPage.elements.alertsChartBarsVisiblePaths().should('have.length.greaterThan', 0);
incidentsPage.elements.alertsChartContainer().first().scrollIntoView();
- incidentsPage.elements.alertsChartContainer().first().then(($container) => {
- const containerTop = $container[0].getBoundingClientRect().top;
- incidentsPage.getAlertBarRect(0).then((barRect) => {
- const gap = barRect.top - containerTop;
- cy.log(`${label}: Gap between container top and first alert bar = ${gap}px`);
- expect(gap, `${label}: first alert bar should start near chart top`).to.be.lessThan(maxGap);
- expect(gap, `${label}: gap should be non-negative`).to.be.at.least(0);
+ incidentsPage.elements
+ .alertsChartContainer()
+ .first()
+ .then(($container) => {
+ const containerTop = $container[0].getBoundingClientRect().top;
+ incidentsPage.getAlertBarRect(0).then((barRect) => {
+ const gap = barRect.top - containerTop;
+ cy.log(`${label}: Gap between container top and first alert bar = ${gap}px`);
+ expect(gap, `${label}: first alert bar should start near chart top`).to.be.lessThan(
+ maxGap,
+ );
+ expect(gap, `${label}: gap should be non-negative`).to.be.at.least(0);
+ });
});
- });
};
cy.log('5.1.1 Verify no excessive padding with 100 alerts');
@@ -72,7 +75,7 @@ describe('Regression: Stress Testing UI', { tags: ['@incidents'] }, () => {
'15-stress-test-100-alerts.yaml',
'cluster-wide-failure-100-alerts',
MAX_GAP_STANDARD,
- '100 alerts'
+ '100 alerts',
);
cy.log('5.1.2 Verify no excessive padding with 200 alerts');
@@ -80,7 +83,7 @@ describe('Regression: Stress Testing UI', { tags: ['@incidents'] }, () => {
'16-stress-test-200-alerts.yaml',
'cluster-wide-failure-200-alerts',
MAX_GAP_STANDARD,
- '200 alerts'
+ '200 alerts',
);
cy.log('5.1.3 Verify accepted limitation with 500 alerts (relaxed threshold)');
@@ -88,7 +91,7 @@ describe('Regression: Stress Testing UI', { tags: ['@incidents'] }, () => {
'17-stress-test-500-alerts.yaml',
'cluster-wide-failure-500-alerts',
MAX_GAP_RELAXED,
- '500 alerts'
+ '500 alerts',
);
cy.log('Verified: Alert bars have no excessive padding for 100, 200, and 500 alerts');
diff --git a/web/cypress/e2e/monitoring/00.bvt_admin.cy.ts b/web/cypress/e2e/monitoring/00.bvt_admin.cy.ts
index 6ef745739..b082cab6b 100644
--- a/web/cypress/e2e/monitoring/00.bvt_admin.cy.ts
+++ b/web/cypress/e2e/monitoring/00.bvt_admin.cy.ts
@@ -10,7 +10,6 @@ const MP = {
};
describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
-
before(() => {
cy.beforeBlock(MP);
});
@@ -18,7 +17,7 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
beforeEach(() => {
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
+ cy.changeNamespace('All Projects');
alerts.getWatchdogAlert();
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
commonPages.titleShouldHaveText('Alerting');
@@ -38,10 +37,9 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
commonPages.titleShouldHaveText('Dashboards');
nav.sidenav.clickNavLink(['Observe', 'Targets']);
commonPages.titleShouldHaveText('Metrics targets');
-
-
});
- // TODO: Intercept Bell GET request to inject an alert (Watchdog to have it opened in Alert Details page?)
+ // TODO: Intercept Bell GET request to inject an alert (Watchdog to have it opened in
+ // Alert Details page?)
// it('Admin perspective - Bell > Alert details > Alerting rule details > Metrics flow', () => {
// cy.visit('/');
// commonPages.clickBellIcon();
@@ -50,14 +48,14 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
// });
-
it(`2. Admin perspective - Overview Page > Status - View alerts`, () => {
nav.sidenav.clickNavLink(['Home', 'Overview']);
overviewPage.clickStatusViewAlerts();
commonPages.titleShouldHaveText('Alerting');
});
- //TODO: Intercept and inject a valid alert into status-card to be opened correctly to Alerting / Alerts page
+ // TODO: Intercept and inject a valid alert into status-card to be opened correctly to Alerting /
+ // Alerts page
// I couldn't make Watchdog working on status-card
// it('3. Admin perspective - Overview Page > Status - View details', () => {
// cy.visit('/');
@@ -77,5 +75,4 @@ describe('BVT: Monitoring', { tags: ['@smoke', '@monitoring'] }, () => {
runBVTMonitoringTests({
name: 'Administrator',
});
-
-});
\ No newline at end of file
+});
diff --git a/web/cypress/e2e/monitoring/00.bvt_dev.cy.ts b/web/cypress/e2e/monitoring/00.bvt_dev.cy.ts
index 6a5064b93..a5b66eb9e 100644
--- a/web/cypress/e2e/monitoring/00.bvt_dev.cy.ts
+++ b/web/cypress/e2e/monitoring/00.bvt_dev.cy.ts
@@ -9,7 +9,6 @@ const MP = {
};
describe('BVT: Monitoring - Namespaced', { tags: ['@monitoring-dev', '@smoke-dev'] }, () => {
-
before(() => {
cy.beforeBlock(MP);
});
@@ -23,8 +22,7 @@ describe('BVT: Monitoring - Namespaced', { tags: ['@monitoring-dev', '@smoke-dev
});
// Run tests in Administrator perspective
- runBVTMonitoringTestsNamespace({
+ runBVTMonitoringTestsNamespace({
name: 'Administrator',
});
-
-});
\ No newline at end of file
+});
diff --git a/web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts b/web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts
index b8e8176dd..091775529 100644
--- a/web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts
+++ b/web/cypress/e2e/monitoring/regression/01.reg_alerts_admin.cy.ts
@@ -9,27 +9,27 @@ const MP = {
};
// Test suite for Administrator perspective
-describe('Regression: Monitoring - Alerts (Administrator)', { tags: ['@monitoring', '@alerts'] }, () => {
-
- before(() => {
- cy.beforeBlock(MP);
- });
-
- beforeEach(() => {
- alerts.getWatchdogAlert();
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- commonPages.titleShouldHaveText('Alerting');
- alerts.getWatchdogAlert();
- });
-
- // Run tests in Administrator perspective
- runAllRegressionAlertsTests({
- name: 'Administrator',
- });
-
-});
-
-
+describe(
+ 'Regression: Monitoring - Alerts (Administrator)',
+ { tags: ['@monitoring', '@alerts'] },
+ () => {
+ before(() => {
+ cy.beforeBlock(MP);
+ });
+
+ beforeEach(() => {
+ alerts.getWatchdogAlert();
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace('All Projects');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ commonPages.titleShouldHaveText('Alerting');
+ alerts.getWatchdogAlert();
+ });
+
+ // Run tests in Administrator perspective
+ runAllRegressionAlertsTests({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts b/web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts
index f0ad628f0..55e27bcb0 100644
--- a/web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts
+++ b/web/cypress/e2e/monitoring/regression/01.reg_alerts_dev.cy.ts
@@ -8,8 +8,10 @@ const MP = {
operatorName: 'Cluster Monitoring Operator',
};
-describe('Regression: Monitoring - Alerts Namespaced (Administrator)', { tags: ['@monitoring-dev', '@alerts-dev'] }, () => {
-
+describe(
+ 'Regression: Monitoring - Alerts Namespaced (Administrator)',
+ { tags: ['@monitoring-dev', '@alerts-dev'] },
+ () => {
before(() => {
cy.beforeBlock(MP);
});
@@ -21,11 +23,10 @@ describe('Regression: Monitoring - Alerts Namespaced (Administrator)', { tags: [
alerts.getWatchdogAlert();
cy.changeNamespace(MP.namespace);
});
-
+
// Run tests in Administrator perspective
runAllRegressionAlertsTestsNamespace({
name: 'Administrator',
});
-
-});
-
+ },
+);
diff --git a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts b/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts
index 4c01c2dbe..7e710abbd 100644
--- a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts
+++ b/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_1.cy.ts
@@ -9,42 +9,45 @@ const MP = {
};
// Test suite for Administrator perspective
-describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@monitoring', '@metrics'] }, () => {
-
- before(() => {
- cy.beforeBlock(MP);
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
- });
-
- // Run tests in Administrator perspective
- runAllRegressionMetricsTests1({
- name: 'Administrator',
- });
-
-});
+describe(
+ 'Regression: Monitoring - Metrics (Administrator)',
+ { tags: ['@monitoring', '@metrics'] },
+ () => {
+ before(() => {
+ cy.beforeBlock(MP);
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace('All Projects');
+ });
+
+ // Run tests in Administrator perspective
+ runAllRegressionMetricsTests1({
+ name: 'Administrator',
+ });
+ },
+);
// Test suite for Administrator perspective
-describe('Regression: Monitoring - Metrics Namespaced (Administrator)', { tags: ['@monitoring', '@metrics'] }, () => {
-
- before(() => {
- cy.beforeBlock(MP);
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace(MP.namespace);
- });
-
- // Run tests in Administrator perspective
- runAllRegressionMetricsTestsNamespace1({
- name: 'Administrator',
- });
-
-});
-
+describe(
+ 'Regression: Monitoring - Metrics Namespaced (Administrator)',
+ { tags: ['@monitoring', '@metrics'] },
+ () => {
+ before(() => {
+ cy.beforeBlock(MP);
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace(MP.namespace);
+ });
+
+ // Run tests in Administrator perspective
+ runAllRegressionMetricsTestsNamespace1({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts b/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts
index 6b15d73f2..82e1672af 100644
--- a/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts
+++ b/web/cypress/e2e/monitoring/regression/02.reg_metrics_admin_2.cy.ts
@@ -9,42 +9,45 @@ const MP = {
};
// Test suite for Administrator perspective
-describe('Regression: Monitoring - Metrics (Administrator)', { tags: ['@monitoring', '@metrics'] }, () => {
-
- before(() => {
- cy.beforeBlock(MP);
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
- });
-
- // Run tests in Administrator perspective
- runAllRegressionMetricsTests2({
- name: 'Administrator',
- });
-
-});
+describe(
+ 'Regression: Monitoring - Metrics (Administrator)',
+ { tags: ['@monitoring', '@metrics'] },
+ () => {
+ before(() => {
+ cy.beforeBlock(MP);
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace('All Projects');
+ });
+
+ // Run tests in Administrator perspective
+ runAllRegressionMetricsTests2({
+ name: 'Administrator',
+ });
+ },
+);
// Test suite for Administrator perspective
-describe('Regression: Monitoring - Metrics Namespaced (Administrator)', { tags: ['@monitoring', '@metrics'] }, () => {
-
- before(() => {
- cy.beforeBlock(MP);
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace(MP.namespace);
- });
-
- // Run tests in Administrator perspective
- runAllRegressionMetricsTestsNamespace2({
- name: 'Administrator',
- });
-
-});
-
+describe(
+ 'Regression: Monitoring - Metrics Namespaced (Administrator)',
+ { tags: ['@monitoring', '@metrics'] },
+ () => {
+ before(() => {
+ cy.beforeBlock(MP);
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace(MP.namespace);
+ });
+
+ // Run tests in Administrator perspective
+ runAllRegressionMetricsTestsNamespace2({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts b/web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts
index 795b2e9a8..5439930a9 100644
--- a/web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts
+++ b/web/cypress/e2e/monitoring/regression/03.reg_legacy_dashboards_admin.cy.ts
@@ -9,46 +9,51 @@ const MP = {
};
// Test suite for Administrator perspective
-describe('Regression: Monitoring - Legacy Dashboards (Administrator)', { tags: ['@monitoring', '@dashboards'] }, () => {
-
- before(() => {
- cy.beforeBlock(MP);
- });
-
- beforeEach(() => {
- //when running only this file, beforeBlock changes the namespace to openshift-monitoring
- //so we need to change it back to All Projects before landing to Dashboards page in order to have API Performance dashboard loaded by default
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- commonPages.titleShouldHaveText('Dashboards');
- cy.changeNamespace("All Projects");
- });
-
- // Run tests in Administrator perspective
- runAllRegressionLegacyDashboardsTests({
- name: 'Administrator',
- });
-
-});
+describe(
+ 'Regression: Monitoring - Legacy Dashboards (Administrator)',
+ { tags: ['@monitoring', '@dashboards'] },
+ () => {
+ before(() => {
+ cy.beforeBlock(MP);
+ });
+
+ beforeEach(() => {
+ // When running only this file, beforeBlock changes the namespace to openshift-monitoring so
+ // we need to change it back to All Projects before landing to Dashboards page in order to
+ // have API Performance dashboard loaded by default
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace('All Projects');
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ commonPages.titleShouldHaveText('Dashboards');
+ cy.changeNamespace('All Projects');
+ });
+
+ // Run tests in Administrator perspective
+ runAllRegressionLegacyDashboardsTests({
+ name: 'Administrator',
+ });
+ },
+);
// Test suite for Administrator perspective
-describe('Regression: Monitoring - Legacy Dashboards Namespaced (Administrator)', { tags: ['@monitoring', '@dashboards'] }, () => {
-
- before(() => {
- cy.beforeBlock(MP);
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- commonPages.titleShouldHaveText('Dashboards');
- cy.changeNamespace(MP.namespace);
- });
-
- // Run tests in Administrator perspective
- runAllRegressionLegacyDashboardsTestsNamespace({
- name: 'Administrator',
- });
-
-});
+describe(
+ 'Regression: Monitoring - Legacy Dashboards Namespaced (Administrator)',
+ { tags: ['@monitoring', '@dashboards'] },
+ () => {
+ before(() => {
+ cy.beforeBlock(MP);
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ commonPages.titleShouldHaveText('Dashboards');
+ cy.changeNamespace(MP.namespace);
+ });
+
+ // Run tests in Administrator perspective
+ runAllRegressionLegacyDashboardsTestsNamespace({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/00.coo_bvt_perses_admin.cy.ts b/web/cypress/e2e/perses/00.coo_bvt_perses_admin.cy.ts
index 8fe7a7b8f..b3638e894 100644
--- a/web/cypress/e2e/perses/00.coo_bvt_perses_admin.cy.ts
+++ b/web/cypress/e2e/perses/00.coo_bvt_perses_admin.cy.ts
@@ -1,6 +1,6 @@
import { nav } from '../../views/nav';
-import { runBVTCOOPersesTests } from '../../support/perses/00.coo_bvt_perses_admin.cy';
-import { guidedTour } from '../../views/tour';
+//TODO: rename after customizable-dashboards gets merged
+import { runBVTCOOPersesTests1 } from '../../support/perses/00.coo_bvt_perses_admin.cy';
// Set constants for the operators that need to be installed for tests.
const MCP = {
@@ -18,18 +18,23 @@ const MP = {
operatorName: 'Cluster Monitoring Operator',
};
-describe('BVT: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke', '@dashboards', '@perses'] }, () => {
+//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
+describe(
+ 'BVT: COO - Dashboards (Perses) - Administrator perspective',
+ { tags: ['@smoke', '@dashboards', '@perses'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ cy.cleanupPersesTestDashboardsBeforeTests();
+ });
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ });
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
-
- runBVTCOOPersesTests({
- name: 'Administrator',
- });
-
-});
\ No newline at end of file
+ //TODO: rename after customizable-dashboards gets merged
+ runBVTCOOPersesTests1({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/00.coo_bvt_perses_admin_1.cy.ts b/web/cypress/e2e/perses/00.coo_bvt_perses_admin_1.cy.ts
deleted file mode 100644
index 0e2c05032..000000000
--- a/web/cypress/e2e/perses/00.coo_bvt_perses_admin_1.cy.ts
+++ /dev/null
@@ -1,38 +0,0 @@
-import { nav } from '../../views/nav';
-//TODO: rename after customizable-dashboards gets merged
-import { runBVTCOOPersesTests1 } from '../../support/perses/00.coo_bvt_perses_admin_1.cy';
-
-// Set constants for the operators that need to be installed for tests.
-const MCP = {
- namespace: 'openshift-cluster-observability-operator',
- packageName: 'cluster-observability-operator',
- operatorName: 'Cluster Observability Operator',
- config: {
- kind: 'UIPlugin',
- name: 'monitoring',
- },
-};
-
-const MP = {
- namespace: 'openshift-monitoring',
- operatorName: 'Cluster Monitoring Operator',
-};
-
-//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
-describe('BVT: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke-', '@dashboards-', '@perses-'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- cy.cleanupPersesTestDashboardsBeforeTests();
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
-
- //TODO: rename after customizable-dashboards gets merged
- runBVTCOOPersesTests1({
- name: 'Administrator',
- });
-
-});
\ No newline at end of file
diff --git a/web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts b/web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts
index 7517a88a4..fcb7c5ff7 100644
--- a/web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts
+++ b/web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts
@@ -1,5 +1,8 @@
import { nav } from '../../views/nav';
-import { runCOOListPersesDuplicateDashboardTests, runCOOListPersesTests } from '../../support/perses/01.coo_list_perses_admin.cy';
+import {
+ runCOOListPersesDuplicateDashboardTests,
+ runCOOListPersesTests,
+} from '../../support/perses/01.coo_list_perses_admin.cy';
import { runCOOListPersesTestsNamespace } from '../../support/perses/01.coo_list_perses_admin_namespace.cy';
// Set constants for the operators that need to be installed for tests.
@@ -19,45 +22,49 @@ const MP = {
};
//TODO: change tag to @dashboards when customizable-dashboards gets merged
-describe('COO - Dashboards (Perses) - List perses dashboards', { tags: ['@perses', '@dashboards-'] }, () => {
+describe(
+ 'COO - Dashboards (Perses) - List perses dashboards',
+ { tags: ['@perses', '@dashboards'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ cy.cleanupPersesTestDashboardsBeforeTests();
+ });
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- cy.cleanupPersesTestDashboardsBeforeTests();
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ cy.wait(5000);
+ cy.changeNamespace('All Projects');
+ });
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.wait(5000);
- cy.changeNamespace('All Projects');
- });
+ runCOOListPersesTests({
+ name: 'Administrator',
+ });
- runCOOListPersesTests({
- name: 'Administrator',
- });
-
- runCOOListPersesDuplicateDashboardTests({
- name: 'Administrator',
- });
-
-});
+ runCOOListPersesDuplicateDashboardTests({
+ name: 'Administrator',
+ });
+ },
+);
//TODO: change tag to @dashboards when customizable-dashboards gets merged
-describe('COO - Dashboards (Perses) - List perses dashboards - Namespace', { tags: ['@perses', '@dashboards-'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- cy.cleanupPersesTestDashboardsBeforeTests();
- });
+describe(
+ 'COO - Dashboards (Perses) - List perses dashboards - Namespace',
+ { tags: ['@perses', '@dashboards'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ cy.cleanupPersesTestDashboardsBeforeTests();
+ });
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.changeNamespace('All Projects');
- });
-
- runCOOListPersesTestsNamespace({
- name: 'Administrator',
- });
-
-});
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ cy.wait(5000);
+ cy.changeNamespace('All Projects');
+ });
+ runCOOListPersesTestsNamespace({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/02.coo_edit_perses_admin.cy.ts b/web/cypress/e2e/perses/02.coo_edit_perses_admin.cy.ts
index ccb4bc70a..f3cd4e882 100644
--- a/web/cypress/e2e/perses/02.coo_edit_perses_admin.cy.ts
+++ b/web/cypress/e2e/perses/02.coo_edit_perses_admin.cy.ts
@@ -19,28 +19,27 @@ const MP = {
};
//TODO: change tag to @dashboards when customizable-dashboards gets merged
-describe('COO - Dashboards (Perses) - Edit perses dashboard', { tags: ['@perses', '@dashboards-'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- cy.cleanupPersesTestDashboardsBeforeTests();
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.wait(5000);
- cy.changeNamespace('All Projects');
- });
-
- runCOOEditPersesTests({
- name: 'Administrator',
- });
-
- runCOOEditPersesTests1({
- name: 'Administrator',
- });
-
-});
-
-
-
+describe(
+ 'COO - Dashboards (Perses) - Edit perses dashboard',
+ { tags: ['@perses', '@dashboards'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ cy.cleanupPersesTestDashboardsBeforeTests();
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ cy.wait(5000);
+ cy.changeNamespace('All Projects');
+ });
+
+ runCOOEditPersesTests({
+ name: 'Administrator',
+ });
+
+ runCOOEditPersesTests1({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/03.coo_create_perses_admin.cy.ts b/web/cypress/e2e/perses/03.coo_create_perses_admin.cy.ts
index 54f2e0efb..05d22f7d7 100644
--- a/web/cypress/e2e/perses/03.coo_create_perses_admin.cy.ts
+++ b/web/cypress/e2e/perses/03.coo_create_perses_admin.cy.ts
@@ -18,29 +18,28 @@ const MP = {
};
//TODO: change tag to @dashboards when customizable-dashboards gets merged
-describe('COO - Dashboards (Perses) - Create perses dashboard', { tags: ['@perses', '@dashboards-'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- cy.cleanupPersesTestDashboardsBeforeTests();
- cy.setupPersesRBACandExtraDashboards();
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.wait(5000);
- cy.changeNamespace('All Projects');
- });
-
- after(() => {
- cy.cleanupExtraDashboards();
- });
-
- runCOOCreatePersesTests({
- name: 'Administrator',
- });
-
-});
-
-
-
+describe(
+ 'COO - Dashboards (Perses) - Create perses dashboard',
+ { tags: ['@perses', '@dashboards'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ cy.cleanupPersesTestDashboardsBeforeTests();
+ cy.setupPersesRBACandExtraDashboards();
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ cy.wait(5000);
+ cy.changeNamespace('All Projects');
+ });
+
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
+
+ runCOOCreatePersesTests({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/04.coo_import_perses_admin.cy.ts b/web/cypress/e2e/perses/04.coo_import_perses_admin.cy.ts
index cdf4778c9..0770a1456 100644
--- a/web/cypress/e2e/perses/04.coo_import_perses_admin.cy.ts
+++ b/web/cypress/e2e/perses/04.coo_import_perses_admin.cy.ts
@@ -18,29 +18,28 @@ const MP = {
};
//TODO: change tag to @dashboards when customizable-dashboards gets merged
-describe('COO - Dashboards (Perses) - Import perses dashboard', { tags: ['@perses', '@dashboards-'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- cy.cleanupPersesTestDashboardsBeforeTests();
- cy.setupPersesRBACandExtraDashboards();
- });
-
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.wait(5000);
- cy.changeNamespace('All Projects');
- });
-
- after(() => {
- cy.cleanupExtraDashboards();
- });
-
- runCOOImportPersesTests({
- name: 'Administrator',
- });
-
-});
-
-
-
+describe(
+ 'COO - Dashboards (Perses) - Import perses dashboard',
+ { tags: ['@perses', '@dashboards'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ cy.cleanupPersesTestDashboardsBeforeTests();
+ cy.setupPersesRBACandExtraDashboards();
+ });
+
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ cy.wait(5000);
+ cy.changeNamespace('All Projects');
+ });
+
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
+
+ runCOOImportPersesTests({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts b/web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts
index 50f576fb7..8c9806738 100644
--- a/web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts
+++ b/web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts
@@ -1,7 +1,6 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser1 } from '../../support/perses/99.coo_rbac_perses_user1.cy';
-
// Set constants for the operators that need to be installed for tests.
const MCP = {
namespace: 'openshift-cluster-observability-operator',
@@ -19,60 +18,66 @@ const MP = {
};
//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
-describe('RBAC User1: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke-', '@dashboards-', '@perses-dev'] }, () => {
-
- before(() => {
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
- // cy.log('Granting temporary cluster-admin role to dev user for setup');
- // cy.adminCLI(
- // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+describe(
+ 'RBAC User1: COO - Dashboards (Perses) - Administrator perspective',
+ { tags: ['@perses', '@perses-dev'] },
+ () => {
+ before(() => {
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
+ // cy.log('Granting temporary cluster-admin role to dev user for setup');
+ // cy.adminCLI(
+ // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 2: Setup COO and Perses dashboards (requires admin privileges)
- cy.beforeBlockCOO(MCP, MP);
- cy.setupPersesRBACandExtraDashboards();
+ // Step 2: Setup COO and Perses dashboards (requires admin privileges)
+ cy.beforeBlockCOO(MCP, MP);
+ cy.setupPersesRBACandExtraDashboards();
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 3: Remove cluster-admin role - dev user now has limited permissions
- // cy.log('Removing cluster-admin role from dev user');
- // cy.adminCLI(
- // `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 3: Remove cluster-admin role - dev user now has limited permissions
+ // cy.log('Removing cluster-admin role from dev user');
+ // cy.adminCLI(
+ // `oc adm policy remove-cluster-role-from-user cluster-admin ` +
+ // `${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 4: Clear Cypress session cache and logout
- // This is critical because beforeBlockCOO uses cy.session() which caches the login state
- cy.log('Clearing Cypress session cache to ensure fresh login');
- Cypress.session.clearAllSavedSessions();
-
- // Clear all cookies and storage to fully reset browser state
- cy.clearAllCookies();
- cy.clearAllLocalStorage();
- cy.clearAllSessionStorage();
+ // Step 4: Clear Cypress session cache and logout
+ // This is critical because beforeBlockCOO uses cy.session() which caches the login state
+ cy.log('Clearing Cypress session cache to ensure fresh login');
+ cy.then(() => {
+ Cypress.session.clearAllSavedSessions();
+ });
- // Step 5: Re-login as dev user (now without cluster-admin role)
- // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
- cy.log('Re-logging in as dev user with limited permissions');
- cy.relogin(
- Cypress.env('LOGIN_IDP_DEV_USER'),
- Cypress.env('LOGIN_USERNAME1'),
- Cypress.env('LOGIN_PASSWORD1'),
- );
- cy.validateLogin();
- cy.closeOnboardingModalIfPresent();
- });
+ // Clear all cookies and storage to fully reset browser state
+ cy.clearAllCookies();
+ cy.clearAllLocalStorage();
+ cy.clearAllSessionStorage();
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
+ // Step 5: Re-login as dev user (now without cluster-admin role)
+ // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
+ cy.log('Re-logging in as dev user with limited permissions');
+ cy.relogin(
+ Cypress.env('LOGIN_IDP_DEV_USER'),
+ Cypress.env('LOGIN_USERNAME1'),
+ Cypress.env('LOGIN_PASSWORD1'),
+ );
+ cy.validateLogin();
+ cy.closeOnboardingModalIfPresent();
+ });
- after(() => {
- cy.cleanupExtraDashboards();
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ });
- //TODO: rename after customizable-dashboards gets merged
- runCOORBACPersesTestsDevUser1({
- name: 'Administrator',
- });
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
-});
\ No newline at end of file
+ //TODO: rename after customizable-dashboards gets merged
+ runCOORBACPersesTestsDevUser1({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts b/web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts
index 884933c3d..24b9b901e 100644
--- a/web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts
+++ b/web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts
@@ -1,7 +1,6 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser2 } from '../../support/perses/99.coo_rbac_perses_user2.cy';
-
// Set constants for the operators that need to be installed for tests.
const MCP = {
namespace: 'openshift-cluster-observability-operator',
@@ -19,61 +18,67 @@ const MP = {
};
//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
-describe('RBAC User2: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke-', '@dashboards-', '@perses-dev'] }, () => {
-
- before(() => {
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
- // cy.log('Granting temporary cluster-admin role to dev user for setup');
- // cy.adminCLI(
- // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+describe(
+ 'RBAC User2: COO - Dashboards (Perses) - Administrator perspective',
+ { tags: ['@perses', '@perses-dev'] },
+ () => {
+ before(() => {
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
+ // cy.log('Granting temporary cluster-admin role to dev user for setup');
+ // cy.adminCLI(
+ // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 2: Setup COO and Perses dashboards (requires admin privileges)
- cy.beforeBlockCOO(MCP, MP);
- cy.setupPersesRBACandExtraDashboards();
+ // Step 2: Setup COO and Perses dashboards (requires admin privileges)
+ cy.beforeBlockCOO(MCP, MP);
+ cy.setupPersesRBACandExtraDashboards();
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 3: Remove cluster-admin role - dev user now has limited permissions
- // cy.log('Removing cluster-admin role from dev user');
- // cy.adminCLI(
- // `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 3: Remove cluster-admin role - dev user now has limited permissions
+ // cy.log('Removing cluster-admin role from dev user');
+ // cy.adminCLI(
+ // `oc adm policy remove-cluster-role-from-user cluster-admin ` +
+ // `${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 4: Clear Cypress session cache and logout
- // This is critical because beforeBlockCOO uses cy.session() which caches the login state
- cy.log('Clearing Cypress session cache to ensure fresh login');
- Cypress.session.clearAllSavedSessions();
-
- // Clear all cookies and storage to fully reset browser state
- cy.clearAllCookies();
- cy.clearAllLocalStorage();
- cy.clearAllSessionStorage();
+ // Step 4: Clear Cypress session cache and logout
+ // This is critical because beforeBlockCOO uses cy.session() which caches the login state
+ cy.log('Clearing Cypress session cache to ensure fresh login');
+ cy.then(() => {
+ Cypress.session.clearAllSavedSessions();
+ });
- // Step 5: Re-login as dev user (now without cluster-admin role)
- // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
- cy.log('Re-logging in as dev user with limited permissions');
- cy.relogin(
- Cypress.env('LOGIN_IDP_DEV_USER'),
- Cypress.env('LOGIN_USERNAME2'),
- Cypress.env('LOGIN_PASSWORD2'),
- );
- cy.validateLogin();
- cy.closeOnboardingModalIfPresent();
- });
+ // Clear all cookies and storage to fully reset browser state
+ cy.clearAllCookies();
+ cy.clearAllLocalStorage();
+ cy.clearAllSessionStorage();
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.changeNamespace('All Projects');
- });
+ // Step 5: Re-login as dev user (now without cluster-admin role)
+ // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
+ cy.log('Re-logging in as dev user with limited permissions');
+ cy.relogin(
+ Cypress.env('LOGIN_IDP_DEV_USER'),
+ Cypress.env('LOGIN_USERNAME2'),
+ Cypress.env('LOGIN_PASSWORD2'),
+ );
+ cy.validateLogin();
+ cy.closeOnboardingModalIfPresent();
+ });
- after(() => {
- cy.cleanupExtraDashboards();
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ cy.changeNamespace('All Projects');
+ });
- //TODO: rename after customizable-dashboards gets merged
- runCOORBACPersesTestsDevUser2({
- name: 'Administrator',
- });
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
-});
\ No newline at end of file
+ //TODO: rename after customizable-dashboards gets merged
+ runCOORBACPersesTestsDevUser2({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts b/web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts
index 61e99a8db..e621cf812 100644
--- a/web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts
+++ b/web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts
@@ -1,7 +1,6 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser3 } from '../../support/perses/99.coo_rbac_perses_user3.cy';
-
// Set constants for the operators that need to be installed for tests.
const MCP = {
namespace: 'openshift-cluster-observability-operator',
@@ -19,60 +18,66 @@ const MP = {
};
//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
-describe('RBAC User3: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke-', '@dashboards-', '@perses-dev'] }, () => {
-
- before(() => {
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
- // cy.log('Granting temporary cluster-admin role to dev user for setup');
- // cy.adminCLI(
- // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+describe(
+ 'RBAC User3: COO - Dashboards (Perses) - Administrator perspective',
+ { tags: ['@perses', '@perses-dev'] },
+ () => {
+ before(() => {
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
+ // cy.log('Granting temporary cluster-admin role to dev user for setup');
+ // cy.adminCLI(
+ // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 2: Setup COO and Perses dashboards (requires admin privileges)
- cy.beforeBlockCOO(MCP, MP);
- cy.setupPersesRBACandExtraDashboards();
+ // Step 2: Setup COO and Perses dashboards (requires admin privileges)
+ cy.beforeBlockCOO(MCP, MP);
+ cy.setupPersesRBACandExtraDashboards();
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 3: Remove cluster-admin role - dev user now has limited permissions
- // cy.log('Removing cluster-admin role from dev user');
- // cy.adminCLI(
- // `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 3: Remove cluster-admin role - dev user now has limited permissions
+ // cy.log('Removing cluster-admin role from dev user');
+ // cy.adminCLI(
+ // `oc adm policy remove-cluster-role-from-user cluster-admin ` +
+ // `${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 4: Clear Cypress session cache and logout
- // This is critical because beforeBlockCOO uses cy.session() which caches the login state
- cy.log('Clearing Cypress session cache to ensure fresh login');
- Cypress.session.clearAllSavedSessions();
-
- // Clear all cookies and storage to fully reset browser state
- cy.clearAllCookies();
- cy.clearAllLocalStorage();
- cy.clearAllSessionStorage();
+ // Step 4: Clear Cypress session cache and logout
+ // This is critical because beforeBlockCOO uses cy.session() which caches the login state
+ cy.log('Clearing Cypress session cache to ensure fresh login');
+ cy.then(() => {
+ Cypress.session.clearAllSavedSessions();
+ });
- // Step 5: Re-login as dev user (now without cluster-admin role)
- // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
- cy.log('Re-logging in as dev user with limited permissions');
- cy.relogin(
- Cypress.env('LOGIN_IDP_DEV_USER'),
- Cypress.env('LOGIN_USERNAME3'),
- Cypress.env('LOGIN_PASSWORD3'),
- );
- cy.validateLogin();
- cy.closeOnboardingModalIfPresent();
- });
+ // Clear all cookies and storage to fully reset browser state
+ cy.clearAllCookies();
+ cy.clearAllLocalStorage();
+ cy.clearAllSessionStorage();
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
+ // Step 5: Re-login as dev user (now without cluster-admin role)
+ // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
+ cy.log('Re-logging in as dev user with limited permissions');
+ cy.relogin(
+ Cypress.env('LOGIN_IDP_DEV_USER'),
+ Cypress.env('LOGIN_USERNAME3'),
+ Cypress.env('LOGIN_PASSWORD3'),
+ );
+ cy.validateLogin();
+ cy.closeOnboardingModalIfPresent();
+ });
- after(() => {
- cy.cleanupExtraDashboards();
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ });
- //TODO: rename after customizable-dashboards gets merged
- runCOORBACPersesTestsDevUser3({
- name: 'Administrator',
- });
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
-});
\ No newline at end of file
+ //TODO: rename after customizable-dashboards gets merged
+ runCOORBACPersesTestsDevUser3({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user4.cy.ts b/web/cypress/e2e/perses/99.coo_rbac_perses_user4.cy.ts
index c246c54a6..0ae289839 100644
--- a/web/cypress/e2e/perses/99.coo_rbac_perses_user4.cy.ts
+++ b/web/cypress/e2e/perses/99.coo_rbac_perses_user4.cy.ts
@@ -1,7 +1,6 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser4 } from '../../support/perses/99.coo_rbac_perses_user4.cy';
-
// Set constants for the operators that need to be installed for tests.
const MCP = {
namespace: 'openshift-cluster-observability-operator',
@@ -19,60 +18,66 @@ const MP = {
};
//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
-describe('RBAC User4: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke-', '@dashboards-', '@perses-dev'] }, () => {
-
- before(() => {
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
- // cy.log('Granting temporary cluster-admin role to dev user for setup');
- // cy.adminCLI(
- // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+describe(
+ 'RBAC User4: COO - Dashboards (Perses) - Administrator perspective',
+ { tags: ['@perses', '@perses-dev'] },
+ () => {
+ before(() => {
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
+ // cy.log('Granting temporary cluster-admin role to dev user for setup');
+ // cy.adminCLI(
+ // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 2: Setup COO and Perses dashboards (requires admin privileges)
- cy.beforeBlockCOO(MCP, MP);
- cy.setupPersesRBACandExtraDashboards();
+ // Step 2: Setup COO and Perses dashboards (requires admin privileges)
+ cy.beforeBlockCOO(MCP, MP);
+ cy.setupPersesRBACandExtraDashboards();
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 3: Remove cluster-admin role - dev user now has limited permissions
- // cy.log('Removing cluster-admin role from dev user');
- // cy.adminCLI(
- // `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 3: Remove cluster-admin role - dev user now has limited permissions
+ // cy.log('Removing cluster-admin role from dev user');
+ // cy.adminCLI(
+ // `oc adm policy remove-cluster-role-from-user cluster-admin ` +
+ // `${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 4: Clear Cypress session cache and logout
- // This is critical because beforeBlockCOO uses cy.session() which caches the login state
- cy.log('Clearing Cypress session cache to ensure fresh login');
- Cypress.session.clearAllSavedSessions();
-
- // Clear all cookies and storage to fully reset browser state
- cy.clearAllCookies();
- cy.clearAllLocalStorage();
- cy.clearAllSessionStorage();
+ // Step 4: Clear Cypress session cache and logout
+ // This is critical because beforeBlockCOO uses cy.session() which caches the login state
+ cy.log('Clearing Cypress session cache to ensure fresh login');
+ cy.then(() => {
+ Cypress.session.clearAllSavedSessions();
+ });
- // Step 5: Re-login as dev user (now without cluster-admin role)
- // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
- cy.log('Re-logging in as dev user with limited permissions');
- cy.relogin(
- Cypress.env('LOGIN_IDP_DEV_USER'),
- Cypress.env('LOGIN_USERNAME4'),
- Cypress.env('LOGIN_PASSWORD4'),
- );
- cy.validateLogin();
- cy.closeOnboardingModalIfPresent();
- });
+ // Clear all cookies and storage to fully reset browser state
+ cy.clearAllCookies();
+ cy.clearAllLocalStorage();
+ cy.clearAllSessionStorage();
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
+ // Step 5: Re-login as dev user (now without cluster-admin role)
+ // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
+ cy.log('Re-logging in as dev user with limited permissions');
+ cy.relogin(
+ Cypress.env('LOGIN_IDP_DEV_USER'),
+ Cypress.env('LOGIN_USERNAME4'),
+ Cypress.env('LOGIN_PASSWORD4'),
+ );
+ cy.validateLogin();
+ cy.closeOnboardingModalIfPresent();
+ });
- after(() => {
- cy.cleanupExtraDashboards();
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ });
- //TODO: rename after customizable-dashboards gets merged
- runCOORBACPersesTestsDevUser4({
- name: 'Administrator',
- });
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
-});
\ No newline at end of file
+ //TODO: rename after customizable-dashboards gets merged
+ runCOORBACPersesTestsDevUser4({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user5.cy.ts b/web/cypress/e2e/perses/99.coo_rbac_perses_user5.cy.ts
index fcc729465..d5e19817c 100644
--- a/web/cypress/e2e/perses/99.coo_rbac_perses_user5.cy.ts
+++ b/web/cypress/e2e/perses/99.coo_rbac_perses_user5.cy.ts
@@ -1,7 +1,6 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser5 } from '../../support/perses/99.coo_rbac_perses_user5.cy';
-
// Set constants for the operators that need to be installed for tests.
const MCP = {
namespace: 'openshift-cluster-observability-operator',
@@ -19,60 +18,66 @@ const MP = {
};
//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
-describe('RBAC User5: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke-', '@dashboards-', '@perses-dev'] }, () => {
-
- before(() => {
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
- // cy.log('Granting temporary cluster-admin role to dev user for setup');
- // cy.adminCLI(
- // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+describe(
+ 'RBAC User5: COO - Dashboards (Perses) - Administrator perspective',
+ { tags: ['@perses', '@perses-dev'] },
+ () => {
+ before(() => {
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
+ // cy.log('Granting temporary cluster-admin role to dev user for setup');
+ // cy.adminCLI(
+ // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 2: Setup COO and Perses dashboards (requires admin privileges)
- cy.beforeBlockCOO(MCP, MP);
- cy.setupPersesRBACandExtraDashboards();
+ // Step 2: Setup COO and Perses dashboards (requires admin privileges)
+ cy.beforeBlockCOO(MCP, MP);
+ cy.setupPersesRBACandExtraDashboards();
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 3: Remove cluster-admin role - dev user now has limited permissions
- // cy.log('Removing cluster-admin role from dev user');
- // cy.adminCLI(
- // `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 3: Remove cluster-admin role - dev user now has limited permissions
+ // cy.log('Removing cluster-admin role from dev user');
+ // cy.adminCLI(
+ // `oc adm policy remove-cluster-role-from-user cluster-admin ` +
+ // `${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 4: Clear Cypress session cache and logout
- // This is critical because beforeBlockCOO uses cy.session() which caches the login state
- cy.log('Clearing Cypress session cache to ensure fresh login');
- Cypress.session.clearAllSavedSessions();
-
- // Clear all cookies and storage to fully reset browser state
- cy.clearAllCookies();
- cy.clearAllLocalStorage();
- cy.clearAllSessionStorage();
+ // Step 4: Clear Cypress session cache and logout
+ // This is critical because beforeBlockCOO uses cy.session() which caches the login state
+ cy.log('Clearing Cypress session cache to ensure fresh login');
+ cy.then(() => {
+ Cypress.session.clearAllSavedSessions();
+ });
- // Step 5: Re-login as dev user (now without cluster-admin role)
- // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
- cy.log('Re-logging in as dev user with limited permissions');
- cy.relogin(
- Cypress.env('LOGIN_IDP_DEV_USER'),
- Cypress.env('LOGIN_USERNAME5'),
- Cypress.env('LOGIN_PASSWORD5'),
- );
- cy.validateLogin();
- cy.closeOnboardingModalIfPresent();
- });
+ // Clear all cookies and storage to fully reset browser state
+ cy.clearAllCookies();
+ cy.clearAllLocalStorage();
+ cy.clearAllSessionStorage();
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
+ // Step 5: Re-login as dev user (now without cluster-admin role)
+ // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
+ cy.log('Re-logging in as dev user with limited permissions');
+ cy.relogin(
+ Cypress.env('LOGIN_IDP_DEV_USER'),
+ Cypress.env('LOGIN_USERNAME5'),
+ Cypress.env('LOGIN_PASSWORD5'),
+ );
+ cy.validateLogin();
+ cy.closeOnboardingModalIfPresent();
+ });
- after(() => {
- cy.cleanupExtraDashboards();
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ });
- //TODO: rename after customizable-dashboards gets merged
- runCOORBACPersesTestsDevUser5({
- name: 'Administrator',
- });
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
-});
\ No newline at end of file
+ //TODO: rename after customizable-dashboards gets merged
+ runCOORBACPersesTestsDevUser5({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/perses/99.coo_rbac_perses_user6.cy.ts b/web/cypress/e2e/perses/99.coo_rbac_perses_user6.cy.ts
index 6fd396098..e7e261f59 100644
--- a/web/cypress/e2e/perses/99.coo_rbac_perses_user6.cy.ts
+++ b/web/cypress/e2e/perses/99.coo_rbac_perses_user6.cy.ts
@@ -1,7 +1,6 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser6 } from '../../support/perses/99.coo_rbac_perses_user6.cy';
-
// Set constants for the operators that need to be installed for tests.
const MCP = {
namespace: 'openshift-cluster-observability-operator',
@@ -19,60 +18,66 @@ const MP = {
};
//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
-describe('RBAC User6: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke-', '@dashboards-', '@perses-dev'] }, () => {
-
- before(() => {
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
- // cy.log('Granting temporary cluster-admin role to dev user for setup');
- // cy.adminCLI(
- // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+describe(
+ 'RBAC User6: COO - Dashboards (Perses) - Administrator perspective',
+ { tags: ['@perses', '@perses-dev'] },
+ () => {
+ before(() => {
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 1: Grant temporary cluster-admin role to dev user for COO/Perses installation
+ // cy.log('Granting temporary cluster-admin role to dev user for setup');
+ // cy.adminCLI(
+ // `oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 2: Setup COO and Perses dashboards (requires admin privileges)
- cy.beforeBlockCOO(MCP, MP);
- cy.setupPersesRBACandExtraDashboards();
+ // Step 2: Setup COO and Perses dashboards (requires admin privileges)
+ cy.beforeBlockCOO(MCP, MP);
+ cy.setupPersesRBACandExtraDashboards();
- //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
- // Step 3: Remove cluster-admin role - dev user now has limited permissions
- // cy.log('Removing cluster-admin role from dev user');
- // cy.adminCLI(
- // `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
- // );
+ //TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
+ // Step 3: Remove cluster-admin role - dev user now has limited permissions
+ // cy.log('Removing cluster-admin role from dev user');
+ // cy.adminCLI(
+ // `oc adm policy remove-cluster-role-from-user cluster-admin ` +
+ // `${Cypress.env('LOGIN_USERNAME')}`,
+ // );
- // Step 4: Clear Cypress session cache and logout
- // This is critical because beforeBlockCOO uses cy.session() which caches the login state
- cy.log('Clearing Cypress session cache to ensure fresh login');
- Cypress.session.clearAllSavedSessions();
-
- // Clear all cookies and storage to fully reset browser state
- cy.clearAllCookies();
- cy.clearAllLocalStorage();
- cy.clearAllSessionStorage();
+ // Step 4: Clear Cypress session cache and logout
+ // This is critical because beforeBlockCOO uses cy.session() which caches the login state
+ cy.log('Clearing Cypress session cache to ensure fresh login');
+ cy.then(() => {
+ Cypress.session.clearAllSavedSessions();
+ });
- // Step 5: Re-login as dev user (now without cluster-admin role)
- // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
- cy.log('Re-logging in as dev user with limited permissions');
- cy.relogin(
- Cypress.env('LOGIN_IDP_DEV_USER'),
- Cypress.env('LOGIN_USERNAME6'),
- Cypress.env('LOGIN_PASSWORD6'),
- );
- cy.validateLogin();
- cy.closeOnboardingModalIfPresent();
- });
+ // Clear all cookies and storage to fully reset browser state
+ cy.clearAllCookies();
+ cy.clearAllLocalStorage();
+ cy.clearAllSessionStorage();
- beforeEach(() => {
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
+ // Step 5: Re-login as dev user (now without cluster-admin role)
+ // Using cy.relogin() because it doesn't require oauthurl and handles the login page directly
+ cy.log('Re-logging in as dev user with limited permissions');
+ cy.relogin(
+ Cypress.env('LOGIN_IDP_DEV_USER'),
+ Cypress.env('LOGIN_USERNAME6'),
+ Cypress.env('LOGIN_PASSWORD6'),
+ );
+ cy.validateLogin();
+ cy.closeOnboardingModalIfPresent();
+ });
- after(() => {
- cy.cleanupExtraDashboards();
- });
+ beforeEach(() => {
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ });
- //TODO: rename after customizable-dashboards gets merged
- runCOORBACPersesTestsDevUser6({
- name: 'Administrator',
- });
+ after(() => {
+ cy.cleanupExtraDashboards();
+ });
-});
\ No newline at end of file
+ //TODO: rename after customizable-dashboards gets merged
+ runCOORBACPersesTestsDevUser6({
+ name: 'Administrator',
+ });
+ },
+);
diff --git a/web/cypress/e2e/virtualization/00.coo_ivt.cy.ts b/web/cypress/e2e/virtualization/00.coo_ivt.cy.ts
index e9ce793c4..19df13b3b 100644
--- a/web/cypress/e2e/virtualization/00.coo_ivt.cy.ts
+++ b/web/cypress/e2e/virtualization/00.coo_ivt.cy.ts
@@ -1,5 +1,4 @@
import { runBVTMonitoringTests } from '../../support/monitoring/00.bvt_monitoring.cy';
-import { runBVTMonitoringTestsNamespace } from '../../support/monitoring/00.bvt_monitoring_namespace.cy';
import { guidedTour } from '../../views/tour';
import { alerts } from '../../fixtures/monitoring/alert';
import { nav } from '../../views/nav';
@@ -31,23 +30,24 @@ const KBV = {
crd: {
kubevirt: 'kubevirts.kubevirt.io',
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
- }
+ },
};
-describe('Installation: COO and setting up Monitoring Plugin', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
-
- });
+describe(
+ 'Installation: COO and setting up Monitoring Plugin',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ });
- it('1. Installation: COO and setting up Monitoring Plugin', () => {
- cy.log('Installation: COO and setting up Monitoring Plugin');
- });
-});
+ it('1. Installation: COO and setting up Monitoring Plugin', () => {
+ cy.log('Installation: COO and setting up Monitoring Plugin');
+ });
+ },
+);
describe('Installation: Virtualization', { tags: ['@virtualization', '@slow'] }, () => {
-
before(() => {
cy.beforeBlockVirtualization(KBV);
});
@@ -60,7 +60,6 @@ describe('Installation: Virtualization', { tags: ['@virtualization', '@slow'] },
});
describe('IVT: Monitoring + Virtualization', { tags: ['@smoke', '@virtualization'] }, () => {
-
beforeEach(() => {
cy.visit('/');
guidedTour.close();
@@ -69,7 +68,7 @@ describe('IVT: Monitoring + Virtualization', { tags: ['@smoke', '@virtualization
guidedTour.closeKubevirtTour();
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
+ cy.changeNamespace('All Projects');
alerts.getWatchdogAlert();
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
commonPages.titleShouldHaveText('Alerting');
@@ -80,5 +79,4 @@ describe('IVT: Monitoring + Virtualization', { tags: ['@smoke', '@virtualization
runBVTMonitoringTests({
name: 'Virtualization',
});
-
-});
\ No newline at end of file
+});
diff --git a/web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts b/web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts
index 8e2ac841c..10e0dc07c 100644
--- a/web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts
+++ b/web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts
@@ -1,6 +1,5 @@
import { alerts } from '../../fixtures/monitoring/alert';
import { runAllRegressionAlertsTests } from '../../support/monitoring/01.reg_alerts.cy';
-import { runAllRegressionAlertsTestsNamespace } from '../../support/monitoring/04.reg_alerts_namespace.cy';
import { commonPages } from '../../views/common';
import { nav } from '../../views/nav';
import { guidedTour } from '../../views/tour';
@@ -31,51 +30,59 @@ const KBV = {
crd: {
kubevirt: 'kubevirts.kubevirt.io',
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
- }
+ },
};
-describe('Installation: COO and setting up Monitoring Plugin', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- });
-
- it('1. Installation: COO and setting up Monitoring Plugin', () => {
- cy.log('Installation: COO and setting up Monitoring Plugin');
- });
-});
-
-describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization', '@slow'] }, () => {
+describe(
+ 'Installation: COO and setting up Monitoring Plugin',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ });
- before(() => {
- cy.beforeBlockVirtualization(KBV);
- });
-
- it('1. Virtualization perspective - Observe Menu', () => {
- cy.log('Virtualization perspective - Observe Menu and verify all submenus');
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- });
-});
+ it('1. Installation: COO and setting up Monitoring Plugin', () => {
+ cy.log('Installation: COO and setting up Monitoring Plugin');
+ });
+ },
+);
-describe('Regression: Monitoring - Alerts (Virtualization)', { tags: ['@virtualization', '@alerts'] }, () => {
+describe(
+ 'IVT: Monitoring UIPlugin + Virtualization',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockVirtualization(KBV);
+ });
- beforeEach(() => {
- cy.visit('/');
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
- alerts.getWatchdogAlert();
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- commonPages.titleShouldHaveText('Alerting');
- alerts.getWatchdogAlert();
- });
- // Run tests in Virtualization perspective
- runAllRegressionAlertsTests({
- name: 'Virtualization',
- });
+ it('1. Virtualization perspective - Observe Menu', () => {
+ cy.log('Virtualization perspective - Observe Menu and verify all submenus');
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ });
+ },
+);
-});
\ No newline at end of file
+describe(
+ 'Regression: Monitoring - Alerts (Virtualization)',
+ { tags: ['@virtualization', '@alerts'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace('All Projects');
+ alerts.getWatchdogAlert();
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ commonPages.titleShouldHaveText('Alerting');
+ alerts.getWatchdogAlert();
+ });
+ // Run tests in Virtualization perspective
+ runAllRegressionAlertsTests({
+ name: 'Virtualization',
+ });
+ },
+);
diff --git a/web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts b/web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts
index 1236c6f10..54b70b554 100644
--- a/web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts
+++ b/web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts
@@ -30,69 +30,79 @@ const KBV = {
crd: {
kubevirt: 'kubevirts.kubevirt.io',
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
- }
+ },
};
-describe('Installation: COO and setting up Monitoring Plugin', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- });
-
- it('1. Installation: COO and setting up Monitoring Plugin', () => {
- cy.log('Installation: COO and setting up Monitoring Plugin');
- });
-});
-
-describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockVirtualization(KBV);
- });
-
- it('1. Virtualization perspective - Observe Menu', () => {
- cy.log('Virtualization perspective - Observe Menu and verify all submenus');
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- });
-});
-
-describe('Regression: Monitoring - Metrics (Virtualization)', { tags: ['@virtualization', '@metrics'] }, () => {
-
- beforeEach(() => {
- cy.visit('/');
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- alerts.getWatchdogAlert();
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
- alerts.getWatchdogAlert();
- });
-
- runAllRegressionMetricsTests1({
- name: 'Virtualization',
- });
-
-});
-
-describe('Regression: Monitoring - Metrics Namespaced (Virtualization)', { tags: ['@virtualization', '@metrics'] }, () => {
-
- beforeEach(() => {
- cy.visit('/');
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- alerts.getWatchdogAlert();
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace(MP.namespace);
- alerts.getWatchdogAlert();
- });
-
- runAllRegressionMetricsTestsNamespace1({
- name: 'Virtualization',
- });
-
-});
\ No newline at end of file
+describe(
+ 'Installation: COO and setting up Monitoring Plugin',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ });
+
+ it('1. Installation: COO and setting up Monitoring Plugin', () => {
+ cy.log('Installation: COO and setting up Monitoring Plugin');
+ });
+ },
+);
+
+describe(
+ 'IVT: Monitoring UIPlugin + Virtualization',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockVirtualization(KBV);
+ });
+
+ it('1. Virtualization perspective - Observe Menu', () => {
+ cy.log('Virtualization perspective - Observe Menu and verify all submenus');
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ });
+ },
+);
+
+describe(
+ 'Regression: Monitoring - Metrics (Virtualization)',
+ { tags: ['@virtualization', '@metrics'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ alerts.getWatchdogAlert();
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace('All Projects');
+ alerts.getWatchdogAlert();
+ });
+
+ runAllRegressionMetricsTests1({
+ name: 'Virtualization',
+ });
+ },
+);
+
+describe(
+ 'Regression: Monitoring - Metrics Namespaced (Virtualization)',
+ { tags: ['@virtualization', '@metrics'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ alerts.getWatchdogAlert();
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace(MP.namespace);
+ alerts.getWatchdogAlert();
+ });
+
+ runAllRegressionMetricsTestsNamespace1({
+ name: 'Virtualization',
+ });
+ },
+);
diff --git a/web/cypress/e2e/virtualization/02.coo_ivt_metrics_2.cy.ts b/web/cypress/e2e/virtualization/02.coo_ivt_metrics_2.cy.ts
index eea255db2..d13a65eb9 100644
--- a/web/cypress/e2e/virtualization/02.coo_ivt_metrics_2.cy.ts
+++ b/web/cypress/e2e/virtualization/02.coo_ivt_metrics_2.cy.ts
@@ -30,69 +30,79 @@ const KBV = {
crd: {
kubevirt: 'kubevirts.kubevirt.io',
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
- }
+ },
};
-describe('Installation: COO and setting up Monitoring Plugin', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- });
-
- it('1. Installation: COO and setting up Monitoring Plugin', () => {
- cy.log('Installation: COO and setting up Monitoring Plugin');
- });
-});
-
-describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockVirtualization(KBV);
- });
-
- it('1. Virtualization perspective - Observe Menu', () => {
- cy.log('Virtualization perspective - Observe Menu and verify all submenus');
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- });
-});
-
-describe('Regression: Monitoring - Metrics (Virtualization)', { tags: ['@virtualization', '@metrics'] }, () => {
-
- beforeEach(() => {
- cy.visit('/');
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- alerts.getWatchdogAlert();
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace("All Projects");
- alerts.getWatchdogAlert();
- });
-
- runAllRegressionMetricsTests2({
- name: 'Virtualization',
- });
-
-});
-
-describe('Regression: Monitoring - Metrics Namespaced (Virtualization)', { tags: ['@virtualization', '@metrics'] }, () => {
-
- beforeEach(() => {
- cy.visit('/');
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- alerts.getWatchdogAlert();
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- commonPages.titleShouldHaveText('Metrics');
- cy.changeNamespace(MP.namespace);
- alerts.getWatchdogAlert();
- });
-
- runAllRegressionMetricsTestsNamespace2({
- name: 'Virtualization',
- });
-
-});
\ No newline at end of file
+describe(
+ 'Installation: COO and setting up Monitoring Plugin',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ });
+
+ it('1. Installation: COO and setting up Monitoring Plugin', () => {
+ cy.log('Installation: COO and setting up Monitoring Plugin');
+ });
+ },
+);
+
+describe(
+ 'IVT: Monitoring UIPlugin + Virtualization',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockVirtualization(KBV);
+ });
+
+ it('1. Virtualization perspective - Observe Menu', () => {
+ cy.log('Virtualization perspective - Observe Menu and verify all submenus');
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ });
+ },
+);
+
+describe(
+ 'Regression: Monitoring - Metrics (Virtualization)',
+ { tags: ['@virtualization', '@metrics'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ alerts.getWatchdogAlert();
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace('All Projects');
+ alerts.getWatchdogAlert();
+ });
+
+ runAllRegressionMetricsTests2({
+ name: 'Virtualization',
+ });
+ },
+);
+
+describe(
+ 'Regression: Monitoring - Metrics Namespaced (Virtualization)',
+ { tags: ['@virtualization', '@metrics'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ alerts.getWatchdogAlert();
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ commonPages.titleShouldHaveText('Metrics');
+ cy.changeNamespace(MP.namespace);
+ alerts.getWatchdogAlert();
+ });
+
+ runAllRegressionMetricsTestsNamespace2({
+ name: 'Virtualization',
+ });
+ },
+);
diff --git a/web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts b/web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts
index 611fce248..bcbaf9fb2 100644
--- a/web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts
+++ b/web/cypress/e2e/virtualization/03.coo_ivt_legacy_dashboards.cy.ts
@@ -1,4 +1,3 @@
-import { alerts } from '../../fixtures/monitoring/alert';
import { runAllRegressionLegacyDashboardsTests } from '../../support/monitoring/03.reg_legacy_dashboards.cy';
import { runAllRegressionLegacyDashboardsTestsNamespace } from '../../support/monitoring/06.reg_legacy_dashboards_namespace.cy';
import { commonPages } from '../../views/common';
@@ -30,63 +29,75 @@ const KBV = {
crd: {
kubevirt: 'kubevirts.kubevirt.io',
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
- }
+ },
};
-describe('Installation: COO and setting up Monitoring Plugin', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- });
-
- it('1. Installation: COO and setting up Monitoring Plugin', () => {
- cy.log('Installation: COO and setting up Monitoring Plugin');
- });
-});
-
-describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockVirtualization(KBV);
- });
+describe(
+ 'Installation: COO and setting up Monitoring Plugin',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ });
- it('1. Virtualization perspective - Observe Menu', () => {
- cy.log('Virtualization perspective - Observe Menu and verify all submenus');
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- });
-});
+ it('1. Installation: COO and setting up Monitoring Plugin', () => {
+ cy.log('Installation: COO and setting up Monitoring Plugin');
+ });
+ },
+);
-describe('Regression: Monitoring - Legacy Dashboards (Virtualization)', { tags: ['@virtualization', '@dashboards'] }, () => {
+describe(
+ 'IVT: Monitoring UIPlugin + Virtualization',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockVirtualization(KBV);
+ });
- beforeEach(() => {
- cy.visit('/');
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- commonPages.titleShouldHaveText('Dashboards');
- cy.changeNamespace("All Projects");
- });
+ it('1. Virtualization perspective - Observe Menu', () => {
+ cy.log('Virtualization perspective - Observe Menu and verify all submenus');
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ });
+ },
+);
- runAllRegressionLegacyDashboardsTests({
- name: 'Virtualization',
- });
+describe(
+ 'Regression: Monitoring - Legacy Dashboards (Virtualization)',
+ { tags: ['@virtualization', '@dashboards'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ commonPages.titleShouldHaveText('Dashboards');
+ cy.changeNamespace('All Projects');
+ });
-});
+ runAllRegressionLegacyDashboardsTests({
+ name: 'Virtualization',
+ });
+ },
+);
-describe('Regression: Monitoring - Legacy Dashboards Namespaced (Virtualization)', { tags: ['@virtualization', '@dashboards'] }, () => {
- beforeEach(() => {
- cy.visit('/');
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- commonPages.titleShouldHaveText('Dashboards');
- cy.changeNamespace(MP.namespace);
- });
+describe(
+ 'Regression: Monitoring - Legacy Dashboards Namespaced (Virtualization)',
+ { tags: ['@virtualization', '@dashboards'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ commonPages.titleShouldHaveText('Dashboards');
+ cy.changeNamespace(MP.namespace);
+ });
- runAllRegressionLegacyDashboardsTestsNamespace({
- name: 'Virtualization',
- });
-});
\ No newline at end of file
+ runAllRegressionLegacyDashboardsTestsNamespace({
+ name: 'Virtualization',
+ });
+ },
+);
diff --git a/web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts b/web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts
index 8905c81e2..ef91013c6 100644
--- a/web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts
+++ b/web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts
@@ -1,11 +1,11 @@
import { nav } from '../../views/nav';
-import { runBVTCOOPersesTests } from '../../support/perses/00.coo_bvt_perses_admin.cy';
+import { runBVTCOOPersesTests1 } from '../../support/perses/00.coo_bvt_perses_admin.cy';
import { guidedTour } from '../../views/tour';
import { commonPages } from '../../views/common';
// Set constants for the operators that need to be installed for tests.
const MCP = {
- namespace: 'openshift-cluster-observability-operator',
+ namespace: Cypress.env('COO_NAMESPACE'),
packageName: 'cluster-observability-operator',
operatorName: 'Cluster Observability Operator',
config: {
@@ -29,22 +29,25 @@ const KBV = {
crd: {
kubevirt: 'kubevirts.kubevirt.io',
hyperconverged: 'hyperconvergeds.hco.kubevirt.io',
- }
+ },
};
-describe('Installation: COO and setting up Monitoring Plugin', { tags: ['@virtualization', '@slow'] }, () => {
-
- before(() => {
- cy.beforeBlockCOO(MCP, MP);
- });
+describe(
+ 'Installation: COO and setting up Monitoring Plugin',
+ { tags: ['@virtualization', '@slow'] },
+ () => {
+ before(() => {
+ cy.beforeBlockCOO(MCP, MP);
+ cy.cleanupPersesTestDashboardsBeforeTests();
+ });
- it('1. Installation: COO and setting up Monitoring Plugin', () => {
- cy.log('Installation: COO and setting up Monitoring Plugin');
- });
-});
+ it('1. Installation: COO and setting up Monitoring Plugin', () => {
+ cy.log('Installation: COO and setting up Monitoring Plugin');
+ });
+ },
+);
describe('Installation: Virtualization', { tags: ['@virtualization', '@slow'] }, () => {
-
before(() => {
cy.beforeBlockVirtualization(KBV);
});
@@ -56,20 +59,22 @@ describe('Installation: Virtualization', { tags: ['@virtualization', '@slow'] },
});
});
-describe('IVT: COO - Dashboards (Perses) - Virtualization perspective', { tags: ['@virtualization', '@perses'] }, () => {
+describe(
+ 'IVT: COO - Dashboards (Perses) - Virtualization perspective',
+ { tags: ['@virtualization', '@perses'] },
+ () => {
+ beforeEach(() => {
+ cy.visit('/');
+ guidedTour.close();
+ cy.validateLogin();
+ cy.switchPerspective('Virtualization');
+ guidedTour.closeKubevirtTour();
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ commonPages.titleShouldHaveText('Dashboards');
+ });
- beforeEach(() => {
- cy.visit('/');
- guidedTour.close();
- cy.validateLogin();
- cy.switchPerspective('Virtualization');
- guidedTour.closeKubevirtTour();
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- commonPages.titleShouldHaveText('Dashboards');
- });
-
- runBVTCOOPersesTests({
- name: 'Virtualization',
- });
-
-});
\ No newline at end of file
+ runBVTCOOPersesTests1({
+ name: 'Virtualization',
+ });
+ },
+);
diff --git a/web/cypress/fixtures/coo/coo141_perses/dashboards/openshift-cluster-sample-dashboard.yaml b/web/cypress/fixtures/coo/coo140_perses/dashboards/openshift-cluster-sample-dashboard.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/dashboards/openshift-cluster-sample-dashboard.yaml
rename to web/cypress/fixtures/coo/coo140_perses/dashboards/openshift-cluster-sample-dashboard.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/dashboards/perses-dashboard-sample.yaml b/web/cypress/fixtures/coo/coo140_perses/dashboards/perses-dashboard-sample.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/dashboards/perses-dashboard-sample.yaml
rename to web/cypress/fixtures/coo/coo140_perses/dashboards/perses-dashboard-sample.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/dashboards/prometheus-overview-variables.yaml b/web/cypress/fixtures/coo/coo140_perses/dashboards/prometheus-overview-variables.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/dashboards/prometheus-overview-variables.yaml
rename to web/cypress/fixtures/coo/coo140_perses/dashboards/prometheus-overview-variables.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/dashboards/thanos-compact-overview-1var.yaml b/web/cypress/fixtures/coo/coo140_perses/dashboards/thanos-compact-overview-1var.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/dashboards/thanos-compact-overview-1var.yaml
rename to web/cypress/fixtures/coo/coo140_perses/dashboards/thanos-compact-overview-1var.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/dashboards/thanos-querier-datasource.yaml b/web/cypress/fixtures/coo/coo140_perses/dashboards/thanos-querier-datasource.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/dashboards/thanos-querier-datasource.yaml
rename to web/cypress/fixtures/coo/coo140_perses/dashboards/thanos-querier-datasource.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/import/accelerators-dashboard-cr-v1alpha1.yaml b/web/cypress/fixtures/coo/coo140_perses/import/accelerators-dashboard-cr-v1alpha1.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/import/accelerators-dashboard-cr-v1alpha1.yaml
rename to web/cypress/fixtures/coo/coo140_perses/import/accelerators-dashboard-cr-v1alpha1.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/import/accelerators-dashboard-cr-v1alpha2.yaml b/web/cypress/fixtures/coo/coo140_perses/import/accelerators-dashboard-cr-v1alpha2.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/import/accelerators-dashboard-cr-v1alpha2.yaml
rename to web/cypress/fixtures/coo/coo140_perses/import/accelerators-dashboard-cr-v1alpha2.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/import/acm-vm-status.json b/web/cypress/fixtures/coo/coo140_perses/import/acm-vm-status.json
similarity index 99%
rename from web/cypress/fixtures/coo/coo141_perses/import/acm-vm-status.json
rename to web/cypress/fixtures/coo/coo140_perses/import/acm-vm-status.json
index 5e66d30ef..33d0e64ab 100644
--- a/web/cypress/fixtures/coo/coo141_perses/import/acm-vm-status.json
+++ b/web/cypress/fixtures/coo/coo140_perses/import/acm-vm-status.json
@@ -521,10 +521,10 @@
"schemaVersion": 30,
"style": "dark",
"tags": [
- "ACM",
- "KubeVirt",
- "OpenShift",
- "Virtualization"
+ "acm",
+ "kubevirt",
+ "openshift",
+ "virtualization"
],
"templating": {
"list": [
diff --git a/web/cypress/fixtures/coo/coo141_perses/import/grafana_to_check_errors.json b/web/cypress/fixtures/coo/coo140_perses/import/grafana_to_check_errors.json
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/import/grafana_to_check_errors.json
rename to web/cypress/fixtures/coo/coo140_perses/import/grafana_to_check_errors.json
diff --git a/web/cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json b/web/cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json
rename to web/cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json
diff --git a/web/cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml b/web/cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml
rename to web/cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml
diff --git a/web/cypress/fixtures/coo/coo141_perses/rbac/rbac_perses_e2e_ci_users.sh b/web/cypress/fixtures/coo/coo140_perses/rbac/rbac_perses_e2e_ci_users.sh
similarity index 100%
rename from web/cypress/fixtures/coo/coo141_perses/rbac/rbac_perses_e2e_ci_users.sh
rename to web/cypress/fixtures/coo/coo140_perses/rbac/rbac_perses_e2e_ci_users.sh
diff --git a/web/cypress/fixtures/monitoring/alert.ts b/web/cypress/fixtures/monitoring/alert.ts
index dd1b2e853..1a32dede3 100644
--- a/web/cypress/fixtures/monitoring/alert.ts
+++ b/web/cypress/fixtures/monitoring/alert.ts
@@ -1,59 +1,55 @@
-import { WatchdogAlert } from "./constants";
+import { WatchdogAlert } from './constants';
export const alerts = {
- getWatchdogAlert: () => {
- cy.intercept('GET', '/api/prometheus/api/v1/rules?', {
- data: {
- groups: [
- {
- file: 'dummy-file',
- interval: 30,
- name: 'general.rules',
- rules: [
- {
- state: 'firing',
- name: `${WatchdogAlert.ALERTNAME}`,
- query: 'vector(1)',
- duration: 0,
+ getWatchdogAlert: () => {
+ cy.intercept('GET', '/api/prometheus/api/v1/rules?', {
+ data: {
+ groups: [
+ {
+ file: 'dummy-file',
+ interval: 30,
+ name: 'general.rules',
+ rules: [
+ {
+ state: 'firing',
+ name: `${WatchdogAlert.ALERTNAME}`,
+ query: 'vector(1)',
+ duration: 0,
+ labels: {
+ // namespace: `${NAMESPACE}`,
+ prometheus: 'openshift-monitoring/k8s',
+ namespace: `${WatchdogAlert.NAMESPACE}`,
+ severity: `${WatchdogAlert.SEVERITY}`,
+ },
+ annotations: {
+ description: `${WatchdogAlert.ALERT_DESC}`,
+ summary: `${WatchdogAlert.ALERT_SUMMARY}`,
+ },
+ alerts: [
+ {
labels: {
- // namespace: `${NAMESPACE}`,
- prometheus: 'openshift-monitoring/k8s',
- namespace: `${WatchdogAlert.NAMESPACE}`,
- severity: `${WatchdogAlert.SEVERITY}`,
+ alertname: `${WatchdogAlert.ALERTNAME}`,
+ namespace: `${WatchdogAlert.NAMESPACE}`,
+ severity: `${WatchdogAlert.SEVERITY}`,
},
annotations: {
- description:
- `${WatchdogAlert.ALERT_DESC}`,
- summary:
- `${WatchdogAlert.ALERT_SUMMARY}`,
- },
- alerts: [
- {
- labels: {
- alertname: `${WatchdogAlert.ALERTNAME}`,
- namespace: `${WatchdogAlert.NAMESPACE}`,
- severity: `${WatchdogAlert.SEVERITY}`,
- },
- annotations: {
- description:
- `${WatchdogAlert.ALERT_DESC}`,
- summary:
- `${WatchdogAlert.ALERT_SUMMARY}`,
- },
- state: 'firing',
- activeAt: '2023-04-10T12:00:00.123456789Z',
- value: '1e+00',
- 'partialResponseStrategy': 'WARN',
- },
- ],
- health: 'ok',
- type: 'alerting',
+ description: `${WatchdogAlert.ALERT_DESC}`,
+ summary: `${WatchdogAlert.ALERT_SUMMARY}`,
},
+ state: 'firing',
+ activeAt: '2023-04-10T12:00:00.123456789Z',
+ value: '1e+00',
+ partialResponseStrategy: 'WARN',
+ },
],
- },
+ health: 'ok',
+ type: 'alerting',
+ },
],
- },
- }),
- cy.log('Watchdog alert loaded');
- },
-};
\ No newline at end of file
+ },
+ ],
+ },
+ });
+ cy.log('Watchdog alert loaded');
+ },
+};
diff --git a/web/cypress/fixtures/monitoring/constants.ts b/web/cypress/fixtures/monitoring/constants.ts
index 9f05c1ad6..1d37415ec 100644
--- a/web/cypress/fixtures/monitoring/constants.ts
+++ b/web/cypress/fixtures/monitoring/constants.ts
@@ -6,45 +6,45 @@ export enum MonitoringPageTitles {
RECREATE_SILENCE = 'Recreate silence',
EDIT_SILENCE = 'Edit silence',
SILENCE_ALERT = 'Silence alert',
-};
+}
export enum AlertsAlertState {
FIRING = 'Firing',
PENDING = 'Pending',
SILENCED = 'Silenced',
-};
+}
export enum AlertingRulesAlertState {
FIRING = 'Firing',
PENDING = 'Pending',
SILENCED = 'Silenced',
NOT_FIRING = 'Not Firing',
-};
+}
export enum Severity {
CRITICAL = 'Critical',
WARNING = 'Warning',
INFO = 'Info',
NONE = 'None',
-};
+}
export enum SilenceState {
ACTIVE = 'Active',
PENDING = 'Pending',
EXPIRED = 'Expired',
-};
+}
export enum MainTagState {
ALERT_STATE = 'Alert State',
SEVERITY = 'Severity',
SOURCE = 'Source',
SILENCE_STATE = 'Silence State',
-};
+}
export enum Source {
PLATFORM = 'Platform',
USER = 'User',
-};
+}
export enum GraphTimespan {
FIVE_MINUTES = '5m',
@@ -58,7 +58,7 @@ export enum GraphTimespan {
TWO_DAYS = '2d',
ONE_WEEK = '1w',
TWO_WEEKS = '2w',
-};
+}
export enum MetricsPageUnits {
NO_UNITS = 'No Units',
@@ -70,7 +70,7 @@ export enum MetricsPageUnits {
MILISECONDS = 'Miliseconds',
SECONDS = 'Seconds',
PERCENTAGE = 'Percentage',
-};
+}
export enum MonitoringRefreshInterval {
REFRESH_OFF = 'Refresh off',
@@ -81,7 +81,7 @@ export enum MonitoringRefreshInterval {
ONE_HOUR = '1 hour',
TWO_HOURS = '2 hours',
ONE_DAY = '1 day',
-};
+}
export enum MetricsPagePredefinedQueries {
CPU_USAGE = 'CPU Usage',
@@ -93,13 +93,13 @@ export enum MetricsPagePredefinedQueries {
RATE_OF_TRANSMITTED_PACKETS = 'Rate of transmitted packets',
RATE_OF_RECEIVED_PACKETS_DROPPED = 'Rate of received packets dropped',
RATE_OF_TRANSMITTED_PACKETS_DROPPED = 'Rate of transmitted packets dropped',
-};
+}
export enum MetricsPageQueryInput {
EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES = 'Expression (press Shift+Enter for newlines)',
INSERT_EXAMPLE_QUERY = 'sort_desc(sum(sum_over_time(ALERTS{alertstate="firing"}[24h])) by (alertname))',
INSERT_EXAMPLE_QUERY_NAMESPACE = 'sort_desc(sum(sum_over_time(ALERTS{alertstate="firing", namespace="openshift-monitoring"}[24h])) by (alertname))',
- VECTOR_QUERY='vector(1)',
+ VECTOR_QUERY = 'vector(1)',
CPU_USAGE = 'OpenShift_Metrics_QueryTable_sum(node_namespace_pod_container_container_cpu_usage_seconds_total_sum_irate) by (pod).csv',
MEMORY_USAGE = 'OpenShift_Metrics_QueryTable_sum(container_memory_working_set_bytes{container!=__}) by (pod).csv',
FILESYSTEM_USAGE = 'OpenShift_Metrics_QueryTable_topk(25, sort_desc(sum(pod_container_fs_usage_bytes_sum{container=__,pod!=__}) BY (pod, namespace))).csv',
@@ -124,15 +124,15 @@ export enum MetricsPageQueryInput {
}
export enum MetricsPageQueryInputByNamespace {
- CPU_USAGE = 'OpenShift_Metrics_QueryTable_sum(node_namespace_pod_container_container_cpu_usage_seconds_total_sum_irate{namespace=\'openshift-monitoring\'}) by (pod).csv',
- MEMORY_USAGE = 'OpenShift_Metrics_QueryTable_sum(container_memory_working_set_bytes{container!=__, namespace=\'openshift-monitoring\'}) by (pod).csv',
- FILESYSTEM_USAGE = 'OpenShift_Metrics_QueryTable_topk(25, sort_desc(sum(pod_container_fs_usage_bytes_sum{container=__,pod!=__,namespace=\'openshift-monitoring\'}) BY (pod, namespace))).csv',
- RECEIVE_BANDWIDTH = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_bytes_total{namespace=\'openshift-monitoring\'}[2h])) by (pod).csv',
- TRANSMIT_BANDWIDTH = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_bytes_total{namespace=\'openshift-monitoring\'}[2h])) by (pod).csv',
- RATE_OF_RECEIVED_PACKETS = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_packets_total{namespace=\'openshift-monitoring\'}[2h])) by (pod).csv',
- RATE_OF_TRANSMITTED_PACKETS = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_total{namespace=\'openshift-monitoring\'}[2h])) by (pod).csv',
- RATE_OF_RECEIVED_PACKETS_DROPPED = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_packets_dropped_total{namespace=\'openshift-monitoring\'}[2h])) by (pod).csv',
- RATE_OF_TRANSMITTED_PACKETS_DROPPED = 'OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_dropped_total{namespace=\'openshift-monitoring\'}[2h])) by (pod).csv',
+ CPU_USAGE = "OpenShift_Metrics_QueryTable_sum(node_namespace_pod_container_container_cpu_usage_seconds_total_sum_irate{namespace='openshift-monitoring'}) by (pod).csv",
+ MEMORY_USAGE = "OpenShift_Metrics_QueryTable_sum(container_memory_working_set_bytes{container!=__, namespace='openshift-monitoring'}) by (pod).csv",
+ FILESYSTEM_USAGE = "OpenShift_Metrics_QueryTable_topk(25, sort_desc(sum(pod_container_fs_usage_bytes_sum{container=__,pod!=__,namespace='openshift-monitoring'}) BY (pod, namespace))).csv",
+ RECEIVE_BANDWIDTH = "OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_bytes_total{namespace='openshift-monitoring'}[2h])) by (pod).csv",
+ TRANSMIT_BANDWIDTH = "OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_bytes_total{namespace='openshift-monitoring'}[2h])) by (pod).csv",
+ RATE_OF_RECEIVED_PACKETS = "OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_packets_total{namespace='openshift-monitoring'}[2h])) by (pod).csv",
+ RATE_OF_TRANSMITTED_PACKETS = "OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_total{namespace='openshift-monitoring'}[2h])) by (pod).csv",
+ RATE_OF_RECEIVED_PACKETS_DROPPED = "OpenShift_Metrics_QueryTable_sum(irate(container_network_receive_packets_dropped_total{namespace='openshift-monitoring'}[2h])) by (pod).csv",
+ RATE_OF_TRANSMITTED_PACKETS_DROPPED = "OpenShift_Metrics_QueryTable_sum(irate(container_network_transmit_packets_dropped_total{namespace='openshift-monitoring'}[2h])) by (pod).csv",
CPU_UTILISATION_FROM_REQUESTS = 'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{namespace="openshift-monitoring"}) / sum(kube_pod_container_resource_requests{job="kube-state-metrics", namespace="openshift-monitoring", resource="cpu"})',
}
@@ -151,7 +151,7 @@ export enum MetricGraphEmptyState {
UNGRAPHABLE_RESULTS_DESCRIPTION = 'The resulting dataset is too large to graph.',
}
-export enum MetricsPageQueryKebabDropdown{
+export enum MetricsPageQueryKebabDropdown {
DISABLE_QUERY = 'Disable query',
ENABLE_QUERY = 'Enable query',
HIDE_ALL_SERIES = 'Hide all series',
@@ -177,32 +177,47 @@ export enum LegacyDashboardsTimeRange {
}
export const LegacyDashboardsDashboardDropdown = {
-API_PERFORMANCE: ['API Performance', ''],
-ETCD: ['etcd', 'etcd-mixin'],
-K8S_COMPUTE_RESOURCES_CLUSTER: ['Kubernetes / Compute Resources / Cluster', 'kubernetes-mixin'],
-K8S_COMPUTE_RESOURCES_NAMESPACE_PODS: ['Kubernetes / Compute Resources / Namespace (Pods)', 'kubernetes-mixin'],
-K8S_COMPUTE_RESOURCES_NAMESPACE_WORKLOADS: ['Kubernetes / Compute Resources / Namespace (Workloads)', 'kubernetes-mixin'],
-K8S_COMPUTE_RESOURCES_NODE_PODS: ['Kubernetes / Compute Resources / Node (Pods)', 'kubernetes-mixin'],
-K8S_COMPUTE_RESOURCES_POD: ['Kubernetes / Compute Resources / Pod', 'kubernetes-mixin'],
-K8S_COMPUTE_RESOURCES_WORKLOAD: ['Kubernetes / Compute Resources / Workload', 'kubernetes-mixin'],
-K8S_NETWORKING_CLUSTER: ['Kubernetes / Networking / Cluster', 'kubernetes-mixin'],
-K8S_NETWORKING_NAMESPACE_PODS: ['Kubernetes / Networking / Namespace (Pods)', 'kubernetes-mixin'],
-K8S_NETWORKING_POD: ['Kubernetes / Networking / Pod', 'kubernetes-mixin'],
-NETWORKING_INFRASTRUCTURE: ['Networking / Infrastructure', 'networking-mixin'],
-NETWORKING_INGRESS: ['Networking / Ingress', 'networking-mixin'],
-NETWORKING_LINUX_SUBSYSTEM_STATS: ['Networking / Linux Subsystem Stats', 'networking-mixin'],
-NODE_CLUSTER: ['Node Cluster', ''],
-NODE_EXPORTER_USE_METHOD_CLUSTER: ['Node Exporter / USE Method / Cluster', 'node-exporter-mixin'],
-NODE_EXPORTER_USE_METHOD_NODE: ['Node Exporter / USE Method / Node', 'node-exporter-mixin'],
-PROMETHEUS_OVERVIEW: ['Prometheus / Overview', 'prometheus-mixin'],
-}
+ API_PERFORMANCE: ['API Performance', ''],
+ ETCD: ['etcd', 'etcd-mixin'],
+ K8S_COMPUTE_RESOURCES_CLUSTER: ['Kubernetes / Compute Resources / Cluster', 'kubernetes-mixin'],
+ K8S_COMPUTE_RESOURCES_NAMESPACE_PODS: [
+ 'Kubernetes / Compute Resources / Namespace (Pods)',
+ 'kubernetes-mixin',
+ ],
+ K8S_COMPUTE_RESOURCES_NAMESPACE_WORKLOADS: [
+ 'Kubernetes / Compute Resources / Namespace (Workloads)',
+ 'kubernetes-mixin',
+ ],
+ K8S_COMPUTE_RESOURCES_NODE_PODS: [
+ 'Kubernetes / Compute Resources / Node (Pods)',
+ 'kubernetes-mixin',
+ ],
+ K8S_COMPUTE_RESOURCES_POD: ['Kubernetes / Compute Resources / Pod', 'kubernetes-mixin'],
+ K8S_COMPUTE_RESOURCES_WORKLOAD: ['Kubernetes / Compute Resources / Workload', 'kubernetes-mixin'],
+ K8S_NETWORKING_CLUSTER: ['Kubernetes / Networking / Cluster', 'kubernetes-mixin'],
+ K8S_NETWORKING_NAMESPACE_PODS: ['Kubernetes / Networking / Namespace (Pods)', 'kubernetes-mixin'],
+ K8S_NETWORKING_POD: ['Kubernetes / Networking / Pod', 'kubernetes-mixin'],
+ NETWORKING_INFRASTRUCTURE: ['Networking / Infrastructure', 'networking-mixin'],
+ NETWORKING_INGRESS: ['Networking / Ingress', 'networking-mixin'],
+ NETWORKING_LINUX_SUBSYSTEM_STATS: ['Networking / Linux Subsystem Stats', 'networking-mixin'],
+ NODE_CLUSTER: ['Node Cluster', ''],
+ NODE_EXPORTER_USE_METHOD_CLUSTER: ['Node Exporter / USE Method / Cluster', 'node-exporter-mixin'],
+ NODE_EXPORTER_USE_METHOD_NODE: ['Node Exporter / USE Method / Node', 'node-exporter-mixin'],
+ PROMETHEUS_OVERVIEW: ['Prometheus / Overview', 'prometheus-mixin'],
+};
export const LegacyDashboardsDashboardDropdownNamespace = {
- K8S_COMPUTE_RESOURCES_NAMESPACE_PODS: ['Kubernetes / Compute Resources / Namespace (Pods)', 'kubernetes-mixin'],
- K8S_COMPUTE_RESOURCES_NAMESPACE_WORKLOADS: ['Kubernetes / Compute Resources / Namespace (Workloads)', 'kubernetes-mixin'],
+ K8S_COMPUTE_RESOURCES_NAMESPACE_PODS: [
+ 'Kubernetes / Compute Resources / Namespace (Pods)',
+ 'kubernetes-mixin',
+ ],
+ K8S_COMPUTE_RESOURCES_NAMESPACE_WORKLOADS: [
+ 'Kubernetes / Compute Resources / Namespace (Workloads)',
+ 'kubernetes-mixin',
+ ],
K8S_COMPUTE_RESOURCES_POD: ['Kubernetes / Compute Resources / Pod', 'kubernetes-mixin'],
K8S_COMPUTE_RESOURCES_WORKLOAD: ['Kubernetes / Compute Resources / Workload', 'kubernetes-mixin'],
-}
+};
export enum API_PERFORMANCE_DASHBOARD_PANELS {
API_PERFORMANCE_PANEL_1 = 'API Request Duration by Verb - 99th Percentile',
@@ -242,7 +257,6 @@ export enum KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS {
KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANEL_16 = 'IOPS(Reads+Writes)',
KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANEL_17 = 'ThroughPut(Read+Write)',
KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANEL_18 = 'Current Storage IO',
-
}
export enum WatchdogAlert {
@@ -251,9 +265,8 @@ export enum WatchdogAlert {
SEVERITY = 'None',
ALERT_DESC = 'This is an alert meant to ensure that the entire alerting pipeline is functional. This alert is always firing, therefore it should always be firing in Alertmanager and always fire against a receiver. There are integrations with various notification mechanisms that send a notification when this alert is not firing. For example the "DeadMansSnitch" integration in PagerDuty.',
ALERT_SUMMARY = 'An alert that should always be firing to certify that Alertmanager is working properly.',
-
}
export enum SilenceComment {
SILENCE_COMMENT = 'test comment',
-}
\ No newline at end of file
+}
diff --git a/web/cypress/fixtures/perses/constants.ts b/web/cypress/fixtures/perses/constants.ts
index 610ab9a51..2a7ff2fa6 100644
--- a/web/cypress/fixtures/perses/constants.ts
+++ b/web/cypress/fixtures/perses/constants.ts
@@ -21,16 +21,20 @@ export enum persesDashboardsRefreshInterval {
}
export const persesDashboardsDashboardDropdownCOO = {
- ACCELERATORS_COMMON_METRICS:['Accelerators common metrics', 'perses', 'accelerators-dashboard'],
+ ACCELERATORS_COMMON_METRICS: ['Accelerators common metrics', 'perses', 'accelerators-dashboard'],
APM_DASHBOARD: ['Application Performance Monitoring (APM)', 'perses', 'apm-dashboard'],
- K8S_COMPUTE_RESOURCES_CLUSTER: ['Kubernetes / Compute Resources / Cluster', 'perses', 'openshift-cluster-sample-dashboard'],
-}
+ K8S_COMPUTE_RESOURCES_CLUSTER: [
+ 'Kubernetes / Compute Resources / Cluster',
+ 'perses',
+ 'openshift-cluster-sample-dashboard',
+ ],
+};
export const persesDashboardsDashboardDropdownPersesDev = {
PERSES_DASHBOARD_SAMPLE: ['Perses Dashboard Sample', 'perses', 'perses-dashboard-sample'],
PROMETHEUS_OVERVIEW: ['Prometheus / Overview', 'perses', 'prometheus-overview'],
THANOS_COMPACT_OVERVIEW: ['Thanos / Compact / Overview', 'perses', 'thanos-compact-overview'],
-}
+};
export enum persesDashboardsAcceleratorsCommonMetricsPanels {
GPU_UTILIZATION = 'GPU Utilization',
@@ -47,15 +51,14 @@ export const listPersesDashboardsPageSubtitle = 'View and manage dashboards.';
export const listPersesDashboardsEmptyState = {
TITLE: 'No results found',
BODY: 'No results match the filter criteria. Clear filters to show results.',
-
-}
+};
export const listPersesDashboardsNoDashboardsFoundState = {
TITLE: 'No dashboards found',
BODY: 'No Perses dashboards are currently available in this project.',
-}
+};
-export const persesDashboardsModalTitles ={
+export const persesDashboardsModalTitles = {
EDIT_DASHBOARD_VARIABLES: 'Edit Dashboard Variables',
DASHBOARD_BUILT_IN_VARIABLES: 'Dashboard Built-in Variables',
ADD_VARIABLE: 'Add Variable',
@@ -75,14 +78,14 @@ export const persesDashboardsModalTitles ={
VIEW_JSON_DIALOG: 'Dashboard JSON',
CREATE_DASHBOARD: 'Create Dashboard',
IMPORT_DASHBOARD: 'Import Dashboard',
-}
+};
export enum persesDashboardsAddListVariableSource {
- STATIC_LIST_VARIABLE= 'Static List Variable',
- DATASOURCE_VARIABLE= 'Datasource Variable',
- PROMETHEUS_LABEL_VARIABLE= 'Prometheus Label Values Variable',
- PROMETHEUS_NAMES_VARIABLE= 'Prometheus Label Names Variable',
- PROMETHEUS_PROMQL_VARIABLE= 'Prometheus PromQL Variable',
+ STATIC_LIST_VARIABLE = 'Static List Variable',
+ DATASOURCE_VARIABLE = 'Datasource Variable',
+ PROMETHEUS_LABEL_VARIABLE = 'Prometheus Label Values Variable',
+ PROMETHEUS_NAMES_VARIABLE = 'Prometheus Label Names Variable',
+ PROMETHEUS_PROMQL_VARIABLE = 'Prometheus PromQL Variable',
}
export enum persesDashboardsAddListVariableSort {
@@ -96,8 +99,8 @@ export enum persesDashboardsAddListVariableSort {
}
export const persesDashboardsRequiredFields = {
- AddVariableNameField: 'String must contain at least 1 character(s)'
-}
+ AddVariableNameField: 'String must contain at least 1 character(s)',
+};
export const persesDashboardsAddListPanelType = {
BAR_CHART: 'Bar Chart',
@@ -116,60 +119,68 @@ export const persesDashboardsAddListPanelType = {
TIME_SERIES_TABLE: 'Time Series Table',
TRACE_TABLE: 'Trace Table',
TRACING_GANTT_CHART: 'Tracing Gantt Chart',
-}
+};
-export const persesDashboardsAddPanelAddQueryType ={
- BAR_GAUGE_HEAT_HISTOGRAM_PIE_STAT_STATUS_TABLE_TIMESERIES : {
+export const persesDashboardsAddPanelAddQueryType = {
+ BAR_GAUGE_HEAT_HISTOGRAM_PIE_STAT_STATUS_TABLE_TIMESERIES: {
CLICKHOUSE_TIME_SERIES_QUERY: 'ClickHouse Time Series Query',
LOKI_TIME_SERIES_QUERY: 'Loki Time Series Query',
PROMETHEUS_TIME_SERIES_QUERY: 'Prometheus Time Series Query',
VICTORIALOGS_TIME_SERIES_QUERY: 'VictoriaLogs Time Series Query',
},
- FLAME_CHART : {
+ FLAME_CHART: {
PYROSCOPE_PROFILE_QUERY: 'Pyroscope Profile Query',
},
- LOGS_TABLE : {
+ LOGS_TABLE: {
CLICKHOUSE_LOG_QUERY: 'ClickHouse Log Query',
LOKI_LOG_QUERY: 'Loki Log Query',
VICTORIALOGS_LOG_QUERY: 'Victorialogs Log Query',
},
- SCATTER_TRACE_TRACINGGANTT : {
+ SCATTER_TRACE_TRACINGGANTT: {
TEMPO_TRACE_QUERY: 'Tempo Trace Query',
},
-}
+};
export const persesCreateDashboard = {
- DIALOG_MAX_LENGTH_VALIDATION: 'Danger alert:bad request: code=400, message=cannot contain more than 75 characters, internal=cannot contain more than 75 characters',
+ DIALOG_MAX_LENGTH_VALIDATION: 'Must be 75 or fewer characters long: error status;',
DIALOG_DUPLICATED_NAME_PF_VALIDATION_PREFIX: 'Dashboard name ',
- DIALOG_DUPLICATED_NAME_PF_VALIDATION_SUFFIX: ' already exists in this project: error status;',
- DIALOG_DUPLICATED_NAME_BKD_VALIDATION: 'Danger alert:document already exists',
-}
+ DIALOG_DUPLICATED_NAME_PF_VALIDATION_SUFFIX: ' already exists in ',
+ DIALOG_DUPLICATED_NAME_PF_VALIDATION_SUFFIX_PROJECT: ' project!: error status;',
+ DIALOG_DUPLICATED_NAME_BKD_VALIDATION:
+ 'Danger alert:Could not create dashboard. e: document already exists',
+};
export const persesDashboardsEmptyDashboard = {
TITLE: 'Empty Dashboard',
DESCRIPTION: 'To get started add something to your dashboard',
-}
+};
export const persesDashboardSampleQueries = {
- CPU_LINE_MULTI_SERIES: 'avg without (cpu)(rate(node_cpu_seconds_total{job=\'$job\',instance=\~\'$instance\',mode!=\"nice\",mode!=\"steal\",mode!=\"irq\"}[$interval]))',
+ CPU_LINE_MULTI_SERIES:
+ 'avg without (cpu)(rate(node_cpu_seconds_total{job=\'$job\',instance=~\'$instance\',mode!="nice",mode!="steal",mode!="irq"}[$interval]))',
CPU_LINE_MULTI_SERIES_LEGEND: '{{}{{}mode{}}{}} mode - {{}{{}job{}}{}} {{}{{}instance{}}{}}',
CPU_LINE_MULTI_SERIES_SERIES_SELECTOR: 'up{{}job=~"$job"{}}',
-}
+};
export const persesDashboardsRenameDashboard = {
DIALOG_MAX_LENGTH_VALIDATION: 'Must be 75 or fewer characters long: error status;',
-}
+};
export const persesDashboardsDuplicateDashboard = {
- DIALOG_DUPLICATED_NAME_VALIDATION: "already exists", //use contains
-}
+ DIALOG_DUPLICATED_NAME_VALIDATION: 'already exists', //use contains
+};
export const persesDashboardsImportDashboard = {
DIALOG_TITLE: '1. Provide a dashboard (JSON or YAML)',
- DIALOG_UPLOAD_JSON_YAML_FILE: 'Upload a dashboard file or paste the dashboard definition directly in the editor below.',
- DIALOG_UNABLE_TO_DETECT_DASHBOARD_FORMAT: 'Unable to detect dashboard format. Please provide a valid Perses or Grafana dashboard.',
- DIALOG_GRAFANA_DASHBOARD_DETECTED: 'Grafana dashboard detected. It will be automatically migrated to Perses format. Note: migration may be partial as not all Grafana features are supported.',
+ DIALOG_UPLOAD_JSON_YAML_FILE:
+ 'Upload a dashboard file or paste the dashboard definition directly in the editor below.',
+ DIALOG_UNABLE_TO_DETECT_DASHBOARD_FORMAT:
+ 'Unable to detect dashboard format. Please provide a valid Perses or Grafana dashboard.',
+ DIALOG_GRAFANA_DASHBOARD_DETECTED:
+ 'Grafana dashboard detected. It will be automatically migrated to Perses format. Note: migration may be partial as not all Grafana features are supported.',
DIALOG_PERSES_DASHBOARD_DETECTED: 'Perses dashboard detected.',
- DIALOG_FAILED_TO_MIGRATE_GRAFANA_DASHBOARD: 'Danger alert:Failed to migrate dashboard: internal server error',
- DIALOG_DUPLICATED_DASHBOARD_ERROR: 'Danger alert:document already exists',
-}
\ No newline at end of file
+ DIALOG_FAILED_TO_MIGRATE_GRAFANA_DASHBOARD:
+ 'Danger alert:Error migrating dashboard: Failed to migrate dashboard: internal server error',
+ DIALOG_DUPLICATED_DASHBOARD_ERROR:
+ 'Danger alert:Error importing dashboard: document already exists',
+};
diff --git a/web/cypress/support/commands/auth-commands.ts b/web/cypress/support/commands/auth-commands.ts
index f62597279..138a97923 100644
--- a/web/cypress/support/commands/auth-commands.ts
+++ b/web/cypress/support/commands/auth-commands.ts
@@ -1,8 +1,9 @@
import { nav } from '../../views/nav';
import { guidedTour } from '../../views/tour';
-export { };
+export {};
declare global {
+ // eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
switchPerspective(...perspectives: string[]);
@@ -10,8 +11,18 @@ declare global {
uiLogout();
cliLogin(username?, password?, hostapi?);
cliLogout();
- login(provider?: string, username?: string, password?: string, oauthurl?: string): Chainable;
- loginNoSession(provider: string, username: string, password: string, oauthurl: string): Chainable;
+ login(
+ provider?: string,
+ username?: string,
+ password?: string,
+ oauthurl?: string,
+ ): Chainable;
+ loginNoSession(
+ provider: string,
+ username: string,
+ password: string,
+ oauthurl: string,
+ ): Chainable;
adminCLI(command: string, options?);
executeAndDelete(command: string);
validateLogin(): Chainable;
@@ -32,27 +43,36 @@ export const operatorAuthUtils = {
} else {
cy.adminCLI(`oc project openshift-monitoring`);
cy.adminCLI(
- `oc adm policy add-role-to-user monitoring-edit ${Cypress.env('LOGIN_USERNAME')} -n openshift-monitoring`,
+ `oc adm policy add-role-to-user monitoring-edit ${Cypress.env(
+ 'LOGIN_USERNAME',
+ )} -n openshift-monitoring`,
);
cy.adminCLI(
- `oc adm policy add-role-to-user monitoring-alertmanager-edit --role-namespace openshift-monitoring ${Cypress.env('LOGIN_USERNAME')}`,
+ 'oc adm policy add-role-to-user monitoring-alertmanager-edit ' +
+ `--role-namespace openshift-monitoring ${Cypress.env('LOGIN_USERNAME')}`,
);
cy.adminCLI(
- `oc adm policy add-role-to-user view ${Cypress.env('LOGIN_USERNAME')} -n openshift-monitoring`,
+ `oc adm policy add-role-to-user view ${Cypress.env(
+ 'LOGIN_USERNAME',
+ )} -n openshift-monitoring`,
);
cy.adminCLI(`oc project default`);
cy.adminCLI(
- `oc adm policy add-role-to-user monitoring-edit ${Cypress.env('LOGIN_USERNAME')} -n default`,
+ `oc adm policy add-role-to-user monitoring-edit ${Cypress.env(
+ 'LOGIN_USERNAME',
+ )} -n default`,
);
cy.adminCLI(
- `oc adm policy add-role-to-user monitoring-alertmanager-edit --role-namespace default ${Cypress.env('LOGIN_USERNAME')}`,
+ 'oc adm policy add-role-to-user monitoring-alertmanager-edit ' +
+ `--role-namespace default ${Cypress.env('LOGIN_USERNAME')}`,
);
cy.adminCLI(
`oc adm policy add-role-to-user view ${Cypress.env('LOGIN_USERNAME')} -n default`,
);
}
cy.exec(
- `oc get oauthclient openshift-browser-client -o go-template --template="{{index .redirectURIs 0}}" --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc get oauthclient openshift-browser-client -o go-template ` +
+ `--template="{{index .redirectURIs 0}}" --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
).then((result) => {
if (result.stderr === '') {
const oauth = result.stdout;
@@ -130,10 +150,7 @@ export const operatorAuthUtils = {
MP.namespace,
MP.operatorName,
];
- const envVars = [
- Cypress.env('SKIP_ALL_INSTALL'),
- Cypress.env('MP_IMAGE'),
- ];
+ const envVars = [Cypress.env('SKIP_ALL_INSTALL'), Cypress.env('MP_IMAGE')];
return [...baseKey, ...envVars.map((v) => v || '')];
},
@@ -144,21 +161,17 @@ export const operatorAuthUtils = {
KBV.namespace,
KBV.packageName,
];
- const envVars = [
- Cypress.env('SKIP_KBV_INSTALL'),
- Cypress.env('KBV_UI_INSTALL'),
- ];
+ const envVars = [Cypress.env('SKIP_KBV_INSTALL'), Cypress.env('KBV_UI_INSTALL')];
return [...baseKey, ...envVars.map((v) => v || '')];
},
};
-
// Core login function (used by both session and non-session versions)
function performLogin(
provider: string,
username: string,
password: string,
- oauthurl: string
+ oauthurl: string,
): void {
cy.visit(Cypress.config('baseUrl'));
cy.log('Session - after visiting');
@@ -172,22 +185,20 @@ function performLogin(
return;
}
cy.exec(
- `oc get node --selector=hypershift.openshift.io/managed --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc get node --selector=hypershift.openshift.io/managed --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
).then((result) => {
cy.log(result.stdout);
cy.task('log', result.stdout);
if (result.stdout.includes('Ready')) {
cy.log(`Attempting login via cy.origin to: ${oauthurl}`);
cy.task('log', `Attempting login via cy.origin to: ${oauthurl}`);
- cy.origin(
- oauthurl,
- { args: { username, password } },
- ({ username, password }) => {
- cy.get('#inputUsername').type(username);
- cy.get('#inputPassword').type(password);
- cy.get('button[type=submit]').click();
- },
- );
+ cy.origin(oauthurl, { args: { username, password } }, ({ username, password }) => {
+ cy.get('#inputUsername').type(username);
+ cy.get('#inputPassword').type(password);
+ cy.get('button[type=submit]').click();
+ });
} else {
cy.task('log', ` Logging in as ${username} using fallback on ${oauthurl}`);
cy.origin(
@@ -203,7 +214,7 @@ function performLogin(
cy.get('#inputUsername').type(username);
cy.get('#inputPassword').type(password);
cy.get('button[type=submit]').click();
- }
+ },
);
}
});
@@ -215,7 +226,7 @@ Cypress.Commands.add('validateLogin', () => {
cy.log('validateLogin');
cy.visit('/');
cy.wait(2000);
- cy.byTestID("username", { timeout: 120000 }).should('be.visible');
+ cy.byTestID('username', { timeout: 120000 }).should('be.visible');
cy.wait(10000);
guidedTour.close();
});
@@ -245,10 +256,13 @@ Cypress.Commands.add(
);
// Non-session login (for use within sessions)
-Cypress.Commands.add('loginNoSession', (provider: string, username: string, password: string, oauthurl: string) => {
- performLogin(provider, username, password, oauthurl);
- cy.validateLogin();
-});
+Cypress.Commands.add(
+ 'loginNoSession',
+ (provider: string, username: string, password: string, oauthurl: string) => {
+ performLogin(provider, username, password, oauthurl);
+ cy.validateLogin();
+ },
+);
Cypress.Commands.add('switchPerspective', (...perspectives: string[]) => {
/* If side bar is collapsed then expand it
@@ -299,25 +313,26 @@ Cypress.Commands.add('uiLogin', (provider: string, username: string, password: s
// Fetches OAuth URL and uses cy.origin() for cross-origin login like the other login commands
Cypress.Commands.add('relogin', (provider: string, username: string, password: string) => {
cy.log('Commands relogin - fetching OAuth URL and performing fresh login');
-
+
cy.uiLogout();
// Get the OAuth URL from the cluster (same as performLoginAndAuth does)
cy.exec(
- `oc get oauthclient openshift-browser-client -o go-template --template="{{index .redirectURIs 0}}" --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc get oauthclient openshift-browser-client -o go-template ` +
+ `--template="{{index .redirectURIs 0}}" --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
).then((result) => {
if (result.stderr !== '') {
throw new Error(`Failed to get OAuth URL: ${result.stderr}`);
}
-
+
const oauth = result.stdout;
const oauthurl = new URL(oauth);
const oauthorigin = oauthurl.origin;
cy.log(`OAuth origin: ${oauthorigin}`);
-
+
// Now perform login using cy.origin() for cross-origin OAuth
cy.clearCookie('openshift-session-token');
cy.visit(Cypress.config('baseUrl'));
-
+
// Use cy.origin() for cross-origin login (OAuth is on a different domain)
cy.origin(
oauthorigin,
@@ -325,26 +340,26 @@ Cypress.Commands.add('relogin', (provider: string, username: string, password: s
({ provider, username, password }) => {
// Wait for login page to load
cy.get('[data-test-id="login"]', { timeout: 60000 }).should('be.visible');
-
+
// Select the IDP if available
cy.get('body').then(($body) => {
if ($body.text().includes(provider)) {
cy.contains(provider).should('be.visible').click();
}
});
-
+
// Fill in login form
cy.get('#inputUsername', { timeout: 30000 }).should('be.visible').type(username);
cy.get('#inputPassword').type(password);
cy.get('button[type=submit]').click();
- }
+ },
);
-
+
// Wait for successful login back on the main origin
cy.byTestID('username', { timeout: 120000 }).should('be.visible');
cy.switchPerspective('Administrator');
});
-});
+});
Cypress.Commands.add('uiLogout', () => {
cy.window().then(
@@ -368,7 +383,8 @@ Cypress.Commands.add('cliLogin', (username?, password?, hostapi?) => {
const loginPassword = password || Cypress.env('LOGIN_PASSWORD');
const hostapiurl = hostapi || Cypress.env('HOST_API');
cy.exec(
- `oc login -u ${loginUsername} -p ${loginPassword} ${hostapiurl} --insecure-skip-tls-verify=true`,
+ `oc login -u ${loginUsername} -p ${loginPassword} ${hostapiurl} ` +
+ '--insecure-skip-tls-verify=true',
{ failOnNonZeroExit: false },
).then((result) => {
cy.log(result.stderr);
@@ -390,12 +406,11 @@ Cypress.Commands.add('adminCLI', (command: string) => {
});
Cypress.Commands.add('executeAndDelete', (command: string) => {
- cy.exec(command, { failOnNonZeroExit: false })
- .then(result => {
- if (result.code !== 0) {
- cy.task('logError', `Command "${command}" failed: ${result.stderr || result.stdout}`);
- } else {
- cy.task('log', `Command "${command}" executed successfully`);
- }
- });
-});
\ No newline at end of file
+ cy.exec(command, { failOnNonZeroExit: false }).then((result) => {
+ if (result.code !== 0) {
+ cy.task('logError', `Command "${command}" failed: ${result.stderr || result.stdout}`);
+ } else {
+ cy.task('log', `Command "${command}" executed successfully`);
+ }
+ });
+});
diff --git a/web/cypress/support/commands/coo-install-commands.ts b/web/cypress/support/commands/coo-install-commands.ts
index 5a772a9de..578c9f81e 100644
--- a/web/cypress/support/commands/coo-install-commands.ts
+++ b/web/cypress/support/commands/coo-install-commands.ts
@@ -2,7 +2,7 @@ import 'cypress-wait-until';
import { operatorHubPage } from '../../views/operator-hub-page';
import { nav } from '../../views/nav';
-export { };
+export {};
const readyTimeoutMilliseconds = Cypress.config('readyTimeoutMilliseconds') as number;
const installTimeoutMilliseconds = Cypress.config('installTimeoutMilliseconds') as number;
@@ -15,63 +15,95 @@ export const cooInstallUtils = {
cy.log('COO_UI_INSTALL is set. COO will be installed from redhat-operators catalog source');
cy.log('Install Cluster Observability Operator');
operatorHubPage.installOperator(MCP.packageName, 'redhat-operators');
- cy.get('.co-clusterserviceversion-install__heading', { timeout: installTimeoutMilliseconds }).should(
- 'include.text',
- 'Operator installed successfully',
- );
+ cy.get('.co-clusterserviceversion-install__heading', {
+ timeout: installTimeoutMilliseconds,
+ }).should('include.text', 'Operator installed successfully');
cy.exec(
- `oc label namespace ${MCP.namespace} openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc label namespace ${
+ MCP.namespace
+ } openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
);
} else if (Cypress.env('KONFLUX_COO_BUNDLE_IMAGE')) {
- cy.log('KONFLUX_COO_BUNDLE_IMAGE is set. COO operator will be installed from Konflux bundle.');
+ cy.log(
+ 'KONFLUX_COO_BUNDLE_IMAGE is set. COO operator will be installed from Konflux bundle.',
+ );
cy.log('Install Cluster Observability Operator');
cy.exec(
- `oc --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} apply -f ./cypress/fixtures/coo/coo-imagecontentsourcepolicy.yaml`,
+ `oc --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )} apply -f ./cypress/fixtures/coo/coo-imagecontentsourcepolicy.yaml`,
);
cy.exec(
- `oc create namespace ${MCP.namespace} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --dry-run=client -o yaml | oc apply --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} -f -`,
+ `oc create namespace ${MCP.namespace} --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )} --dry-run=client -o yaml | oc apply --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} -f -`,
);
cy.exec(
- `oc label namespace ${MCP.namespace} openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc label namespace ${
+ MCP.namespace
+ } openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
);
cy.exec(
- `operator-sdk run bundle --timeout=10m --namespace ${MCP.namespace} --security-context-config restricted ${Cypress.env('KONFLUX_COO_BUNDLE_IMAGE')} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
+ `operator-sdk run bundle --timeout=10m --namespace ${
+ MCP.namespace
+ } --security-context-config restricted ${Cypress.env(
+ 'KONFLUX_COO_BUNDLE_IMAGE',
+ )} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
{ timeout: installTimeoutMilliseconds },
);
} else if (Cypress.env('CUSTOM_COO_BUNDLE_IMAGE')) {
- cy.log('CUSTOM_COO_BUNDLE_IMAGE is set. COO operator will be installed from custom built bundle.');
+ cy.log(
+ 'CUSTOM_COO_BUNDLE_IMAGE is set. COO operator will be installed from custom built bundle.',
+ );
cy.log('Install Cluster Observability Operator');
cy.exec(
- `oc --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} apply -f ./cypress/fixtures/coo/coo-imagecontentsourcepolicy.yaml`,
+ `oc --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )} apply -f ./cypress/fixtures/coo/coo-imagecontentsourcepolicy.yaml`,
);
cy.exec(
- `oc create namespace ${MCP.namespace} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --dry-run=client -o yaml | oc apply --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} -f -`,
+ `oc create namespace ${MCP.namespace} --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )} --dry-run=client -o yaml | oc apply --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} -f -`,
);
cy.exec(
- `oc label namespace ${MCP.namespace} openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc label namespace ${
+ MCP.namespace
+ } openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
);
cy.exec(
- `operator-sdk run bundle --timeout=10m --namespace ${MCP.namespace} --security-context-config restricted ${Cypress.env('CUSTOM_COO_BUNDLE_IMAGE')} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
+ `operator-sdk run bundle --timeout=10m --namespace ${
+ MCP.namespace
+ } --security-context-config restricted ${Cypress.env(
+ 'CUSTOM_COO_BUNDLE_IMAGE',
+ )} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
{ timeout: installTimeoutMilliseconds },
);
} else if (Cypress.env('FBC_STAGE_COO_IMAGE')) {
cy.log('FBC_COO_IMAGE is set. COO operator will be installed from FBC image.');
cy.log('Install Cluster Observability Operator');
cy.exec(
- `oc --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} apply -f ./cypress/fixtures/coo/coo-imagecontentsourcepolicy.yaml`,
+ `oc --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )} apply -f ./cypress/fixtures/coo/coo-imagecontentsourcepolicy.yaml`,
);
- cy.exec(
- './cypress/fixtures/coo/coo_stage.sh',
- {
- env: {
- FBC_STAGE_COO_IMAGE: Cypress.env('FBC_STAGE_COO_IMAGE'),
- KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
- },
- timeout: installTimeoutMilliseconds,
+ cy.exec('./cypress/fixtures/coo/coo_stage.sh', {
+ env: {
+ FBC_STAGE_COO_IMAGE: Cypress.env('FBC_STAGE_COO_IMAGE'),
+ KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
},
- );
+ timeout: installTimeoutMilliseconds,
+ });
} else {
- throw new Error('No CYPRESS env set for operator installation, check the README for more details.');
+ throw new Error(
+ 'No CYPRESS env set for operator installation, check the README for more details.',
+ );
}
},
@@ -85,7 +117,8 @@ export const cooInstallUtils = {
() =>
cy
.exec(
- `oc get pods -n ${MCP.namespace} -o name --kubeconfig ${kubeconfig} | grep observability-operator | grep -v bundle`,
+ `oc get pods -n ${MCP.namespace} -o name --kubeconfig ${kubeconfig} ` +
+ '| grep observability-operator | grep -v bundle',
{ failOnNonZeroExit: false },
)
.then((result) => result.code === 0 && result.stdout.trim().length > 0),
@@ -97,7 +130,8 @@ export const cooInstallUtils = {
);
cy.exec(
- `oc get pods -n ${MCP.namespace} -o name --kubeconfig ${kubeconfig} | grep observability-operator | grep -v bundle`,
+ `oc get pods -n ${MCP.namespace} -o name --kubeconfig ${kubeconfig} ` +
+ '| grep observability-operator | grep -v bundle',
)
.its('stdout')
.then((podOutput) => {
@@ -105,7 +139,8 @@ export const cooInstallUtils = {
cy.log(`Found COO pod: ${podName}`);
cy.exec(
- `oc wait --for=condition=Ready ${podName} -n ${MCP.namespace} --timeout=120s --kubeconfig ${kubeconfig}`,
+ `oc wait --for=condition=Ready ${podName} -n ${MCP.namespace} ` +
+ `--timeout=120s --kubeconfig ${kubeconfig}`,
{ timeout: readyTimeoutMilliseconds, failOnNonZeroExit: true },
).then((result) => {
expect(result.code).to.eq(0);
@@ -134,15 +169,17 @@ export const cooInstallUtils = {
cy.log('Remove Cluster Observability Operator namespace');
- cy.exec(
- `oc get namespace ${MCP.namespace} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
- { timeout: readyTimeoutMilliseconds, failOnNonZeroExit: false },
- ).then((checkResult) => {
+ cy.exec(`oc get namespace ${MCP.namespace} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`, {
+ timeout: readyTimeoutMilliseconds,
+ failOnNonZeroExit: false,
+ }).then((checkResult) => {
if (checkResult.code === 0) {
cy.log('Namespace exists, proceeding with deletion');
cy.exec(
- `oc delete csv --all -n ${MCP.namespace} --ignore-not-found --wait=false --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc delete csv --all -n ${
+ MCP.namespace
+ } --ignore-not-found --wait=false --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
{ timeout: 30000, failOnNonZeroExit: false },
).then((result) => {
if (result.code === 0) {
@@ -153,7 +190,9 @@ export const cooInstallUtils = {
});
cy.exec(
- `oc delete subscription --all -n ${MCP.namespace} --ignore-not-found --wait=false --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc delete subscription --all -n ${
+ MCP.namespace
+ } --ignore-not-found --wait=false --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
{ timeout: 30000, failOnNonZeroExit: false },
).then((result) => {
if (result.code === 0) {
@@ -164,7 +203,9 @@ export const cooInstallUtils = {
});
cy.exec(
- `oc delete namespace ${MCP.namespace} --ignore-not-found --wait=false --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc delete namespace ${
+ MCP.namespace
+ } --ignore-not-found --wait=false --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
{ timeout: 30000, failOnNonZeroExit: false },
).then((result) => {
if (result.code === 0) {
@@ -182,20 +223,30 @@ export const cooInstallUtils = {
const elapsed = Date.now() - startTime;
if (elapsed > maxWaitTimeMs) {
- cy.log(`${elapsed}ms - Timeout reached (${maxWaitTimeMs / 60000}m). Namespace ${MCP.namespace} still terminating. Attempting force-delete.`);
- return cy.exec(
- `./cypress/fixtures/coo/force_delete_ns.sh ${MCP.namespace} ${Cypress.env('KUBECONFIG_PATH')}`,
- { failOnNonZeroExit: false, timeout: installTimeoutMilliseconds },
- ).then((result) => {
- cy.log(`${elapsed}ms - Force delete output: ${result.stdout}`);
- if (result.code !== 0) {
- cy.log(`Force delete failed with exit code ${result.code}: ${result.stderr}`);
- }
- });
+ cy.log(
+ `${elapsed}ms - Timeout reached (${maxWaitTimeMs / 60000}m). Namespace ${
+ MCP.namespace
+ } still terminating. Attempting force-delete.`,
+ );
+ return cy
+ .exec(
+ `./cypress/fixtures/coo/force_delete_ns.sh ${MCP.namespace} ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ { failOnNonZeroExit: false, timeout: installTimeoutMilliseconds },
+ )
+ .then((result) => {
+ cy.log(`${elapsed}ms - Force delete output: ${result.stdout}`);
+ if (result.code !== 0) {
+ cy.log(`Force delete failed with exit code ${result.code}: ${result.stderr}`);
+ }
+ });
}
cy.exec(
- `oc get ns ${MCP.namespace} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} -o jsonpath='{.status.phase}'`,
+ `oc get ns ${MCP.namespace} --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )} -o jsonpath='{.status.phase}'`,
{ failOnNonZeroExit: false },
).then((result) => {
if (result.code !== 0) {
@@ -205,19 +256,30 @@ export const cooInstallUtils = {
const status = result.stdout.trim();
if (status === 'Terminating') {
- cy.log(`${elapsed}ms - ${MCP.namespace} is still 'Terminating'. Retrying in ${checkIntervalMs / 1000}s. Elapsed: ${Math.round(elapsed / 1000)}s`);
+ cy.log(
+ `${elapsed}ms - ${MCP.namespace} is still 'Terminating'. Retrying in ${
+ checkIntervalMs / 1000
+ }s. Elapsed: ${Math.round(elapsed / 1000)}s`,
+ );
cy.exec(
- `./cypress/fixtures/coo/force_delete_ns.sh ${MCP.namespace} ${Cypress.env('KUBECONFIG_PATH')}`,
+ `./cypress/fixtures/coo/force_delete_ns.sh ${MCP.namespace} ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
{ failOnNonZeroExit: false, timeout: installTimeoutMilliseconds },
).then((forceResult) => {
cy.log(`${elapsed}ms - Force delete output: ${forceResult.stdout}`);
if (forceResult.code !== 0) {
- cy.log(`Force delete failed with exit code ${forceResult.code}: ${forceResult.stderr}`);
+ cy.log(
+ `Force delete failed with exit code ${forceResult.code}: ${forceResult.stderr}`,
+ );
}
});
cy.wait(checkIntervalMs).then(checkStatus);
} else {
- cy.log(`${elapsed}ms - ${MCP.namespace} changed to unexpected state: ${status}. Stopping monitoring.`);
+ cy.log(
+ `${elapsed}ms - ${MCP.namespace} changed to unexpected state: ${status}. ` +
+ 'Stopping monitoring.',
+ );
}
});
};
@@ -246,10 +308,9 @@ export const cooInstallUtils = {
throw new Error(`Timeout: Pods still exist after ${maxWaitMs / 1000}s`);
}
- cy.exec(
- `oc get pods -n ${namespace} --kubeconfig ${kubeconfigPath} -o name`,
- { failOnNonZeroExit: false },
- ).then((result) => {
+ cy.exec(`oc get pods -n ${namespace} --kubeconfig ${kubeconfigPath} -o name`, {
+ failOnNonZeroExit: false,
+ }).then((result) => {
if (result.code !== 0) {
if (result.stderr.includes('not found')) {
cy.log(`All target pods deleted after ${elapsed}ms (namespace gone)`);
diff --git a/web/cypress/support/commands/dashboards-commands.ts b/web/cypress/support/commands/dashboards-commands.ts
index 3ab0a2162..deda7058e 100644
--- a/web/cypress/support/commands/dashboards-commands.ts
+++ b/web/cypress/support/commands/dashboards-commands.ts
@@ -2,7 +2,7 @@ import 'cypress-wait-until';
import { DataTestIDs, LegacyTestIDs } from '../../../src/components/data-test';
import { waitForPodsReady, waitForResourceCondition } from './wait-utils';
-export { };
+export {};
const readyTimeoutMilliseconds = Cypress.config('readyTimeoutMilliseconds') as number;
const installTimeoutMilliseconds = Cypress.config('installTimeoutMilliseconds') as number;
@@ -10,59 +10,118 @@ const installTimeoutMilliseconds = Cypress.config('installTimeoutMilliseconds')
export const dashboardsUtils = {
setupMonitoringUIPlugin(MCP: { namespace: string }): void {
cy.log('Create Monitoring UI Plugin instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/monitoring-ui-plugin.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
- waitForPodsReady('app.kubernetes.io/instance=monitoring', MCP.namespace, readyTimeoutMilliseconds);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/monitoring-ui-plugin.yaml --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
+ waitForPodsReady(
+ 'app.kubernetes.io/instance=monitoring',
+ MCP.namespace,
+ readyTimeoutMilliseconds,
+ );
cy.log(`Monitoring plugin pod is now running in namespace: ${MCP.namespace}`);
},
setupDashboardsAndPlugins(MCP: { namespace: string }): void {
cy.log('Create perses-dev namespace.');
- cy.exec(`oc new-project perses-dev --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`, { failOnNonZeroExit: false });
+ cy.exec(`oc new-project perses-dev --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`, {
+ failOnNonZeroExit: false,
+ });
/**
- * TODO: When COO1.4.0 is released, points COO_UI_INSTALL to install dashboards on COO1.4.0 folder
+ * TODO: When COO1.4.0 is released, points COO_UI_INSTALL to install dashboards on
+ * COO1.4.0 folder
*/
if (Cypress.env('COO_UI_INSTALL')) {
- cy.log('COO_UI_INSTALL is set. Installing dashboards on COO1.2.0 folder');
+ cy.log('COO_UI_INSTALL is set. Installing dashboards on COO1.4.0 folder');
cy.log('Create openshift-cluster-sample-dashboard instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo121_perses/dashboards/openshift-cluster-sample-dashboard.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `openshift-cluster-sample-dashboard.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create perses-dashboard-sample instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo121_perses/dashboards/perses-dashboard-sample.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `perses-dashboard-sample.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create prometheus-overview-variables instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo121_perses/dashboards/prometheus-overview-variables.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `prometheus-overview-variables.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create thanos-compact-overview-1var instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo121_perses/dashboards/thanos-compact-overview-1var.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-compact-overview-1var.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create Thanos Querier instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo121_perses/dashboards/thanos-querier-datasource.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-querier-datasource.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
} else {
cy.log('COO_UI_INSTALL is not set. Installing dashboards on COO1.4.0 folder');
cy.log('Create openshift-cluster-sample-dashboard instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo141_perses/dashboards/openshift-cluster-sample-dashboard.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `openshift-cluster-sample-dashboard.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create perses-dashboard-sample instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo141_perses/dashboards/perses-dashboard-sample.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `perses-dashboard-sample.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create prometheus-overview-variables instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo141_perses/dashboards/prometheus-overview-variables.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `prometheus-overview-variables.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create thanos-compact-overview-1var instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-compact-overview-1var.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-compact-overview-1var.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Create Thanos Querier instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-querier-datasource.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-querier-datasource.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
}
cy.exec(
- `oc label namespace ${MCP.namespace} openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc label namespace ${
+ MCP.namespace
+ } openshift.io/cluster-monitoring=true --overwrite=true --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
);
- waitForPodsReady('app.kubernetes.io/instance=perses', MCP.namespace, installTimeoutMilliseconds);
+ waitForPodsReady(
+ 'app.kubernetes.io/instance=perses',
+ MCP.namespace,
+ installTimeoutMilliseconds,
+ );
cy.log(`Perses-0 pod is now running in namespace: ${MCP.namespace}`);
waitForResourceCondition(
@@ -80,13 +139,24 @@ export const dashboardsUtils = {
setupTroubleshootingPanel(MCP: { namespace: string }): void {
cy.log('Create troubleshooting panel instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/coo/troubleshooting-panel-ui-plugin.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/troubleshooting-panel-ui-plugin.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Troubleshooting panel instance created. Waiting for pods to be ready.');
- waitForPodsReady('app.kubernetes.io/instance=troubleshooting-panel', MCP.namespace, readyTimeoutMilliseconds);
+ waitForPodsReady(
+ 'app.kubernetes.io/instance=troubleshooting-panel',
+ MCP.namespace,
+ readyTimeoutMilliseconds,
+ );
cy.log(`Troubleshooting panel pod is now running in namespace: ${MCP.namespace}`);
- waitForPodsReady('app.kubernetes.io/instance=korrel8r', MCP.namespace, installTimeoutMilliseconds);
+ waitForPodsReady(
+ 'app.kubernetes.io/instance=korrel8r',
+ MCP.namespace,
+ installTimeoutMilliseconds,
+ );
cy.log(`Korrel8r pod is now running in namespace: ${MCP.namespace}`);
cy.reload(true);
@@ -95,11 +165,13 @@ export const dashboardsUtils = {
// Retry by closing/re-opening the launcher until the item appears.
cy.waitUntil(
() =>
- cy.byLegacyTestID(LegacyTestIDs.ApplicationLauncher, { timeout: 10000 })
+ cy
+ .byLegacyTestID(LegacyTestIDs.ApplicationLauncher, { timeout: 10000 })
.should('be.visible')
.click()
.then(() =>
- cy.get(`[data-test="${DataTestIDs.MastHeadApplicationItem}"]`, { timeout: 5000 })
+ cy
+ .get(`[data-test="${DataTestIDs.MastHeadApplicationItem}"]`, { timeout: 5000 })
.then(($items) => $items.filter(':contains("Signal Correlation")').length > 0)
.then((found) => {
if (!found) {
@@ -116,7 +188,10 @@ export const dashboardsUtils = {
);
},
- cleanupTroubleshootingPanel(MCP: { namespace: string; config1?: { kind: string; name: string } }): void {
+ cleanupTroubleshootingPanel(MCP: {
+ namespace: string;
+ config1?: { kind: string; name: string };
+ }): void {
const config1 = MCP.config1 || { kind: 'UIPlugin', name: 'troubleshooting-panel' };
if (Cypress.env('SKIP_ALL_INSTALL')) {
@@ -126,46 +201,92 @@ export const dashboardsUtils = {
cy.log('Delete Troubleshooting Panel instance.');
cy.executeAndDelete(
- `oc delete ${config1.kind} ${config1.name} --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc delete ${config1.kind} ${config1.name} --ignore-not-found --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
);
},
cleanupDashboards(): void {
if (Cypress.env('COO_UI_INSTALL')) {
cy.log('Remove openshift-cluster-sample-dashboard instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo121_perses/dashboards/openshift-cluster-sample-dashboard.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `openshift-cluster-sample-dashboard.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove perses-dashboard-sample instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo121_perses/dashboards/perses-dashboard-sample.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `perses-dashboard-sample.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove prometheus-overview-variables instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo121_perses/dashboards/prometheus-overview-variables.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `prometheus-overview-variables.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove thanos-compact-overview-1var instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo121_perses/dashboards/thanos-compact-overview-1var.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-compact-overview-1var.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove Thanos Querier instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo121_perses/dashboards/thanos-querier-datasource.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-querier-datasource.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
} else {
cy.log('COO_UI_INSTALL is not set. Removing dashboards on COO1.4.0 folder');
cy.log('Remove openshift-cluster-sample-dashboard instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo141_perses/dashboards/openshift-cluster-sample-dashboard.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `openshift-cluster-sample-dashboard.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove perses-dashboard-sample instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo141_perses/dashboards/perses-dashboard-sample.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `perses-dashboard-sample.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove prometheus-overview-variables instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo141_perses/dashboards/prometheus-overview-variables.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `prometheus-overview-variables.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove thanos-compact-overview-1var instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-compact-overview-1var.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-compact-overview-1var.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove Thanos Querier instance.');
- cy.executeAndDelete(`oc delete -f ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-querier-datasource.yaml --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/coo/coo140_perses/dashboards/` +
+ `thanos-querier-datasource.yaml ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
}
cy.log('Remove perses-dev namespace');
- cy.executeAndDelete(`oc delete namespace perses-dev --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete namespace perses-dev --ignore-not-found --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
},
};
diff --git a/web/cypress/support/commands/image-patch-commands.ts b/web/cypress/support/commands/image-patch-commands.ts
index f6acb4d1b..d8dd04acd 100644
--- a/web/cypress/support/commands/image-patch-commands.ts
+++ b/web/cypress/support/commands/image-patch-commands.ts
@@ -1,6 +1,6 @@
import { waitForPodsReady, waitForPodsReadyOrAbsent } from './wait-utils';
-export { };
+export {};
const readyTimeoutMilliseconds = Cypress.config('readyTimeoutMilliseconds') as number;
@@ -8,23 +8,24 @@ export const imagePatchUtils = {
setupMonitoringPluginImage(MP: { namespace: string }): void {
cy.log('Set Monitoring Plugin image in operator CSV');
if (Cypress.env('MP_IMAGE')) {
- cy.exec(
- './cypress/fixtures/cmo/update-monitoring-plugin-image.sh',
- {
- env: {
- MP_IMAGE: Cypress.env('MP_IMAGE'),
- KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
- MP_NAMESPACE: `${MP.namespace}`,
- },
- timeout: readyTimeoutMilliseconds,
- failOnNonZeroExit: true,
+ cy.exec('./cypress/fixtures/cmo/update-monitoring-plugin-image.sh', {
+ env: {
+ MP_IMAGE: Cypress.env('MP_IMAGE'),
+ KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
+ MP_NAMESPACE: `${MP.namespace}`,
},
- ).then((result) => {
+ timeout: readyTimeoutMilliseconds,
+ failOnNonZeroExit: true,
+ }).then((result) => {
expect(result.code).to.eq(0);
cy.log(`CMO deployment Scaled Down successfully: ${result.stdout}`);
});
- waitForPodsReady('app.kubernetes.io/name=monitoring-plugin', MP.namespace, readyTimeoutMilliseconds);
+ waitForPodsReady(
+ 'app.kubernetes.io/name=monitoring-plugin',
+ MP.namespace,
+ readyTimeoutMilliseconds,
+ );
cy.log(`Monitoring plugin pod is now running in namespace: ${MP.namespace}`);
cy.reload(true);
} else {
@@ -85,22 +86,23 @@ export const imagePatchUtils = {
revertMonitoringPluginImage(MP: { namespace: string }): void {
if (Cypress.env('MP_IMAGE')) {
cy.log('MP_IMAGE is set. Lets revert CMO operator CSV');
- cy.exec(
- './cypress/fixtures/cmo/reenable-monitoring.sh',
- {
- env: {
- MP_IMAGE: Cypress.env('MP_IMAGE'),
- KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
- MP_NAMESPACE: `${MP.namespace}`,
- },
- timeout: readyTimeoutMilliseconds,
- failOnNonZeroExit: true,
+ cy.exec('./cypress/fixtures/cmo/reenable-monitoring.sh', {
+ env: {
+ MP_IMAGE: Cypress.env('MP_IMAGE'),
+ KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
+ MP_NAMESPACE: `${MP.namespace}`,
},
- ).then((result) => {
+ timeout: readyTimeoutMilliseconds,
+ failOnNonZeroExit: true,
+ }).then((result) => {
expect(result.code).to.eq(0);
cy.log(`CMO CSV reverted successfully with Monitoring Plugin image: ${result.stdout}`);
- waitForPodsReadyOrAbsent('app.kubernetes.io/name=monitoring-plugin', MP.namespace, readyTimeoutMilliseconds);
+ waitForPodsReadyOrAbsent(
+ 'app.kubernetes.io/name=monitoring-plugin',
+ MP.namespace,
+ readyTimeoutMilliseconds,
+ );
cy.log(`Monitoring plugin pods verified in namespace: ${MP.namespace}`);
cy.reload(true);
diff --git a/web/cypress/support/commands/incident-commands.ts b/web/cypress/support/commands/incident-commands.ts
index 8a88f4b3c..01de98ef4 100644
--- a/web/cypress/support/commands/incident-commands.ts
+++ b/web/cypress/support/commands/incident-commands.ts
@@ -1,103 +1,112 @@
export {};
declare global {
- namespace Cypress {
- interface Chainable {
- createKubePodCrashLoopingAlert(testName?: string): Chainable;
- cleanupIncidentPrometheusRules(): Chainable;
- }
+ // eslint-disable-next-line @typescript-eslint/no-namespace
+ namespace Cypress {
+ interface Chainable {
+ createKubePodCrashLoopingAlert(testName?: string): Chainable;
+ cleanupIncidentPrometheusRules(): Chainable;
}
}
-
+}
Cypress.Commands.add('createKubePodCrashLoopingAlert', (testName?: string) => {
- const kubeconfigPath = Cypress.env('KUBECONFIG_PATH');
-
- const alertName = testName
- ? `CustomPodCrashLooping_${testName}`
- : `CustomPodCrashLooping_${Math.random().toString(36).substring(2, 15)}`;
-
- const shouldReuseResources = !!testName;
-
- cy.log(`Using alert name: ${alertName}${shouldReuseResources ? ' (reuse mode)' : ' (create new)'}`);
-
- if (!testName) {
- Cypress.env('CURRENT_ALERT_NAME', alertName);
- }
-
- const createOrUpdatePrometheusRule = () => {
- cy.readFile('./cypress/fixtures/incidents/prometheus_rule_pod_crash_loop.yaml').then((template) => {
+ const kubeconfigPath = Cypress.env('KUBECONFIG_PATH');
+
+ const alertName = testName
+ ? `CustomPodCrashLooping_${testName}`
+ : `CustomPodCrashLooping_${Math.random().toString(36).substring(2, 15)}`;
+
+ const shouldReuseResources = !!testName;
+
+ cy.log(
+ `Using alert name: ${alertName}${shouldReuseResources ? ' (reuse mode)' : ' (create new)'}`,
+ );
+
+ if (!testName) {
+ Cypress.env('CURRENT_ALERT_NAME', alertName);
+ }
+
+ const createOrUpdatePrometheusRule = () => {
+ cy.readFile('./cypress/fixtures/incidents/prometheus_rule_pod_crash_loop.yaml').then(
+ (template) => {
const yamlContent = template.replace(/\{\{ALERT_NAME\}\}/g, alertName);
-
- cy.writeFile('./cypress/fixtures/incidents/temp_prometheus_rule.yaml', yamlContent).then(() => {
- cy.exec(
- `oc apply -f ./cypress/fixtures/incidents/temp_prometheus_rule.yaml --kubeconfig ${kubeconfigPath}`,
- );
-
- cy.exec('rm ./cypress/fixtures/incidents/temp_prometheus_rule.yaml');
- });
- });
- };
-
- const createPod = () => {
- cy.exec(
- `oc apply -f ./cypress/fixtures/incidents/pod_crash_loop.yaml --kubeconfig ${kubeconfigPath}`,
- );
- };
-
- if (shouldReuseResources) {
- cy.exec(
- `oc get prometheusrule kubernetes-monitoring-podcrash-rules -n openshift-monitoring -o yaml --kubeconfig ${kubeconfigPath}`,
- { failOnNonZeroExit: false }
- ).then((result) => {
- if (result.code === 0 && result.stdout.includes(`alert: ${alertName}`)) {
- cy.log(`PrometheusRule with alert '${alertName}' already exists, reusing it`);
- } else {
- if (result.code === 0) {
- cy.log(`PrometheusRule exists but does not contain alert '${alertName}', updating it`);
- } else {
- cy.log('PrometheusRule does not exist, creating it');
- }
- createOrUpdatePrometheusRule();
- }
- });
- cy.exec(
- `oc get -f ./cypress/fixtures/incidents/pod_crash_loop.yaml --kubeconfig ${kubeconfigPath}`,
- { failOnNonZeroExit: false }
- ).then((result) => {
+ cy.writeFile('./cypress/fixtures/incidents/temp_prometheus_rule.yaml', yamlContent).then(
+ () => {
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/incidents/temp_prometheus_rule.yaml ` +
+ `--kubeconfig ${kubeconfigPath}`,
+ );
+
+ cy.exec('rm ./cypress/fixtures/incidents/temp_prometheus_rule.yaml');
+ },
+ );
+ },
+ );
+ };
+
+ const createPod = () => {
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/incidents/pod_crash_loop.yaml --kubeconfig ${kubeconfigPath}`,
+ );
+ };
+
+ if (shouldReuseResources) {
+ cy.exec(
+ `oc get prometheusrule kubernetes-monitoring-podcrash-rules ` +
+ `-n openshift-monitoring -o yaml --kubeconfig ${kubeconfigPath}`,
+ { failOnNonZeroExit: false },
+ ).then((result) => {
+ if (result.code === 0 && result.stdout.includes(`alert: ${alertName}`)) {
+ cy.log(`PrometheusRule with alert '${alertName}' already exists, reusing it`);
+ } else {
if (result.code === 0) {
- cy.log('Crash looping pod already exists, reusing it');
+ cy.log(`PrometheusRule exists but does not contain alert '${alertName}', updating it`);
} else {
- cy.log('Crash looping pod does not exist, creating it');
- createPod();
+ cy.log('PrometheusRule does not exist, creating it');
}
- });
- } else {
- createOrUpdatePrometheusRule();
- createPod();
- }
-
- return cy.wrap(alertName);
- });
-
- // Clean up incident fixture manifests from the cluster
- Cypress.Commands.add('cleanupIncidentPrometheusRules', () => {
- const kubeconfigPath = Cypress.env('KUBECONFIG_PATH');
-
- // Delete all PrometheusRules that match our pattern (kubernetes-monitoring-podcrash-rules)
- // This ensures cleanup before tests and after tests
+ createOrUpdatePrometheusRule();
+ }
+ });
+
cy.exec(
- `oc delete prometheusrule kubernetes-monitoring-podcrash-rules -n openshift-monitoring --kubeconfig ${kubeconfigPath} --ignore-not-found=true`,
- );
-
- // Clear the environment variable if it exists
- if (Cypress.env('CURRENT_ALERT_NAME')) {
- Cypress.env('CURRENT_ALERT_NAME', null);
- }
-
- cy.executeAndDelete(
- `oc delete -f ./cypress/fixtures/incidents/pod_crash_loop.yaml --ignore-not-found=true --kubeconfig ${kubeconfigPath}`,
- );
- });
+ `oc get -f ./cypress/fixtures/incidents/pod_crash_loop.yaml --kubeconfig ${kubeconfigPath}`,
+ { failOnNonZeroExit: false },
+ ).then((result) => {
+ if (result.code === 0) {
+ cy.log('Crash looping pod already exists, reusing it');
+ } else {
+ cy.log('Crash looping pod does not exist, creating it');
+ createPod();
+ }
+ });
+ } else {
+ createOrUpdatePrometheusRule();
+ createPod();
+ }
+
+ return cy.wrap(alertName);
+});
+
+// Clean up incident fixture manifests from the cluster
+Cypress.Commands.add('cleanupIncidentPrometheusRules', () => {
+ const kubeconfigPath = Cypress.env('KUBECONFIG_PATH');
+
+ // Delete all PrometheusRules that match our pattern (kubernetes-monitoring-podcrash-rules)
+ // This ensures cleanup before tests and after tests
+ cy.exec(
+ `oc delete prometheusrule kubernetes-monitoring-podcrash-rules ` +
+ `-n openshift-monitoring --kubeconfig ${kubeconfigPath} --ignore-not-found=true`,
+ );
+
+ // Clear the environment variable if it exists
+ if (Cypress.env('CURRENT_ALERT_NAME')) {
+ Cypress.env('CURRENT_ALERT_NAME', null);
+ }
+ cy.executeAndDelete(
+ `oc delete -f ./cypress/fixtures/incidents/pod_crash_loop.yaml ` +
+ `--ignore-not-found=true --kubeconfig ${kubeconfigPath}`,
+ );
+});
diff --git a/web/cypress/support/commands/operator-commands.ts b/web/cypress/support/commands/operator-commands.ts
index 7c759f30a..0d61e5ec8 100644
--- a/web/cypress/support/commands/operator-commands.ts
+++ b/web/cypress/support/commands/operator-commands.ts
@@ -5,7 +5,7 @@ import { cooInstallUtils } from './coo-install-commands';
import { imagePatchUtils } from './image-patch-commands';
import { dashboardsUtils } from './dashboards-commands';
-export { };
+export {};
export interface COOSetupOptions {
dashboards?: boolean;
@@ -20,6 +20,7 @@ const DEFAULT_COO_OPTIONS: Required = {
};
declare global {
+ // eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
beforeBlock(MP: { namespace: string; operatorName: string });
@@ -56,7 +57,9 @@ const useSession = String(Cypress.env('SESSION')).toLowerCase() === 'true';
function removeClusterAdminRole(): void {
cy.log('Remove cluster-admin role from user.');
cy.executeAndDelete(
- `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env('LOGIN_USERNAME')} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc adm policy remove-cluster-role-from-user cluster-admin ${Cypress.env(
+ 'LOGIN_USERNAME',
+ )} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
);
}
@@ -89,7 +92,9 @@ function cleanupUIPlugin(
cy.log('Delete Monitoring UI Plugin instance.');
cy.executeAndDelete(
- `oc delete ${config.kind} ${config.name} --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc delete ${config.kind} ${config.name} --ignore-not-found --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
);
if (opts.dashboards) {
@@ -199,7 +204,9 @@ Cypress.Commands.add(
cy.log('Cleanup COO');
if (Cypress.env('SKIP_ALL_INSTALL')) {
- cy.log('SKIP_ALL_INSTALL is set. Skipping COO cleanup and operator verifications (preserves existing setup).');
+ cy.log(
+ 'SKIP_ALL_INSTALL is set. Skipping COO cleanup and operator verifications (preserves existing setup).',
+ );
return;
}
if (opts.troubleshootingPanel) {
@@ -221,7 +228,9 @@ Cypress.Commands.add(
const opts = { ...DEFAULT_COO_OPTIONS, ...options };
if (Cypress.env('SKIP_ALL_INSTALL')) {
- cy.log('SKIP_ALL_INSTALL is set. Skipping COO setup and operator verifications (uses existing installation).');
+ cy.log(
+ 'SKIP_ALL_INSTALL is set. Skipping COO setup and operator verifications (uses existing installation).',
+ );
return;
}
cooInstallUtils.installCOO(MCP);
@@ -257,14 +266,23 @@ Cypress.Commands.add('beforeBlockACM', (MCP, MP) => {
failOnNonZeroExit: false,
timeout: 1200000,
});
- cy.exec(`oc apply -f ./cypress/fixtures/coo/acm-uiplugin.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
- cy.exec(`oc apply -f ./cypress/fixtures/coo/acm-alerrule-test.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/acm-uiplugin.yaml --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
+ cy.exec(
+ `oc apply -f ./cypress/fixtures/coo/acm-alerrule-test.yaml --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
cy.log('ACM environment setup completed');
});
Cypress.Commands.add('closeOnboardingModalIfPresent', () => {
cy.get('body').then(($body) => {
- const modalSelector = 'button[data-ouia-component-id="clustersOnboardingModal-ModalBoxCloseButton"]';
+ const modalSelector =
+ 'button[data-ouia-component-id="clustersOnboardingModal-ModalBoxCloseButton"]';
if ($body.find(modalSelector).length > 0) {
cy.log('Onboarding modal detected, attempting to close...');
cy.get(modalSelector, { timeout: 20000 })
diff --git a/web/cypress/support/commands/perses-commands.ts b/web/cypress/support/commands/perses-commands.ts
index 1a5228067..de401d1a8 100644
--- a/web/cypress/support/commands/perses-commands.ts
+++ b/web/cypress/support/commands/perses-commands.ts
@@ -1,11 +1,13 @@
-export { };
+export {};
import { nav } from '../../views/nav';
import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { listPersesDashboardsOUIAIDs } from '../../../src/components/data-test';
-// Display name prefixes/exact matches for test-created PersesDashboards to delete before Perses tests.
-// Examples: "Test Dashboard0.24...", "Dashboard to test duplication0.33...", "Testing Dashboard - UP 0.32..."
+// Display name prefixes/exact matches for test-created PersesDashboards to delete before
+// Perses tests.
+// Examples: "Test Dashboard0.24...", "Dashboard to test duplication0.33...",
+// "Testing Dashboard - UP 0.32..."
const PERSES_TEST_DASHBOARD_NAME_PREFIXES = [
'Testing Dashboard - UP ',
'Renamed dashboard ',
@@ -21,71 +23,117 @@ const PERSES_TEST_DASHBOARD_NAME_EXACT = [
'Service Level dashboards / Virtual Machines by Time in Status',
];
+const PERSES_E2E_DASHBOARDS_DIR = './cypress/fixtures/coo/coo140_perses/dashboards';
+const SED_OCP_NS_TO_OBS_TEST =
+ "sed 's/namespace: openshift-cluster-observability-operator/namespace: observ-test/g'";
+const SED_PERSES_DEV_TO_OBS_TEST = "sed 's/namespace: perses-dev/namespace: observ-test/g'";
+
declare global {
- namespace Cypress {
- interface Chainable {
- setupPersesRBACandExtraDashboards(): Chainable;
- cleanupExtraDashboards(): Chainable;
- /** Delete test Perses dashboards via UI (list page). Call before Perses tests. */
- cleanupPersesTestDashboardsBeforeTests(): Chainable;
- }
+ // eslint-disable-next-line @typescript-eslint/no-namespace
+ namespace Cypress {
+ interface Chainable {
+ setupPersesRBACandExtraDashboards(): Chainable;
+ cleanupExtraDashboards(): Chainable;
+ /** Delete test Perses dashboards via UI (list page). Call before Perses tests. */
+ cleanupPersesTestDashboardsBeforeTests(): Chainable;
}
}
+}
Cypress.Commands.add('setupPersesRBACandExtraDashboards', () => {
+ if (
+ `${Cypress.env('LOGIN_USERNAME1')}` !== 'kubeadmin' &&
+ `${Cypress.env('LOGIN_USERNAME2')}` !== undefined
+ ) {
+ cy.exec('./cypress/fixtures/coo/coo140_perses/rbac/rbac_perses_e2e_ci_users.sh', {
+ env: {
+ USER1: `${Cypress.env('LOGIN_USERNAME1')}`,
+ USER2: `${Cypress.env('LOGIN_USERNAME2')}`,
+ USER3: `${Cypress.env('LOGIN_USERNAME3')}`,
+ USER4: `${Cypress.env('LOGIN_USERNAME4')}`,
+ USER5: `${Cypress.env('LOGIN_USERNAME5')}`,
+ USER6: `${Cypress.env('LOGIN_USERNAME6')}`,
+ },
+ });
- if (`${Cypress.env('LOGIN_USERNAME1')}` !== 'kubeadmin' && `${Cypress.env('LOGIN_USERNAME2')}` !== undefined) {
- cy.exec(
- './cypress/fixtures/coo/coo141_perses/rbac/rbac_perses_e2e_ci_users.sh',
- {
- env: {
- USER1: `${Cypress.env('LOGIN_USERNAME1')}`,
- USER2: `${Cypress.env('LOGIN_USERNAME2')}`,
- USER3: `${Cypress.env('LOGIN_USERNAME3')}`,
- USER4: `${Cypress.env('LOGIN_USERNAME4')}`,
- USER5: `${Cypress.env('LOGIN_USERNAME5')}`,
- USER6: `${Cypress.env('LOGIN_USERNAME6')}`,
- },
- }
- );
+ const kc = Cypress.env('KUBECONFIG_PATH');
cy.log('Create openshift-cluster-sample-dashboard instance.');
- cy.exec(`sed 's/namespace: openshift-cluster-observability-operator/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/openshift-cluster-sample-dashboard.yaml | oc apply -f - --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `${SED_OCP_NS_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `openshift-cluster-sample-dashboard.yaml | oc apply -f - --kubeconfig ${kc}`,
+ );
cy.log('Create perses-dashboard-sample instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/perses-dashboard-sample.yaml | oc apply -f - --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `perses-dashboard-sample.yaml | oc apply -f - --kubeconfig ${kc}`,
+ );
cy.log('Create prometheus-overview-variables instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/prometheus-overview-variables.yaml | oc apply -f - --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `prometheus-overview-variables.yaml | oc apply -f - --kubeconfig ${kc}`,
+ );
cy.log('Create thanos-compact-overview-1var instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-compact-overview-1var.yaml | oc apply -f - --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `thanos-compact-overview-1var.yaml | oc apply -f - --kubeconfig ${kc}`,
+ );
cy.log('Create Thanos Querier instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-querier-datasource.yaml | oc apply -f - --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `thanos-querier-datasource.yaml | oc apply -f - --kubeconfig ${kc}`,
+ );
}
});
Cypress.Commands.add('cleanupExtraDashboards', () => {
-
- cy.log('Remove openshift-cluster-sample-dashboard instance.');
- cy.exec(`sed 's/namespace: openshift-cluster-observability-operator/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/openshift-cluster-sample-dashboard.yaml | oc delete -f - --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
-
- cy.log('Remove perses-dashboard-sample instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/perses-dashboard-sample.yaml | oc delete -f - --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
-
- cy.log('Remove prometheus-overview-variables instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/prometheus-overview-variables.yaml | oc delete -f - --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
-
- cy.log('Remove thanos-compact-overview-1var instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-compact-overview-1var.yaml | oc delete -f - --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
-
- cy.log('Remove Thanos Querier instance.');
- cy.exec(`sed 's/namespace: perses-dev/namespace: observ-test/g' ./cypress/fixtures/coo/coo141_perses/dashboards/thanos-querier-datasource.yaml | oc delete -f - --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
-
- cy.log('Remove observ-test namespace');
- cy.exec(`oc delete namespace observ-test --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
-
+ const kc = Cypress.env('KUBECONFIG_PATH');
+
+ cy.log('Remove openshift-cluster-sample-dashboard instance.');
+ cy.exec(
+ `${SED_OCP_NS_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `openshift-cluster-sample-dashboard.yaml | oc delete -f - --ignore-not-found ` +
+ `--kubeconfig ${kc}`,
+ );
+
+ cy.log('Remove perses-dashboard-sample instance.');
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `perses-dashboard-sample.yaml | oc delete -f - --ignore-not-found ` +
+ `--kubeconfig ${kc}`,
+ );
+
+ cy.log('Remove prometheus-overview-variables instance.');
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `prometheus-overview-variables.yaml | oc delete -f - --ignore-not-found ` +
+ `--kubeconfig ${kc}`,
+ );
+
+ cy.log('Remove thanos-compact-overview-1var instance.');
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `thanos-compact-overview-1var.yaml | oc delete -f - --ignore-not-found ` +
+ `--kubeconfig ${kc}`,
+ );
+
+ cy.log('Remove Thanos Querier instance.');
+ cy.exec(
+ `${SED_PERSES_DEV_TO_OBS_TEST} ${PERSES_E2E_DASHBOARDS_DIR}/` +
+ `thanos-querier-datasource.yaml | oc delete -f - --ignore-not-found ` +
+ `--kubeconfig ${kc}`,
+ );
+
+ cy.log('Remove observ-test namespace');
+ cy.exec(
+ `oc delete namespace observ-test --ignore-not-found --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
});
function isTestDashboardName(displayName: string | undefined): boolean {
@@ -102,7 +150,9 @@ Cypress.Commands.add('cleanupPersesTestDashboardsBeforeTests', () => {
cy.wait(5000);
cy.changeNamespace('All Projects');
cy.wait(5000);
- cy.get(`[data-ouia-component-id^="${listPersesDashboardsOUIAIDs.PersesDashListDataViewTable}"]`, { timeout: 15000 })
+ cy.get(`[data-ouia-component-id^="${listPersesDashboardsOUIAIDs.PersesDashListDataViewTable}"]`, {
+ timeout: 15000,
+ })
.should('be.visible')
.then(() => {
runDeleteOneMatching(0);
@@ -112,7 +162,9 @@ Cypress.Commands.add('cleanupPersesTestDashboardsBeforeTests', () => {
function runDeleteOneMatching(iteration: number): void {
if (iteration >= MAX_UI_CLEANUP_ITERATIONS) return;
cy.get('body').then(($body) => {
- const $table = $body.find(`[data-ouia-component-id^="${listPersesDashboardsOUIAIDs.PersesDashListDataViewTable}"]`);
+ const $table = $body.find(
+ `[data-ouia-component-id^="${listPersesDashboardsOUIAIDs.PersesDashListDataViewTable}"]`,
+ );
if ($table.length === 0) return;
const $rows = $table.find('tbody tr');
if ($rows.length === 0) return;
@@ -120,7 +172,10 @@ function runDeleteOneMatching(iteration: number): void {
let deleteName = '';
for (let i = 0; i < $rows.length; i++) {
const $row = $rows.eq(i);
- const $link = $row.find('a').filter((_, el) => (Cypress.$(el).text().trim().length > 0)).first();
+ const $link = $row
+ .find('a')
+ .filter((_, el) => Cypress.$(el).text().trim().length > 0)
+ .first();
const name = $link.length ? $link.text().trim() : '';
if (name && isTestDashboardName(name)) {
deleteIndex = i;
@@ -137,4 +192,3 @@ function runDeleteOneMatching(iteration: number): void {
cy.then(() => runDeleteOneMatching(iteration + 1));
});
}
-
diff --git a/web/cypress/support/commands/selector-commands.ts b/web/cypress/support/commands/selector-commands.ts
index f397b8c79..398bf3e97 100644
--- a/web/cypress/support/commands/selector-commands.ts
+++ b/web/cypress/support/commands/selector-commands.ts
@@ -6,6 +6,7 @@ import Shadow = Cypress.Shadow;
export {};
declare global {
+ // eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
byTestID(
@@ -33,84 +34,91 @@ declare global {
byOUIAID(selector: string): Chainable;
byClass(selector: string): Chainable;
bySemanticElement(element: string, text?: string): Chainable>;
- byAriaLabel(label: string, options?: Partial): Chainable>;
- byPFRole(role: string, options?: Partial): Chainable>;
+ byAriaLabel(
+ label: string,
+ options?: Partial,
+ ): Chainable>;
+ byPFRole(
+ role: string,
+ options?: Partial,
+ ): Chainable>;
}
}
}
+Cypress.Commands.add(
+ 'byTestID',
+ (selector: string, options?: Partial) => {
+ cy.get(`[data-test="${selector}"]`, options);
+ },
+);
+
+Cypress.Commands.add('byTestActionID', (selector: string) =>
+ cy.get(`[data-test-action="${selector}"]:not([disabled])`),
+);
+// Deprecated! new IDs should use 'data-test', ie. `cy.byTestID(...)`
Cypress.Commands.add(
- 'byTestID',
- (selector: string, options?: Partial) => {
- cy.get(`[data-test="${selector}"]`, options);
- },
- );
-
- Cypress.Commands.add('byTestActionID', (selector: string) =>
- cy.get(`[data-test-action="${selector}"]:not([disabled])`),
- );
-
- // Deprecated! new IDs should use 'data-test', ie. `cy.byTestID(...)`
- Cypress.Commands.add(
- 'byLegacyTestID',
- (selector: string, options?: Partial) => {
- cy.get(`[data-test-id="${selector}"]`, options);
- },
- );
-
- Cypress.Commands.add('byButtonText', (selector: string) => {
- cy.get('button[type="button"]').contains(`${selector}`);
- });
-
- Cypress.Commands.add('byDataID', (selector: string) => {
- cy.get(`[data-id="${selector}"]`);
- });
-
- Cypress.Commands.add(
- 'byTestSelector',
- (selector: string, options?: Partial) => {
- cy.get(`[data-test-selector="${selector}"]`, options);
- },
- );
-
- Cypress.Commands.add('byTestDropDownMenu', (selector: string) => {
- cy.get(`[data-test-dropdown-menu="${selector}"]`);
- });
-
- Cypress.Commands.add('byTestOperatorRow', (selector: string, options?: object) => {
- cy.get(`[data-test-operator-row="${selector}"]`, options);
- });
-
- Cypress.Commands.add('byTestSectionHeading', (selector: string) => {
- cy.get(`[data-test-section-heading="${selector}"]`);
- });
-
- Cypress.Commands.add('byTestOperandLink', (selector: string) => {
- cy.get(`[data-test-operand-link="${selector}"]`);
- });
-
- Cypress.Commands.add('byOUIAID', (selector: string) => cy.get(`[data-ouia-component-id^="${selector}"]`));
-
- Cypress.Commands.add('byClass', (selector: string) => cy.get(`[class="${selector}"]`));
-
- Cypress.Commands.add('bySemanticElement', (element: string, text?: string) => {
- if (text) {
- return cy.get(element).contains(text);
- }
- return cy.get(element);
- });
+ 'byLegacyTestID',
+ (selector: string, options?: Partial) => {
+ cy.get(`[data-test-id="${selector}"]`, options);
+ },
+);
- Cypress.Commands.add(
- 'byAriaLabel',
- (label: string, options?: Partial) => {
- return cy.get(`[aria-label="${label}"]`, options);
- }
- );
+Cypress.Commands.add('byButtonText', (selector: string) => {
+ cy.get('button[type="button"]').contains(`${selector}`);
+});
- Cypress.Commands.add(
- 'byPFRole',
- (role: string, options?: Partial) => {
- return cy.get(`[role="${role}"]`, options);
- }
- );
+Cypress.Commands.add('byDataID', (selector: string) => {
+ cy.get(`[data-id="${selector}"]`);
+});
+
+Cypress.Commands.add(
+ 'byTestSelector',
+ (selector: string, options?: Partial) => {
+ cy.get(`[data-test-selector="${selector}"]`, options);
+ },
+);
+
+Cypress.Commands.add('byTestDropDownMenu', (selector: string) => {
+ cy.get(`[data-test-dropdown-menu="${selector}"]`);
+});
+
+Cypress.Commands.add('byTestOperatorRow', (selector: string, options?: object) => {
+ cy.get(`[data-test-operator-row="${selector}"]`, options);
+});
+
+Cypress.Commands.add('byTestSectionHeading', (selector: string) => {
+ cy.get(`[data-test-section-heading="${selector}"]`);
+});
+
+Cypress.Commands.add('byTestOperandLink', (selector: string) => {
+ cy.get(`[data-test-operand-link="${selector}"]`);
+});
+
+Cypress.Commands.add('byOUIAID', (selector: string) =>
+ cy.get(`[data-ouia-component-id^="${selector}"]`),
+);
+
+Cypress.Commands.add('byClass', (selector: string) => cy.get(`[class="${selector}"]`));
+
+Cypress.Commands.add('bySemanticElement', (element: string, text?: string) => {
+ if (text) {
+ return cy.get(element).contains(text);
+ }
+ return cy.get(element);
+});
+
+Cypress.Commands.add(
+ 'byAriaLabel',
+ (label: string, options?: Partial) => {
+ return cy.get(`[aria-label="${label}"]`, options);
+ },
+);
+
+Cypress.Commands.add(
+ 'byPFRole',
+ (role: string, options?: Partial) => {
+ return cy.get(`[role="${role}"]`, options);
+ },
+);
diff --git a/web/cypress/support/commands/utility-commands.ts b/web/cypress/support/commands/utility-commands.ts
index 15d2fdd21..7ac083c44 100644
--- a/web/cypress/support/commands/utility-commands.ts
+++ b/web/cypress/support/commands/utility-commands.ts
@@ -1,29 +1,29 @@
-import { Classes, DataTestIDs, LegacyTestIDs } from "../../../src/components/data-test";
+import { Classes, DataTestIDs, LegacyTestIDs } from '../../../src/components/data-test';
export {};
declare global {
- namespace Cypress {
- interface Chainable {
- waitUntilWithCustomTimeout(
- fn: () => any,
- options: { interval: number; timeout: number; timeoutMessage: string }
- ): Cypress.Chainable;
- clickNavLink(path: string[]): Chainable;
- changeNamespace(namespace: string): Chainable;
- aboutModal(): Chainable;
- podImage(pod: string, namespace: string): Chainable;
- assertNamespace(namespace: string, exists: boolean): Chainable;
- }
+ // eslint-disable-next-line @typescript-eslint/no-namespace
+ namespace Cypress {
+ interface Chainable {
+ waitUntilWithCustomTimeout(
+ fn: () => any,
+ options: { interval: number; timeout: number; timeoutMessage: string },
+ ): Cypress.Chainable;
+ clickNavLink(path: string[]): Chainable;
+ changeNamespace(namespace: string): Chainable;
+ aboutModal(): Chainable;
+ podImage(pod: string, namespace: string): Chainable;
+ assertNamespace(namespace: string, exists: boolean): Chainable;
}
}
+}
// Custom waitUntil with timeout message
-Cypress.Commands.add('waitUntilWithCustomTimeout', (
- fn: () => any,
- options: { interval: number; timeout: number; timeoutMessage: string }
- ) => {
+Cypress.Commands.add(
+ 'waitUntilWithCustomTimeout',
+ (fn: () => any, options: { interval: number; timeout: number; timeoutMessage: string }) => {
const { timeoutMessage, ...waitOptions } = options;
-
+
// Set up custom error handling before the waitUntil call
cy.on('fail', (err) => {
if (err.message.includes('Timed out retrying')) {
@@ -35,156 +35,221 @@ Cypress.Commands.add('waitUntilWithCustomTimeout', (
// For any other errors, re-throw them unchanged
throw err;
});
-
+
// Execute the waitUntil with the original options (without timeoutMessage)
return cy.waitUntil(fn, waitOptions);
-
- });
+ },
+);
+Cypress.Commands.add('clickNavLink', (path: string[]) => {
+ cy.get('#page-sidebar')
+ .contains(path[0])
+ .then(($navItem) => {
+ if ($navItem.attr('aria-expanded') !== 'true') {
+ cy.wrap($navItem).click({ force: true });
+ }
+ });
+ if (path.length === 2) {
+ cy.get('#page-sidebar').contains(path[1]).click({ force: true });
+ }
+});
- Cypress.Commands.add('clickNavLink', (path: string[]) => {
- cy.get('#page-sidebar')
- .contains(path[0])
- .then(($navItem) => {
- if ($navItem.attr('aria-expanded') !== 'true') {
- cy.wrap($navItem).click({force: true});
+Cypress.Commands.add('changeNamespace', (namespace: string) => {
+ cy.log('Changing Namespace to: ' + namespace);
+ cy.wait(2000);
+ cy.get('body').then(($body) => {
+ const hasNamespaceBarDropdown =
+ $body.find('[data-test-id="' + LegacyTestIDs.NamespaceBarDropdown + '"]').length > 0;
+ if (hasNamespaceBarDropdown) {
+ cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ } else {
+ cy.get(Classes.NamespaceDropdown).scrollIntoView().should('be.visible');
+ cy.get(Classes.NamespaceDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ }
+ });
+ cy.get('body').then(($body) => {
+ const hasShowSystemSwitch =
+ $body.find('[data-test="' + DataTestIDs.NamespaceDropdownShowSwitch + '"]').length > 0;
+ if (hasShowSystemSwitch) {
+ cy.get('[data-test="' + DataTestIDs.NamespaceDropdownShowSwitch + '"]').then(($element) => {
+ if ($element.attr('data-checked-state') !== 'true') {
+ cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch)
+ .siblings('span')
+ .eq(0)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch)
+ .siblings('span')
+ .eq(0)
+ .should('be.visible')
+ .click({ force: true });
}
});
- if (path.length === 2) {
- cy.get('#page-sidebar')
- .contains(path[1])
- .click({force: true});
}
});
+ cy.byTestID(DataTestIDs.NamespaceDropdownTextFilter).type(namespace, { delay: 100 });
+ cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink).contains(namespace).should('be.visible');
+ cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink)
+ .contains(namespace)
+ .should('be.visible')
+ .click({ force: true });
+ cy.log('Namespace changed to: ' + namespace);
+});
- Cypress.Commands.add('changeNamespace', (namespace: string) => {
- cy.log('Changing Namespace to: ' + namespace);
- cy.wait(2000);
- cy.get('body').then(($body) => {
- const hasNamespaceBarDropdown = $body.find('[data-test-id="'+LegacyTestIDs.NamespaceBarDropdown+'"]').length > 0;
- if (hasNamespaceBarDropdown) {
- cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown).find('button').scrollIntoView().should('be.visible');
- cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown).find('button').scrollIntoView().should('be.visible').click({force: true});
- } else {
- cy.get(Classes.NamespaceDropdown).scrollIntoView().should('be.visible');
- cy.get(Classes.NamespaceDropdown).scrollIntoView().should('be.visible').click({force: true});
- }
- });
- cy.get('body').then(($body) => {
- const hasShowSystemSwitch = $body.find('[data-test="'+DataTestIDs.NamespaceDropdownShowSwitch+'"]').length > 0;
- if (hasShowSystemSwitch) {
- cy.get('[data-test="'+DataTestIDs.NamespaceDropdownShowSwitch+'"]').then(($element)=> {
- if ($element.attr('data-checked-state') !== 'true') {
- cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch).siblings('span').eq(0).should('be.visible');
- cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch).siblings('span').eq(0).should('be.visible').click({force: true});
- }
- });
- }
- });
- cy.byTestID(DataTestIDs.NamespaceDropdownTextFilter).type(namespace, {delay: 100});
- cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink).contains(namespace).should('be.visible');
- cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink).contains(namespace).should('be.visible').click({force: true});
- cy.log('Namespace changed to: ' + namespace);
- });
-
- Cypress.Commands.add('aboutModal', () => {
- cy.log('Getting OCP version');
- if (Cypress.env('LOGIN_USERNAME') === 'kubeadmin') {
- cy.byTestID(DataTestIDs.MastHeadHelpIcon).should('be.visible');
- cy.byTestID(DataTestIDs.MastHeadHelpIcon).should('be.visible').click({force: true});
- cy.byTestID(DataTestIDs.MastHeadApplicationItem).contains('About').should('be.visible').click();
- cy.byAriaLabel('About modal').find('div[class*="co-select-to-copy"]').eq(0).should('be.visible').then(($ocpversion) => {
+Cypress.Commands.add('aboutModal', () => {
+ cy.log('Getting OCP version');
+ if (Cypress.env('LOGIN_USERNAME') === 'kubeadmin') {
+ cy.byTestID(DataTestIDs.MastHeadHelpIcon).should('be.visible');
+ cy.byTestID(DataTestIDs.MastHeadHelpIcon).should('be.visible').click({ force: true });
+ cy.byTestID(DataTestIDs.MastHeadApplicationItem).contains('About').should('be.visible').click();
+ cy.byAriaLabel('About modal')
+ .find('div[class*="co-select-to-copy"]')
+ .eq(0)
+ .should('be.visible')
+ .then(($ocpversion) => {
cy.log('OCP version: ' + $ocpversion.text());
});
- cy.byAriaLabel('Close Dialog').should('be.visible').click();
- }
+ cy.byAriaLabel('Close Dialog').should('be.visible').click();
+ }
+});
- });
+Cypress.Commands.overwrite('log', (log, ...args) => {
+ if (Cypress.browser.isHeadless && Cypress.env('DEBUG')) {
+ // Log to the terminal using the custom task
+ return cy.task('log', args, { log: false }).then(() => {
+ // The original cy.log is still executed but its output is hidden from the
+ // command log in headless mode
+ return log(...args);
+ });
+ } else {
+ // In headed mode, use the original cy.log behavior
+ return log(...args);
+ }
+});
- Cypress.Commands.overwrite('log', (log, ...args) => {
- if (Cypress.browser.isHeadless && Cypress.env('DEBUG')) {
- // Log to the terminal using the custom task
- return cy.task('log', args, { log: false }).then(() => {
- // The original cy.log is still executed but its output is hidden from the
- // command log in headless mode
- return log(...args);
- });
+Cypress.Commands.add('podImage', (pod: string, namespace: string) => {
+ cy.log('Get pod image');
+ cy.switchPerspective('Core platform', 'Administrator');
+ cy.wait(5000);
+ cy.clickNavLink(['Workloads', 'Pods']);
+ cy.changeNamespace(namespace);
+ cy.byTestID('page-heading').contains('Pods').should('be.visible');
+ cy.wait(5000);
+ // Check for DataViewFilters component using Cypress's built-in retry-ability
+ cy.get('body').then(($body) => {
+ const hasDataViewFilters = $body.find('[data-ouia-component-id="DataViewFilters"]').length > 0;
+ if (hasDataViewFilters) {
+ cy.byOUIAID('DataViewFilters')
+ .find('button')
+ .contains('Status')
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
+ cy.byOUIAID('OUIA-Generated-Menu')
+ .find('button')
+ .contains('Name')
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
+ cy.byAriaLabel('Name filter').scrollIntoView().should('be.visible').type(pod);
} else {
- // In headed mode, use the original cy.log behavior
- return log(...args);
+ cy.byTestID('name-filter-input').should('be.visible').type(pod);
}
});
-
- Cypress.Commands.add('podImage', (pod: string, namespace: string) => {
- cy.log('Get pod image');
- cy.switchPerspective('Core platform', 'Administrator');
- cy.wait(5000);
- cy.clickNavLink(['Workloads', 'Pods']);
- cy.changeNamespace(namespace);
- cy.byTestID('page-heading').contains('Pods').should('be.visible');
- cy.wait(5000);
- // Check for DataViewFilters component using Cypress's built-in retry-ability
- cy.get('body').then(($body) => {
- const hasDataViewFilters = $body.find('[data-ouia-component-id="DataViewFilters"]').length > 0;
- if (hasDataViewFilters) {
- cy.byOUIAID('DataViewFilters').find('button').contains('Status').scrollIntoView().should('be.visible').click();
- cy.byOUIAID('OUIA-Generated-Menu').find('button').contains('Name').scrollIntoView().should('be.visible').click();
- cy.byAriaLabel('Name filter').scrollIntoView().should('be.visible').type(pod);
- } else {
- cy.byTestID('name-filter-input').should('be.visible').type(pod);
- }
+ cy.get(`a[data-test^="${pod}"]`).eq(0).as('podLink').click();
+ cy.get('@podLink').should('be.visible').click();
+ cy.byPFRole('rowgroup')
+ .find('td')
+ .eq(1)
+ .scrollIntoView()
+ .should('be.visible')
+ .then(($td) => {
+ cy.log('Pod image: ' + $td.text());
});
- cy.get(`a[data-test^="${pod}"]`).eq(0).as('podLink').click();
- cy.get('@podLink').should('be.visible').click();
- cy.byPFRole('rowgroup').find('td').eq(1).scrollIntoView().should('be.visible').then(($td) => {
- cy.log('Pod image: ' + $td.text());
+ cy.log('Get pod image completed');
+});
+
+Cypress.Commands.add('assertNamespace', (namespace: string, exists: boolean) => {
+ cy.log('Asserting Namespace: ' + namespace + ' exists: ' + exists);
+ cy.wait(2000);
+ cy.get('body').then(($body) => {
+ const hasNamespaceBarDropdown =
+ $body.find('[data-test-id="' + LegacyTestIDs.NamespaceBarDropdown + '"]').length > 0;
+ if (hasNamespaceBarDropdown) {
+ cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ } else {
+ cy.get(Classes.NamespaceDropdown).scrollIntoView().should('be.visible');
+ cy.get(Classes.NamespaceDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ }
+ });
+ cy.get('body').then(($body) => {
+ const hasShowSystemSwitch =
+ $body.find('[data-test="' + DataTestIDs.NamespaceDropdownShowSwitch + '"]').length > 0;
+ if (hasShowSystemSwitch) {
+ cy.get('[data-test="' + DataTestIDs.NamespaceDropdownShowSwitch + '"]').then(($element) => {
+ if ($element.attr('data-checked-state') !== 'true') {
+ cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch)
+ .siblings('span')
+ .eq(0)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch)
+ .siblings('span')
+ .eq(0)
+ .should('be.visible')
+ .click({ force: true });
+ }
});
- cy.log('Get pod image completed');
+ }
});
+ cy.byTestID(DataTestIDs.NamespaceDropdownTextFilter).type(namespace, { delay: 100 });
+ if (exists) {
+ cy.log('Namespace: ' + namespace + ' exists');
+ cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink).contains(namespace).should('be.visible');
+ } else {
+ cy.log('Namespace: ' + namespace + ' does not exist');
+ cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink).should('not.exist');
+ }
-
- Cypress.Commands.add('assertNamespace', (namespace: string, exists: boolean) => {
- cy.log('Asserting Namespace: ' + namespace + ' exists: ' + exists);
- cy.wait(2000);
- cy.get('body').then(($body) => {
- const hasNamespaceBarDropdown = $body.find('[data-test-id="'+LegacyTestIDs.NamespaceBarDropdown+'"]').length > 0;
- if (hasNamespaceBarDropdown) {
- cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown).find('button').scrollIntoView().should('be.visible');
- cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown).find('button').scrollIntoView().should('be.visible').click({force: true});
- } else {
- cy.get(Classes.NamespaceDropdown).scrollIntoView().should('be.visible');
- cy.get(Classes.NamespaceDropdown).scrollIntoView().should('be.visible').click({force: true});
- }
- });
- cy.get('body').then(($body) => {
- const hasShowSystemSwitch = $body.find('[data-test="'+DataTestIDs.NamespaceDropdownShowSwitch+'"]').length > 0;
- if (hasShowSystemSwitch) {
- cy.get('[data-test="'+DataTestIDs.NamespaceDropdownShowSwitch+'"]').then(($element)=> {
- if ($element.attr('data-checked-state') !== 'true') {
- cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch).siblings('span').eq(0).should('be.visible');
- cy.byTestID(DataTestIDs.NamespaceDropdownShowSwitch).siblings('span').eq(0).should('be.visible').click({force: true});
- }
- });
- }
- });
- cy.byTestID(DataTestIDs.NamespaceDropdownTextFilter).type(namespace, {delay: 100});
- if (exists) {
- cy.log('Namespace: ' + namespace + ' exists');
- cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink).contains(namespace).should('be.visible');
+ cy.get('body').then(($body) => {
+ const hasNamespaceBarDropdown =
+ $body.find('[data-test-id="' + LegacyTestIDs.NamespaceBarDropdown + '"]').length > 0;
+ if (hasNamespaceBarDropdown) {
+ cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
} else {
- cy.log('Namespace: ' + namespace + ' does not exist');
- cy.byTestID(DataTestIDs.NamespaceDropdownMenuLink).should('not.exist');
+ cy.get(Classes.NamespaceDropdownExpanded).scrollIntoView().should('be.visible');
+ cy.get(Classes.NamespaceDropdownExpanded)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
}
-
- cy.get('body').then(($body) => {
- const hasNamespaceBarDropdown = $body.find('[data-test-id="'+LegacyTestIDs.NamespaceBarDropdown+'"]').length > 0;
- if (hasNamespaceBarDropdown) {
- cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown).find('button').scrollIntoView().should('be.visible');
- cy.byLegacyTestID(LegacyTestIDs.NamespaceBarDropdown).find('button').scrollIntoView().should('be.visible').click({force: true});
- } else {
- cy.get(Classes.NamespaceDropdownExpanded).scrollIntoView().should('be.visible');
- cy.get(Classes.NamespaceDropdownExpanded).scrollIntoView().should('be.visible').click({force: true});
- }
- });
-
- });
\ No newline at end of file
+ });
+});
diff --git a/web/cypress/support/commands/virtualization-commands.ts b/web/cypress/support/commands/virtualization-commands.ts
index b98f158d0..6c3e9ccd1 100644
--- a/web/cypress/support/commands/virtualization-commands.ts
+++ b/web/cypress/support/commands/virtualization-commands.ts
@@ -1,8 +1,4 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
-import Loggable = Cypress.Loggable;
-import Timeoutable = Cypress.Timeoutable;
-import Withinable = Cypress.Withinable;
-import Shadow = Cypress.Shadow;
import 'cypress-wait-until';
import { operatorHubPage } from '../../views/operator-hub-page';
import { nav } from '../../views/nav';
@@ -12,95 +8,107 @@ import { guidedTour } from '../../views/tour';
export {};
declare global {
- namespace Cypress {
- interface Chainable {
- adminCLI(command: string, options?);
- executeAndDelete(command: string);
- beforeBlockVirtualization(KBV: { namespace: string, packageName: string });
- cleanupKBV(KBV: { namespace: string, packageName: string });
- }
+ // eslint-disable-next-line @typescript-eslint/no-namespace
+ namespace Cypress {
+ interface Chainable {
+ adminCLI(command: string, options?);
+ executeAndDelete(command: string);
+ beforeBlockVirtualization(KBV: { namespace: string; packageName: string });
+ cleanupKBV(KBV: { namespace: string; packageName: string });
}
}
-
+}
+
const readyTimeoutMilliseconds = Cypress.config('readyTimeoutMilliseconds') as number;
const installTimeoutMilliseconds = Cypress.config('installTimeoutMilliseconds') as number;
-let operatorName;
-
const useSession = Cypress.env('SESSION');
const virtualizationUtils = {
- installVirtualization(KBV: { namespace: string, packageName: string }): void {
+ installVirtualization(KBV: { namespace: string; packageName: string }): void {
if (Cypress.env('SKIP_KBV_INSTALL')) {
cy.log('SKIP_KBV_INSTALL is set. Skipping Openshift Virtualization installation.');
} else if (Cypress.env('KBV_UI_INSTALL')) {
- cy.log('KBV_UI_INSTALL is set. Kubevirt will be installed from redhat-operators catalog source');
+ cy.log(
+ 'KBV_UI_INSTALL is set. Kubevirt will be installed from redhat-operators catalog source',
+ );
cy.log('Install Openshift Virtualization');
operatorHubPage.installOperator(KBV.packageName, 'redhat-operators');
- cy.get('.co-clusterserviceversion-install__heading', { timeout: installTimeoutMilliseconds }).should(
- 'include.text',
- 'Create initialization resource',
- );
-
+ cy.get('.co-clusterserviceversion-install__heading', {
+ timeout: installTimeoutMilliseconds,
+ }).should('include.text', 'Create initialization resource');
} else if (Cypress.env('KONFLUX_KBV_BUNDLE_IMAGE')) {
- cy.log('KONFLUX_KBV_BUNDLE_IMAGE is set. Openshift Virtualization operator will be installed from Konflux bundle.');
+ cy.log(
+ 'KONFLUX_KBV_BUNDLE_IMAGE is set. Openshift Virtualization operator will be installed from Konflux bundle.',
+ );
cy.log('Install Openshift Virtualization');
cy.exec(
`oc create namespace ${KBV.namespace} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
);
cy.exec(
- `operator-sdk run bundle --timeout=10m --namespace ${KBV.namespace} ${Cypress.env('KONFLUX_KBV_BUNDLE_IMAGE')} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
+ `operator-sdk run bundle --timeout=10m --namespace ${KBV.namespace} ${Cypress.env(
+ 'KONFLUX_KBV_BUNDLE_IMAGE',
+ )} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
{ timeout: installTimeoutMilliseconds },
);
} else if (Cypress.env('CUSTOM_KBV_BUNDLE_IMAGE')) {
- cy.log('CUSTOM_KBV_BUNDLE_IMAGE is set. Openshift Virtualization operator will be installed from custom built bundle.');
+ cy.log(
+ 'CUSTOM_KBV_BUNDLE_IMAGE is set. Openshift Virtualization operator will be installed from custom built bundle.',
+ );
cy.log('Install Openshift Virtualization');
cy.exec(
`oc create namespace ${KBV.namespace} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
);
cy.exec(
- `operator-sdk run bundle --timeout=10m --namespace ${KBV.namespace} ${Cypress.env('CUSTOM_KBV_BUNDLE_IMAGE')} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
+ `operator-sdk run bundle --timeout=10m --namespace ${KBV.namespace} ${Cypress.env(
+ 'CUSTOM_KBV_BUNDLE_IMAGE',
+ )} --kubeconfig ${Cypress.env('KUBECONFIG_PATH')} --verbose `,
{ timeout: installTimeoutMilliseconds },
);
} else if (Cypress.env('FBC_STAGE_KBV_IMAGE')) {
- cy.log('FBC_STAGE_KBV_IMAGE is set. Openshift Virtualization operator will be installed from FBC image.');
- cy.log('Install Openshift Virtualization');
-
- cy.exec(
- './cypress/fixtures/virtulization/virtualization_stage.sh',
- {
- env: {
- FBC_STAGE_KBV_IMAGE: Cypress.env('FBC_STAGE_KBV_IMAGE'),
- KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
- },
- timeout: installTimeoutMilliseconds
- }
+ cy.log(
+ 'FBC_STAGE_KBV_IMAGE is set. Openshift Virtualization operator will be installed from FBC image.',
);
+ cy.log('Install Openshift Virtualization');
+
+ cy.exec('./cypress/fixtures/virtualization/virtualization_stage.sh', {
+ env: {
+ FBC_STAGE_KBV_IMAGE: Cypress.env('FBC_STAGE_KBV_IMAGE'),
+ KUBECONFIG: Cypress.env('KUBECONFIG_PATH'),
+ },
+ timeout: installTimeoutMilliseconds,
+ });
} else {
- throw new Error('No CYPRESS env set for operator installation, check the README for more details.');
+ throw new Error(
+ 'No CYPRESS env set for operator installation, check the README for more details.',
+ );
}
},
- waitForVirtualizationReady(KBV: { namespace: string}): void {
+ waitForVirtualizationReady(KBV: { namespace: string }): void {
cy.log('Check Openshift Virtualization status');
cy.exec(`oc get csv -n openshift-cnv | grep kubevirt | awk '{print $1}'`)
.its('stdout') // Get the captured output string
.then((operatorName) => {
- // Trim any extra whitespace (newline, etc.)
- const KBV_OPERATOR_NAME = operatorName.trim();
-
- cy.log(`Successfully retrieved Operator Name: ${KBV_OPERATOR_NAME}`);
-
- // Now, run your actual oc wait command using the captured variable
- cy.exec(
- `sleep 15 && oc wait --for=jsonpath='{.status.phase}'=Succeeded ClusterServiceVersion/${KBV_OPERATOR_NAME} -n ${KBV.namespace} --timeout=300s --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`
- , {
- timeout: readyTimeoutMilliseconds // Set a long timeout for the 'oc wait' command
- }
- );
- });
+ // Trim any extra whitespace (newline, etc.)
+ const KBV_OPERATOR_NAME = operatorName.trim();
+
+ cy.log(`Successfully retrieved Operator Name: ${KBV_OPERATOR_NAME}`);
+
+ // Now, run your actual oc wait command using the captured variable
+ cy.exec(
+ `sleep 15 && oc wait ` +
+ `--for=jsonpath='{.status.phase}'=Succeeded ` +
+ `ClusterServiceVersion/${KBV_OPERATOR_NAME} ` +
+ `-n ${KBV.namespace} ` +
+ `--timeout=300s --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ {
+ timeout: readyTimeoutMilliseconds, // Set a long timeout for the 'oc wait' command
+ },
+ );
+ });
cy.get('#page-sidebar').then(($sidebar) => {
const section = $sidebar.text().includes('Ecosystem') ? 'Ecosystem' : 'Operators';
@@ -110,12 +118,12 @@ const virtualizationUtils = {
cy.changeNamespace(KBV.namespace);
cy.byTestID('name-filter-input').should('be.visible').type('Openshift Virtualization{enter}');
- cy.get('[data-test="status-text"]', { timeout: installTimeoutMilliseconds }).eq(0).should('contain.text', 'Succeeded', { timeout: installTimeoutMilliseconds });
-
+ cy.get('[data-test="status-text"]', { timeout: installTimeoutMilliseconds })
+ .eq(0)
+ .should('contain.text', 'Succeeded', { timeout: installTimeoutMilliseconds });
},
- setupHyperconverged(KBV: { namespace: string}): void {
-
+ setupHyperconverged(KBV: { namespace: string }): void {
if (Cypress.env('SKIP_KBV_INSTALL')) {
cy.log('Skip Hyperconverged instance creation.');
} else if (Cypress.env('KBV_UI_INSTALL')) {
@@ -124,22 +132,35 @@ const virtualizationUtils = {
.its('stdout') // Get the captured output string
.then((operatorName) => {
// Trim any extra whitespace (newline, etc.)
- const KBV_OPERATOR_NAME = operatorName.trim();
+ const KBV_OPERATOR_NAME = operatorName.trim();
cy.log(`Successfully retrieved Operator Name: ${KBV_OPERATOR_NAME}`);
- cy.visit(`k8s/ns/openshift-cnv/operators.coreos.com~v1alpha1~ClusterServiceVersion/${KBV_OPERATOR_NAME}`);
- cy.byOUIAID('OUIA-Generated-Button-primary').contains('Create HyperConverged').should('be.visible').click();
+ cy.visit(
+ `k8s/ns/openshift-cnv/operators.coreos.com~v1alpha1~` +
+ `ClusterServiceVersion/${KBV_OPERATOR_NAME}`,
+ );
+ cy.byOUIAID('OUIA-Generated-Button-primary')
+ .contains('Create HyperConverged')
+ .should('be.visible')
+ .click();
cy.byTestID('create-dynamic-form').scrollIntoView().should('be.visible').click();
- cy.byTestID('status-text').should('contain.text', 'ReconcileComplete', { timeout: installTimeoutMilliseconds });
+ cy.byTestID('status-text').should('contain.text', 'ReconcileComplete', {
+ timeout: installTimeoutMilliseconds,
+ });
});
} else {
cy.log('Create Hyperconverged instance.');
- cy.exec(`oc apply -f ./cypress/fixtures/virtualization/hyperconverged.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
cy.exec(
- `sleep 15 && oc wait --for=condition=Available --selector=app=kubevirt-hyperconverged -n ${KBV.namespace} --timeout=60s --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc apply -f ./cypress/fixtures/virtualization/hyperconverged.yaml ` +
+ `--kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
+ cy.exec(
+ `sleep 15 && oc wait --for=condition=Available --selector=app=kubevirt-hyperconverged -n ${
+ KBV.namespace
+ } --timeout=60s --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
{
timeout: readyTimeoutMilliseconds,
- failOnNonZeroExit: true
- }
+ failOnNonZeroExit: true,
+ },
).then((result) => {
expect(result.code).to.eq(0);
cy.log(`Hyperconverged is now running in namespace: ${KBV.namespace}`);
@@ -148,12 +169,14 @@ const virtualizationUtils = {
cy.reload(true);
cy.byLegacyTestID('perspective-switcher-toggle').should('be.visible');
-
},
- cleanup(KBV: { namespace: string, config?: { kind: string, name: string }, crd?: { kubevirt: string, hyperconverged: string } }): void {
- const config = KBV.config || { kind: 'HyperConverged', name: 'kubevirt-hyperconverged' }
- const crd = KBV.crd || { kubevirt: 'kubevirts.kubevirt.io', hyperconverged: 'hyperconvergeds.hco.kubevirt.io' };
+ cleanup(KBV: {
+ namespace: string;
+ config?: { kind: string; name: string };
+ crd?: { kubevirt: string; hyperconverged: string };
+ }): void {
+ const config = KBV.config || { kind: 'HyperConverged', name: 'kubevirt-hyperconverged' };
cy.adminCLI(
`oc adm policy add-cluster-role-to-user cluster-admin ${Cypress.env('LOGIN_USERNAME')}`,
@@ -161,43 +184,73 @@ const virtualizationUtils = {
if (Cypress.env('SKIP_KBV_INSTALL')) {
cy.log('Maintain Openshift Virtualization');
-
} else {
//https://docs.redhat.com/en/documentation/openshift_container_platform/4.19/html/virtualization/installing#virt-deleting-virt-cli_uninstalling-virt
- cy.log('Delete Hyperconverged instance.');
- cy.executeAndDelete(`oc patch hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged -n ${KBV.namespace} -p '{"metadata":{"finalizers":[]}}' --type=merge --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.log('Delete Hyperconverged instance.');
+ cy.executeAndDelete(
+ `oc patch hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged -n ${
+ KBV.namespace
+ } -p '{"metadata":{"finalizers":[]}}' --type=merge --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
+
+ cy.executeAndDelete(
+ `oc patch kubevirt.kubevirt.io/kubevirt -n ${
+ KBV.namespace
+ } --type=merge -p '{"metadata":{"finalizers":[]}}' --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
- cy.executeAndDelete(`oc patch kubevirt.kubevirt.io/kubevirt -n ${KBV.namespace} --type=merge -p '{"metadata":{"finalizers":[]}}' --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete HyperConverged kubevirt-hyperconverged -n ${
+ KBV.namespace
+ } --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
- cy.executeAndDelete(`oc delete HyperConverged kubevirt-hyperconverged -n ${KBV.namespace} --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
-
cy.log('Remove Openshift Virtualization subscription');
- cy.executeAndDelete(`oc delete subscription ${config.name} -n ${KBV.namespace} --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete subscription ${config.name} -n ${
+ KBV.namespace
+ } --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ );
cy.log('Remove Openshift Virtualization CSV');
- cy.executeAndDelete(`oc delete csv -n ${KBV.namespace} -l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ cy.executeAndDelete(
+ `oc delete csv -n ${KBV.namespace} ` +
+ `-l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
);
cy.log('Remove Openshift Virtualization namespace');
- cy.executeAndDelete(`oc delete namespace ${KBV.namespace} --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`);
+ cy.executeAndDelete(
+ `oc delete namespace ${KBV.namespace} --ignore-not-found --kubeconfig ${Cypress.env(
+ 'KUBECONFIG_PATH',
+ )}`,
+ );
cy.log('Delete Hyperconverged CRD instance.');
cy.executeAndDelete(
- `oc delete crd --dry-run=client -l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc delete crd --dry-run=client ` +
+ `-l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
);
cy.log('Delete Kubevirt instance.');
cy.executeAndDelete(
- `oc delete crd -l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv --ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
+ `oc delete crd ` +
+ `-l operators.coreos.com/kubevirt-hyperconverged.openshift-cnv ` +
+ `--ignore-not-found --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`,
);
-
}
- }
+ },
};
-
- Cypress.Commands.add('beforeBlockVirtualization', (KBV: { namespace: string, packageName: string }) => {
+Cypress.Commands.add(
+ 'beforeBlockVirtualization',
+ (KBV: { namespace: string; packageName: string }) => {
if (useSession) {
const sessionKey = operatorAuthUtils.generateKBVSessionKey(KBV);
cy.session(
@@ -220,7 +273,6 @@ const virtualizationUtils = {
// Additional validation for Virtualization setup
cy.switchPerspective('Virtualization');
guidedTour.closeKubevirtTour();
-
},
},
);
@@ -235,10 +287,11 @@ const virtualizationUtils = {
virtualizationUtils.setupHyperconverged(KBV);
cy.log('Before block Virtualization (no session) completed');
}
- });
-
- Cypress.Commands.add('cleanupKBV', (KBV: { namespace: string, packageName: string }) => {
- cy.log('Cleanup Virtualization (no session)');
- virtualizationUtils.cleanup(KBV);
- cy.log('Cleanup Virtualization (no session) completed');
- });
+ },
+);
+
+Cypress.Commands.add('cleanupKBV', (KBV: { namespace: string; packageName: string }) => {
+ cy.log('Cleanup Virtualization (no session)');
+ virtualizationUtils.cleanup(KBV);
+ cy.log('Cleanup Virtualization (no session) completed');
+});
diff --git a/web/cypress/support/commands/wait-utils.ts b/web/cypress/support/commands/wait-utils.ts
index e0279a8e4..0ff18986c 100644
--- a/web/cypress/support/commands/wait-utils.ts
+++ b/web/cypress/support/commands/wait-utils.ts
@@ -21,14 +21,17 @@ export function waitForPodsReady(
() =>
cy
.exec(
- `oc wait --for=condition=Ready pods --selector=${selector} -n ${namespace} --timeout=10s --kubeconfig ${kubeconfig}`,
+ `oc wait --for=condition=Ready pods --selector=${selector} ` +
+ `-n ${namespace} --timeout=10s --kubeconfig ${kubeconfig}`,
{ failOnNonZeroExit: false, timeout: 20000 },
)
.then((result) => result.code === 0),
{
timeout,
interval: intervalMs,
- errorMsg: `Pods with selector '${selector}' not ready in '${namespace}' within ${timeout / 1000}s`,
+ errorMsg: `Pods with selector '${selector}' not ready in '${namespace}' within ${
+ timeout / 1000
+ }s`,
},
);
}
@@ -50,17 +53,19 @@ export function waitForPodsReadyOrAbsent(
() =>
cy
.exec(
- `oc wait --for=condition=Ready pods --selector=${selector} -n ${namespace} --timeout=10s --kubeconfig ${kubeconfig}`,
+ `oc wait --for=condition=Ready pods --selector=${selector} ` +
+ `-n ${namespace} --timeout=10s --kubeconfig ${kubeconfig}`,
{ failOnNonZeroExit: false, timeout: 20000 },
)
.then(
- (result) =>
- result.code === 0 || result.stderr.includes('no matching resources found'),
+ (result) => result.code === 0 || result.stderr.includes('no matching resources found'),
),
{
timeout,
interval: intervalMs,
- errorMsg: `Pods with selector '${selector}' neither ready nor absent in '${namespace}' within ${timeout / 1000}s`,
+ errorMsg:
+ `Pods with selector '${selector}' neither ready nor absent ` +
+ `in '${namespace}' within ${timeout / 1000}s`,
},
);
}
@@ -83,14 +88,17 @@ export function waitForResourceCondition(
() =>
cy
.exec(
- `oc wait --for=${condition} ${resource} -n ${namespace} --timeout=10s --kubeconfig ${kubeconfig}`,
+ `oc wait --for=${condition} ${resource} ` +
+ `-n ${namespace} --timeout=10s --kubeconfig ${kubeconfig}`,
{ failOnNonZeroExit: false, timeout: 20000 },
)
.then((result) => result.code === 0),
{
timeout,
interval: intervalMs,
- errorMsg: `Condition '${condition}' not met for '${resource}' in '${namespace}' within ${timeout / 1000}s`,
+ errorMsg: `Condition '${condition}' not met for '${resource}' in '${namespace}' within ${
+ timeout / 1000
+ }s`,
},
);
}
diff --git a/web/cypress/support/e2e.js b/web/cypress/support/e2e.js
index 56bfe492c..06b7d843b 100644
--- a/web/cypress/support/e2e.js
+++ b/web/cypress/support/e2e.js
@@ -1,4 +1,4 @@
import './commands';
import registerCypressGrep from '@cypress/grep';
-registerCypressGrep();
\ No newline at end of file
+registerCypressGrep();
diff --git a/web/cypress/support/incidents_prometheus_query_mocks/mock-generators.ts b/web/cypress/support/incidents_prometheus_query_mocks/mock-generators.ts
index 28a728c32..e5a8d19a9 100644
--- a/web/cypress/support/incidents_prometheus_query_mocks/mock-generators.ts
+++ b/web/cypress/support/incidents_prometheus_query_mocks/mock-generators.ts
@@ -1,5 +1,5 @@
// Mock data generators for Prometheus mocking system
-import { IncidentDefinition, PrometheusResult, AlertDefinition } from './types';
+import { IncidentDefinition, PrometheusResult } from './types';
import { severityToValue, parseQueryLabels } from './utils';
import { nowInClusterTimezone } from './utils';
import { NEW_METRIC_NAME, OLD_METRIC_NAME } from './prometheus-mocks';
@@ -13,23 +13,23 @@ function generateIntervalTimestamps(startTime: number, endTime: number): number[
const duration = endTime - startTime;
const fiveMinutes = 300;
const timestamps: number[] = [];
-
- if (duration < fiveMinutes) {
+
+ if (duration < fiveMinutes) {
timestamps.push(startTime);
return timestamps;
}
-
+
let currentTime = startTime;
while (currentTime <= endTime) {
timestamps.push(currentTime);
currentTime += fiveMinutes;
}
-
+
// Ensure we have the end timestamp if it doesn't align with 5-minute intervals
if (timestamps[timestamps.length - 1] !== endTime) {
timestamps.push(endTime);
}
-
+
return timestamps;
}
@@ -39,13 +39,13 @@ function generateIntervalTimestamps(startTime: number, endTime: number): number[
function getSeverityAtTime(
timestamp: number,
severityChanges: Array<{ timestamp: number; severity: 'critical' | 'warning' | 'info' }>,
- defaultSeverity: 'critical' | 'warning' | 'info'
+ defaultSeverity: 'critical' | 'warning' | 'info',
): 'critical' | 'warning' | 'info' {
// Find the most recent severity change before or at this timestamp
const applicableChange = severityChanges
- .filter(change => change.timestamp <= timestamp)
+ .filter((change) => change.timestamp <= timestamp)
.sort((a, b) => b.timestamp - a.timestamp)[0];
-
+
return applicableChange ? applicableChange.severity : defaultSeverity;
}
@@ -55,7 +55,7 @@ function getSeverityAtTime(
function severityToMetricValue(
severity: 'critical' | 'warning' | 'info',
alertSeverity: 'critical' | 'warning' | 'info',
- metricType: 'health' | 'alerts'
+ metricType: 'health' | 'alerts',
): string {
if (metricType === 'alerts') {
return severity === alertSeverity ? '1' : '0';
@@ -71,13 +71,13 @@ function buildTimelineValues(
alertSeverity: 'critical' | 'warning' | 'info',
metricType: 'health' | 'alerts',
queryStartTime?: number,
- queryEndTime?: number
+ queryEndTime?: number,
): Array<[number, string]> {
const now = nowInClusterTimezone();
const isOngoing = !timeline.end;
let endTime = isOngoing ? now - 60 : timeline.end;
let startTime = timeline.start;
-
+
// Constrain to query window if provided (simulates Prometheus time range filtering)
if (queryStartTime !== undefined) {
startTime = Math.max(startTime, queryStartTime);
@@ -85,19 +85,19 @@ function buildTimelineValues(
if (queryEndTime !== undefined) {
endTime = Math.min(endTime, queryEndTime);
}
-
+
// Skip if no data in this time window
if (startTime > endTime) {
return [];
}
-
+
const timestamps = generateIntervalTimestamps(startTime, endTime);
-
+
const values: Array<[number, string]> = [];
-
+
if (timeline.severityChanges?.length) {
// Timeline with severity changes: use 5-minute intervals with dynamic severity
- timestamps.forEach(timestamp => {
+ timestamps.forEach((timestamp) => {
const severity = getSeverityAtTime(timestamp, timeline.severityChanges, alertSeverity);
const value = severityToMetricValue(severity, alertSeverity, metricType);
values.push([timestamp, value]);
@@ -105,7 +105,7 @@ function buildTimelineValues(
} else {
// Simple timeline: constant severity throughout
const value = severityToMetricValue(alertSeverity, alertSeverity, metricType);
- timestamps.forEach(timestamp => {
+ timestamps.forEach((timestamp) => {
values.push([timestamp, value]);
});
}
@@ -117,33 +117,33 @@ function buildTimelineValues(
* Creates mock incident data from declarative definitions
*/
export function createIncidentMock(
- incidents: IncidentDefinition[],
+ incidents: IncidentDefinition[],
query?: string,
queryStartTime?: number,
- queryEndTime?: number
+ queryEndTime?: number,
): PrometheusResult[] {
const now = nowInClusterTimezone();
const results: PrometheusResult[] = [];
-
+
// Parse query to extract label selectors if provided
const queryLabels = query ? parseQueryLabels(query) : {};
const versioned_metric = query?.includes(NEW_METRIC_NAME) ? NEW_METRIC_NAME : OLD_METRIC_NAME;
- incidents.forEach(incident => {
+ incidents.forEach((incident) => {
// Filter incidents based on query parameters
if (queryLabels.group_id) {
const groupIdFilter = queryLabels.group_id;
- const groupIdMatches = Array.isArray(groupIdFilter)
+ const groupIdMatches = Array.isArray(groupIdFilter)
? groupIdFilter.includes(incident.id)
: groupIdFilter === incident.id;
-
+
if (!groupIdMatches) {
return; // Skip this incident if it doesn't match the query's group_id(s)
}
}
-
- incident.alerts.forEach(alert => {
+
+ incident.alerts.forEach((alert) => {
const metric: Record = {
__name__: versioned_metric,
component: alert.component || incident.component,
@@ -162,7 +162,7 @@ export function createIncidentMock(
namespace: Cypress.env('COO_NAMESPACE'),
pod: 'health-analyzer-55fc4cbbb6-5gjcv',
prometheus: 'openshift-monitoring/k8s',
- service: 'health-analyzer'
+ service: 'health-analyzer',
};
if (incident.managed_cluster) {
@@ -171,20 +171,30 @@ export function createIncidentMock(
// Generate timeline values using unified function
const timeline = incident.timeline || { start: now - 3600 * 24 * 7 };
- const values = buildTimelineValues(timeline, alert.severity, 'health', queryStartTime, queryEndTime);
+ const values = buildTimelineValues(
+ timeline,
+ alert.severity,
+ 'health',
+ queryStartTime,
+ queryEndTime,
+ );
// Skip if no data in query time window
if (values.length === 0) {
return;
}
+ // eslint-disable-next-line no-console
console.log(`Adding alert: ${alert.name} from incident: ${incident.id}`);
+ // eslint-disable-next-line no-console
console.log(`Results array length before push: ${results.length}`);
results.push({ metric, values });
+ // eslint-disable-next-line no-console
console.log(`Results array length after push: ${results.length}`);
});
});
+ // eslint-disable-next-line no-console
console.log(`Final results array length: ${results.length}`);
return results;
}
@@ -193,54 +203,53 @@ export function createIncidentMock(
* Creates mock ALERTS metric data for alert detail queries
*/
export function createAlertDetailsMock(
- incidents: IncidentDefinition[],
+ incidents: IncidentDefinition[],
query: string,
queryStartTime?: number,
- queryEndTime?: number
+ queryEndTime?: number,
): PrometheusResult[] {
const now = nowInClusterTimezone();
const results: PrometheusResult[] = [];
-
+
// Parse query to extract label selectors
const queryLabels = parseQueryLabels(query);
-
- incidents.forEach(incident => {
- incident.alerts.forEach(alert => {
+
+ incidents.forEach((incident) => {
+ incident.alerts.forEach((alert) => {
// Filter alerts based on query parameters
if (queryLabels.alertname) {
const alertnameFilter = queryLabels.alertname;
- const alertnameMatches = Array.isArray(alertnameFilter)
+ const alertnameMatches = Array.isArray(alertnameFilter)
? alertnameFilter.includes(alert.name)
: alertnameFilter === alert.name;
-
+
if (!alertnameMatches) {
return; // Skip this alert if it doesn't match the query's alertname(s)
}
}
-
- if (queryLabels.namespace) {
- const namespaceFilter = queryLabels.namespace;
- const namespaceMatches = Array.isArray(namespaceFilter)
- ? namespaceFilter.includes(alert.namespace)
- : namespaceFilter === alert.namespace;
-
- if (!namespaceMatches) {
- return; // Skip this alert if it doesn't match the query's namespace(s)
- }
- }
-
+
+ if (queryLabels.namespace) {
+ const namespaceFilter = queryLabels.namespace;
+ const namespaceMatches = Array.isArray(namespaceFilter)
+ ? namespaceFilter.includes(alert.namespace)
+ : namespaceFilter === alert.namespace;
+
+ if (!namespaceMatches) {
+ return; // Skip this alert if it doesn't match the query's namespace(s)
+ }
+ }
+
// Use individual alert timeline if available, otherwise fall back to incident timeline
const timeline = alert.timeline || incident.timeline || { start: now - 3600 * 24 * 7 };
- const isFiring = !timeline.end;
-
+
const effectiveComponent = alert.component || incident.component;
const metric: Record = {
__name__: 'ALERTS',
alertname: alert.name,
// The only way to see the alert in UI is to have the alertstate as firing
- // Resolved is determined entirely by the values array (last value in 10 minutes from now = resolved)
+ // Resolved is determined by the values array (last value in 10 minutes from now = resolved)
alertstate: 'firing',
- silenced: (alert.silenced).toString(),
+ silenced: alert.silenced.toString(),
component: effectiveComponent,
layer: incident.layer,
name: effectiveComponent, // Required by processAlerts
@@ -249,7 +258,7 @@ export function createAlertDetailsMock(
// Standard ALERTS metric labels
instance: 'prometheus-k8s-0:9090',
job: 'prometheus-k8s',
- prometheus: 'openshift-monitoring/k8s'
+ prometheus: 'openshift-monitoring/k8s',
};
if (incident.managed_cluster) {
@@ -257,20 +266,30 @@ export function createAlertDetailsMock(
}
// Generate alert timeline values using unified function
- const values = buildTimelineValues(timeline, alert.severity, 'alerts', queryStartTime, queryEndTime);
+ const values = buildTimelineValues(
+ timeline,
+ alert.severity,
+ 'alerts',
+ queryStartTime,
+ queryEndTime,
+ );
// Skip if no data in query time window
if (values.length === 0) {
return;
}
+ // eslint-disable-next-line no-console
console.log(`Adding ALERTS alert: ${alert.name} from incident: ${incident.id}`);
+ // eslint-disable-next-line no-console
console.log(`ALERTS Results array length before push: ${results.length}`);
results.push({ metric, values });
+ // eslint-disable-next-line no-console
console.log(`ALERTS Results array length after push: ${results.length}`);
});
});
+ // eslint-disable-next-line no-console
console.log(`Final ALERTS results array length: ${results.length}`);
return results;
-}
\ No newline at end of file
+}
diff --git a/web/cypress/support/incidents_prometheus_query_mocks/prometheus-mocks.ts b/web/cypress/support/incidents_prometheus_query_mocks/prometheus-mocks.ts
index 4e57a0e6b..c74c914f7 100644
--- a/web/cypress/support/incidents_prometheus_query_mocks/prometheus-mocks.ts
+++ b/web/cypress/support/incidents_prometheus_query_mocks/prometheus-mocks.ts
@@ -4,6 +4,7 @@ import { convertFixtureToIncidents, parseYamlFixture } from './schema/fixture-co
import { incidentsPage } from '../../views/incidents-page';
declare global {
+ // eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
mockIncidents(incidents: IncidentDefinition[]): Chainable;
@@ -26,10 +27,10 @@ const MOCK_QUERY = '/api/prometheus/api/v1/query_range*';
/**
* Main mocking function - sets up cy.intercept for Prometheus query_range API
- *
+ *
* The Incidents page gets all data from the /query endpoint, including silence status
* via the 'silenced' label in the cluster_health_components_map metric.
- * *
+ * *
* @param incidents - Array of incident definitions to mock
*/
export function mockPrometheusQueryRange(incidents: IncidentDefinition[]): void {
@@ -42,35 +43,33 @@ export function mockPrometheusQueryRange(incidents: IncidentDefinition[]): void
const queryStartTime = startTime ? parseFloat(startTime) : undefined;
const queryEndTime = endTime ? parseFloat(endTime) : undefined;
+ // eslint-disable-next-line no-console
console.log(`INTERCEPTED: ${req.method} ${req.url}`);
+ // eslint-disable-next-line no-console
console.log(`Query: ${query}`);
+ // eslint-disable-next-line no-console
console.log(`Time range: ${queryStartTime} - ${queryEndTime}`);
- let results: any[];
+ const versioned_metric = query.includes(NEW_METRIC_NAME) ? NEW_METRIC_NAME : OLD_METRIC_NAME;
- const versioned_metric = query.includes(NEW_METRIC_NAME)
- ? NEW_METRIC_NAME: OLD_METRIC_NAME;
-
if (!(query.includes(versioned_metric) || query.includes('ALERTS{'))) {
+ // eslint-disable-next-line no-console
console.log(`Passing through non-mocked query`);
req.continue();
return;
}
- results = query.includes(versioned_metric)
- ? createIncidentMock(incidents, query, queryStartTime, queryEndTime)
+ const results = query.includes(versioned_metric)
+ ? createIncidentMock(incidents, query, queryStartTime, queryEndTime)
: createAlertDetailsMock(incidents, query, queryStartTime, queryEndTime);
const response: PrometheusResponse = {
- status: 'success',
- data: {
- resultType: 'matrix',
- result: results
- }
- };
-
- console.log(`Responding with ${results.length} incident alerts from ${incidents.length} incidents`);
- req.reply(response);
-
+ status: 'success',
+ data: {
+ resultType: 'matrix',
+ result: results,
+ },
+ };
+ req.reply(response);
}).as('prometheusQueryMock');
}
@@ -122,33 +121,36 @@ Cypress.Commands.add('transformMetrics', () => {
cy.log('=== SETTING UP METRIC TRANSFORMATION ===');
const mockNewMetrics = Cypress.env('MOCK_NEW_METRICS') === true;
-
if (!mockNewMetrics) {
cy.log('CYPRESS_MOCK_NEW_METRICS is disabled, skipping transformation');
return;
}
cy.log('Transforming old metric queries to new format');
-
+
cy.intercept('GET', MOCK_QUERY, (req) => {
const url = new URL(req.url, window.location.origin);
const query = url.searchParams.get('query') || '';
const hasNewMetric = query.includes(NEW_METRIC_NAME);
-
+
if (hasNewMetric) {
const transformedQuery = query.replace(new RegExp(NEW_METRIC_NAME, 'g'), OLD_METRIC_NAME);
+ // eslint-disable-next-line no-console
console.log(`Transforming metric query: ${query} -> ${transformedQuery}`);
-
+
// Update the URL with the transformed query
url.searchParams.set('query', transformedQuery);
req.url = url.toString();
-
+
// Also transform the response to use new metric names
req.continue((res) => {
if (res.body?.data?.result) {
res.body.data.result.forEach((result: any) => {
if (result?.metric?.__name__ === OLD_METRIC_NAME) {
- console.log(`Transforming response metric name: ${OLD_METRIC_NAME} -> ${NEW_METRIC_NAME}`);
+ // eslint-disable-next-line no-console
+ console.log(
+ `Transforming response metric name: ${OLD_METRIC_NAME} -> ${NEW_METRIC_NAME}`,
+ );
result.metric.__name__ = NEW_METRIC_NAME;
}
});
@@ -168,8 +170,8 @@ export function mockPermissionDeniedResponses(endpoints: PermissionDeniedEndpoin
statusCode: 403,
body: 'Forbidden',
headers: {
- 'content-type': 'text/plain'
- }
+ 'content-type': 'text/plain',
+ },
};
if (rules) {
@@ -205,4 +207,4 @@ export function mockPermissionDeniedResponses(endpoints: PermissionDeniedEndpoin
Cypress.Commands.add('mockPermissionDenied', (endpoints: PermissionDeniedEndpoints = {}) => {
cy.log('=== SETTING UP PERMISSION DENIED MOCKS ===');
mockPermissionDeniedResponses(endpoints);
-});
\ No newline at end of file
+});
diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-converter.ts b/web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-converter.ts
index 7223bf3a4..bce334c46 100644
--- a/web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-converter.ts
+++ b/web/cypress/support/incidents_prometheus_query_mocks/schema/fixture-converter.ts
@@ -1,28 +1,36 @@
-import { IncidentDefinition, IncidentTimeline, IncidentScenarioFixture, IncidentFixture } from '../types';
+import {
+ IncidentDefinition,
+ IncidentTimeline,
+ IncidentScenarioFixture,
+ IncidentFixture,
+} from '../types';
import { parseDuration, nowInClusterTimezone } from '../utils';
import { validateAndParseYamlFixture } from './schema-validator';
/**
* Converts fixture timeline to runtime timeline with actual timestamps
*/
-function convertTimeline(fixtureTimeline: IncidentFixture['timeline'], now: number): IncidentTimeline | undefined {
+function convertTimeline(
+ fixtureTimeline: IncidentFixture['timeline'],
+ now: number,
+): IncidentTimeline | undefined {
if (!fixtureTimeline) return undefined;
-
+
const timeline: IncidentTimeline = {
- start: now - parseDuration(fixtureTimeline.start)
+ start: now - parseDuration(fixtureTimeline.start),
};
-
+
if (fixtureTimeline.end) {
timeline.end = now - parseDuration(fixtureTimeline.end);
}
-
+
if (fixtureTimeline.severityChanges) {
- timeline.severityChanges = fixtureTimeline.severityChanges.map(change => ({
+ timeline.severityChanges = fixtureTimeline.severityChanges.map((change) => ({
timestamp: now - parseDuration(change.time),
- severity: change.severity
+ severity: change.severity,
}));
}
-
+
return timeline;
}
@@ -31,22 +39,22 @@ function convertTimeline(fixtureTimeline: IncidentFixture['timeline'], now: numb
*/
export function convertFixtureToIncidents(fixture: IncidentScenarioFixture): IncidentDefinition[] {
const now = nowInClusterTimezone();
-
- return fixture.incidents.map(incident => ({
+
+ return fixture.incidents.map((incident) => ({
id: incident.id,
component: incident.component,
layer: incident.layer,
timeline: convertTimeline(incident.timeline, now),
- alerts: incident.alerts.map(alert => ({
+ alerts: incident.alerts.map((alert) => ({
name: alert.name,
namespace: alert.namespace,
severity: alert.severity,
component: alert.component,
firing: alert.firing,
silenced: alert.silenced === true,
- timeline: convertTimeline(alert.timeline, now)
+ timeline: convertTimeline(alert.timeline, now),
})),
- managed_cluster: incident.managed_cluster
+ managed_cluster: incident.managed_cluster,
}));
}
@@ -55,11 +63,11 @@ export function convertFixtureToIncidents(fixture: IncidentScenarioFixture): Inc
*/
export function parseYamlFixture(yamlContent: string): IncidentScenarioFixture {
const result = validateAndParseYamlFixture(yamlContent);
-
+
if (!result.valid) {
const errorMessage = result.errors?.join('\n') || 'Unknown validation error';
throw new Error(`YAML fixture validation failed:\n${errorMessage}`);
}
-
+
return result.fixture!;
}
diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/schema-validator.ts b/web/cypress/support/incidents_prometheus_query_mocks/schema/schema-validator.ts
index 1dd1bbd1d..db75822ae 100644
--- a/web/cypress/support/incidents_prometheus_query_mocks/schema/schema-validator.ts
+++ b/web/cypress/support/incidents_prometheus_query_mocks/schema/schema-validator.ts
@@ -4,6 +4,7 @@ import Ajv from 'ajv';
import { IncidentScenarioFixture } from '../types';
// Import the JSON schema
+// eslint-disable-next-line @typescript-eslint/no-require-imports
const schema = require('./fixture-schema.json');
const ajv = new Ajv({ allErrors: true });
@@ -14,42 +15,44 @@ const validate = ajv.compile(schema);
*/
export function validateFixture(fixture: any): { valid: boolean; errors?: string[] } {
const valid = validate(fixture);
-
+
if (valid) {
return { valid: true };
}
-
- const errors = validate.errors?.map(error => {
- const path = error.instancePath ? error.instancePath : 'root';
- return `${path}: ${error.message}`;
- }) || [];
-
+
+ const errors =
+ validate.errors?.map((error) => {
+ const path = error.instancePath ? error.instancePath : 'root';
+ return `${path}: ${error.message}`;
+ }) || [];
+
return { valid: false, errors };
}
/**
* Validates and parses YAML content with schema validation
*/
-export function validateAndParseYamlFixture(yamlContent: string): {
- fixture?: IncidentScenarioFixture;
- valid: boolean;
- errors?: string[]
+export function validateAndParseYamlFixture(yamlContent: string): {
+ fixture?: IncidentScenarioFixture;
+ valid: boolean;
+ errors?: string[];
} {
try {
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
const yaml = require('js-yaml');
const parsed = yaml.load(yamlContent);
-
+
const validation = validateFixture(parsed);
-
+
if (validation.valid) {
return { fixture: parsed as IncidentScenarioFixture, valid: true };
} else {
return { valid: false, errors: validation.errors };
}
} catch (error) {
- return {
- valid: false,
- errors: [`YAML parsing error: ${error instanceof Error ? error.message : 'Unknown error'}`]
+ return {
+ valid: false,
+ errors: [`YAML parsing error: ${error instanceof Error ? error.message : 'Unknown error'}`],
};
}
}
diff --git a/web/cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts b/web/cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts
index cd52ad1da..6fcf0bcfe 100755
--- a/web/cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts
+++ b/web/cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts
@@ -3,7 +3,8 @@
/**
* 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
+ * Or from web directory:
+ * npm run ts-node cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts
*/
import * as fs from 'fs';
@@ -21,30 +22,38 @@ const validate = ajv.compile(schema);
function validateFixture(filePath: string): boolean {
try {
+ // eslint-disable-next-line no-console
console.log(`Validating: ${filePath}`);
-
+
// Read and parse YAML
const yamlContent = fs.readFileSync(filePath, 'utf8');
const fixture = yaml.load(yamlContent);
-
+
// Validate against schema
const valid = validate(fixture);
-
+
if (valid) {
+ // eslint-disable-next-line no-console
console.log(`VALID: ${filePath}`);
+ // eslint-disable-next-line no-console
console.log(` Name: ${(fixture as any).name}`);
+ // eslint-disable-next-line no-console
console.log(` Incidents: ${(fixture as any).incidents?.length || 0}`);
return true;
} else {
+ // eslint-disable-next-line no-console
console.log(`INVALID: ${filePath}`);
- validate.errors?.forEach(error => {
+ validate.errors?.forEach((error) => {
const errorPath = error.instancePath || 'root';
+ // eslint-disable-next-line no-console
console.log(` ${errorPath}: ${error.message}`);
});
return false;
}
} catch (error) {
+ // eslint-disable-next-line no-console
console.log(`PARSE ERROR: ${filePath}`);
+ // eslint-disable-next-line no-console
console.log(` ${error instanceof Error ? error.message : 'Unknown error'}`);
return false;
}
@@ -54,9 +63,16 @@ function validateFixture(filePath: string): boolean {
const args: string[] = process.argv.slice(2);
if (args.length === 0) {
+ // eslint-disable-next-line no-console
console.log('Usage: npm run ts-node validate-fixtures.ts [ ...]');
- console.log(' 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');
+ // eslint-disable-next-line no-console
+ console.log(
+ ' or: npm run ts-node validate-fixtures.ts --all (validates all .yaml files in fixtures directory)',
+ );
+ // eslint-disable-next-line no-console
+ console.log(
+ 'From web directory: npm run ts-node cypress/support/incidents_prometheus_query_mocks/schema/validate-fixtures.ts -- --all',
+ );
process.exit(1);
}
@@ -65,40 +81,48 @@ let allValid = true;
if (args[0] === '--all') {
// Validate all YAML files in the fixtures directory
const fixturesDir = path.join(__dirname, '../../../fixtures/incident-scenarios');
-
+
if (!fs.existsSync(fixturesDir)) {
+ // eslint-disable-next-line no-console
console.log(`ERROR: Fixtures directory not found: ${fixturesDir}`);
process.exit(1);
}
-
- const files = fs.readdirSync(fixturesDir)
- .filter(file => file.endsWith('.yaml') || file.endsWith('.yml'));
-
+
+ const files = fs
+ .readdirSync(fixturesDir)
+ .filter((file) => file.endsWith('.yaml') || file.endsWith('.yml'));
+
if (files.length === 0) {
+ // eslint-disable-next-line no-console
console.log('No YAML fixture files found');
process.exit(0);
}
-
+
+ // eslint-disable-next-line no-console
console.log(`Found ${files.length} YAML fixture files:`);
+ // eslint-disable-next-line no-console
console.log('');
-
- files.forEach(file => {
+
+ files.forEach((file) => {
const filePath = path.join(fixturesDir, file);
const valid = validateFixture(filePath);
if (!valid) allValid = false;
+ // eslint-disable-next-line no-console
console.log('');
});
} else {
// Validate specific files
- args.forEach(filePath => {
+ args.forEach((filePath) => {
if (!fs.existsSync(filePath)) {
+ // eslint-disable-next-line no-console
console.log(`ERROR: File not found: ${filePath}`);
allValid = false;
return;
}
-
+
const valid = validateFixture(filePath);
if (!valid) allValid = false;
+ // eslint-disable-next-line no-console
console.log('');
});
}
diff --git a/web/cypress/support/incidents_prometheus_query_mocks/types.ts b/web/cypress/support/incidents_prometheus_query_mocks/types.ts
index 1812a49b8..d162e1d90 100644
--- a/web/cypress/support/incidents_prometheus_query_mocks/types.ts
+++ b/web/cypress/support/incidents_prometheus_query_mocks/types.ts
@@ -25,10 +25,11 @@ export interface IncidentDefinition {
export interface AlertDefinition {
name: string; // src_alertname
- namespace: string; // src_namespace
+ namespace: string; // src_namespace
severity: 'critical' | 'warning' | 'info';
component?: string; // Optional: override component for this specific alert
- firing?: boolean; // Optional: override firing state (default: true for critical/warning, false for resolved incidents)
+ // Optional: override firing state (default: true for critical/warning, false for resolved)
+ firing?: boolean;
silenced?: boolean; // Optional: mark alert as silenced for testing
timeline?: IncidentTimeline; // Individual alert timeline
}
diff --git a/web/cypress/support/incidents_prometheus_query_mocks/utils.ts b/web/cypress/support/incidents_prometheus_query_mocks/utils.ts
index 5807b8d7d..ef320145b 100644
--- a/web/cypress/support/incidents_prometheus_query_mocks/utils.ts
+++ b/web/cypress/support/incidents_prometheus_query_mocks/utils.ts
@@ -1,15 +1,19 @@
// Utility functions for Prometheus mocking system
-import { TZDate } from "@date-fns/tz";
+import { TZDate } from '@date-fns/tz';
/**
* Converts severity string to numeric value expected by UI
*/
export function severityToValue(severity: 'critical' | 'warning' | 'info'): string {
switch (severity) {
- case 'critical': return '2';
- case 'warning': return '1';
- case 'info': return '0';
- default: return '0';
+ case 'critical':
+ return '2';
+ case 'warning':
+ return '1';
+ case 'info':
+ return '0';
+ default:
+ return '0';
}
}
@@ -28,7 +32,8 @@ export function parseDuration(duration: string): number {
const fullPattern = /^(?:\d+[smhd])+$/;
if (!fullPattern.test(normalized)) {
throw new Error(
- `Invalid duration format: ${duration}. Use formats like "30m", "2h", "7d", "1h30m", "7d2h30m"`
+ `Invalid duration format: ${duration}. ` +
+ `Use formats like "30m", "2h", "7d", "1h30m", "7d2h30m"`,
);
}
@@ -60,14 +65,16 @@ export function parseDuration(duration: string): number {
throw new Error(`Unknown duration unit: ${unit}`);
}
}
-
// Ensure the entire string was valid; reject strings with invalid characters/order
if (!matchedAny) {
- cy.log(`Invalid duration format: ${duration}. Use formats like "30m", "2h", "7d", "1h30m", "7d2h30m"`);
+ cy.log(
+ `Invalid duration format: ${duration}. ` +
+ `Use formats like "30m", "2h", "7d", "1h30m", "7d2h30m"`,
+ );
throw new Error(
`Invalid duration format: ${duration}. Use formats like "30m", "2h", "7d", "1h30m", "7d2h30m",
- ${normalized}, ${componentRegex.lastIndex}, ${matchedAny}, ${totalSeconds}`
+ ${normalized}, ${componentRegex.lastIndex}, ${matchedAny}, ${totalSeconds}`,
);
}
@@ -79,14 +86,14 @@ export function parseDuration(duration: string): number {
*/
export function parseQueryLabels(query: string): Record {
const labels: Record = {};
-
+
// Match label selectors in the format: labelname="value" or labelname='value'
const regex = /(\w+)=["']([^"']+)["']/g;
let match;
-
+
while ((match = regex.exec(query)) !== null) {
const [, labelName, labelValue] = match;
-
+
if (labels[labelName]) {
// If we already have a value for this label, convert to array
if (Array.isArray(labels[labelName])) {
@@ -98,7 +105,7 @@ export function parseQueryLabels(query: string): Record
assert.isTrue(!win.windowError, win.windowError);
});
- // Ignore benign ResizeObserver errors globally so they don't fail tests
+// Ignore benign ResizeObserver errors globally so they don't fail tests
// See: https://docs.cypress.io/api/cypress-api/catalog-of-events#Uncaught-Exceptions
Cypress.on('uncaught:exception', (err) => {
const message = err?.message || String(err || '');
@@ -33,6 +33,7 @@ Cypress.on('uncaught:exception', (err) => {
message.includes(`(intermediate value) is not a function`) ||
message.includes(`Cannot read properties of null (reading '0')`)
) {
+ // eslint-disable-next-line no-console
console.warn('Ignored frontend exception:', err.message);
return false;
}
diff --git a/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts b/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts
index bee9e9c38..bb029ab61 100644
--- a/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts
+++ b/web/cypress/support/monitoring/00.bvt_monitoring.cy.ts
@@ -6,7 +6,12 @@ import { nav } from '../../views/nav';
import { silenceDetailsPage } from '../../views/silence-details-page';
import { silencesListPage } from '../../views/silences-list-page';
import { getValFromElement } from '../../views/utils';
-import { AlertsAlertState, SilenceComment, SilenceState, WatchdogAlert } from '../../fixtures/monitoring/constants';
+import {
+ AlertsAlertState,
+ SilenceComment,
+ SilenceState,
+ WatchdogAlert,
+} from '../../fixtures/monitoring/constants';
import { alertingRuleListPage } from '../../views/alerting-rule-list-page';
export interface PerspectiveConfig {
@@ -19,65 +24,81 @@ export function runBVTMonitoringTests(perspective: PerspectiveConfig) {
}
export function testBVTMonitoring(perspective: PerspectiveConfig) {
-
- it(`${perspective.name} perspective - Alerting > Alerting Details page > Alerting Rule > Metrics`, () => {
- cy.log('5.1. use sidebar nav to go to Observe > Alerting');
- commonPages.titleShouldHaveText('Alerting');
- listPage.tabShouldHaveText('Alerts');
- listPage.tabShouldHaveText('Silences');
- listPage.tabShouldHaveText('Alerting rules');
- commonPages.linkShouldExist('Export as CSV');
- commonPages.linkShouldExist('Clear all filters');
- listPage.ARRows.shouldBeLoaded();
-
- cy.log('5.2. filter Alerts and click on Alert');
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- listPage.ARRows.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, 'Firing');
- listPage.ARRows.expandRow();
- listPage.ARRows.AShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, `${WatchdogAlert.NAMESPACE}`);
- listPage.ARRows.clickAlert();
-
- cy.log('5.3. click on Alert Details Page');
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`);
- commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
-
- const timeIntervalValue = getValFromElement(`[data-ouia-component-id^="OUIA-Generated-TextInputBase"]`);
- timeIntervalValue.then((value) => {
- expect(value).to.not.be.empty;
- });
-
- cy.log('5.4. click on Alert Rule link');
- detailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- commonPages.detailsPage.alertRule;
- commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`);
- cy.get(`[class="pf-v6-c-code-block__content"]`).invoke('text').then((expText) => {
- cy.log(`${expText}`);
- cy.wrap(expText).as('alertExpression');
- });
-
-
- cy.log('5.5. click on Alert Details Page');
- detailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`);
- commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('5.6. click on Inspect on Alert Details Page');
- detailsPage.clickInspectAlertPage();
-
- cy.log('5.7. Metrics page is loaded');
- commonPages.titleShouldHaveText('Metrics');
-
- cy.log('5.8. Assert Expression');
- cy.get('[class="cm-line"]').should('be.visible');
- cy.get(`@alertExpression`).then((expText) => {
- cy.log(`${expText}`);
- cy.get('[class="cm-line"]').invoke('text').should('equal', `${expText}`);
- });
- });
+ it(
+ `${perspective.name} perspective - ` +
+ 'Alerting > Alerting Details page > Alerting Rule > Metrics',
+ () => {
+ cy.log('5.1. use sidebar nav to go to Observe > Alerting');
+ commonPages.titleShouldHaveText('Alerting');
+ listPage.tabShouldHaveText('Alerts');
+ listPage.tabShouldHaveText('Silences');
+ listPage.tabShouldHaveText('Alerting rules');
+ commonPages.linkShouldExist('Export as CSV');
+ commonPages.linkShouldExist('Clear all filters');
+ listPage.ARRows.shouldBeLoaded();
+
+ cy.log('5.2. filter Alerts and click on Alert');
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ listPage.ARRows.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ 'Firing',
+ );
+ listPage.ARRows.expandRow();
+ listPage.ARRows.AShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ `${WatchdogAlert.NAMESPACE}`,
+ );
+ listPage.ARRows.clickAlert();
+
+ cy.log('5.3. click on Alert Details Page');
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
+
+ const timeIntervalValue = getValFromElement(
+ `[data-ouia-component-id^="OUIA-Generated-TextInputBase"]`,
+ );
+ timeIntervalValue.then((value) => {
+ expect(value).to.be.a('string');
+ expect(String(value).trim()).not.to.equal('');
+ });
+
+ cy.log('5.4. click on Alert Rule link');
+ detailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.alertRule();
+ commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`);
+ cy.get(`[class="pf-v6-c-code-block__content"]`)
+ .invoke('text')
+ .then((expText) => {
+ cy.log(`${expText}`);
+ cy.wrap(expText).as('alertExpression');
+ });
+
+ cy.log('5.5. click on Alert Details Page');
+ detailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('5.6. click on Inspect on Alert Details Page');
+ detailsPage.clickInspectAlertPage();
+
+ cy.log('5.7. Metrics page is loaded');
+ commonPages.titleShouldHaveText('Metrics');
+
+ cy.log('5.8. Assert Expression');
+ cy.get('[class="cm-line"]').should('be.visible');
+ cy.get(`@alertExpression`).then((expText) => {
+ cy.log(`${expText}`);
+ cy.get('[class="cm-line"]').invoke('text').should('equal', `${expText}`);
+ });
+ },
+ );
it(`${perspective.name} perspective - Creates and expires a Silence`, () => {
cy.log('6.1 filter to Watchdog alert');
@@ -97,10 +118,26 @@ export function testBVTMonitoring(perspective: PerspectiveConfig) {
silenceAlertPage.silenceAlertSectionDefault();
silenceAlertPage.durationSectionDefault();
silenceAlertPage.alertLabelsSectionDefault();
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('alertname', `${WatchdogAlert.ALERTNAME}`, false, false);
- // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('severity', `${SEVERITY}`, false, false);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('namespace', `${WatchdogAlert.NAMESPACE}`, false, false);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('prometheus', 'openshift-monitoring/k8s', false, false);
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'alertname',
+ `${WatchdogAlert.ALERTNAME}`,
+ false,
+ false,
+ );
+ // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ // 'severity', `${SEVERITY}`, false, false);
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ false,
+ false,
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'prometheus',
+ 'openshift-monitoring/k8s',
+ false,
+ false,
+ );
// Change duration
silenceAlertPage.setForAndStartImmediately('1h', true);
@@ -119,7 +156,11 @@ export function testBVTMonitoring(perspective: PerspectiveConfig) {
// After creating the Silence, should be redirected to its details page
cy.log('6.4 Assert Silence details page');
- silenceDetailsPage.assertSilenceDetailsPage(`${WatchdogAlert.ALERTNAME}`, 'Silence details', 'alertname=Watchdog');
+ silenceDetailsPage.assertSilenceDetailsPage(
+ `${WatchdogAlert.ALERTNAME}`,
+ 'Silence details',
+ 'alertname=Watchdog',
+ );
cy.log('6.5 Click on Firing alerts');
silenceDetailsPage.clickOnFiringAlerts(`${WatchdogAlert.ALERTNAME}`);
@@ -148,14 +189,24 @@ export function testBVTMonitoring(perspective: PerspectiveConfig) {
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.tabs.switchTab('Alerting rules');
listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- alertingRuleListPage.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, AlertsAlertState.SILENCED);
+ alertingRuleListPage.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ AlertsAlertState.SILENCED,
+ );
cy.log('6.9 verify on Alerts list page again');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
listPage.filter.clearAllFilters();
listPage.filter.selectFilterOption(true, AlertsAlertState.SILENCED, true);
listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, AlertsAlertState.SILENCED);
+ listPage.ARRows.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ AlertsAlertState.SILENCED,
+ );
cy.log('6.10 expires the Silence');
listPage.ARRows.expandRow();
@@ -163,12 +214,15 @@ export function testBVTMonitoring(perspective: PerspectiveConfig) {
detailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`);
silenceDetailsPage.expireSilence(true, true);
-
cy.log('6.11 verify on Alerts list page again');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
listPage.filter.clearAllFilters();
listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, AlertsAlertState.FIRING);
-
+ listPage.ARRows.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ AlertsAlertState.FIRING,
+ );
});
}
diff --git a/web/cypress/support/monitoring/00.bvt_monitoring_namespace.cy.ts b/web/cypress/support/monitoring/00.bvt_monitoring_namespace.cy.ts
index a4bf1f057..31bacd053 100644
--- a/web/cypress/support/monitoring/00.bvt_monitoring_namespace.cy.ts
+++ b/web/cypress/support/monitoring/00.bvt_monitoring_namespace.cy.ts
@@ -6,7 +6,12 @@ import { nav } from '../../views/nav';
import { silenceDetailsPage } from '../../views/silence-details-page';
import { silencesListPage } from '../../views/silences-list-page';
import { getValFromElement } from '../../views/utils';
-import { AlertsAlertState, SilenceComment, SilenceState, WatchdogAlert } from '../../fixtures/monitoring/constants';
+import {
+ AlertsAlertState,
+ SilenceComment,
+ SilenceState,
+ WatchdogAlert,
+} from '../../fixtures/monitoring/constants';
import { alertingRuleListPage } from '../../views/alerting-rule-list-page';
export interface PerspectiveConfig {
@@ -19,65 +24,81 @@ export function runBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) {
}
export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig) {
-
- it(`${perspective.name} perspective - Alerting > Alerting Details page > Alerting Rule > Metrics`, () => {
- cy.log('4.1. use sidebar nav to go to Observe > Alerting');
- commonPages.titleShouldHaveText('Alerting');
- listPage.tabShouldHaveText('Alerts');
- listPage.tabShouldHaveText('Silences');
- listPage.tabShouldHaveText('Alerting rules');
- commonPages.linkShouldExist('Export as CSV');
- commonPages.linkShouldExist('Clear all filters');
- listPage.ARRows.shouldBeLoaded();
-
- cy.log('4.2. filter Alerts and click on Alert');
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- listPage.ARRows.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, 'Firing');
- listPage.ARRows.expandRow();
- listPage.ARRows.AShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, `${WatchdogAlert.NAMESPACE}`);
- listPage.ARRows.clickAlert();
-
- cy.log('4.3. click on Alert Details Page');
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`);
- commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
-
- const timeIntervalValue = getValFromElement(`[data-ouia-component-id^="OUIA-Generated-TextInputBase"]`);
- timeIntervalValue.then((value) => {
- expect(value).to.not.be.empty;
- });
-
- cy.log('4.4. click on Alert Rule link');
- detailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- commonPages.detailsPage.alertRule;
- commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`);
- cy.get(`[class="pf-v6-c-code-block__content"]`).invoke('text').then((expText) => {
- cy.log(`${expText}`);
- cy.wrap(expText).as('alertExpression');
- });
-
-
- cy.log('4.5. click on Alert Details Page');
- detailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`);
- commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('4.6. click on Inspect on Alert Details Page');
- detailsPage.clickInspectAlertPage();
-
- cy.log('4.7. Metrics page is loaded');
- commonPages.titleShouldHaveText('Metrics');
-
- cy.log('4.8. Assert Expression');
- cy.get('[class="cm-line"]').should('be.visible');
- cy.get(`@alertExpression`).then((expText) => {
- cy.log(`${expText}`);
- cy.get('[class="cm-line"]').invoke('text').should('equal', `${expText}`);
- });
- });
+ it(
+ `${perspective.name} perspective - ` +
+ 'Alerting > Alerting Details page > Alerting Rule > Metrics',
+ () => {
+ cy.log('4.1. use sidebar nav to go to Observe > Alerting');
+ commonPages.titleShouldHaveText('Alerting');
+ listPage.tabShouldHaveText('Alerts');
+ listPage.tabShouldHaveText('Silences');
+ listPage.tabShouldHaveText('Alerting rules');
+ commonPages.linkShouldExist('Export as CSV');
+ commonPages.linkShouldExist('Clear all filters');
+ listPage.ARRows.shouldBeLoaded();
+
+ cy.log('4.2. filter Alerts and click on Alert');
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ listPage.ARRows.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ 'Firing',
+ );
+ listPage.ARRows.expandRow();
+ listPage.ARRows.AShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ `${WatchdogAlert.NAMESPACE}`,
+ );
+ listPage.ARRows.clickAlert();
+
+ cy.log('4.3. click on Alert Details Page');
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
+
+ const timeIntervalValue = getValFromElement(
+ `[data-ouia-component-id^="OUIA-Generated-TextInputBase"]`,
+ );
+ timeIntervalValue.then((value) => {
+ expect(value).to.be.a('string');
+ expect(String(value).trim()).not.to.equal('');
+ });
+
+ cy.log('4.4. click on Alert Rule link');
+ detailsPage.clickAlertRule(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.alertRule();
+ commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`);
+ cy.get(`[class="pf-v6-c-code-block__content"]`)
+ .invoke('text')
+ .then((expText) => {
+ cy.log(`${expText}`);
+ cy.wrap(expText).as('alertExpression');
+ });
+
+ cy.log('4.5. click on Alert Details Page');
+ detailsPage.clickAlertDesc(`${WatchdogAlert.ALERT_DESC}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.common(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.detailsPage.alert(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('4.6. click on Inspect on Alert Details Page');
+ detailsPage.clickInspectAlertPage();
+
+ cy.log('4.7. Metrics page is loaded');
+ commonPages.titleShouldHaveText('Metrics');
+
+ cy.log('4.8. Assert Expression');
+ cy.get('[class="cm-line"]').should('be.visible');
+ cy.get(`@alertExpression`).then((expText) => {
+ cy.log(`${expText}`);
+ cy.get('[class="cm-line"]').invoke('text').should('equal', `${expText}`);
+ });
+ },
+ );
it(`${perspective.name} perspective - Creates and expires a Silence`, () => {
cy.log('5.1 filter to Watchdog alert');
@@ -98,11 +119,31 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig)
silenceAlertPage.silenceAlertSectionDefault();
silenceAlertPage.durationSectionDefault();
silenceAlertPage.alertLabelsSectionDefault();
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('alertname', `${WatchdogAlert.ALERTNAME}`, false, false);
- // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('severity', `${SEVERITY}`, false, false);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('namespace', `${WatchdogAlert.NAMESPACE}`, false, false);
- silenceAlertPage.assertNamespaceLabelNamespaceValueDisabled('namespace', `${WatchdogAlert.NAMESPACE}`, true);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('prometheus', 'openshift-monitoring/k8s', false, false);
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'alertname',
+ `${WatchdogAlert.ALERTNAME}`,
+ false,
+ false,
+ );
+ // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ // 'severity', `${SEVERITY}`, false, false);
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ false,
+ false,
+ );
+ silenceAlertPage.assertNamespaceLabelNamespaceValueDisabled(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ true,
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'prometheus',
+ 'openshift-monitoring/k8s',
+ false,
+ false,
+ );
// Change duration
silenceAlertPage.setForAndStartImmediately('1h', true);
@@ -121,7 +162,11 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig)
// After creating the Silence, should be redirected to its details page
cy.log('5.4 Assert Silence details page');
- silenceDetailsPage.assertSilenceDetailsPage(`${WatchdogAlert.ALERTNAME}`, 'Silence details', 'alertname=Watchdog');
+ silenceDetailsPage.assertSilenceDetailsPage(
+ `${WatchdogAlert.ALERTNAME}`,
+ 'Silence details',
+ 'alertname=Watchdog',
+ );
commonPages.projectDropdownShouldNotExist();
cy.log('5.5 Click on Firing alerts');
@@ -152,14 +197,24 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig)
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.tabs.switchTab('Alerting rules');
listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- alertingRuleListPage.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, AlertsAlertState.SILENCED);
+ alertingRuleListPage.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ AlertsAlertState.SILENCED,
+ );
cy.log('5.9 verify on Alerts list page again');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
listPage.filter.clearAllFilters();
listPage.filter.selectFilterOption(true, AlertsAlertState.SILENCED, true);
listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, AlertsAlertState.SILENCED);
+ listPage.ARRows.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ AlertsAlertState.SILENCED,
+ );
cy.log('5.10 expires the Silence');
listPage.ARRows.expandRow();
@@ -167,12 +222,15 @@ export function testBVTMonitoringTestsNamespace(perspective: PerspectiveConfig)
detailsPage.clickOnSilencedBy(`${WatchdogAlert.ALERTNAME}`);
silenceDetailsPage.expireSilence(true, true);
-
cy.log('5.11 verify on Alerts list page again');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
listPage.filter.clearAllFilters();
listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.ARShouldBe(`${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 1, AlertsAlertState.FIRING);
-
+ listPage.ARRows.ARShouldBe(
+ `${WatchdogAlert.ALERTNAME}`,
+ `${WatchdogAlert.SEVERITY}`,
+ 1,
+ AlertsAlertState.FIRING,
+ );
});
}
diff --git a/web/cypress/support/monitoring/01.reg_alerts.cy.ts b/web/cypress/support/monitoring/01.reg_alerts.cy.ts
index 6ddf75abd..ea63b39e2 100644
--- a/web/cypress/support/monitoring/01.reg_alerts.cy.ts
+++ b/web/cypress/support/monitoring/01.reg_alerts.cy.ts
@@ -7,7 +7,15 @@ import { silenceDetailsPage } from '../../views/silence-details-page';
import { silencesListPage } from '../../views/silences-list-page';
import { alertingRuleListPage } from '../../views/alerting-rule-list-page';
import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page';
-import { AlertingRulesAlertState, MainTagState, Severity, SilenceState, Source, SilenceComment, WatchdogAlert } from '../../fixtures/monitoring/constants';
+import {
+ AlertingRulesAlertState,
+ MainTagState,
+ Severity,
+ SilenceState,
+ Source,
+ SilenceComment,
+ WatchdogAlert,
+} from '../../fixtures/monitoring/constants';
export interface PerspectiveConfig {
name: string;
@@ -29,18 +37,17 @@ export function testAlertsRegression(perspective: PerspectiveConfig) {
listPage.filter.selectFilterOption(false, Severity.NONE, false);
listPage.filter.selectFilterOption(false, Source.USER, true);
listPage.filter.removeMainTag(MainTagState.SOURCE);
- listPage.filter.removeIndividualTag( AlertingRulesAlertState.FIRING);
- listPage.filter.removeIndividualTag( AlertingRulesAlertState.PENDING);
- listPage.filter.removeIndividualTag( AlertingRulesAlertState.SILENCED);
+ listPage.filter.removeIndividualTag(AlertingRulesAlertState.FIRING);
+ listPage.filter.removeIndividualTag(AlertingRulesAlertState.PENDING);
+ listPage.filter.removeIndividualTag(AlertingRulesAlertState.SILENCED);
listPage.filter.clearAllFilters();
- listPage.exportAsCSV(true, /openshift.csv/, `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 'firing', 1);
+ listPage.exportAsCSV(true, /openshift.csv/);
- listPage.filter.byLabel('alertname='+`${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`);
listPage.filter.removeMainTag('Label');
- listPage.filter.byLabel('alertname='+`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.removeIndividualTag('alertname='+`${WatchdogAlert.ALERTNAME}`);
-
+ listPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.removeIndividualTag('alertname=' + `${WatchdogAlert.ALERTNAME}`);
});
it(`${perspective.name} perspective - Alerting > Silences page > Create silence`, () => {
@@ -61,131 +68,172 @@ export function testAlertsRegression(perspective: PerspectiveConfig) {
silenceAlertPage.fillLabeNameLabelValue('a', '');
silenceAlertPage.clickSubmit();
silenceAlertPage.assertLabelValueError();
-
});
- it(`${perspective.name} perspective - Alerting > Alerts / Silences > Kebab icon on List and Details`, () => {
- cy.log('3.1 use sidebar nav to go to Observe > Alerting');
-
- cy.log('3.2 filter to Watchdog alert');
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
-
- cy.log('3.3 silence alert');
- listPage.ARRows.expandRow();
- listPage.ARRows.silenceAlert();
- silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
- silenceAlertPage.clickSubmit();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('3.4 Assert Kebab on Alert Details page');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- commonPages.titleShouldHaveText('Alerting');
- listPage.filter.clearAllFilters();
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- listPage.ARRows.expandRow();
- listPage.ARRows.assertNoKebab();
- listPage.ARRows.clickAlert();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- detailsPage.assertSilencedAlert();
-
- cy.log('3.5 Assert Kebab on Silence List page for Silenced alert');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
- silencesListPage.shouldBeLoaded();
- listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
- listPage.filter.removeIndividualTag(SilenceState.PENDING);
- silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.clickFilter(true,false);
- listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
- silencesListPage.rows.assertSilencedAlertKebab();
-
- cy.log('3.6 Click on Silenced alert and Assert Actions button');
- silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- silenceDetailsPage.assertActionsSilencedAlert();
-
- cy.log('3.7 Expire silence');
- silenceDetailsPage.expireSilence(false, true);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
-
- cy.log('3.8 Assert Kebab on Silence List page for Expired alert');
- silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- silencesListPage.emptyState();
- listPage.filter.removeMainTag(MainTagState.SILENCE_STATE);
- listPage.filter.selectFilterOption(true, SilenceState.EXPIRED, false);
- listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, false);
- listPage.filter.selectFilterOption(false, SilenceState.PENDING, true);
- silencesListPage.rows.assertExpiredAlertKebab('0');
-
- cy.log('3.9 Click on Expired alert and Assert Actions button');
- silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- silenceDetailsPage.assertActionsExpiredAlert();
-
- cy.log('3.10 Recreate silence');
- silenceDetailsPage.recreateSilence(false);
- commonPages.titleShouldHaveText('Recreate silence');
- silenceAlertPage.silenceAlertSectionDefault();
- silenceAlertPage.durationSectionDefault();
- silenceAlertPage.alertLabelsSectionDefault();
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('alertname', `${WatchdogAlert.ALERTNAME}`, false, false);
- // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('severity', `${SEVERITY}`, false, false);
- cy.log('https://issues.redhat.com/browse/OU-1110 - [Namespace-level] - Admin user - Create, Edit, Recreate silences is showing namespace dropdown');
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('namespace', `${WatchdogAlert.NAMESPACE}`, false, false);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('prometheus', 'openshift-monitoring/k8s', false, false);
- silenceAlertPage.clickSubmit();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('3.11 Edit silence');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
- silencesListPage.shouldBeLoaded();
- listPage.filter.removeIndividualTag(SilenceState.PENDING);
- silencesListPage.filter.byName( `${WatchdogAlert.ALERTNAME}`);
- silencesListPage.rows.editSilence();
- commonPages.titleShouldHaveText('Edit silence');
- silenceAlertPage.silenceAlertSectionDefault();
- silenceAlertPage.editAlertWarning();
- silenceAlertPage.editDurationSectionDefault();
- silenceAlertPage.alertLabelsSectionDefault();
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('alertname', `${WatchdogAlert.ALERTNAME}`, false, false);
- // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('severity', `${SEVERITY}`, false, false);
- cy.log('https://issues.redhat.com/browse/OU-1110 - [Namespace-level] - Admin user - Create, Edit, Recreate silences is showing namespace dropdown');
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('namespace', `${WatchdogAlert.NAMESPACE}`, false, false);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('prometheus', 'openshift-monitoring/k8s', false, false);
- silenceAlertPage.clickSubmit();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('3.12 Expire silence');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
- silencesListPage.shouldBeLoaded(); silencesListPage.shouldBeLoaded();
- listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
- listPage.filter.removeIndividualTag(SilenceState.PENDING);
- silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.clickFilter(true,false);
- listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
- silencesListPage.rows.expireSilence(true);
-
- cy.log('3.13 Alert Details > Silence alert button > Cancel');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- listPage.ARRows.expandRow();
- listPage.ARRows.clickAlert();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- detailsPage.clickSilenceAlertButton();
- silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
- silenceAlertPage.clickCancelButton();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- });
+ it(
+ `${perspective.name} perspective - ` +
+ 'Alerting > Alerts / Silences > Kebab icon on List and Details',
+ () => {
+ cy.log('3.1 use sidebar nav to go to Observe > Alerting');
+
+ cy.log('3.2 filter to Watchdog alert');
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+
+ cy.log('3.3 silence alert');
+ listPage.ARRows.expandRow();
+ listPage.ARRows.silenceAlert();
+ silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
+ silenceAlertPage.clickSubmit();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('3.4 Assert Kebab on Alert Details page');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ commonPages.titleShouldHaveText('Alerting');
+ listPage.filter.clearAllFilters();
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ listPage.ARRows.expandRow();
+ listPage.ARRows.assertNoKebab();
+ listPage.ARRows.clickAlert();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ detailsPage.assertSilencedAlert();
+
+ cy.log('3.5 Assert Kebab on Silence List page for Silenced alert');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+ silencesListPage.shouldBeLoaded();
+ listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
+ listPage.filter.removeIndividualTag(SilenceState.PENDING);
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.clickFilter(true, false);
+ listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
+ silencesListPage.rows.assertSilencedAlertKebab();
+
+ cy.log('3.6 Click on Silenced alert and Assert Actions button');
+ silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ silenceDetailsPage.assertActionsSilencedAlert();
+
+ cy.log('3.7 Expire silence');
+ silenceDetailsPage.expireSilence(false, true);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+
+ cy.log('3.8 Assert Kebab on Silence List page for Expired alert');
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ silencesListPage.emptyState();
+ listPage.filter.removeMainTag(MainTagState.SILENCE_STATE);
+ listPage.filter.selectFilterOption(true, SilenceState.EXPIRED, false);
+ listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, false);
+ listPage.filter.selectFilterOption(false, SilenceState.PENDING, true);
+ silencesListPage.rows.assertExpiredAlertKebab('0');
+
+ cy.log('3.9 Click on Expired alert and Assert Actions button');
+ silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ silenceDetailsPage.assertActionsExpiredAlert();
+
+ cy.log('3.10 Recreate silence');
+ silenceDetailsPage.recreateSilence(false);
+ commonPages.titleShouldHaveText('Recreate silence');
+ silenceAlertPage.silenceAlertSectionDefault();
+ silenceAlertPage.durationSectionDefault();
+ silenceAlertPage.alertLabelsSectionDefault();
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'alertname',
+ `${WatchdogAlert.ALERTNAME}`,
+ false,
+ false,
+ );
+ // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ // 'severity', `${SEVERITY}`, false, false);
+ cy.log(
+ 'https://issues.redhat.com/browse/OU-1110 - [Namespace-level] - Admin user - Create, Edit, ' +
+ 'Recreate silences is showing namespace dropdown',
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ false,
+ false,
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'prometheus',
+ 'openshift-monitoring/k8s',
+ false,
+ false,
+ );
+ silenceAlertPage.clickSubmit();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('3.11 Edit silence');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+ silencesListPage.shouldBeLoaded();
+ listPage.filter.removeIndividualTag(SilenceState.PENDING);
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ silencesListPage.rows.editSilence();
+ commonPages.titleShouldHaveText('Edit silence');
+ silenceAlertPage.silenceAlertSectionDefault();
+ silenceAlertPage.editAlertWarning();
+ silenceAlertPage.editDurationSectionDefault();
+ silenceAlertPage.alertLabelsSectionDefault();
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'alertname',
+ `${WatchdogAlert.ALERTNAME}`,
+ false,
+ false,
+ );
+ // silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ // 'severity', `${SEVERITY}`, false, false);
+ cy.log(
+ 'https://issues.redhat.com/browse/OU-1110 - [Namespace-level] - Admin user - Create, Edit, ' +
+ 'Recreate silences is showing namespace dropdown',
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ false,
+ false,
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'prometheus',
+ 'openshift-monitoring/k8s',
+ false,
+ false,
+ );
+ silenceAlertPage.clickSubmit();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('3.12 Expire silence');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+ silencesListPage.shouldBeLoaded();
+ listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
+ listPage.filter.removeIndividualTag(SilenceState.PENDING);
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.clickFilter(true, false);
+ listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
+ silencesListPage.rows.expireSilence(true);
+
+ cy.log('3.13 Alert Details > Silence alert button > Cancel');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ listPage.ARRows.expandRow();
+ listPage.ARRows.clickAlert();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ detailsPage.clickSilenceAlertButton();
+ silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
+ silenceAlertPage.clickCancelButton();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ },
+ );
it(`${perspective.name} perspective - Alerting > Alerting Rules`, () => {
cy.log('4.1 use sidebar nav to go to Observe > Alerting');
@@ -256,10 +304,8 @@ export function testAlertsRegression(perspective: PerspectiveConfig) {
listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
listPage.filter.removeIndividualTag(SilenceState.PENDING);
silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.clickFilter(true,false);
+ listPage.filter.clickFilter(true, false);
listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
silencesListPage.rows.expireSilence(true);
-
});
-
}
diff --git a/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts b/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts
index 1d8a834a1..7cbd70870 100644
--- a/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts
+++ b/web/cypress/support/monitoring/02.reg_metrics_1.cy.ts
@@ -1,6 +1,11 @@
import { metricsPage } from '../../views/metrics';
import { Classes, DataTestIDs } from '../../../src/components/data-test';
-import { GraphTimespan, MetricsPagePredefinedQueries, MetricsPageQueryInput, MetricsPageUnits } from '../../fixtures/monitoring/constants';
+import {
+ GraphTimespan,
+ MetricsPagePredefinedQueries,
+ MetricsPageQueryInput,
+ MetricsPageUnits,
+} from '../../fixtures/monitoring/constants';
export interface PerspectiveConfig {
name: string;
@@ -12,7 +17,6 @@ export function runAllRegressionMetricsTests1(perspective: PerspectiveConfig) {
}
export function testMetricsRegression1(perspective: PerspectiveConfig) {
-
it(`${perspective.name} perspective - Metrics`, () => {
cy.log('1.1 Metrics page loaded');
metricsPage.shouldBeLoaded();
@@ -31,7 +35,6 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
cy.log('1.6 Kebab dropdown');
metricsPage.kebabDropdownAssertionWithoutQuery();
-
});
it(`${perspective.name} perspective - Metrics > Actions - No query added`, () => {
@@ -69,8 +72,10 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
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');
-
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton)
+ .find('button')
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true');
});
it(`${perspective.name} perspective - Metrics > Actions - One query added`, () => {
@@ -86,8 +91,14 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
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.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);
@@ -98,8 +109,14 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
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.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);
@@ -110,8 +127,14 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
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.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);
@@ -123,16 +146,20 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
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');
+ 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);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
metricsPage.graphAxisXAssertion(GraphTimespan.THIRTY_MINUTES);
cy.log('4.2 Graph Timespan Dropdown');
@@ -163,7 +190,11 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
cy.log('4.6 Reset Zoom Button');
metricsPage.clickResetZoomButton();
- cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should('have.attr', 'value', GraphTimespan.THIRTY_MINUTES);
+ cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should(
+ 'have.attr',
+ 'value',
+ GraphTimespan.THIRTY_MINUTES,
+ );
cy.log('4.7 Hide Graph Button');
metricsPage.clickHideGraphButton();
@@ -182,7 +213,6 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
cy.log('4.11 Stacked Checkbox');
metricsPage.clickStackedCheckboxAndAssert();
-
});
//https://issues.redhat.com/browse/OU-974 - [Metrics] - Units - undefined showing in Y axis and tooltip
@@ -197,6 +227,4 @@ export function testMetricsRegression1(perspective: PerspectiveConfig) {
metricsPage.unitsAxisYAssertion(unit);
});
});
-
}
-
diff --git a/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts b/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts
index 33cf58461..6ba5f4b62 100644
--- a/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts
+++ b/web/cypress/support/monitoring/02.reg_metrics_2.cy.ts
@@ -1,6 +1,11 @@
import { metricsPage } from '../../views/metrics';
-import { Classes, DataTestIDs, LegacyTestIDs } from '../../../src/components/data-test';
-import { MetricGraphEmptyState, MetricsPagePredefinedQueries, MetricsPageQueryInput, MetricsPageQueryKebabDropdown } from '../../fixtures/monitoring/constants';
+import { Classes, DataTestIDs } from '../../../src/components/data-test';
+import {
+ MetricGraphEmptyState,
+ MetricsPagePredefinedQueries,
+ MetricsPageQueryInput,
+ MetricsPageQueryKebabDropdown,
+} from '../../fixtures/monitoring/constants';
export interface PerspectiveConfig {
name: string;
@@ -12,22 +17,33 @@ export function runAllRegressionMetricsTests2(perspective: PerspectiveConfig) {
}
export 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();
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1);
metricsPage.clickInsertExampleQuery();
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
cy.log('6.2 Only one query added, resulting in 2 rows');
metricsPage.clickActionsAddQuery();
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.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
-
+ 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.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+
cy.log('6.3 Preparation to test Run Queries button');
cy.get(Classes.MetricsPageQueryInput).eq(0).should('be.visible').clear();
cy.get(Classes.MetricsPageQueryInput).eq(0).type(MetricsPageQueryInput.VECTOR_QUERY);
@@ -42,33 +58,53 @@ export function testMetricsRegression2(perspective: PerspectiveConfig) {
metricsPage.disableEnableQuerySwitchAssertion(1, true);
metricsPage.expandCollapseRowAssertion(true, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
-
+
cy.log('6.6 Kebab icon - Disable query');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible')
+ .click();
metricsPage.disableEnableQuerySwitchAssertion(0, false);
metricsPage.disableEnableQuerySwitchAssertion(1, true);
metricsPage.expandCollapseRowAssertion(false, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
metricsPage.clickKebabDropdown(0);
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
cy.log('6.7 Kebab icon - Enable query');
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY).should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY)
+ .should('be.visible')
+ .click();
metricsPage.disableEnableQuerySwitchAssertion(0, true);
metricsPage.disableEnableQuerySwitchAssertion(1, true);
metricsPage.expandCollapseRowAssertion(true, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
cy.byTestID(DataTestIDs.MetricGraph).should('exist');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV)
+ .should('be.visible');
metricsPage.clickKebabDropdown(0);
cy.log('6.8 Switch - Disable query for both queries');
@@ -79,23 +115,35 @@ export function testMetricsRegression2(perspective: PerspectiveConfig) {
metricsPage.expandCollapseRowAssertion(false, 0, true, true);
metricsPage.expandCollapseRowAssertion(false, 1, true, true);
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY).should('be.visible');
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('have.attr', 'aria-disabled', 'true');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY)
+ .should('be.visible');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('have.attr', 'aria-disabled', 'true');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
metricsPage.clickKebabDropdown(0);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY).should('be.visible');
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('have.attr', 'aria-disabled', 'true');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY)
+ .should('be.visible');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('have.attr', 'aria-disabled', 'true');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
metricsPage.clickKebabDropdown(1);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageNoQueryEnteredTitle).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageNoQueryEntered).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageInsertExampleQueryButton).should('be.visible');
-
+
cy.log('6.9 Switch - Enable query for both queries');
metricsPage.clickDisableEnableQuerySwitch(0);
metricsPage.clickDisableEnableQuerySwitch(1);
@@ -104,40 +152,68 @@ export function testMetricsRegression2(perspective: PerspectiveConfig) {
metricsPage.expandCollapseRowAssertion(true, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV)
+ .should('be.visible');
metricsPage.clickKebabDropdown(0);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
cy.byTestID(DataTestIDs.MetricGraph).scrollIntoView().should('be.visible');
cy.log('6.10 Kebab icon - Hide all series');
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible').click();
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, false);
- }
- });
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible')
+ .click();
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, false);
+ }
+ });
metricsPage.selectAllUnselectAllButtonAssertion(1, false);
cy.log('6.11 Kebab icon - Show all series');
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES).should('be.visible').click();
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, true);
- }
- });
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES)
+ .should('be.visible')
+ .click();
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, true);
+ }
+ });
metricsPage.clickKebabDropdown(1);
metricsPage.selectAllUnselectAllButtonAssertion(1, true);
@@ -146,7 +222,9 @@ export function testMetricsRegression2(perspective: PerspectiveConfig) {
metricsPage.seriesButtonAssertion(1, 0, false);
metricsPage.selectAllUnselectAllButtonAssertion(1, false);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.13 Select serie - index 1 - manually');
@@ -154,68 +232,101 @@ export function testMetricsRegression2(perspective: PerspectiveConfig) {
metricsPage.seriesButtonAssertion(1, 0, true);
metricsPage.selectAllUnselectAllButtonAssertion(1, true);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.14 Unselect all - index 1 - manually');
metricsPage.clickSelectAllUnselectAllButton(1, true);
metricsPage.selectAllUnselectAllButtonAssertion(1, false);
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, false);
- }
- });
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, false);
+ }
+ });
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.15 Select all - index 1 - manually');
metricsPage.clickSelectAllUnselectAllButton(1, false);
metricsPage.selectAllUnselectAllButtonAssertion(1, true);
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, true);
- }
- });
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, true);
+ }
+ });
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.16 Kebab icon - Delete query');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DELETE_QUERY).should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DELETE_QUERY)
+ .should('be.visible')
+ .click();
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1);
- cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).find('button').eq(0).should('have.attr', 'aria-expanded', 'true');
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton)
+ .find('button')
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true');
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).should('have.length', 1);
cy.log('6.17 Kebab icon - Duplicate query');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY).should('be.visible').click();
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY)
+ .should('be.visible')
+ .click();
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY);
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
- cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).find('button').eq(0).should('have.attr', 'aria-expanded', 'true');
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(0).should('not.have.attr', 'checked');
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton)
+ .find('button')
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(0)
+ .should('not.have.attr', 'checked');
cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).should('have.length', 1);
metricsPage.clickKebabDropdown(0);
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('have.attr', 'aria-disabled', 'true');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('have.attr', 'aria-disabled', 'true');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
-
});
it(`${perspective.name} perspective - Metrics > Predefined Queries > Export as CSV`, () => {
- //OCPBUGS-54316 - [4.16] Metrics "Export as CSV" is not working for all queries
+ //OCPBUGS-54316 - [4.16] Metrics "Export as CSV" is not working for all queries
cy.log('7.1 Predefined Queries');
metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.CPU_USAGE);
metricsPage.clickKebabDropdown(0);
metricsPage.exportAsCSV(true, MetricsPageQueryInput.CPU_USAGE);
metricsPage.clickActionsDeleteAllQueries();
- cy.log('7.2 Predefined Queries');
+ cy.log('7.2 Predefined Queries');
metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.MEMORY_USAGE);
metricsPage.clickKebabDropdown(0);
metricsPage.exportAsCSV(true, MetricsPageQueryInput.MEMORY_USAGE);
@@ -258,25 +369,31 @@ export function testMetricsRegression2(perspective: PerspectiveConfig) {
metricsPage.clickActionsDeleteAllQueries();
cy.log('7.9 Predefined Queries');
- metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED);
+ metricsPage.clickPredefinedQuery(
+ MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED,
+ );
metricsPage.clickKebabDropdown(0);
metricsPage.exportAsCSV(true, MetricsPageQueryInput.RATE_OF_TRANSMITTED_PACKETS_DROPPED);
metricsPage.clickActionsDeleteAllQueries();
-
});
it(`${perspective.name} perspective - Metrics > No Datapoints`, () => {
cy.log('8.1 No Datapoints');
metricsPage.enterQueryInput(0, 'aaaaaaaaaa');
metricsPage.clickRunQueriesButton();
- cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound).scrollIntoView().contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageYellowNoDatapointsFound).scrollIntoView().contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound)
+ .scrollIntoView()
+ .contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageYellowNoDatapointsFound)
+ .scrollIntoView()
+ .contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND)
+ .should('be.visible');
metricsPage.clickActionsDeleteAllQueries();
metricsPage.enterQueryInput(0, 'a');
cy.get(Classes.MetricsPageQueryAutocomplete).should('be.visible');
cy.get(Classes.MetricsPageQueryAutocomplete).should('contain', 'abs');
-
});
it(`${perspective.name} perspective - Metrics > No Datapoints with alert`, () => {
@@ -285,6 +402,4 @@ export function testMetricsRegression2(perspective: PerspectiveConfig) {
metricsPage.clickRunQueriesButton();
cy.byOUIAID(DataTestIDs.MetricsGraphAlertDanger).should('be.visible');
});
-
}
-
diff --git a/web/cypress/support/monitoring/03.reg_legacy_dashboards.cy.ts b/web/cypress/support/monitoring/03.reg_legacy_dashboards.cy.ts
index 9ae86762a..09c86e15d 100644
--- a/web/cypress/support/monitoring/03.reg_legacy_dashboards.cy.ts
+++ b/web/cypress/support/monitoring/03.reg_legacy_dashboards.cy.ts
@@ -1,7 +1,15 @@
import { nav } from '../../views/nav';
import { legacyDashboardsPage } from '../../views/legacy-dashboards';
-import { LegacyDashboardsDashboardDropdown, MetricsPageQueryInput, WatchdogAlert } from '../../fixtures/monitoring/constants';
-import { Classes, LegacyDashboardPageTestIDs, DataTestIDs } from '../../../src/components/data-test';
+import {
+ LegacyDashboardsDashboardDropdown,
+ MetricsPageQueryInput,
+ WatchdogAlert,
+} from '../../fixtures/monitoring/constants';
+import {
+ Classes,
+ LegacyDashboardPageTestIDs,
+ DataTestIDs,
+} from '../../../src/components/data-test';
import { metricsPage } from '../../views/metrics';
import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page';
import { alerts } from '../../fixtures/monitoring/alert';
@@ -18,7 +26,6 @@ export function runAllRegressionLegacyDashboardsTests(perspective: PerspectiveCo
}
export function testLegacyDashboardsRegression(perspective: PerspectiveConfig) {
-
it(`${perspective.name} perspective - Dashboards (legacy)`, () => {
cy.log('1.1 Dashboards page loaded');
legacyDashboardsPage.shouldBeLoaded();
@@ -38,10 +45,15 @@ export function testLegacyDashboardsRegression(perspective: PerspectiveConfig) {
legacyDashboardsPage.dashboardAPIPerformancePanelAssertion();
cy.log('1.6 Inspect - API Request Duration by Verb - 99th Percentile');
- cy.byTestID(LegacyDashboardPageTestIDs.Inspect).eq(0).scrollIntoView().should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.Inspect)
+ .eq(0)
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
metricsPage.shouldBeLoadedWithGraph();
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.API_REQUEST_DURATION_BY_VERB_99TH_PERCENTILE_QUERY);
-
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.API_REQUEST_DURATION_BY_VERB_99TH_PERCENTILE_QUERY);
});
it(`${perspective.name} perspective - Dashboards (legacy) - Inspect and Export as CSV`, () => {
@@ -53,75 +65,93 @@ export function testLegacyDashboardsRegression(perspective: PerspectiveConfig) {
cy.log('2.2 Empty state');
legacyDashboardsPage.clickDashboardDropdown('K8S_COMPUTE_RESOURCES_POD');
- cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound).eq(0).scrollIntoView().should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound)
+ .eq(0)
+ .scrollIntoView()
+ .should('be.visible');
legacyDashboardsPage.clickKebabDropdown(0);
cy.byTestID(LegacyDashboardPageTestIDs.ExportAsCsv).should('be.visible');
cy.byPFRole('menuitem').should('have.attr', 'disabled');
-
});
it(`${perspective.name} perspective - Dashboards (legacy) - No kebab dropdown`, () => {
cy.log('3.1 Single Stat - No kebab dropdown');
legacyDashboardsPage.clickDashboardDropdown('K8S_COMPUTE_RESOURCES_NAMESPACE_PODS');
- cy.byLegacyTestID('chart-1').find('[data-test="' + DataTestIDs.KebabDropdownButton + '"]').should('not.exist');
+ cy.byLegacyTestID('chart-1')
+ .find('[data-test="' + DataTestIDs.KebabDropdownButton + '"]')
+ .should('not.exist');
cy.log('3.2 Table - No kebab dropdown');
legacyDashboardsPage.clickDashboardDropdown('PROMETHEUS_OVERVIEW');
- cy.byLegacyTestID('chart-1').find('[data-test="' + DataTestIDs.KebabDropdownButton + '"]').should('not.exist');
-
+ cy.byLegacyTestID('chart-1')
+ .find('[data-test="' + DataTestIDs.KebabDropdownButton + '"]')
+ .should('not.exist');
});
- it(`${perspective.name} perspective - OU-897 - Hide Graph / Show Graph on Metrics, Alert Details and Dashboards`, () => {
- cy.log('4.1 Observe > Metrics > Hide Graph');
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- metricsPage.shouldBeLoaded();
- metricsPage.clickHideGraphButton();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
-
- cy.log('4.2 Observe > Dashboards - Verify graph is visible');
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
-
- cy.log('4.3 Observe > Alerting rule details - Verify graph is visible');
- alerts.getWatchdogAlert();
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- commonPages.titleShouldHaveText('Alerting');
- alerts.getWatchdogAlert();
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- listPage.ARRows.clickAlertingRule();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- alertingRuleDetailsPage.clickHideGraphButton();
- cy.wait(2000);
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
- alertingRuleDetailsPage.clickShowGraphButton();
- cy.wait(2000);
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
- cy.wait(2000);
- alertingRuleDetailsPage.clickHideGraphButton();
- cy.wait(2000);
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
- cy.wait(2000);
-
- cy.log('4.4 Observe > Alert details - Verify graph is visible');
- cy.byTestID(DataTestIDs.AlertResourceLink).first().click();
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Show graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
-
- cy.log('4.5 Observe > Metrics > Hide Graph');
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- metricsPage.shouldBeLoaded();
-
- cy.log('4.6 Observe > Dashboards - Verify graph is visible');
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
-
- });
-
-}
\ No newline at end of file
+ it(
+ `${perspective.name} perspective - OU-897 - ` +
+ 'Hide Graph / Show Graph on Metrics, Alert Details and Dashboards',
+ () => {
+ cy.log('4.1 Observe > Metrics > Hide Graph');
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ metricsPage.shouldBeLoaded();
+ metricsPage.clickHideGraphButton();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+
+ cy.log('4.2 Observe > Dashboards - Verify graph is visible');
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+
+ cy.log('4.3 Observe > Alerting rule details - Verify graph is visible');
+ alerts.getWatchdogAlert();
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ commonPages.titleShouldHaveText('Alerting');
+ alerts.getWatchdogAlert();
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ listPage.ARRows.clickAlertingRule();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ alertingRuleDetailsPage.clickHideGraphButton();
+ cy.wait(2000);
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+ alertingRuleDetailsPage.clickShowGraphButton();
+ cy.wait(2000);
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ cy.wait(2000);
+ alertingRuleDetailsPage.clickHideGraphButton();
+ cy.wait(2000);
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+ cy.wait(2000);
+
+ cy.log('4.4 Observe > Alert details - Verify graph is visible');
+ cy.byTestID(DataTestIDs.AlertResourceLink).first().click();
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Hide graph')
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Hide graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Show graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Hide graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+
+ cy.log('4.5 Observe > Metrics > Hide Graph');
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ metricsPage.shouldBeLoaded();
+
+ cy.log('4.6 Observe > Dashboards - Verify graph is visible');
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ },
+ );
+}
diff --git a/web/cypress/support/monitoring/04.reg_alerts_namespace.cy.ts b/web/cypress/support/monitoring/04.reg_alerts_namespace.cy.ts
index 14dbc08b2..5162ced00 100644
--- a/web/cypress/support/monitoring/04.reg_alerts_namespace.cy.ts
+++ b/web/cypress/support/monitoring/04.reg_alerts_namespace.cy.ts
@@ -7,8 +7,16 @@ import { silenceDetailsPage } from '../../views/silence-details-page';
import { silencesListPage } from '../../views/silences-list-page';
import { alertingRuleListPage } from '../../views/alerting-rule-list-page';
import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page';
-import { AlertingRulesAlertState, MainTagState, Severity, SilenceState, Source, SilenceComment, WatchdogAlert } from '../../fixtures/monitoring/constants';
-import { Classes } from "../../../src/components/data-test";
+import {
+ AlertingRulesAlertState,
+ MainTagState,
+ Severity,
+ SilenceState,
+ Source,
+ SilenceComment,
+ WatchdogAlert,
+} from '../../fixtures/monitoring/constants';
+import { Classes } from '../../../src/components/data-test';
export interface PerspectiveConfig {
name: string;
@@ -31,26 +39,32 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) {
listPage.filter.selectFilterOption(false, Severity.INFO, false);
listPage.filter.selectFilterOption(false, Severity.NONE, true);
- listPage.filter.removeIndividualTag( AlertingRulesAlertState.FIRING);
- listPage.filter.removeIndividualTag( AlertingRulesAlertState.PENDING);
- listPage.filter.removeIndividualTag( AlertingRulesAlertState.SILENCED);
+ listPage.filter.removeIndividualTag(AlertingRulesAlertState.FIRING);
+ listPage.filter.removeIndividualTag(AlertingRulesAlertState.PENDING);
+ listPage.filter.removeIndividualTag(AlertingRulesAlertState.SILENCED);
listPage.filter.clearAllFilters();
- listPage.exportAsCSV(true, /openshift.csv/, `${WatchdogAlert.ALERTNAME}`, `${WatchdogAlert.SEVERITY}`, 'firing', 1);
+ listPage.exportAsCSV(true, /openshift.csv/);
- listPage.filter.byLabel('alertname='+`${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`);
listPage.filter.removeMainTag('Label');
- listPage.filter.byLabel('alertname='+`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.removeIndividualTag('alertname='+`${WatchdogAlert.ALERTNAME}`);
-
+ listPage.filter.byLabel('alertname=' + `${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.removeIndividualTag('alertname=' + `${WatchdogAlert.ALERTNAME}`);
});
it(`${perspective.name} perspective - Alerting > Silences page > Create silence`, () => {
cy.log('2.1 use sidebar nav to go to Observe > Alerting');
nav.tabs.switchTab('Silences');
silencesListPage.createSilence();
- cy.log('https://issues.redhat.com/browse/OU-1109 - [Namespace-level] - Dev user - Create a silence - namespace label does not have a value');
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('namespace', `${WatchdogAlert.NAMESPACE}`, false, false);
+ cy.log(
+ 'https://issues.redhat.com/browse/OU-1109 - [Namespace-level] - Dev user - Create a silence - namespace label does not have a value',
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ false,
+ false,
+ );
silenceAlertPage.assertCommentNoError();
silenceAlertPage.clickSubmit();
silenceAlertPage.assertCommentWithError();
@@ -58,132 +72,168 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) {
silenceAlertPage.addCreator('');
silenceAlertPage.clickSubmit();
silenceAlertPage.assertCreatorWithError();
-
});
- it(`${perspective.name} perspective - Alerting > Alerts / Silences > Kebab icon on List and Details`, () => {
- cy.log('3.1 use sidebar nav to go to Observe > Alerting');
-
- cy.log('3.2 filter to Watchdog alert');
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
-
- cy.log('3.3 silence alert');
- listPage.ARRows.expandRow();
- listPage.ARRows.silenceAlert();
- silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
- silenceAlertPage.clickSubmit();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('3.4 Assert Kebab on Alert Details page');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- commonPages.titleShouldHaveText('Alerting');
- listPage.filter.clearAllFilters();
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.expandRow();
- listPage.ARRows.assertNoKebab();
- listPage.ARRows.clickAlert();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- detailsPage.assertSilencedAlert();
-
- cy.log('3.5 Assert Kebab on Silence List page for Silenced alert');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
- silencesListPage.shouldBeLoaded();
- listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
- listPage.filter.removeIndividualTag(SilenceState.PENDING);
- silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.clickFilter(true,false);
- listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
- silencesListPage.rows.assertSilencedAlertKebab();
-
- cy.log('3.6 Click on Silenced alert and Assert Actions button');
- silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- silenceDetailsPage.assertActionsSilencedAlert();
-
- cy.log('3.7 Expire silence');
- silenceDetailsPage.expireSilence(false, true);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
- cy.changeNamespace('openshift-monitoring');
-
- cy.log('3.8 Assert Kebab on Silence List page for Expired alert');
- silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- silencesListPage.emptyState();
- listPage.filter.removeMainTag(MainTagState.SILENCE_STATE);
- listPage.filter.selectFilterOption(true, SilenceState.EXPIRED, false);
- listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, false);
- listPage.filter.selectFilterOption(false, SilenceState.PENDING, true);
- silencesListPage.rows.assertExpiredAlertKebab('0');
-
- cy.log('3.9 Click on Expired alert and Assert Actions button');
- silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- silenceDetailsPage.assertActionsExpiredAlert();
-
- cy.log('3.10 Recreate silence');
- silenceDetailsPage.recreateSilence(false);
- commonPages.titleShouldHaveText('Recreate silence');
- commonPages.projectDropdownShouldNotExist();
- silenceAlertPage.silenceAlertSectionDefault();
- silenceAlertPage.durationSectionDefault();
- silenceAlertPage.alertLabelsSectionDefault();
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('alertname', `${WatchdogAlert.ALERTNAME}`, false, false);
- cy.log('https://issues.redhat.com/browse/OU-1109 - [Namespace-level] - Dev user - Create a silence - namespace label does not have a value');
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('namespace', `${WatchdogAlert.NAMESPACE}`, false, false);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('prometheus', 'openshift-monitoring/k8s', false, false);
- silenceAlertPage.clickSubmit();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('3.11 Edit silence');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
- silencesListPage.shouldBeLoaded();
- listPage.filter.removeIndividualTag(SilenceState.PENDING);
- silencesListPage.filter.byName( `${WatchdogAlert.ALERTNAME}`);
- silencesListPage.rows.editSilence();
- commonPages.titleShouldHaveText('Edit silence');
- commonPages.projectDropdownShouldNotExist();
- silenceAlertPage.silenceAlertSectionDefault();
- silenceAlertPage.editAlertWarning();
- silenceAlertPage.editDurationSectionDefault();
- silenceAlertPage.alertLabelsSectionDefault();
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('alertname', `${WatchdogAlert.ALERTNAME}`, false, false);
- cy.log('https://issues.redhat.com/browse/OU-1109 - [Namespace-level] - Dev user - Create a silence - namespace label does not have a value');
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('namespace', `${WatchdogAlert.NAMESPACE}`, false, false);
- silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher('prometheus', 'openshift-monitoring/k8s', false, false);
- silenceAlertPage.clickSubmit();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
-
- cy.log('3.12 Expire silence');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.tabs.switchTab('Silences');
- silencesListPage.shouldBeLoaded(); silencesListPage.shouldBeLoaded();
- listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
- listPage.filter.removeIndividualTag(SilenceState.PENDING);
- silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.clickFilter(true,false);
- listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
- silencesListPage.rows.expireSilence(true);
-
- cy.log('3.13 Alert Details > Silence alert button > Cancel');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- listPage.ARRows.expandRow();
- listPage.ARRows.clickAlert();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- detailsPage.clickSilenceAlertButton();
- silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
- silenceAlertPage.clickCancelButton();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- });
-
+ it(
+ `${perspective.name} perspective - ` +
+ 'Alerting > Alerts / Silences > Kebab icon on List and Details',
+ () => {
+ cy.log('3.1 use sidebar nav to go to Observe > Alerting');
+
+ cy.log('3.2 filter to Watchdog alert');
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+
+ cy.log('3.3 silence alert');
+ listPage.ARRows.expandRow();
+ listPage.ARRows.silenceAlert();
+ silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
+ silenceAlertPage.clickSubmit();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('3.4 Assert Kebab on Alert Details page');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ commonPages.titleShouldHaveText('Alerting');
+ listPage.filter.clearAllFilters();
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.expandRow();
+ listPage.ARRows.assertNoKebab();
+ listPage.ARRows.clickAlert();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ detailsPage.assertSilencedAlert();
+
+ cy.log('3.5 Assert Kebab on Silence List page for Silenced alert');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+ silencesListPage.shouldBeLoaded();
+ listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
+ listPage.filter.removeIndividualTag(SilenceState.PENDING);
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.clickFilter(true, false);
+ listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
+ silencesListPage.rows.assertSilencedAlertKebab();
+
+ cy.log('3.6 Click on Silenced alert and Assert Actions button');
+ silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ silenceDetailsPage.assertActionsSilencedAlert();
+
+ cy.log('3.7 Expire silence');
+ silenceDetailsPage.expireSilence(false, true);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+ cy.changeNamespace('openshift-monitoring');
+
+ cy.log('3.8 Assert Kebab on Silence List page for Expired alert');
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ silencesListPage.emptyState();
+ listPage.filter.removeMainTag(MainTagState.SILENCE_STATE);
+ listPage.filter.selectFilterOption(true, SilenceState.EXPIRED, false);
+ listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, false);
+ listPage.filter.selectFilterOption(false, SilenceState.PENDING, true);
+ silencesListPage.rows.assertExpiredAlertKebab('0');
+
+ cy.log('3.9 Click on Expired alert and Assert Actions button');
+ silencesListPage.rows.clickSilencedAlert(`${WatchdogAlert.ALERTNAME}`);
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ silenceDetailsPage.assertActionsExpiredAlert();
+
+ cy.log('3.10 Recreate silence');
+ silenceDetailsPage.recreateSilence(false);
+ commonPages.titleShouldHaveText('Recreate silence');
+ commonPages.projectDropdownShouldNotExist();
+ silenceAlertPage.silenceAlertSectionDefault();
+ silenceAlertPage.durationSectionDefault();
+ silenceAlertPage.alertLabelsSectionDefault();
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'alertname',
+ `${WatchdogAlert.ALERTNAME}`,
+ false,
+ false,
+ );
+ cy.log(
+ 'https://issues.redhat.com/browse/OU-1109 - [Namespace-level] - Dev user - Create a silence - namespace label does not have a value',
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ false,
+ false,
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'prometheus',
+ 'openshift-monitoring/k8s',
+ false,
+ false,
+ );
+ silenceAlertPage.clickSubmit();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('3.11 Edit silence');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+ silencesListPage.shouldBeLoaded();
+ listPage.filter.removeIndividualTag(SilenceState.PENDING);
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ silencesListPage.rows.editSilence();
+ commonPages.titleShouldHaveText('Edit silence');
+ commonPages.projectDropdownShouldNotExist();
+ silenceAlertPage.silenceAlertSectionDefault();
+ silenceAlertPage.editAlertWarning();
+ silenceAlertPage.editDurationSectionDefault();
+ silenceAlertPage.alertLabelsSectionDefault();
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'alertname',
+ `${WatchdogAlert.ALERTNAME}`,
+ false,
+ false,
+ );
+ cy.log(
+ 'https://issues.redhat.com/browse/OU-1109 - [Namespace-level] - Dev user - Create a silence - namespace label does not have a value',
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'namespace',
+ `${WatchdogAlert.NAMESPACE}`,
+ false,
+ false,
+ );
+ silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher(
+ 'prometheus',
+ 'openshift-monitoring/k8s',
+ false,
+ false,
+ );
+ silenceAlertPage.clickSubmit();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+
+ cy.log('3.12 Expire silence');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.tabs.switchTab('Silences');
+ silencesListPage.shouldBeLoaded();
+ listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
+ listPage.filter.removeIndividualTag(SilenceState.PENDING);
+ silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.filter.clickFilter(true, false);
+ listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
+ silencesListPage.rows.expireSilence(true);
+
+ cy.log('3.13 Alert Details > Silence alert button > Cancel');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ listPage.ARRows.expandRow();
+ listPage.ARRows.clickAlert();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ detailsPage.clickSilenceAlertButton();
+ silenceAlertPage.addComment(SilenceComment.SILENCE_COMMENT);
+ silenceAlertPage.clickCancelButton();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ },
+ );
it(`${perspective.name} perspective - Alerting > Alerting Rules`, () => {
cy.log('4.1 use sidebar nav to go to Observe > Alerting');
@@ -254,21 +304,18 @@ export function testAlertsRegressionNamespace(perspective: PerspectiveConfig) {
listPage.filter.removeIndividualTag(SilenceState.ACTIVE);
listPage.filter.removeIndividualTag(SilenceState.PENDING);
silencesListPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.filter.clickFilter(true,false);
+ listPage.filter.clickFilter(true, false);
listPage.filter.selectFilterOption(false, SilenceState.ACTIVE, true);
silencesListPage.rows.expireSilence(true);
-
});
it(`${perspective.name} perspective - Alerting > Empty state`, () => {
cy.log('5.1 Empty state');
- cy.changeNamespace("default");
+ cy.changeNamespace('default');
listPage.emptyState();
nav.tabs.switchTab('Silences');
silencesListPage.firstTimeEmptyState();
nav.tabs.switchTab('Alerting rules');
alertingRuleListPage.emptyState();
-
-});
-
+ });
}
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
index b9401deb6..949ec029b 100644
--- a/web/cypress/support/monitoring/05.reg_metrics_namespace_1.cy.ts
+++ b/web/cypress/support/monitoring/05.reg_metrics_namespace_1.cy.ts
@@ -1,6 +1,11 @@
import { metricsPage } from '../../views/metrics';
import { Classes, DataTestIDs } from '../../../src/components/data-test';
-import { MetricsPageUnits, GraphTimespan, MetricsPagePredefinedQueries, MetricsPageQueryInput, MetricsPageQueryKebabDropdown, MetricsPageQueryInputByNamespace } from '../../fixtures/monitoring/constants';
+import {
+ MetricsPageUnits,
+ GraphTimespan,
+ MetricsPagePredefinedQueries,
+ MetricsPageQueryInput,
+} from '../../fixtures/monitoring/constants';
export interface PerspectiveConfig {
name: string;
@@ -9,7 +14,6 @@ export interface PerspectiveConfig {
export function runAllRegressionMetricsTestsNamespace1(perspective: PerspectiveConfig) {
testMetricsRegressionNamespace1(perspective);
-
}
export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig) {
@@ -31,7 +35,6 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
cy.log('1.6 Kebab dropdown');
metricsPage.kebabDropdownAssertionWithoutQuery();
-
});
it(`${perspective.name} perspective - Metrics > Actions - No query added`, () => {
@@ -69,8 +72,10 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
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');
-
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton)
+ .find('button')
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true');
});
it(`${perspective.name} perspective - Metrics > Actions - One query added`, () => {
@@ -86,8 +91,14 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
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.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);
@@ -98,8 +109,14 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
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.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);
@@ -110,8 +127,14 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
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.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);
@@ -123,16 +146,20 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
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');
+ 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);
+ 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');
@@ -158,13 +185,19 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
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_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.byTestID(DataTestIDs.MetricGraphTimespanInput).should(
+ 'have.attr',
+ 'value',
+ GraphTimespan.THIRTY_MINUTES,
+ );
cy.log('4.7 Hide Graph Button');
metricsPage.clickHideGraphButton();
@@ -184,7 +217,7 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
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');
@@ -196,5 +229,5 @@ export function testMetricsRegressionNamespace1(perspective: PerspectiveConfig)
metricsPage.clickUnitsDropdown(unit);
metricsPage.unitsAxisYAssertion(unit);
});
- });
+ });
}
diff --git a/web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts b/web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts
index c567a36be..f5c7e5193 100644
--- a/web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts
+++ b/web/cypress/support/monitoring/05.reg_metrics_namespace_2.cy.ts
@@ -1,6 +1,11 @@
import { metricsPage } from '../../views/metrics';
import { Classes, DataTestIDs } from '../../../src/components/data-test';
-import { MetricsPageUnits, GraphTimespan, MetricsPagePredefinedQueries, MetricsPageQueryInput, MetricsPageQueryKebabDropdown, MetricsPageQueryInputByNamespace } from '../../fixtures/monitoring/constants';
+import {
+ MetricsPagePredefinedQueries,
+ MetricsPageQueryInput,
+ MetricsPageQueryKebabDropdown,
+ MetricsPageQueryInputByNamespace,
+} from '../../fixtures/monitoring/constants';
export interface PerspectiveConfig {
name: string;
@@ -12,22 +17,33 @@ export function runAllRegressionMetricsTestsNamespace2(perspective: PerspectiveC
}
export 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();
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1);
metricsPage.clickInsertExampleQuery();
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
cy.log('6.2 Only one query added, resulting in 2 rows');
metricsPage.clickActionsAddQuery();
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.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
-
+ 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.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+
cy.log('6.3 Preparation to test Run Queries button');
cy.get(Classes.MetricsPageQueryInput).eq(0).should('be.visible').clear();
cy.get(Classes.MetricsPageQueryInput).eq(0).type(MetricsPageQueryInput.VECTOR_QUERY);
@@ -42,33 +58,53 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
metricsPage.disableEnableQuerySwitchAssertion(1, true);
metricsPage.expandCollapseRowAssertion(true, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
-
+
cy.log('6.6 Kebab icon - Disable query');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible')
+ .click();
metricsPage.disableEnableQuerySwitchAssertion(0, false);
metricsPage.disableEnableQuerySwitchAssertion(1, true);
metricsPage.expandCollapseRowAssertion(false, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
cy.byTestID(DataTestIDs.MetricGraph).scrollIntoView().should('be.visible');
metricsPage.clickKebabDropdown(0);
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
cy.log('6.7 Kebab icon - Enable query');
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY).should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY)
+ .should('be.visible')
+ .click();
metricsPage.disableEnableQuerySwitchAssertion(0, true);
metricsPage.disableEnableQuerySwitchAssertion(1, true);
metricsPage.expandCollapseRowAssertion(true, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
cy.byTestID(DataTestIDs.MetricGraph).scrollIntoView().should('be.visible');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV)
+ .should('be.visible');
metricsPage.clickKebabDropdown(0);
cy.log('6.8 Switch - Disable query for both queries');
@@ -79,23 +115,35 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
metricsPage.expandCollapseRowAssertion(false, 0, true, true);
metricsPage.expandCollapseRowAssertion(false, 1, true, true);
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY).should('be.visible');
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('have.attr', 'aria-disabled', 'true');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY)
+ .should('be.visible');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('have.attr', 'aria-disabled', 'true');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
metricsPage.clickKebabDropdown(0);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY).should('be.visible');
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('have.attr', 'aria-disabled', 'true');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.ENABLE_QUERY)
+ .should('be.visible');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('have.attr', 'aria-disabled', 'true');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
metricsPage.clickKebabDropdown(1);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageNoQueryEnteredTitle).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageNoQueryEntered).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageInsertExampleQueryButton).should('be.visible');
-
+
cy.log('6.9 Switch - Enable query for both queries');
metricsPage.clickDisableEnableQuerySwitch(0);
metricsPage.clickDisableEnableQuerySwitch(1);
@@ -104,40 +152,68 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
metricsPage.expandCollapseRowAssertion(true, 0, true, true);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV)
+ .should('be.visible');
metricsPage.clickKebabDropdown(0);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.VECTOR_QUERY);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.VECTOR_QUERY);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
cy.byTestID(DataTestIDs.MetricGraph).scrollIntoView().should('be.visible');
cy.log('6.10 Kebab icon - Hide all series');
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible').click();
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, false);
- }
- });
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible')
+ .click();
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, false);
+ }
+ });
metricsPage.selectAllUnselectAllButtonAssertion(1, false);
cy.log('6.11 Kebab icon - Show all series');
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES).should('be.visible').click();
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, true);
- }
- });
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES)
+ .should('be.visible')
+ .click();
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, true);
+ }
+ });
metricsPage.clickKebabDropdown(1);
metricsPage.selectAllUnselectAllButtonAssertion(1, true);
@@ -146,7 +222,9 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
metricsPage.seriesButtonAssertion(1, 0, false);
metricsPage.selectAllUnselectAllButtonAssertion(1, false);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.13 Select serie - index 1 - manually');
@@ -154,67 +232,101 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
metricsPage.seriesButtonAssertion(1, 0, true);
metricsPage.selectAllUnselectAllButtonAssertion(1, true);
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.14 Unselect all - index 1 - manually');
metricsPage.clickSelectAllUnselectAllButton(1, true);
metricsPage.selectAllUnselectAllButtonAssertion(1, false);
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, false);
- }
- });
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, false);
+ }
+ });
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.SHOW_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.15 Select all - index 1 - manually');
metricsPage.clickSelectAllUnselectAllButton(1, false);
metricsPage.selectAllUnselectAllButtonAssertion(1, true);
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(1).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').then(($seriesButtons) => {
- const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
- for (let i = 0; i < seriesButtonsCount; i++) {
- metricsPage.seriesButtonAssertion(1, i, true);
- }
- });
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(1)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .then(($seriesButtons) => {
+ const seriesButtonsCount: number = Cypress.$($seriesButtons).length;
+ for (let i = 0; i < seriesButtonsCount; i++) {
+ metricsPage.seriesButtonAssertion(1, i, true);
+ }
+ });
metricsPage.clickKebabDropdown(1);
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
metricsPage.clickKebabDropdown(1);
cy.log('6.16 Kebab icon - Delete query');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DELETE_QUERY).should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DELETE_QUERY)
+ .should('be.visible')
+ .click();
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 1);
- cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).find('button').eq(0).should('have.attr', 'aria-expanded', 'true');
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton)
+ .find('button')
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true');
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).should('have.length', 1);
cy.log('6.17 Kebab icon - Duplicate query');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY).should('be.visible').click();
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
- cy.get(Classes.MetricsPageQueryInput).eq(1).should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY)
+ .should('be.visible')
+ .click();
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(1)
+ .should('contain', MetricsPageQueryInput.INSERT_EXAMPLE_QUERY_NAMESPACE);
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).should('have.length', 2);
metricsPage.expandCollapseRowAssertion(true, 1, true, true);
- cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).find('button').eq(0).should('have.attr', 'aria-expanded', 'true');
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(0).should('not.have.attr', 'checked');
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton)
+ .find('button')
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(0)
+ .should('not.have.attr', 'checked');
cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).should('have.length', 1);
metricsPage.clickKebabDropdown(0);
- cy.get(Classes.MenuItemDisabled).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('have.attr', 'aria-disabled', 'true');
+ cy.get(Classes.MenuItemDisabled)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('have.attr', 'aria-disabled', 'true');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
});
it(`${perspective.name} perspective - Metrics > Predefined Queries > Export as CSV`, () => {
- //OCPBUGS-54316 - [4.16] Metrics "Export as CSV" is not working for all queries
+ //OCPBUGS-54316 - [4.16] Metrics "Export as CSV" is not working for all queries
cy.log('7.1 Predefined Queries');
metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.CPU_USAGE);
metricsPage.clickKebabDropdown(0);
metricsPage.exportAsCSV(true, MetricsPageQueryInputByNamespace.CPU_USAGE);
metricsPage.clickActionsDeleteAllQueries();
- cy.log('7.2 Predefined Queries');
+ cy.log('7.2 Predefined Queries');
metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.MEMORY_USAGE);
metricsPage.clickKebabDropdown(0);
metricsPage.exportAsCSV(true, MetricsPageQueryInputByNamespace.MEMORY_USAGE);
@@ -253,15 +365,22 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
cy.log('7.8 Predefined Queries');
metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.RATE_OF_RECEIVED_PACKETS_DROPPED);
metricsPage.clickKebabDropdown(0);
- metricsPage.exportAsCSV(true, MetricsPageQueryInputByNamespace.RATE_OF_RECEIVED_PACKETS_DROPPED);
+ metricsPage.exportAsCSV(
+ true,
+ MetricsPageQueryInputByNamespace.RATE_OF_RECEIVED_PACKETS_DROPPED,
+ );
metricsPage.clickActionsDeleteAllQueries();
cy.log('7.9 Predefined Queries');
- metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED);
+ metricsPage.clickPredefinedQuery(
+ MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED,
+ );
metricsPage.clickKebabDropdown(0);
- metricsPage.exportAsCSV(true, MetricsPageQueryInputByNamespace.RATE_OF_TRANSMITTED_PACKETS_DROPPED);
+ metricsPage.exportAsCSV(
+ true,
+ MetricsPageQueryInputByNamespace.RATE_OF_TRANSMITTED_PACKETS_DROPPED,
+ );
metricsPage.clickActionsDeleteAllQueries();
-
});
it(`${perspective.name} perspective - Metrics > No Datapoints`, () => {
@@ -274,7 +393,6 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
metricsPage.enterQueryInput(0, 'a');
cy.get(Classes.MetricsPageQueryAutocomplete).should('be.visible');
cy.get(Classes.MetricsPageQueryAutocomplete).should('contain', 'abs');
-
});
it(`${perspective.name} perspective - Metrics > No Datapoints with alert`, () => {
@@ -286,16 +404,15 @@ export function testMetricsRegressionNamespace2(perspective: PerspectiveConfig)
it(`${perspective.name} perspective - Metrics > Empty state`, () => {
cy.log('11.1 Insert example query - Empty state');
- cy.changeNamespace("default");
+ cy.changeNamespace('default');
metricsPage.clickInsertExampleQuery();
metricsPage.noDatapointsFound();
cy.log('11.2 Query - Empty state');
metricsPage.clickActionsDeleteAllQueries();
- metricsPage.clickPredefinedQuery(MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED);
+ metricsPage.clickPredefinedQuery(
+ MetricsPagePredefinedQueries.RATE_OF_TRANSMITTED_PACKETS_DROPPED,
+ );
metricsPage.noDatapointsFound();
-
});
-
}
-
diff --git a/web/cypress/support/monitoring/06.reg_legacy_dashboards_namespace.cy.ts b/web/cypress/support/monitoring/06.reg_legacy_dashboards_namespace.cy.ts
index 4f57241fd..4fe3cd5bc 100644
--- a/web/cypress/support/monitoring/06.reg_legacy_dashboards_namespace.cy.ts
+++ b/web/cypress/support/monitoring/06.reg_legacy_dashboards_namespace.cy.ts
@@ -1,7 +1,15 @@
import { nav } from '../../views/nav';
import { legacyDashboardsPage } from '../../views/legacy-dashboards';
-import { LegacyDashboardsDashboardDropdownNamespace, MetricsPageQueryInputByNamespace, WatchdogAlert } from '../../fixtures/monitoring/constants';
-import { Classes, LegacyDashboardPageTestIDs, DataTestIDs } from '../../../src/components/data-test';
+import {
+ LegacyDashboardsDashboardDropdownNamespace,
+ MetricsPageQueryInputByNamespace,
+ WatchdogAlert,
+} from '../../fixtures/monitoring/constants';
+import {
+ Classes,
+ LegacyDashboardPageTestIDs,
+ DataTestIDs,
+} from '../../../src/components/data-test';
import { metricsPage } from '../../views/metrics';
import { alertingRuleDetailsPage } from '../../views/alerting-rule-details-page';
import { alerts } from '../../fixtures/monitoring/alert';
@@ -19,7 +27,6 @@ export function runAllRegressionLegacyDashboardsTestsNamespace(perspective: Pers
}
export function testLegacyDashboardsRegressionNamespace(perspective: PerspectiveConfig) {
-
it(`${perspective.name} perspective - Dashboards (legacy)`, () => {
cy.log('1.1 Dashboards page loaded');
legacyDashboardsPage.shouldBeLoaded();
@@ -37,10 +44,15 @@ export function testLegacyDashboardsRegressionNamespace(perspective: Perspective
legacyDashboardsPage.dashboardKubernetesComputeResourcesNamespacePodsPanelAssertion();
cy.log('1.6 Inspect - CPU Utilisation (from requests)');
- cy.byTestID(LegacyDashboardPageTestIDs.Inspect).eq(0).scrollIntoView().should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.Inspect)
+ .eq(0)
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
metricsPage.shouldBeLoadedWithGraph();
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('contain', MetricsPageQueryInputByNamespace.CPU_UTILISATION_FROM_REQUESTS);
-
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('contain', MetricsPageQueryInputByNamespace.CPU_UTILISATION_FROM_REQUESTS);
});
it(`${perspective.name} perspective - Dashboards (legacy) - Export as CSV`, () => {
@@ -53,11 +65,13 @@ export function testLegacyDashboardsRegressionNamespace(perspective: Perspective
cy.log('2.2 Empty state');
cy.changeNamespace('default');
legacyDashboardsPage.shouldBeLoaded();
- cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound).eq(0).scrollIntoView().should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound)
+ .eq(0)
+ .scrollIntoView()
+ .should('be.visible');
legacyDashboardsPage.clickKebabDropdown(0);
cy.byTestID(LegacyDashboardPageTestIDs.ExportAsCsv).should('be.visible');
cy.byPFRole('menuitem').should('have.attr', 'disabled');
-
});
it(`${perspective.name} perspective - Dashboards (legacy) - No kebab dropdown`, () => {
@@ -69,57 +83,73 @@ export function testLegacyDashboardsRegressionNamespace(perspective: Perspective
commonPages.titleShouldHaveText('Dashboards');
cy.changeNamespace('openshift-monitoring');
legacyDashboardsPage.shouldBeLoaded();
- cy.byLegacyTestID('chart-1').find('[data-test="'+DataTestIDs.KebabDropdownButton+'"]').should('not.exist');
+ cy.byLegacyTestID('chart-1')
+ .find('[data-test="' + DataTestIDs.KebabDropdownButton + '"]')
+ .should('not.exist');
cy.log('3.2 Table - No kebab dropdown');
- cy.byLegacyTestID('chart-6').find('[data-test="'+DataTestIDs.KebabDropdownButton+'"]').should('not.exist');
-
+ cy.byLegacyTestID('chart-6')
+ .find('[data-test="' + DataTestIDs.KebabDropdownButton + '"]')
+ .should('not.exist');
});
- it(`${perspective.name} perspective - OU-897 - Hide Graph / Show Graph on Metrics, Alert Details and Dashboards`, () => {
- cy.log('4.1 Observe > Metrics > Hide Graph');
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- metricsPage.shouldBeLoaded();
- metricsPage.clickHideGraphButton();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
-
- cy.log('4.2 Observe > Dashboards - Verify graph is visible');
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
-
- cy.log('4.3 Observe > Alerting rule details - Verify graph is visible');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- alerts.getWatchdogAlert();
- listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
- listPage.ARRows.countShouldBe(1);
- listPage.ARRows.clickAlertingRule();
- commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
- alertingRuleDetailsPage.clickHideGraphButton();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
- alertingRuleDetailsPage.clickShowGraphButton();
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
- alertingRuleDetailsPage.clickHideGraphButton();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
-
- cy.log('4.4 Observe > Alert details - Verify graph is visible');
- cy.byTestID(DataTestIDs.AlertResourceLink).first().click();
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Show graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
-
- cy.log('4.5 Observe > Metrics > Hide Graph');
- nav.sidenav.clickNavLink(['Observe', 'Metrics']);
- metricsPage.shouldBeLoaded();
-
- cy.log('4.6 Observe > Dashboards - Verify graph is visible');
- nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
-
- });
-
-}
\ No newline at end of file
+ it(
+ `${perspective.name} perspective - OU-897 - ` +
+ 'Hide Graph / Show Graph on Metrics, Alert Details and Dashboards',
+ () => {
+ cy.log('4.1 Observe > Metrics > Hide Graph');
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ metricsPage.shouldBeLoaded();
+ metricsPage.clickHideGraphButton();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+
+ cy.log('4.2 Observe > Dashboards - Verify graph is visible');
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+
+ cy.log('4.3 Observe > Alerting rule details - Verify graph is visible');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ alerts.getWatchdogAlert();
+ listPage.filter.byName(`${WatchdogAlert.ALERTNAME}`);
+ listPage.ARRows.countShouldBe(1);
+ listPage.ARRows.clickAlertingRule();
+ commonPages.titleShouldHaveText(`${WatchdogAlert.ALERTNAME}`);
+ alertingRuleDetailsPage.clickHideGraphButton();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+ alertingRuleDetailsPage.clickShowGraphButton();
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ alertingRuleDetailsPage.clickHideGraphButton();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+
+ cy.log('4.4 Observe > Alert details - Verify graph is visible');
+ cy.byTestID(DataTestIDs.AlertResourceLink).first().click();
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Hide graph')
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Hide graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Show graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Hide graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+
+ cy.log('4.5 Observe > Metrics > Hide Graph');
+ nav.sidenav.clickNavLink(['Observe', 'Metrics']);
+ metricsPage.shouldBeLoaded();
+
+ cy.log('4.6 Observe > Dashboards - Verify graph is visible');
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ },
+ );
+}
diff --git a/web/cypress/support/perses/00.coo_bvt_perses_admin.cy.ts b/web/cypress/support/perses/00.coo_bvt_perses_admin.cy.ts
index cee213e00..e1e0035b5 100644
--- a/web/cypress/support/perses/00.coo_bvt_perses_admin.cy.ts
+++ b/web/cypress/support/perses/00.coo_bvt_perses_admin.cy.ts
@@ -1,58 +1,352 @@
-import { persesDashboardsAcceleratorsCommonMetricsPanels, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
-import { commonPages } from '../../views/common';
+import {
+ persesDashboardsAcceleratorsCommonMetricsPanels,
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+ persesDashboardsEmptyDashboard,
+} from '../../fixtures/perses/constants';
import { persesDashboardsPage } from '../../views/perses-dashboards';
import { persesMUIDataTestIDs } from '../../../src/components/data-test';
+import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
+import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup';
+import { persesDashboardsPanel } from '../../views/perses-dashboards-panel';
+import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables';
+import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard';
+import { persesDashboardsAddListVariableSource } from '../../fixtures/perses/constants';
+import { persesDashboardSampleQueries } from '../../fixtures/perses/constants';
+import { persesDashboardsAddListPanelType } from '../../fixtures/perses/constants';
+import { commonPages } from '../../views/common';
+import { nav } from '../../views/nav';
export interface PerspectiveConfig {
name: string;
beforeEach?: () => void;
}
-export function runBVTCOOPersesTests(perspective: PerspectiveConfig) {
- testBVTCOOPerses(perspective);
+export function runBVTCOOPersesTests1(perspective: PerspectiveConfig) {
+ testBVTCOOPerses1(perspective);
}
-export function testBVTCOOPerses(perspective: PerspectiveConfig) {
-
+export function testBVTCOOPerses1(perspective: PerspectiveConfig) {
it(`1.${perspective.name} perspective - Dashboards (Perses) page`, () => {
cy.log(`1.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- persesDashboardsPage.shouldBeLoaded();
-
- persesDashboardsPage.timeRangeDropdownAssertion();
- persesDashboardsPage.refreshIntervalDropdownAssertion();
- persesDashboardsPage.dashboardDropdownAssertion(persesDashboardsDashboardDropdownCOO);
- cy.wait(2000);
- cy.changeNamespace('perses-dev');
- persesDashboardsPage.dashboardDropdownAssertion(persesDashboardsDashboardDropdownPersesDev);
+ listPersesDashboardsPage.shouldBeLoaded();
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+ persesDashboardsPage.shouldBeLoaded1();
});
it(`2.${perspective.name} perspective - Accelerators common metrics dashboard `, () => {
- cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses) > Accelerators common metrics dashboard`);
+ cy.log(
+ `2.1. use sidebar nav to go to Observe > Dashboards (Perses) > ` +
+ `Accelerators common metrics dashboard`,
+ );
+ listPersesDashboardsPage.shouldBeLoaded();
cy.changeNamespace('openshift-cluster-observability-operator');
- persesDashboardsPage.clickDashboardDropdown(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0] as keyof typeof persesDashboardsDashboardDropdownCOO);
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-cluster').should('be.visible');
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+
+ cy.log(`2.2. Select dashboard`);
+ persesDashboardsPage.clickDashboardDropdown(
+ persesDashboardsDashboardDropdownCOO
+ .ACCELERATORS_COMMON_METRICS[0] as keyof typeof persesDashboardsDashboardDropdownCOO,
+ );
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-cluster').should('be.visible');
persesDashboardsPage.panelGroupHeaderAssertion('Accelerators', 'Open');
persesDashboardsPage.panelHeadersAcceleratorsCommonMetricsAssertion();
- persesDashboardsPage.expandPanel(persesDashboardsAcceleratorsCommonMetricsPanels.GPU_UTILIZATION);
- persesDashboardsPage.collapsePanel(persesDashboardsAcceleratorsCommonMetricsPanels.GPU_UTILIZATION);
+ persesDashboardsPage.expandPanel(
+ persesDashboardsAcceleratorsCommonMetricsPanels.GPU_UTILIZATION,
+ );
+ persesDashboardsPage.collapsePanel(
+ persesDashboardsAcceleratorsCommonMetricsPanels.GPU_UTILIZATION,
+ );
});
it(`3.${perspective.name} perspective - Perses Dashboard Sample dashboard`, () => {
- cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses) > Perses Dashboard Sample dashboard`);
+ cy.log(
+ `3.1. use sidebar nav to go to Observe > Dashboards (Perses) > ` +
+ `Perses Dashboard Sample dashboard`,
+ );
cy.changeNamespace('perses-dev');
- persesDashboardsPage.clickDashboardDropdown(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] as keyof typeof persesDashboardsDashboardDropdownPersesDev);
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-job').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-instance').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-interval').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-text').should('be.visible');
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ cy.wait(2000);
+ persesDashboardsPage.clickDashboardDropdown(
+ persesDashboardsDashboardDropdownPersesDev
+ .PERSES_DASHBOARD_SAMPLE[0] as keyof typeof persesDashboardsDashboardDropdownPersesDev,
+ );
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-job').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-instance').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-interval').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-text').should('be.visible');
persesDashboardsPage.panelGroupHeaderAssertion('Row 1', 'Open');
persesDashboardsPage.expandPanel('RAM Total');
persesDashboardsPage.collapsePanel('RAM Total');
persesDashboardsPage.statChartValueAssertion('RAM Total', true);
persesDashboardsPage.searchAndSelectVariable('job', 'node-exporter');
persesDashboardsPage.statChartValueAssertion('RAM Total', false);
-
});
+ it(`4.${perspective.name} perspective - Download and View JSON`, () => {
+ cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses) > Download and View JSON`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+ persesDashboardsPage.downloadDashboard(
+ true,
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2],
+ 'JSON',
+ );
+ persesDashboardsPage.downloadDashboard(
+ true,
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2],
+ 'YAML',
+ );
+ persesDashboardsPage.downloadDashboard(
+ true,
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2],
+ 'YAML (CR v1alpha1)',
+ );
+ persesDashboardsPage.downloadDashboard(
+ true,
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2],
+ 'YAML (CR v1alpha2)',
+ );
+ persesDashboardsPage.viewJSON(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2],
+ 'openshift-cluster-observability-operator',
+ );
+ });
+
+ it(
+ `5.${perspective.name} perspective - Duplicate from a project to another, ` +
+ `Rename and Delete`,
+ () => {
+ cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`5.2. Change namespace to perses-dev`);
+ cy.changeNamespace('perses-dev');
+ listPersesDashboardsPage.countDashboards('3');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`5.3. Click on the Kebab icon - Duplicate to another project`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickDuplicateOption();
+ listPersesDashboardsPage.duplicateDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown(
+ 'openshift-cluster-observability-operator',
+ );
+ listPersesDashboardsPage.duplicateDashboardDuplicateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ persesDashboardsPage.shouldBeLoadedAfterDuplicate(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ persesDashboardsPage.backToListPersesDashboardsPage();
+
+ cy.log(`5.4. Click on the Kebab icon - Rename`);
+ cy.changeNamespace('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed',
+ );
+ listPersesDashboardsPage.renameDashboardRenameButton();
+
+ cy.log(`5.5. Click on the Kebab icon - Delete`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed',
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`5.6. Click on the Kebab icon - Delete`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickDeleteOption();
+ listPersesDashboardsPage.deleteDashboardDeleteButton();
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.countDashboards('0');
+
+ cy.log(`5.7. Search for the renamed dashboard`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ cy.changeNamespace('All Projects');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed',
+ );
+ listPersesDashboardsPage.countDashboards('0');
+ listPersesDashboardsPage.clearAllFilters();
+ },
+ );
+
+ it(
+ `6.${perspective.name} perspective - Create Dashboard with panel groups, panels ` +
+ `and variables`,
+ () => {
+ let dashboardName = 'Testing Dashboard - UP ';
+ const randomSuffix = Math.random().toString(5);
+ dashboardName += randomSuffix;
+ cy.log(`6.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`6.2. Click on Create button`);
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+
+ cy.log(`6.3. Create Dashboard`);
+ persesCreateDashboardsPage.selectProject('perses-dev');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+
+ cy.log(`6.4. Add Variable`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'interval',
+ false,
+ false,
+ '',
+ '',
+ '',
+ undefined,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'job',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'instance',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName(
+ 'instance',
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(
+ persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR,
+ );
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Apply');
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`6.5. Add Panel Group`);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('AddGroup');
+ persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
+
+ cy.log(`6.6. Add Panel`);
+ persesDashboardsPage.clickEditActionButton('AddPanel');
+ persesDashboardsPanel.addPanelShouldBeLoaded();
+ persesDashboardsPanel.addPanel(
+ 'Up',
+ 'Panel Group Up',
+ persesDashboardsAddListPanelType.TIME_SERIES_CHART,
+ 'This is a line chart test',
+ 'up',
+ );
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`6.7. Back and check panel`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.clickDashboard(dashboardName);
+ persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
+ persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
+ persesDashboardsPage.assertVariableBeVisible('interval');
+ persesDashboardsPage.assertVariableBeVisible('job');
+ persesDashboardsPage.assertVariableBeVisible('instance');
+
+ cy.log(`6.8. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`6.9. Click on Edit Variables button and Delete all variables`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`6.10. Assert variables not exist`);
+ persesDashboardsPage.assertVariableNotExist('interval');
+ persesDashboardsPage.assertVariableNotExist('job');
+ persesDashboardsPage.assertVariableNotExist('instance');
+
+ cy.log(`6.11. Delete Panel`);
+ persesDashboardsPanel.deletePanel('Up');
+ persesDashboardsPanel.clickDeletePanelButton();
+
+ cy.log(`6.12. Delete Panel Group`);
+ persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
+ persesDashboardsPanelGroup.clickDeletePanelGroupButton();
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.get('h2')
+ .contains(persesDashboardsEmptyDashboard.TITLE)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.get('p')
+ .contains(persesDashboardsEmptyDashboard.DESCRIPTION)
+ .scrollIntoView()
+ .should('be.visible');
+
+ persesDashboardsPage.backToListPersesDashboardsPage();
+
+ cy.log(`6.13. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`6.14. Click on the Kebab icon - Delete`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickDeleteOption();
+ listPersesDashboardsPage.deleteDashboardDeleteButton();
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.countDashboards('0');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+
+ cy.log(`6.15. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.countDashboards('0');
+ listPersesDashboardsPage.clearAllFilters();
+ },
+ );
}
diff --git a/web/cypress/support/perses/00.coo_bvt_perses_admin_1.cy.ts b/web/cypress/support/perses/00.coo_bvt_perses_admin_1.cy.ts
deleted file mode 100644
index b9efd17ac..000000000
--- a/web/cypress/support/perses/00.coo_bvt_perses_admin_1.cy.ts
+++ /dev/null
@@ -1,240 +0,0 @@
-import { persesDashboardsAcceleratorsCommonMetricsPanels, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, persesDashboardsEmptyDashboard } from '../../fixtures/perses/constants';
-import { persesDashboardsPage } from '../../views/perses-dashboards';
-import { persesMUIDataTestIDs } from '../../../src/components/data-test';
-import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
-import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup';
-import { persesDashboardsPanel } from '../../views/perses-dashboards-panel';
-import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables';
-import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard';
-import { persesDashboardsAddListVariableSource } from '../../fixtures/perses/constants';
-import { persesDashboardSampleQueries } from '../../fixtures/perses/constants';
-import { persesDashboardsAddListPanelType } from '../../fixtures/perses/constants';
-import { commonPages } from '../../views/common';
-import { nav } from '../../views/nav';
-
-export interface PerspectiveConfig {
- name: string;
- beforeEach?: () => void;
-}
-
-export function runBVTCOOPersesTests1(perspective: PerspectiveConfig) {
- testBVTCOOPerses1(perspective);
-}
-
-export function testBVTCOOPerses1(perspective: PerspectiveConfig) {
-
- it(`1.${perspective.name} perspective - Dashboards (Perses) page`, () => {
- cy.log(`1.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- listPersesDashboardsPage.shouldBeLoaded();
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- persesDashboardsPage.shouldBeLoaded1();
- });
-
- it(`2.${perspective.name} perspective - Accelerators common metrics dashboard `, () => {
- cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses) > Accelerators common metrics dashboard`);
- cy.changeNamespace('openshift-cluster-observability-operator');
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- cy.wait(2000);
-
- cy.log(`2.2. Select dashboard`);
- persesDashboardsPage.clickDashboardDropdown(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0] as keyof typeof persesDashboardsDashboardDropdownCOO);
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-cluster').should('be.visible');
- persesDashboardsPage.panelGroupHeaderAssertion('Accelerators', 'Open');
- persesDashboardsPage.panelHeadersAcceleratorsCommonMetricsAssertion();
- persesDashboardsPage.expandPanel(persesDashboardsAcceleratorsCommonMetricsPanels.GPU_UTILIZATION);
- persesDashboardsPage.collapsePanel(persesDashboardsAcceleratorsCommonMetricsPanels.GPU_UTILIZATION);
- });
-
- it(`3.${perspective.name} perspective - Perses Dashboard Sample dashboard`, () => {
- cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses) > Perses Dashboard Sample dashboard`);
- cy.changeNamespace('perses-dev');
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- cy.wait(2000);
- persesDashboardsPage.clickDashboardDropdown(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] as keyof typeof persesDashboardsDashboardDropdownPersesDev);
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-job').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-instance').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-interval').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-text').should('be.visible');
- persesDashboardsPage.panelGroupHeaderAssertion('Row 1', 'Open');
- persesDashboardsPage.expandPanel('RAM Total');
- persesDashboardsPage.collapsePanel('RAM Total');
- persesDashboardsPage.statChartValueAssertion('RAM Total', true);
- persesDashboardsPage.searchAndSelectVariable('job', 'node-exporter');
- persesDashboardsPage.statChartValueAssertion('RAM Total', false);
- });
-
- it(`4.${perspective.name} perspective - Download and View JSON`, () => {
- cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses) > Download and View JSON`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- persesDashboardsPage.downloadDashboard(true, persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2], 'JSON');
- persesDashboardsPage.downloadDashboard(true, persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2], 'YAML');
- persesDashboardsPage.downloadDashboard(true, persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2], 'YAML (CR v1alpha1)');
- persesDashboardsPage.downloadDashboard(true, persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2], 'YAML (CR v1alpha2)');
- persesDashboardsPage.viewJSON(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2], 'openshift-cluster-observability-operator');
-
- });
-
- it(`5.${perspective.name} perspective - Duplicate from a project to another, Rename and Delete`, () => {
- cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`5.2. Change namespace to perses-dev`);
- cy.changeNamespace('perses-dev');
- listPersesDashboardsPage.countDashboards('3');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`5.3. Click on the Kebab icon - Duplicate to another project`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickDuplicateOption();
- listPersesDashboardsPage.duplicateDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown('openshift-cluster-observability-operator');
- listPersesDashboardsPage.duplicateDashboardDuplicateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- persesDashboardsPage.shouldBeLoadedAfterDuplicate(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- persesDashboardsPage.backToListPersesDashboardsPage();
-
- cy.log(`5.4. Click on the Kebab icon - Rename`);
- cy.changeNamespace('openshift-cluster-observability-operator');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed');
- listPersesDashboardsPage.renameDashboardRenameButton();
-
- cy.log(`5.5. Click on the Kebab icon - Delete`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);s
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed');
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`5.6. Click on the Kebab icon - Delete`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickDeleteOption();
- listPersesDashboardsPage.deleteDashboardDeleteButton();
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.countDashboards('0');
-
- cy.log(`5.7. Search for the renamed dashboard`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed');
- listPersesDashboardsPage.countDashboards('0');
- listPersesDashboardsPage.clearAllFilters();
-
- });
-
- it(`6.${perspective.name} perspective - Create Dashboard with panel groups, panels and variables`, () => {
- let dashboardName = 'Testing Dashboard - UP ';
- let randomSuffix = Math.random().toString(5);
- dashboardName += randomSuffix;
- cy.log(`6.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`6.2. Click on Create button`);
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
-
- cy.log(`6.3. Create Dashboard`);
- persesCreateDashboardsPage.selectProject('perses-dev');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- cy.log(`6.4. Add Variable`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('interval', false, false, '', '', '', undefined, undefined);
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('job', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('instance', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('instance');
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR);
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Apply');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`6.5. Add Panel Group`);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
-
- cy.log(`6.6. Add Panel`);
- persesDashboardsPage.clickEditActionButton('AddPanel');
- persesDashboardsPanel.addPanelShouldBeLoaded();
- persesDashboardsPanel.addPanel('Up', 'Panel Group Up', persesDashboardsAddListPanelType.TIME_SERIES_CHART, 'This is a line chart test', 'up');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`6.7. Back and check panel`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.clickDashboard(dashboardName);
- persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
- persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
- persesDashboardsPage.assertVariableBeVisible('interval');
- persesDashboardsPage.assertVariableBeVisible('job');
- persesDashboardsPage.assertVariableBeVisible('instance');
-
- cy.log(`6.8. Click on Edit button`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`6.9. Click on Edit Variables button and Delete all variables`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`6.10. Assert variables not exist`);
- persesDashboardsPage.assertVariableNotExist('interval');
- persesDashboardsPage.assertVariableNotExist('job');
- persesDashboardsPage.assertVariableNotExist('instance');
-
- cy.log(`6.11. Delete Panel`);
- persesDashboardsPanel.deletePanel('Up');
- persesDashboardsPanel.clickDeletePanelButton();
-
- cy.log(`6.12. Delete Panel Group`);
- persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
- persesDashboardsPanelGroup.clickDeletePanelGroupButton();
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.get('h2').contains(persesDashboardsEmptyDashboard.TITLE).scrollIntoView().should('be.visible');
- cy.get('p').contains(persesDashboardsEmptyDashboard.DESCRIPTION).scrollIntoView().should('be.visible');
-
- persesDashboardsPage.backToListPersesDashboardsPage();
-
- cy.log(`6.13. Filter by Name`);
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`6.14. Click on the Kebab icon - Delete`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickDeleteOption();
- listPersesDashboardsPage.deleteDashboardDeleteButton();
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.countDashboards('0');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
- cy.log(`6.15. Filter by Name`);
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.countDashboards('0');
- listPersesDashboardsPage.clearAllFilters();
-
- });
-
-}
diff --git a/web/cypress/support/perses/01.coo_list_perses_admin.cy.ts b/web/cypress/support/perses/01.coo_list_perses_admin.cy.ts
index ee5797cce..7eed77d2d 100644
--- a/web/cypress/support/perses/01.coo_list_perses_admin.cy.ts
+++ b/web/cypress/support/perses/01.coo_list_perses_admin.cy.ts
@@ -1,6 +1,9 @@
-import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
+import {
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+} from '../../fixtures/perses/constants';
import { commonPages } from '../../views/common';
-import { listPersesDashboardsPage } from "../../views/perses-dashboards-list-dashboards";
+import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { persesDashboardsPage } from '../../views/perses-dashboards';
import { nav } from '../../views/nav';
@@ -18,14 +21,15 @@ export function runCOOListPersesDuplicateDashboardTests(perspective: Perspective
}
export function testCOOListPerses(perspective: PerspectiveConfig) {
-
it(`1.${perspective.name} perspective - List Dashboards (Perses) page`, () => {
cy.log(`1.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`1.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`1.3. Clear all filters`);
@@ -34,7 +38,9 @@ export function testCOOListPerses(perspective: PerspectiveConfig) {
cy.log(`1.4. Filter by Project and Name`);
listPersesDashboardsPage.filter.byProject('perses-dev');
listPersesDashboardsPage.countDashboards('3');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`1.5. Clear all filters`);
@@ -45,27 +51,65 @@ export function testCOOListPerses(perspective: PerspectiveConfig) {
cy.log(`1.7. Clear all filters`);
listPersesDashboardsPage.clearAllFilters();
-
+
cy.log(`1.8. Sort by Dashboard - Ascending`);
listPersesDashboardsPage.sortBy('Dashboard');
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0], 0);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0], 1);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0], 2);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0], 3);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0], 4);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0], 5);
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ 0,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0],
+ 1,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ 2,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ 3,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ 4,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ 5,
+ );
cy.log(`1.9. Sort by Dashboard - Descending`);
listPersesDashboardsPage.sortBy('Dashboard');
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0], 0);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0], 1);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0], 2);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0], 3);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0], 4);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0], 5);
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ 0,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ 1,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ 2,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ 3,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0],
+ 4,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ 5,
+ );
cy.log(`1.10. Filter by Name - Empty state`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2],
+ );
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');
@@ -73,281 +117,356 @@ export function testCOOListPerses(perspective: PerspectiveConfig) {
listPersesDashboardsPage.clearAllFilters();
cy.log(`1.12. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
});
-
- it(`2.${perspective.name} perspective - Kebab icon - Options available - Rename dashboard - Max length validation`, () => {
- cy.log(`2.1. Filter by Name and click on the Kebab icon`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
-
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.assertKebabIconOptions();
- listPersesDashboardsPage.clickKebabIcon();
-
- cy.log(`2.2. Click on the Kebab icon - Rename dashboard`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName('1234567890123456789012345678901234567890123456789012345678901234567890123456');
- listPersesDashboardsPage.renameDashboardRenameButton();
- listPersesDashboardsPage.assertRenameDashboardMaxLength();
- listPersesDashboardsPage.renameDashboardCancelButton();
-
- cy.log(`2.3. Clear all filters and filter by Name`);
- listPersesDashboardsPage.clearAllFilters();
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
- listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.clearAllFilters();
-
- });
-
- it(`3.${perspective.name} perspective - Kebab icon - Options available - Rename dashboard`, () => {
- let dashboardName = 'Dashboard to test rename';
- let randomSuffix = Math.random().toString(5);
- dashboardName += randomSuffix;
-
- cy.log(`3.1. Filter by Name and click on the Kebab icon`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
-
- cy.log(`3.2. Click on the Kebab icon - Rename dashboard - Cancel`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(dashboardName);
- listPersesDashboardsPage.renameDashboardCancelButton();
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0], 0);
+ it(
+ `2.${perspective.name} perspective - Kebab icon - Options available - ` +
+ `Rename dashboard - Max length validation`,
+ () => {
+ cy.log(`2.1. Filter by Name and click on the Kebab icon`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
- cy.log(`3.3. Click on the Kebab icon - Rename dashboard - Rename`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(dashboardName);
- listPersesDashboardsPage.renameDashboardRenameButton();
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.countDashboards('0');
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.assertKebabIconOptions();
+ listPersesDashboardsPage.clickKebabIcon();
- cy.log(`3.4. Clear all filters and filter by Name`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.countDashboards('1');
+ cy.log(`2.2. Click on the Kebab icon - Rename dashboard`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(
+ '1234567890123456789012345678901234567890123456789012345678901234567890123456',
+ );
+ listPersesDashboardsPage.renameDashboardRenameButton();
+ listPersesDashboardsPage.assertRenameDashboardMaxLength();
+ listPersesDashboardsPage.renameDashboardCancelButton();
+
+ cy.log(`2.3. Clear all filters and filter by Name`);
+ listPersesDashboardsPage.clearAllFilters();
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+ listPersesDashboardsPage.clearAllFilters();
+ },
+ );
+
+ it(
+ `3.${perspective.name} perspective - Kebab icon - Options available - ` + `Rename dashboard`,
+ () => {
+ let dashboardName = 'Dashboard to test rename';
+ const randomSuffix = Math.random().toString(5);
+ dashboardName += randomSuffix;
+
+ cy.log(`3.1. Filter by Name and click on the Kebab icon`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
- cy.log(`3.5. Click on dashboard and verify the name`);
- listPersesDashboardsPage.clickDashboard(dashboardName);
- persesDashboardsPage.shouldBeLoaded1();
- persesDashboardsPage.shouldBeLoadedAfterRename(dashboardName);
- persesDashboardsPage.backToListPersesDashboardsPage();
+ cy.log(`3.2. Click on the Kebab icon - Rename dashboard - Cancel`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(dashboardName);
+ listPersesDashboardsPage.renameDashboardCancelButton();
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ 0,
+ );
+
+ cy.log(`3.3. Click on the Kebab icon - Rename dashboard - Rename`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(dashboardName);
+ listPersesDashboardsPage.renameDashboardRenameButton();
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.countDashboards('0');
- cy.log(`3.6. Rename back to the original name`);
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.countDashboards('1');
+ cy.log(`3.4. Clear all filters and filter by Name`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.countDashboards('1');
- cy.log(`3.7. Click on the Kebab icon - Rename dashboard - Rename`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
- listPersesDashboardsPage.renameDashboardRenameButton();
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.countDashboards('0');
+ cy.log(`3.5. Click on dashboard and verify the name`);
+ listPersesDashboardsPage.clickDashboard(dashboardName);
+ persesDashboardsPage.shouldBeLoaded1();
+ persesDashboardsPage.shouldBeLoadedAfterRename(dashboardName);
+ persesDashboardsPage.backToListPersesDashboardsPage();
- cy.log(`3.8. Clear all filters and filter by Name`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
- listPersesDashboardsPage.countDashboards('1');
+ cy.log(`3.6. Rename back to the original name`);
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.countDashboards('1');
- cy.log(`3.9. Click on dashboard and verify the name`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
- persesDashboardsPage.shouldBeLoaded1();
- persesDashboardsPage.shouldBeLoadedAfterRename(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
- persesDashboardsPage.backToListPersesDashboardsPage();
+ cy.log(`3.7. Click on the Kebab icon - Rename dashboard - Rename`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
+ listPersesDashboardsPage.renameDashboardRenameButton();
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.countDashboards('0');
- });
+ cy.log(`3.8. Clear all filters and filter by Name`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
- //TODO: Add test for Rename to an existing dashboard name to be addressed by https://issues.redhat.com/browse/OU-1220
- it(`4.${perspective.name} perspective - Kebab icon - Options available - Rename dashboard to an existing dashboard name`, () => {
- cy.log(`4.1. Filter by Name and click on the Kebab icon`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
-
+ cy.log(`3.9. Click on dashboard and verify the name`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
+ persesDashboardsPage.shouldBeLoaded1();
+ persesDashboardsPage.shouldBeLoadedAfterRename(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ },
+ );
+
+ // TODO: Add test for Rename to an existing dashboard name — OU-1220
+ // https://issues.redhat.com/browse/OU-1220
+ it(
+ `4.${perspective.name} perspective - Kebab icon - Options available - ` +
+ `Rename dashboard to an existing dashboard name`,
+ () => {
+ cy.log(`4.1. Filter by Name and click on the Kebab icon`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
- cy.log(`4.2. Click on the Kebab icon - Rename dashboard - Rename`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0]);
- listPersesDashboardsPage.renameDashboardRenameButton();
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.countDashboards('0');
+ cy.log(`4.2. Click on the Kebab icon - Rename dashboard - Rename`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ );
+ listPersesDashboardsPage.renameDashboardRenameButton();
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.countDashboards('0');
- cy.log(`4.3. Clear all filters and filter by Name`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0]);
- listPersesDashboardsPage.countDashboards('2');
+ cy.log(`4.3. Clear all filters and filter by Name`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ );
+ listPersesDashboardsPage.countDashboards('2');
- cy.log(`4.4. Sort by Last Modified - Descending`);
- listPersesDashboardsPage.sortBy('Last Modified');
- listPersesDashboardsPage.sortBy('Last Modified');
- listPersesDashboardsPage.clickKebabIcon(0);
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
- listPersesDashboardsPage.renameDashboardRenameButton();
- cy.wait(2000);
- listPersesDashboardsPage.countDashboards('1');
+ cy.log(`4.4. Sort by Last Modified - Descending`);
+ listPersesDashboardsPage.sortBy('Last Modified');
+ listPersesDashboardsPage.sortBy('Last Modified');
+ listPersesDashboardsPage.clickKebabIcon(0);
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
+ listPersesDashboardsPage.renameDashboardRenameButton();
+ cy.wait(2000);
+ listPersesDashboardsPage.countDashboards('1');
- cy.log(`4.5. Clear all filters and filter by Name`);
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- listPersesDashboardsPage.filter.byProject('perses-dev');
- cy.wait(2000);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0]);
- cy.wait(2000);
- listPersesDashboardsPage.countDashboards('1');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- });
+ cy.log(`4.5. Clear all filters and filter by Name`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ },
+ );
}
- export function testCOOListPersesDuplicateDashboard(perspective: PerspectiveConfig) {
-
- it(`5.${perspective.name} perspective - Duplicate - existing dashboard ID in the same project`, () => {
+export function testCOOListPersesDuplicateDashboard(perspective: PerspectiveConfig) {
+ it(
+ `5.${perspective.name} perspective - Duplicate - existing dashboard ID in the ` +
+ `same project`,
+ () => {
cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
-
+
cy.log(`5.2. Filter by Name and click on the Kebab icon`);
listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`5.3. Click on the Kebab icon - Duplicate`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDuplicateOption();
- listPersesDashboardsPage.assertDuplicateProjectDropdown('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.assertDuplicateProjectDropdown(
+ 'openshift-cluster-observability-operator',
+ );
listPersesDashboardsPage.assertDuplicateProjectDropdown('perses-dev');
listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown('perses-dev');
- listPersesDashboardsPage.duplicateDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ listPersesDashboardsPage.duplicateDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2],
+ );
listPersesDashboardsPage.duplicateDashboardDuplicateButton();
listPersesDashboardsPage.assertDuplicateDashboardAlreadyExists();
listPersesDashboardsPage.duplicateDashboardCancelButton();
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
- });
-
- it(`6.${perspective.name} perspective - Duplicate - existing dashboard name in the same project`, () => {
+ },
+ );
+
+ it(
+ `6.${perspective.name} perspective - Duplicate - existing dashboard name in the ` +
+ `same project`,
+ () => {
cy.log(`6.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
-
+
cy.log(`6.2. Filter by Name and click on the Kebab icon`);
listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`6.3. Click on the Kebab icon - Duplicate`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDuplicateOption();
- listPersesDashboardsPage.duplicateDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.duplicateDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.duplicateDashboardDuplicateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- persesDashboardsPage.shouldBeLoadedAfterDuplicate(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
-
+ persesDashboardsPage.shouldBeLoadedEditionMode(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ persesDashboardsPage.shouldBeLoadedAfterDuplicate(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+
cy.log(`6.4. Back to the list and duplicate to another project`);
persesDashboardsPage.backToListPersesDashboardsPage();
-
+
listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('2');
-
+
cy.log(`6.5. Sort by Last Modified - Descending`);
listPersesDashboardsPage.sortBy('Last Modified');
-
+
cy.log(`6.6. Click on the Kebab icon - Duplicate with the same Dashboard name`);
listPersesDashboardsPage.clickKebabIcon(0);
listPersesDashboardsPage.clickDuplicateOption();
- listPersesDashboardsPage.duplicateDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.duplicateDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.duplicateDashboardDuplicateButton();
- listPersesDashboardsPage.assertDuplicateDashboardAlreadyExists();
+ listPersesDashboardsPage.assertDuplicateDashboardAlreadyExists();
listPersesDashboardsPage.duplicateDashboardCancelButton();
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
- });
-
- it(`7.${perspective.name} perspective - Duplicate - existing dashboard ID in another project`, () => {
+ },
+ );
+
+ it(
+ `7.${perspective.name} perspective - Duplicate - existing dashboard ID in another ` + `project`,
+ () => {
cy.log(`7.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
-
+
cy.log(`7.2. Filter by Name and click on the Kebab icon`);
listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('2');
-
+
cy.log(`7.3. Click on the Kebab icon - Duplicate`);
listPersesDashboardsPage.clickKebabIcon(0);
listPersesDashboardsPage.clickDuplicateOption();
- listPersesDashboardsPage.duplicateDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
- listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.duplicateDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2],
+ );
+ listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown(
+ 'openshift-cluster-observability-operator',
+ );
listPersesDashboardsPage.duplicateDashboardDuplicateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
- persesDashboardsPage.shouldBeLoadedAfterDuplicate(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ persesDashboardsPage.shouldBeLoadedEditionMode(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2],
+ );
+ persesDashboardsPage.shouldBeLoadedAfterDuplicate(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2],
+ );
persesDashboardsPage.backToListPersesDashboardsPage();
-
- });
-
- it(`8.${perspective.name} perspective - Delete and Cancel and then Delete`, () => {
- cy.log(`8.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`8.2. Filter by Name and click on the Kebab icon`);
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('2');
- listPersesDashboardsPage.sortBy('Last Modified');
- listPersesDashboardsPage.sortBy('Last Modified');
-
- cy.log(`8.4. Click on the Kebab icon - Delete`);
- listPersesDashboardsPage.clickKebabIcon(0);
- listPersesDashboardsPage.clickDeleteOption();
- listPersesDashboardsPage.deleteDashboardCancelButton();
- listPersesDashboardsPage.countDashboards('2');
-
- cy.log(`8.5. Click on the Kebab icon - Delete`);
- listPersesDashboardsPage.clickKebabIcon(0);
- listPersesDashboardsPage.clickDeleteOption();
- listPersesDashboardsPage.deleteDashboardDeleteButton();
- listPersesDashboardsPage.countDashboards('1');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
- cy.log(`8.6. Filter by Name and click on the Kebab icon`);
- listPersesDashboardsPage.filter.byProject('openshift-cluster-observability-operator');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`8.7. Click on the Kebab icon - Delete`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickDeleteOption();
- listPersesDashboardsPage.deleteDashboardDeleteButton();
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.countDashboards('0');
- nav.sidenav.clickNavLink(['Observe', 'Alerting']);
- nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
- });
- }
\ No newline at end of file
+ },
+ );
+
+ it(`8.${perspective.name} perspective - Delete and Cancel and then Delete`, () => {
+ cy.log(`8.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`8.2. Filter by Name and click on the Kebab icon`);
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('2');
+ listPersesDashboardsPage.sortBy('Last Modified');
+ listPersesDashboardsPage.sortBy('Last Modified');
+
+ cy.log(`8.4. Click on the Kebab icon - Delete`);
+ listPersesDashboardsPage.clickKebabIcon(0);
+ listPersesDashboardsPage.clickDeleteOption();
+ listPersesDashboardsPage.deleteDashboardCancelButton();
+ listPersesDashboardsPage.countDashboards('2');
+
+ cy.log(`8.5. Click on the Kebab icon - Delete`);
+ listPersesDashboardsPage.clickKebabIcon(0);
+ listPersesDashboardsPage.clickDeleteOption();
+ listPersesDashboardsPage.deleteDashboardDeleteButton();
+ listPersesDashboardsPage.countDashboards('1');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+
+ cy.log(`8.6. Filter by Name and click on the Kebab icon`);
+ listPersesDashboardsPage.filter.byProject('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`8.7. Click on the Kebab icon - Delete`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickDeleteOption();
+ listPersesDashboardsPage.deleteDashboardDeleteButton();
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.countDashboards('0');
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ });
+}
diff --git a/web/cypress/support/perses/01.coo_list_perses_admin_namespace.cy.ts b/web/cypress/support/perses/01.coo_list_perses_admin_namespace.cy.ts
index e61785806..16c35c175 100644
--- a/web/cypress/support/perses/01.coo_list_perses_admin_namespace.cy.ts
+++ b/web/cypress/support/perses/01.coo_list_perses_admin_namespace.cy.ts
@@ -1,7 +1,11 @@
-import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
+import {
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+} from '../../fixtures/perses/constants';
import { commonPages } from '../../views/common';
-import { listPersesDashboardsPage } from "../../views/perses-dashboards-list-dashboards";
+import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { persesDashboardsPage } from '../../views/perses-dashboards';
+import { nav } from '../../views/nav';
export interface PerspectiveConfig {
name: string;
@@ -13,7 +17,6 @@ export function runCOOListPersesTestsNamespace(perspective: PerspectiveConfig) {
}
export function testCOOListPersesNamespace(perspective: PerspectiveConfig) {
-
it(`1.${perspective.name} perspective - List Dashboards (Perses) page`, () => {
cy.log(`1.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
@@ -23,7 +26,9 @@ export function testCOOListPersesNamespace(perspective: PerspectiveConfig) {
cy.changeNamespace('perses-dev');
listPersesDashboardsPage.filter.byProject('perses-dev');
listPersesDashboardsPage.countDashboards('3');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`1.3. Clear all filters`);
@@ -31,103 +36,160 @@ export function testCOOListPersesNamespace(perspective: PerspectiveConfig) {
cy.log(`1.4. Sort by Dashboard - Ascending`);
listPersesDashboardsPage.sortBy('Dashboard');
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0], 0);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0], 1);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0], 2);
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ 0,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ 1,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ 2,
+ );
cy.log(`1.5. Sort by Dashboard - Descending`);
listPersesDashboardsPage.sortBy('Dashboard');
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0], 0);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0], 1);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0], 2);
-
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[0],
+ 0,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ 1,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ 2,
+ );
cy.log(`1.6. Change namespace to openshift-cluster-observability-operator`);
cy.changeNamespace('openshift-cluster-observability-operator');
listPersesDashboardsPage.countDashboards('3');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`1.7. Clear all filters`);
listPersesDashboardsPage.clearAllFilters();
-
cy.log(`1.8. Sort by Dashboard - Ascending`);
listPersesDashboardsPage.sortBy('Dashboard');
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0], 0);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0], 1);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0], 2);
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ 0,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0],
+ 1,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ 2,
+ );
cy.log(`1.9. Sort by Dashboard - Descending`);
listPersesDashboardsPage.sortBy('Dashboard');
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0], 0);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0], 1);
- listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0], 2);
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ 0,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0],
+ 1,
+ );
+ listPersesDashboardsPage.assertDashboardName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ 2,
+ );
cy.log(`1.10. Filter by Name - Empty state`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[0],
+ );
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');
- cy.log(`1.11. Clear all filters`);
- listPersesDashboardsPage.clearAllFilters();
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.log(`1.12. Click on a dashboard`);
+ cy.log(`1.11. Click on a dashboard`);
listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[0]);
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
persesDashboardsPage.shouldBeLoaded1();
});
- it(`2.${perspective.name} perspective - Duplicate from a project to another, Rename and Delete`, () => {
- cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`2.2. Change namespace to perses-dev`);
- cy.changeNamespace('perses-dev');
- listPersesDashboardsPage.countDashboards('3');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`2.3. Click on the Kebab icon - Duplicate to another project`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickDuplicateOption();
- listPersesDashboardsPage.duplicateDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown('openshift-cluster-observability-operator');
- listPersesDashboardsPage.duplicateDashboardDuplicateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- persesDashboardsPage.shouldBeLoadedAfterDuplicate(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- persesDashboardsPage.backToListPersesDashboardsPage();
-
- cy.log(`2.4. Click on the Kebab icon - Rename`);
- cy.changeNamespace('openshift-cluster-observability-operator');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed');
- listPersesDashboardsPage.renameDashboardRenameButton();
-
- cy.log(`2.5. Click on the Kebab icon - Delete`);
- listPersesDashboardsPage.clearAllFilters();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed');
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`2.6. Click on the Kebab icon - Delete`);
- listPersesDashboardsPage.clickKebabIcon();
- listPersesDashboardsPage.clickDeleteOption();
- listPersesDashboardsPage.deleteDashboardDeleteButton();
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.countDashboards('0');
-
- cy.log(`2.7. Search for the renamed dashboard`);
- listPersesDashboardsPage.clearAllFilters();
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed');
- listPersesDashboardsPage.countDashboards('0');
- listPersesDashboardsPage.clearAllFilters();
-
- });
-
-
+ it(
+ `2.${perspective.name} perspective - ` +
+ 'Duplicate from a project to another, Rename and Delete',
+ () => {
+ cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`2.2. Change namespace to perses-dev`);
+ cy.changeNamespace('perses-dev');
+ listPersesDashboardsPage.countDashboards('3');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`2.3. Click on the Kebab icon - Duplicate to another project`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickDuplicateOption();
+ listPersesDashboardsPage.duplicateDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown(
+ 'openshift-cluster-observability-operator',
+ );
+ listPersesDashboardsPage.duplicateDashboardDuplicateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ persesDashboardsPage.shouldBeLoadedAfterDuplicate(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ persesDashboardsPage.backToListPersesDashboardsPage();
+
+ cy.log(`2.4. Click on the Kebab icon - Rename`);
+ cy.changeNamespace('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickRenameDashboardOption();
+ listPersesDashboardsPage.renameDashboardEnterName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed',
+ );
+ listPersesDashboardsPage.renameDashboardRenameButton();
+
+ cy.log(`2.5. Click on the Kebab icon - Delete`);
+ listPersesDashboardsPage.clearAllFilters();
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed',
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`2.6. Click on the Kebab icon - Delete`);
+ listPersesDashboardsPage.clickKebabIcon();
+ listPersesDashboardsPage.clickDeleteOption();
+ listPersesDashboardsPage.deleteDashboardDeleteButton();
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.countDashboards('0');
+
+ cy.log(`2.7. Search for the renamed dashboard`);
+ nav.sidenav.clickNavLink(['Observe', 'Alerting']);
+ nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0] + ' - Renamed',
+ );
+ listPersesDashboardsPage.countDashboards('0');
+ listPersesDashboardsPage.clearAllFilters();
+ },
+ );
}
diff --git a/web/cypress/support/perses/02.coo_edit_perses_admin.cy.ts b/web/cypress/support/perses/02.coo_edit_perses_admin.cy.ts
index 57289d3e4..6b8343336 100644
--- a/web/cypress/support/perses/02.coo_edit_perses_admin.cy.ts
+++ b/web/cypress/support/perses/02.coo_edit_perses_admin.cy.ts
@@ -1,10 +1,16 @@
-import { editPersesDashboardsAddVariable, persesMUIDataTestIDs, IDs, editPersesDashboardsAddDatasource } from '../../../src/components/data-test';
-import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
+import {
+ editPersesDashboardsAddVariable,
+ persesMUIDataTestIDs,
+ IDs,
+} from '../../../src/components/data-test';
+import {
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+} from '../../fixtures/perses/constants';
import { commonPages } from '../../views/common';
-import { listPersesDashboardsPage } from "../../views/perses-dashboards-list-dashboards";
+import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { persesDashboardsPage } from '../../views/perses-dashboards';
import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup';
-import { persesDashboardsEditDatasources } from '../../views/perses-dashboards-edit-datasources';
import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables';
export interface PerspectiveConfig {
@@ -17,18 +23,21 @@ export function runCOOEditPersesTests(perspective: PerspectiveConfig) {
}
export function testCOOEditPerses(perspective: PerspectiveConfig) {
-
it(`1.${perspective.name} perspective - Edit perses dashboard page`, () => {
cy.log(`1.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`1.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`1.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
@@ -39,222 +48,293 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
persesDashboardsPage.assertEditModePanelGroupButtons('Headlines');
//already expanded
persesDashboardsPage.assertPanelActionButtons('CPU Usage');
- // tiny panel and modal is opened. So, expand first and then assert the buttons and finally collapse
- // due to modal is opened and page is refreshed, it is not easy to assert buttons in the modal
+ // Tiny panel + modal: expand first, assert buttons, then collapse. Modal refresh makes modal
+ // assertions unreliable.
persesDashboardsPage.assertPanelActionButtons('CPU Utilisation');
cy.log(`1.5. Click on Cancel button`);
persesDashboardsPage.clickEditActionButton('Cancel');
-
+
cy.log(`1.6. Change namespace to All Projects`);
cy.changeNamespace('All Projects');
listPersesDashboardsPage.shouldBeLoaded();
-
- });
-
- it(`2.${perspective.name} perspective - Edit Toolbar - Edit Variables - Add List Variable`, () => {
- cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`2.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`2.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
- // persesDashboardsPage.shouldBeLoaded1();
-
- cy.log(`2.4. Click on Edit button`);
- cy.wait(10000);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
- persesDashboardsEditVariables.addListVariable('ListVariable', true, true, 'AAA', 'Test', 'Test', undefined, undefined);
-
- cy.log(`2.5. Run query`);
- persesDashboardsEditVariables.clickButton('Run Query');
- cy.get('h4').should('contain', 'Preview Values').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardAddVariablePreviewValuesCopy).should('be.visible');
-
- cy.log(`2.6. Add variable`);
- persesDashboardsEditVariables.clickButton('Add');
-
- cy.log(`2.7. Apply changes`);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`2.8. Save dashboard`);
- persesDashboardsPage.clickEditActionButton('Save');
- persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working, so selecting "All" for now
- persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
- //TODO: END testing more to check if it is time constraint or cache issue
-
- });
-
- it(`3.${perspective.name} perspective - Edit Toolbar - Edit Variables - Add Text Variable`, () => {
- cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`3.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`3.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
- // persesDashboardsPage.shouldBeLoaded1();
-
- cy.log(`3.4. Click on Edit button`);
- cy.wait(2000);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('EditVariables');
-
- cy.log(`3.5. Click on Dashboard Built-in Variables button`);
- cy.get('#'+IDs.persesDashboardEditVariablesModalBuiltinButton).should('have.attr', 'aria-expanded', 'false').click();
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('#'+IDs.persesDashboardEditVariablesModalBuiltinButton).should('have.attr', 'aria-expanded', 'true')
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('#'+IDs.persesDashboardEditVariablesModalBuiltinButton).click();
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('#'+IDs.persesDashboardEditVariablesModalBuiltinButton).should('have.attr', 'aria-expanded', 'false');
-
- cy.log(`3.6. Add variable`);
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addTextVariable('TextVariable', true, 'Test', 'Test', 'Test');
- persesDashboardsEditVariables.clickButton('Add');
-
- cy.log(`3.7. Apply changes`);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`3.8. Save dashboard`);
- persesDashboardsPage.clickEditActionButton('Save');
-
- persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
-
- cy.log(`3.9. Search and type variable`);
- persesDashboardsPage.searchAndTypeVariable('TextVariable', '');
-
- });
-
- it(`4.${perspective.name} perspective - Edit Toolbar - Edit Variables - Visibility, Move up/down, Edit and Delete Variable`, () => {
- cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`4.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`4.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
- // persesDashboardsPage.shouldBeLoaded1();
-
- cy.log(`4.4. Click on Edit button`);
- cy.wait(2000);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`4.5. Click on Edit Variables button`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
-
- cy.log(`4.6. Toggle variable visibility`);
- persesDashboardsEditVariables.toggleVariableVisibility(0, false);
-
- cy.log(`4.7. Move variable up`);
- persesDashboardsEditVariables.moveVariableUp(1);
-
- cy.log(`4.8. Click on Edit variable button`);
- persesDashboardsEditVariables.clickEditVariableButton(0);
-
- cy.log(`4.9. Edit list variable`);
- //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
- persesDashboardsEditVariables.addListVariable('ListVariable123', false, false, '123', 'Test123', 'Test123', undefined, undefined);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`4.10. Delete variable`);
- persesDashboardsEditVariables.clickDeleteVariableButton(2);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`4.11. Save dashboard`);
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`4.12. Search and select variable`);
- //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working, so selecting "All" for now
- persesDashboardsPage.searchAndSelectVariable('ListVariable123', 'All');
-
- cy.log(`4.13. Assert variable not be visible`);
- persesDashboardsPage.assertVariableNotBeVisible('cluster');
-
- cy.log(`4.14. Assert variable not exist`);
- persesDashboardsPage.assertVariableNotExist('TextVariable');
-
- cy.log(`4.15. Recover dashboard`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`4.16. Click on Edit Variables button`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
-
- cy.log(`4.16. Toggle variable visibility`);
- persesDashboardsEditVariables.toggleVariableVisibility(1, true);
-
- cy.log(`4.17. Delete variable`);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
-
- cy.log(`4.17. Apply changes`);
- persesDashboardsEditVariables.clickButton('Apply');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`4.18. Assert variable be visible`);
- persesDashboardsPage.assertVariableBeVisible('cluster');
-
- cy.log(`4.19. Assert variable not exist`);
- persesDashboardsPage.assertVariableNotExist('TextVariable');
-
- });
-
- it(`5.${perspective.name} perspective - Edit Toolbar - Edit Variables - Add Variable - Required field validation`, () => {
- cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`5.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`5.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
- // persesDashboardsPage.shouldBeLoaded1();
-
- cy.log(`5.4. Click on Edit button`);
- cy.wait(2000);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('EditVariables');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('button').contains('Add Variable').should('be.visible').click();
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputName+'"]').clear();
- persesDashboardsEditVariables.clickButton('Add');
- persesDashboardsEditVariables.assertRequiredFieldValidation('Name');
- persesDashboardsEditVariables.clickButton('Cancel');
- persesDashboardsEditVariables.clickButton('Cancel');
});
- /**TODO: https://issues.redhat.com/browse/OU-1054 is targeted for COO1.5.0, so, commenting all Datasources related scenarios
- it(`6.${perspective.name} perspective - Edit Toolbar - Edit Datasources - Add and Delete Prometheus Datasource`, () => {
+ it(
+ `2.${perspective.name} perspective - Edit Toolbar - Edit Variables - ` + `Add List Variable`,
+ () => {
+ cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`2.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`2.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
+ // persesDashboardsPage.shouldBeLoaded1();
+
+ cy.log(`2.4. Click on Edit button`);
+ cy.wait(10000);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
+ persesDashboardsEditVariables.addListVariable(
+ 'ListVariable',
+ true,
+ true,
+ 'AAA',
+ 'Test',
+ 'Test',
+ undefined,
+ undefined,
+ );
+
+ cy.log(`2.5. Run query`);
+ persesDashboardsEditVariables.clickButton('Run Query');
+ cy.get('h4').should('contain', 'Preview Values').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardAddVariablePreviewValuesCopy).should(
+ 'be.visible',
+ );
+
+ cy.log(`2.6. Add variable`);
+ persesDashboardsEditVariables.clickButton('Add');
+
+ cy.log(`2.7. Apply changes`);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`2.8. Save dashboard`);
+ persesDashboardsPage.clickEditActionButton('Save');
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ // OU-1159: Custom All Value not working; selecting "All" for now.
+ // https://issues.redhat.com/browse/OU-1159
+ persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
+ //TODO: END testing more to check if it is time constraint or cache issue
+ },
+ );
+
+ it(
+ `3.${perspective.name} perspective - Edit Toolbar - Edit Variables - ` + `Add Text Variable`,
+ () => {
+ cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`3.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`3.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
+ // persesDashboardsPage.shouldBeLoaded1();
+
+ cy.log(`3.4. Click on Edit button`);
+ cy.wait(2000);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+
+ cy.log(`3.5. Click on Dashboard Built-in Variables button`);
+ cy.get('#' + IDs.persesDashboardEditVariablesModalBuiltinButton)
+ .should('have.attr', 'aria-expanded', 'false')
+ .click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('#' + IDs.persesDashboardEditVariablesModalBuiltinButton)
+ .should('have.attr', 'aria-expanded', 'true');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('#' + IDs.persesDashboardEditVariablesModalBuiltinButton)
+ .click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('#' + IDs.persesDashboardEditVariablesModalBuiltinButton)
+ .should('have.attr', 'aria-expanded', 'false');
+
+ cy.log(`3.6. Add variable`);
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addTextVariable('TextVariable', true, 'Test', 'Test', 'Test');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ cy.log(`3.7. Apply changes`);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`3.8. Save dashboard`);
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+
+ cy.log(`3.9. Search and type variable`);
+ persesDashboardsPage.searchAndTypeVariable('TextVariable', '');
+ },
+ );
+
+ it(
+ `4.${perspective.name} perspective - Edit Toolbar - Edit Variables - Visibility, ` +
+ `Move up/down, Edit and Delete Variable`,
+ () => {
+ cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`4.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`4.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
+ // persesDashboardsPage.shouldBeLoaded1();
+
+ cy.log(`4.4. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`4.5. Click on Edit Variables button`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+
+ cy.log(`4.6. Toggle variable visibility`);
+ persesDashboardsEditVariables.toggleVariableVisibility(0, false);
+
+ cy.log(`4.7. Move variable up`);
+ persesDashboardsEditVariables.moveVariableUp(1);
+
+ cy.log(`4.8. Click on Edit variable button`);
+ persesDashboardsEditVariables.clickEditVariableButton(0);
+
+ cy.log(`4.9. Edit list variable`);
+ //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
+ persesDashboardsEditVariables.addListVariable(
+ 'ListVariable123',
+ false,
+ false,
+ '123',
+ 'Test123',
+ 'Test123',
+ undefined,
+ undefined,
+ );
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`4.10. Delete variable`);
+ persesDashboardsEditVariables.clickDeleteVariableButton(2);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`4.11. Save dashboard`);
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`4.12. Search and select variable`);
+ // OU-1159: Custom All Value not working; selecting "All" for now.
+ // https://issues.redhat.com/browse/OU-1159
+ persesDashboardsPage.searchAndSelectVariable('ListVariable123', 'All');
+
+ cy.log(`4.13. Assert variable not be visible`);
+ persesDashboardsPage.assertVariableNotBeVisible('cluster');
+
+ cy.log(`4.14. Assert variable not exist`);
+ persesDashboardsPage.assertVariableNotExist('TextVariable');
+
+ cy.log(`4.15. Recover dashboard`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`4.16. Click on Edit Variables button`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+
+ cy.log(`4.17. Toggle variable visibility`);
+ persesDashboardsEditVariables.toggleVariableVisibility(1, true);
+
+ cy.log(`4.18. Delete variable`);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+
+ cy.log(`4.19. Apply changes`);
+ persesDashboardsEditVariables.clickButton('Apply');
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`4.20. Assert variable be visible`);
+ persesDashboardsPage.assertVariableBeVisible('cluster');
+
+ cy.log(`4.21. Assert variable not exist`);
+ persesDashboardsPage.assertVariableNotExist('TextVariable');
+ },
+ );
+
+ it(
+ `5.${perspective.name} perspective - Edit Toolbar - Edit Variables - ` +
+ `Add Variable - Required field validation`,
+ () => {
+ cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`5.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`5.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
+ // persesDashboardsPage.shouldBeLoaded1();
+
+ cy.log(`5.4. Click on Edit button`);
+ cy.wait(2000);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('button')
+ .contains('Add Variable')
+ .should('be.visible')
+ .click();
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputName + '"]').clear();
+ persesDashboardsEditVariables.clickButton('Add');
+ persesDashboardsEditVariables.assertRequiredFieldValidation('Name');
+ persesDashboardsEditVariables.clickButton('Cancel');
+ persesDashboardsEditVariables.clickButton('Cancel');
+ },
+ );
+
+ /**TODO: https://issues.redhat.com/browse/OU-1054 is targeted for COO1.5.0,
+ * so, commenting all Datasources related scenarios
+ it(`6.${perspective.name} perspective - Edit Toolbar - Edit Datasources
+ - Add and Delete Prometheus Datasource`, () => {
cy.log(`6.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`6.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ listPersesDashboardsPage
+ .filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
listPersesDashboardsPage.countDashboards('1');
cy.log(`6.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ listPersesDashboardsPage
+ .clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
@@ -264,19 +344,24 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
persesDashboardsPage.clickEditActionButton('EditDatasources');
cy.log(`6.5. Verify existing datasources`);
- persesDashboardsEditDatasources.assertDatasource(0, 'PrometheusLocal', 'PrometheusDatasource', '');
+ persesDashboardsEditDatasources
+ .assertDatasource(0, 'PrometheusLocal', 'PrometheusDatasource', '');
cy.log(`6.6. Add datasource`);
persesDashboardsEditDatasources.clickButton('Add Datasource');
- persesDashboardsEditDatasources.addDatasource('Datasource1', true, 'Prometheus Datasource', 'Datasource1', 'Datasource1');
+ persesDashboardsEditDatasources
+ .addDatasource('Datasource1', true, 'Prometheus Datasource', 'Datasource1', 'Datasource1');
persesDashboardsEditDatasources.clickButton('Add');
- persesDashboardsEditDatasources.assertDatasource(1, 'Datasource1', 'PrometheusDatasource', 'Datasource1');
+ persesDashboardsEditDatasources
+ .assertDatasource(1, 'Datasource1', 'PrometheusDatasource', 'Datasource1');
cy.log(`6.7. Add second datasource`);
persesDashboardsEditDatasources.clickButton('Add Datasource');
- persesDashboardsEditDatasources.addDatasource('Datasource2', true, 'Prometheus Datasource', 'Datasource2', 'Datasource2');
+ persesDashboardsEditDatasources
+ .addDatasource('Datasource2', true, 'Prometheus Datasource', 'Datasource2', 'Datasource2');
persesDashboardsEditDatasources.clickButton('Add');
- persesDashboardsEditDatasources.assertDatasource(2, 'Datasource2', 'PrometheusDatasource', 'Datasource2');
+ persesDashboardsEditDatasources
+ .assertDatasource(2, 'Datasource2', 'PrometheusDatasource', 'Datasource2');
cy.log(`6.8. Delete first datasource`);
persesDashboardsEditDatasources.clickDeleteDatasourceButton(1);
@@ -287,17 +372,20 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
// persesDashboardsPage.clickEditActionButton('Save');
});
- it(`7.${perspective.name} perspective - Edit Toolbar - Edit Datasources - Edit Prometheus Datasource`, () => {
+ it(`7.${perspective.name} perspective - Edit Toolbar - Edit Datasources -
+ - Edit Prometheus Datasource`, () => {
cy.log(`7.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`7.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ listPersesDashboardsPage
+ .filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
listPersesDashboardsPage.countDashboards('1');
cy.log(`7.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ listPersesDashboardsPage
+ .clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
@@ -307,32 +395,39 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
persesDashboardsPage.clickEditActionButton('EditDatasources');
cy.log(`7.5. Verify existing datasources`);
- persesDashboardsEditDatasources.assertDatasource(0,'PrometheusLocal', 'PrometheusDatasource', '');
+ persesDashboardsEditDatasources
+ .assertDatasource(0,'PrometheusLocal', 'PrometheusDatasource', '');
cy.log(`7.6. Edit datasource`);
persesDashboardsEditDatasources.clickEditDatasourceButton(0);
- persesDashboardsEditDatasources.addDatasource('PrometheusLocal', false, 'Prometheus Datasource', 'Datasource1', 'Datasource1');
+ persesDashboardsEditDatasources
+ .addDatasource('PrometheusLocal', false, 'Prometheus Datasource', 'Datasource1', 'Datasource1');
persesDashboardsEditDatasources.clickButton('Apply');
- persesDashboardsEditDatasources.assertDatasource(0,'PrometheusLocal', 'PrometheusDatasource', 'Datasource1');
+ persesDashboardsEditDatasources
+ .assertDatasource(0,'PrometheusLocal', 'PrometheusDatasource', 'Datasource1');
persesDashboardsEditDatasources.clickButton('Cancel');
persesDashboardsPage.clickEditActionButton('Cancel');
});
- // it(`8.${perspective.name} perspective - Edit Toolbar - Edit Datasources - Add Tempo Datasource`, () => {
+ // it(`8.${perspective.name} perspective - Edit Toolbar -
+ // Edit Datasources - Add Tempo Datasource`, () => {
// });
- it(`8.${perspective.name} perspective - Edit Toolbar - Edit Datasources - Required field validation`, () => {
+ it(`8.${perspective.name} perspective - Edit Toolbar -
+ - Edit Datasources - Required field validation`, () => {
cy.log(`8.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
commonPages.titleShouldHaveText('Dashboards');
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`8.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ listPersesDashboardsPage
+ .filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
listPersesDashboardsPage.countDashboards('1');
cy.log(`8.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
+ listPersesDashboardsPage
+ .clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]);
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
@@ -365,11 +460,15 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`6.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`6.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
@@ -388,10 +487,13 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
cy.log(`6.7. Back and check panel group`);
//TODO: START testing more to check if it is time constraint or cache issue
persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
persesDashboardsPage.panelGroupHeaderAssertion('PanelGroup1', 'Open');
-
});
it(`7.${perspective.name} perspective - Edit Toolbar - Edit Panel Group`, () => {
@@ -400,16 +502,19 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`7.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`7.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
cy.log(`7.4. Click on Edit button`);
- cy.wait(2000);
persesDashboardsPage.clickEditButton();
persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup1', 'edit');
//TODO: https://issues.redhat.com/browse/OU-1223 - Upstream ref: [Edit Dashboard] - Edit Panel Group from closed/opened vice-versa is not shown right away
@@ -420,10 +525,13 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
cy.log(`7.5. Back and check panel group`);
//TODO: START testing more to check if it is time constraint or cache issue
persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
persesDashboardsPage.panelGroupHeaderAssertion('PanelGroup2', 'Closed');
-
});
it(`8.${perspective.name} perspective - Edit Toolbar - Move Panel Group Down and Up`, () => {
@@ -432,11 +540,15 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`8.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`8.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
@@ -444,7 +556,7 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
cy.wait(2000);
persesDashboardsPage.clickEditButton();
persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup2', 'moveDown');
-
+
cy.log(`8.5. Save panel group`);
persesDashboardsPage.clickEditActionButton('Save');
@@ -456,8 +568,12 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
cy.log(`8.7. Back and check panel group order`);
//TODO: START testing more to check if it is time constraint or cache issue
persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
persesDashboardsPage.assertPanelGroupOrder('Row 1', 0);
persesDashboardsPage.assertPanelGroupOrder('PanelGroup2', 1);
persesDashboardsPage.assertPanelGroupOrder('Row 2', 2);
@@ -474,12 +590,16 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
persesDashboardsPage.assertPanelGroupOrder('PanelGroup2', 0);
persesDashboardsPage.assertPanelGroupOrder('Row 1', 1);
persesDashboardsPage.assertPanelGroupOrder('Row 2', 2);
-
+
cy.log(`8.11. Back and check panel group order`);
//TODO: START testing more to check if it is time constraint or cache issue
persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
persesDashboardsPage.assertPanelGroupOrder('PanelGroup2', 0);
persesDashboardsPage.assertPanelGroupOrder('Row 1', 1);
persesDashboardsPage.assertPanelGroupOrder('Row 2', 2);
@@ -491,11 +611,15 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`9.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`9.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
@@ -510,9 +634,12 @@ export function testCOOEditPerses(perspective: PerspectiveConfig) {
cy.log(`9.5. Back and check panel group`);
//TODO: START testing more to check if it is time constraint or cache issue
persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
persesDashboardsPage.assertPanelGroupNotExist('PanelGroup2');
});
-
}
diff --git a/web/cypress/support/perses/02.coo_edit_perses_admin_1.cy.ts b/web/cypress/support/perses/02.coo_edit_perses_admin_1.cy.ts
index 7bd2ff9ea..fc7df22dc 100644
--- a/web/cypress/support/perses/02.coo_edit_perses_admin_1.cy.ts
+++ b/web/cypress/support/perses/02.coo_edit_perses_admin_1.cy.ts
@@ -1,9 +1,11 @@
-import { IDs, editPersesDashboardsAddPanel } from '../../../src/components/data-test';
-import { persesDashboardsAddListPanelType, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
+import {
+ persesDashboardsAddListPanelType,
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+} from '../../fixtures/perses/constants';
import { commonPages } from '../../views/common';
-import { listPersesDashboardsPage } from "../../views/perses-dashboards-list-dashboards";
+import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { persesDashboardsPage } from '../../views/perses-dashboards';
-import { persesDashboardsEditDatasources } from '../../views/perses-dashboards-edit-datasources';
import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables';
import { persesDashboardsPanel } from '../../views/perses-dashboards-panel';
import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup';
@@ -18,264 +20,338 @@ export function runCOOEditPersesTests1(perspective: PerspectiveConfig) {
}
export 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');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`10.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`10.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
-
- const panelTypeKeys = Object.keys(persesDashboardsAddListPanelType) as (keyof typeof persesDashboardsAddListPanelType)[];
- panelTypeKeys.forEach((typeKey) => {
- const panelName = persesDashboardsAddListPanelType[typeKey]; // e.g., 'Bar Chart'
-
- cy.log(`10.4. Click on Edit button`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`10.5. Click on Add Group - PanelGroup ` + panelName);
- persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('PanelGroup ' + panelName, 'Open', '');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`10.6. Click on Edit button`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`10.7. Click on Add Panel button` + panelName);
- persesDashboardsPage.clickEditActionButton('AddPanel');
- persesDashboardsPanel.addPanelShouldBeLoaded();
- persesDashboardsPanel.addPanel(panelName, 'PanelGroup ' + panelName, panelName);
- persesDashboardsPage.assertPanel(panelName, 'PanelGroup ' + panelName, 'Open');
- persesDashboardsPage.clickEditActionButton('Save');
- });
- });
-
- it(`11.${perspective.name} perspective - Edit Toolbar - Edit Panel`, () => {
- cy.log(`11.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`11.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`11.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
-
- cy.log(`11.4. Click on Edit button`);
- cy.wait(2000);
- persesDashboardsPage.clickEditButton();
-
- const panelTypeKeys = Object.keys(persesDashboardsAddListPanelType) as (keyof typeof persesDashboardsAddListPanelType)[];
- const lastKey = panelTypeKeys[panelTypeKeys.length - 1]; // Get the last KEY from the array
- const lastPanelName = persesDashboardsAddListPanelType[lastKey]; // Use the KEY to get the VALUE
-
- cy.log(`11.5. Click on Edit Panel button` + lastPanelName + ' to Panel1');
- persesDashboardsPage.clickPanelAction(lastPanelName, 'edit');
- persesDashboardsPanel.editPanel('Panel1', 'PanelGroup ' + lastPanelName, persesDashboardsAddListPanelType.BAR_CHART, 'Description1');
- persesDashboardsPage.assertPanel('Panel1', 'PanelGroup ' + lastPanelName, 'Open');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`11.6. Click on Edit Panel button from Panel 1 to` + lastPanelName);
+ 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');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`10.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`10.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+
+ const panelTypeKeys = Object.keys(
+ persesDashboardsAddListPanelType,
+ ) as (keyof typeof persesDashboardsAddListPanelType)[];
+ panelTypeKeys.forEach((typeKey) => {
+ const panelName = persesDashboardsAddListPanelType[typeKey]; // e.g., 'Bar Chart'
+
+ cy.log(`10.4. Click on Edit button`);
persesDashboardsPage.clickEditButton();
-
- persesDashboardsPage.clickPanelAction('Panel1', 'edit');
- persesDashboardsPanel.editPanel(lastPanelName, 'PanelGroup ' + lastPanelName, lastPanelName, 'Description1');
- persesDashboardsPage.assertPanel(lastPanelName, 'PanelGroup ' + lastPanelName, 'Open');
- persesDashboardsPage.clickEditActionButton('Save');
-
- });
-
- it(`12.${perspective.name} perspective - Edit Toolbar - Delete Panel`, () => {
- cy.log(`12.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`12.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`12.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
-
- const panelTypeKeys = Object.keys(persesDashboardsAddListPanelType) as (keyof typeof persesDashboardsAddListPanelType)[];
-
- panelTypeKeys.reverse().forEach((typeKey) => {
- const panelName = persesDashboardsAddListPanelType[typeKey]; // e.g., 'Bar Chart'
- cy.log(`12.4. Delete Panel` + panelName);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPanel.deletePanel(panelName);
- persesDashboardsPanel.clickDeletePanelButton();
-
- cy.log(`12.5. Delete Panel Group` + panelName);
- persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup ' + panelName, 'delete');
- persesDashboardsPanelGroup.clickDeletePanelGroupButton();
- persesDashboardsPage.clickEditActionButton('Save');
- });
- });
-
- it(`13.${perspective.name} perspective - Edit Toolbar - Duplicate Panel`, () => {
- cy.log(`13.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`13.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`13.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
-
- cy.log(`13.4. Click on Edit button`);
- cy.wait(2000);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`13.5. Collapse Row 1 Panel Group`);
- persesDashboardsPage.collapsePanelGroup('Row 1');
-
- cy.log(`13.6. Click on Duplicate Panel button`);
- persesDashboardsPage.clickPanelAction('Legend Example', 'duplicate');
-
- cy.log(`13.7. Assert duplicated panel`);
- persesDashboardsPage.assertDuplicatedPanel('Legend Example', 2);
- });
-
- it(`14.${perspective.name} perspective - Edit Toolbar - Perform changes and Cancel`, () => {
- cy.log(`14.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`14.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`14.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
- // persesDashboardsPage.shouldBeLoaded1();
-
- cy.log(`14.4. Click on Edit button`);
- cy.wait(2000);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
- persesDashboardsEditVariables.addListVariable('ListVariable', true, true, 'AAA', 'Test', 'Test', undefined, undefined);
-
- cy.log(`14.5. Add variable`);
- persesDashboardsEditVariables.clickButton('Add');
-
- cy.log(`14.6. Apply changes`);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`14.7. Assert Variable before cancelling`);
- persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
-
- cy.log(`14.8. Click on Add Panel Group button`);
+ cy.log(`10.5. Click on Add Group - PanelGroup ` + panelName);
persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('PanelGroup Perform Changes and Cancel', 'Open', '');
-
- cy.log(`14.9. Click on Add Panel button`);
- persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup Perform Changes and Cancel', 'addPanel');
- persesDashboardsPanel.addPanel('Panel Perform Changes and Cancel', 'PanelGroup Perform Changes and Cancel', 'Bar Chart');
-
- cy.log(`14.10. Click on Cancel button`);
- persesDashboardsPage.clickEditActionButton('Cancel');
-
- cy.log(`14.11. Assert variable not exist`);
- persesDashboardsPage.assertVariableNotExist('ListVariable');
-
- cy.log(`14.12. Assert panel group not exist`);
- persesDashboardsPage.assertPanelGroupNotExist('PanelGroup Perform Changes and Cancel');
-
- cy.log(`14.13. Assert panel not exist`);
- persesDashboardsPage.assertPanelNotExist('Panel Perform Changes and Cancel');
-
- });
-
- /**
- * OU-886 Mark dashboards and datasources created using CRD as readonly
- *
- * Admin user and dev users with persesdashboard-editor-role will be able to edit dashboards using CRD.
- *
- */
- it(`15.${perspective.name} perspective - Try to editAccelerators and APM dashboards`, () => {
- cy.log(`15.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- commonPages.titleShouldHaveText('Dashboards');
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`15.2. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- listPersesDashboardsPage.countDashboards('1');
-
- cy.log(`15.3. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
- // persesDashboardsPage.shouldBeLoaded1();
+ persesDashboardsPanelGroup.addPanelGroup('PanelGroup ' + panelName, 'Open', '');
+ persesDashboardsPage.clickEditActionButton('Save');
- cy.log(`15.4. Click on Edit button`);
- cy.wait(2000);
+ cy.log(`10.6. Click on Edit button`);
persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
- persesDashboardsEditVariables.addListVariable('ListVariable', true, true, 'AAA', 'Test', 'Test', undefined, undefined);
-
- cy.log(`15.5. Add variable`);
- persesDashboardsEditVariables.clickButton('Add');
-
- cy.log(`15.6. Apply changes`);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`15.7. Assert Variable before saving`);
- persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
-
- cy.log(`15.8. Click on Add Panel Group button`);
- persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('PanelGroup Perform Changes and Save', 'Open', '');
- cy.log(`15.9. Click on Add Panel button`);
- persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup Perform Changes and Save', 'addPanel');
- persesDashboardsPanel.addPanel('Panel Perform Changes and Save', 'PanelGroup Perform Changes and Save', 'Bar Chart');
-
- cy.log(`15.10. Click on Save button`);
+ cy.log(`10.7. Click on Add Panel button` + panelName);
+ persesDashboardsPage.clickEditActionButton('AddPanel');
+ persesDashboardsPanel.addPanelShouldBeLoaded();
+ persesDashboardsPanel.addPanel(panelName, 'PanelGroup ' + panelName, panelName);
+ persesDashboardsPage.assertPanel(panelName, 'PanelGroup ' + panelName, 'Open');
persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`15.11. Back and check panel group`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
-
- cy.log(`15.12. Assert Variable before deleting`);
- persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
-
- cy.log(`15.13. Assert panel group exists`);
- persesDashboardsPage.panelGroupHeaderAssertion('PanelGroup Perform Changes and Save', 'Open');
-
- cy.log(`15.14. Assert panel exists`);
- persesDashboardsPage.assertPanel('Panel Perform Changes and Save', 'PanelGroup Perform Changes and Save', 'Open');
-
- cy.log (`15.15. Click on Edit button`);
+ });
+ });
+
+ it(`11.${perspective.name} perspective - Edit Toolbar - Edit Panel`, () => {
+ cy.log(`11.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`11.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`11.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+
+ cy.log(`11.4. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ const panelTypeKeys = Object.keys(
+ persesDashboardsAddListPanelType,
+ ) as (keyof typeof persesDashboardsAddListPanelType)[];
+ const lastKey = panelTypeKeys[panelTypeKeys.length - 1]; // Get the last KEY from the array
+ const lastPanelName = persesDashboardsAddListPanelType[lastKey]; // Use the KEY to get the VALUE
+
+ cy.log(`11.5. Click on Edit Panel button` + lastPanelName + ' to Panel1');
+ persesDashboardsPage.clickPanelAction(lastPanelName, 'edit');
+ persesDashboardsPanel.editPanel(
+ 'Panel1',
+ 'PanelGroup ' + lastPanelName,
+ persesDashboardsAddListPanelType.BAR_CHART,
+ 'Description1',
+ );
+ persesDashboardsPage.assertPanel('Panel1', 'PanelGroup ' + lastPanelName, 'Open');
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`11.6. Click on Edit Panel button from Panel 1 to` + lastPanelName);
+ persesDashboardsPage.clickEditButton();
+
+ persesDashboardsPage.clickPanelAction('Panel1', 'edit');
+ persesDashboardsPanel.editPanel(
+ lastPanelName,
+ 'PanelGroup ' + lastPanelName,
+ lastPanelName,
+ 'Description1',
+ );
+ persesDashboardsPage.assertPanel(lastPanelName, 'PanelGroup ' + lastPanelName, 'Open');
+ persesDashboardsPage.clickEditActionButton('Save');
+ });
+
+ it(`12.${perspective.name} perspective - Edit Toolbar - Delete Panel`, () => {
+ cy.log(`12.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`12.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`12.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+
+ const panelTypeKeys = Object.keys(
+ persesDashboardsAddListPanelType,
+ ) as (keyof typeof persesDashboardsAddListPanelType)[];
+
+ panelTypeKeys.reverse().forEach((typeKey) => {
+ const panelName = persesDashboardsAddListPanelType[typeKey]; // e.g., 'Bar Chart'
+ cy.log(`12.4. Delete Panel` + panelName);
persesDashboardsPage.clickEditButton();
+ persesDashboardsPanel.deletePanel(panelName);
+ persesDashboardsPanel.clickDeletePanelButton();
- cy.log(`15.16. Delete variable`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickDeleteVariableButton(1);
- persesDashboardsEditVariables.clickButton('Apply');
- persesDashboardsPage.assertVariableNotExist('ListVariable');
-
- cy.log(`15.17. Delete panel group`);
- persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup Perform Changes and Save', 'delete');
+ cy.log(`12.5. Delete Panel Group` + panelName);
+ persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup ' + panelName, 'delete');
persesDashboardsPanelGroup.clickDeletePanelGroupButton();
persesDashboardsPage.clickEditActionButton('Save');
- persesDashboardsPage.assertPanelGroupNotExist('PanelGroup Perform Changes and Save');
-
});
+ });
+
+ it(`13.${perspective.name} perspective - Edit Toolbar - Duplicate Panel`, () => {
+ cy.log(`13.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`13.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`13.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+
+ cy.log(`13.4. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`13.5. Collapse Row 1 Panel Group`);
+ persesDashboardsPage.collapsePanelGroup('Row 1');
+
+ cy.log(`13.6. Click on Duplicate Panel button`);
+ persesDashboardsPage.clickPanelAction('Legend Example', 'duplicate');
+
+ cy.log(`13.7. Assert duplicated panel`);
+ persesDashboardsPage.assertDuplicatedPanel('Legend Example', 2);
+ });
+
+ it(`14.${perspective.name} perspective - Edit Toolbar - Perform changes and Cancel`, () => {
+ cy.log(`14.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`14.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`14.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
+ // persesDashboardsPage.shouldBeLoaded1();
+
+ cy.log(`14.4. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
+ persesDashboardsEditVariables.addListVariable(
+ 'ListVariable',
+ true,
+ true,
+ 'AAA',
+ 'Test',
+ 'Test',
+ undefined,
+ undefined,
+ );
+
+ cy.log(`14.5. Add variable`);
+ persesDashboardsEditVariables.clickButton('Add');
+
+ cy.log(`14.6. Apply changes`);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`14.7. Assert Variable before cancelling`);
+ persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
+
+ cy.log(`14.8. Click on Add Panel Group button`);
+ persesDashboardsPage.clickEditActionButton('AddGroup');
+ persesDashboardsPanelGroup.addPanelGroup('PanelGroup Perform Changes and Cancel', 'Open', '');
+
+ cy.log(`14.9. Click on Add Panel button`);
+ persesDashboardsPanelGroup.clickPanelGroupAction(
+ 'PanelGroup Perform Changes and Cancel',
+ 'addPanel',
+ );
+ persesDashboardsPanel.addPanel(
+ 'Panel Perform Changes and Cancel',
+ 'PanelGroup Perform Changes and Cancel',
+ 'Bar Chart',
+ );
+
+ cy.log(`14.10. Click on Cancel button`);
+ persesDashboardsPage.clickEditActionButton('Cancel');
+
+ cy.log(`14.11. Assert variable not exist`);
+ persesDashboardsPage.assertVariableNotExist('ListVariable');
+
+ cy.log(`14.12. Assert panel group not exist`);
+ persesDashboardsPage.assertPanelGroupNotExist('PanelGroup Perform Changes and Cancel');
+
+ cy.log(`14.13. Assert panel not exist`);
+ persesDashboardsPage.assertPanelNotExist('Panel Perform Changes and Cancel');
+ });
+ /**
+ * OU-886 Mark dashboards and datasources created using CRD as readonly
+ *
+ * Admin user and dev users with persesdashboard-editor-role will be able to edit dashboards using
+ * CRD.
+ *
+ */
+ it(`15.${perspective.name} perspective - ` + 'Try to editAccelerators and APM dashboards', () => {
+ cy.log(`15.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ commonPages.titleShouldHaveText('Dashboards');
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`15.2. Filter by Name`);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+
+ cy.log(`15.3. Click on a dashboard`);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+ //TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
+ // persesDashboardsPage.shouldBeLoaded1();
+
+ cy.log(`15.4. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ //https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
+ persesDashboardsEditVariables.addListVariable(
+ 'ListVariable',
+ true,
+ true,
+ 'AAA',
+ 'Test',
+ 'Test',
+ undefined,
+ undefined,
+ );
+
+ cy.log(`15.5. Add variable`);
+ persesDashboardsEditVariables.clickButton('Add');
+
+ cy.log(`15.6. Apply changes`);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`15.7. Assert Variable before saving`);
+ persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
+
+ cy.log(`15.8. Click on Add Panel Group button`);
+ persesDashboardsPage.clickEditActionButton('AddGroup');
+ persesDashboardsPanelGroup.addPanelGroup('PanelGroup Perform Changes and Save', 'Open', '');
+
+ cy.log(`15.9. Click on Add Panel button`);
+ persesDashboardsPanelGroup.clickPanelGroupAction(
+ 'PanelGroup Perform Changes and Save',
+ 'addPanel',
+ );
+ persesDashboardsPanel.addPanel(
+ 'Panel Perform Changes and Save',
+ 'PanelGroup Perform Changes and Save',
+ 'Bar Chart',
+ );
+
+ cy.log(`15.10. Click on Save button`);
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`15.11. Back and check panel group`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+
+ cy.log(`15.12. Assert Variable before deleting`);
+ persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
+
+ cy.log(`15.13. Assert panel group exists`);
+ persesDashboardsPage.panelGroupHeaderAssertion('PanelGroup Perform Changes and Save', 'Open');
+
+ cy.log(`15.14. Assert panel exists`);
+ persesDashboardsPage.assertPanel(
+ 'Panel Perform Changes and Save',
+ 'PanelGroup Perform Changes and Save',
+ 'Open',
+ );
+
+ cy.log(`15.15. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`15.16. Delete variable`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickDeleteVariableButton(1);
+ persesDashboardsEditVariables.clickButton('Apply');
+ persesDashboardsPage.assertVariableNotExist('ListVariable');
+
+ cy.log(`15.17. Delete panel group`);
+ persesDashboardsPanelGroup.clickPanelGroupAction(
+ 'PanelGroup Perform Changes and Save',
+ 'delete',
+ );
+ persesDashboardsPanelGroup.clickDeletePanelGroupButton();
+ persesDashboardsPage.clickEditActionButton('Save');
+ persesDashboardsPage.assertPanelGroupNotExist('PanelGroup Perform Changes and Save');
+ });
}
diff --git a/web/cypress/support/perses/03.coo_create_perses_admin.cy.ts b/web/cypress/support/perses/03.coo_create_perses_admin.cy.ts
index 15d844faf..dab4172e8 100644
--- a/web/cypress/support/perses/03.coo_create_perses_admin.cy.ts
+++ b/web/cypress/support/perses/03.coo_create_perses_admin.cy.ts
@@ -1,11 +1,15 @@
-import { listPersesDashboardsPage } from "../../views/perses-dashboards-list-dashboards";
+import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { persesDashboardsPage } from '../../views/perses-dashboards';
-import { persesDashboardsAddListPanelType, persesDashboardSampleQueries, persesDashboardsEmptyDashboard } from '../../fixtures/perses/constants';
+import {
+ persesDashboardsAddListPanelType,
+ persesDashboardSampleQueries,
+ persesDashboardsEmptyDashboard,
+} from '../../fixtures/perses/constants';
import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard';
-import { persesDashboardsPanelGroup } from "../../views/perses-dashboards-panelgroup";
-import { persesDashboardsPanel } from "../../views/perses-dashboards-panel";
-import { persesDashboardsEditVariables } from "../../views/perses-dashboards-edit-variables";
-import { persesDashboardsAddListVariableSource } from "../../fixtures/perses/constants";
+import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup';
+import { persesDashboardsPanel } from '../../views/perses-dashboards-panel';
+import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables';
+import { persesDashboardsAddListVariableSource } from '../../fixtures/perses/constants';
export interface PerspectiveConfig {
name: string;
@@ -17,10 +21,9 @@ export function runCOOCreatePersesTests(perspective: PerspectiveConfig) {
}
export function testCOOCreatePerses(perspective: PerspectiveConfig) {
-
it(`1.${perspective.name} perspective - Create Dashboard validation with max length`, () => {
let dashboardName = 'Test Dashboard';
- let randomSuffix = Math.random().toString(5);
+ const randomSuffix = Math.random().toString(5);
dashboardName += randomSuffix;
cy.log(`1.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
listPersesDashboardsPage.shouldBeLoaded();
@@ -36,7 +39,9 @@ export function testCOOCreatePerses(perspective: PerspectiveConfig) {
cy.log(`1.4. Verify Max Length Validation`);
persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.enterDashboardName('1234567890123456789012345678901234567890123456789012345678901234567890123456');
+ persesCreateDashboardsPage.enterDashboardName(
+ '1234567890123456789012345678901234567890123456789012345678901234567890123456',
+ );
persesCreateDashboardsPage.createDashboardDialogCreateButton();
persesCreateDashboardsPage.assertMaxLengthValidation();
@@ -45,165 +50,218 @@ export function testCOOCreatePerses(perspective: PerspectiveConfig) {
persesCreateDashboardsPage.createDashboardDialogCreateButton();
persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- });
-
- it(`2.${perspective.name} perspective - Create Dashboard with duplicated name in the same project`, () => {
- //dashboard name with spaces
- let dashboardName = 'Dashboard to test duplication';
- let randomSuffix = Math.random().toString(5);
- dashboardName += randomSuffix;
- cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`2.2. Click on Create button`);
- listPersesDashboardsPage.clickCreateButton();
-
- cy.log(`2.3. Verify Project dropdown`);
- persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- cy.log(`2.4. Create another dashboard with the same name`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesCreateDashboardsPage.assertDuplicatedNameValidation(dashboardName);
-
- //dashboard name without spaces
- cy.log(`2.5. Create another dashboard with the same name without spaces`);
- dashboardName = 'DashboardToTestDuplication';
- dashboardName += randomSuffix;
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- cy.log(`2.6. Create another dashboard with the same name without spaces`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesCreateDashboardsPage.assertDuplicatedNameValidation(dashboardName);
-
- cy.log(`2.7. Create another dashboard with the same name in other project`);
- persesCreateDashboardsPage.selectProject('perses-dev');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
});
- it(`3.${perspective.name} perspective - Create Dashboard with panel groups, panels and variables`, () => {
- let dashboardName = 'Testing Dashboard - UP ';
- let randomSuffix = Math.random().toString(5);
- dashboardName += randomSuffix;
- cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.log(`3.2. Click on Create button`);
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
-
- cy.log(`3.3. Create Dashboard`);
- persesCreateDashboardsPage.selectProject('perses-dev');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- cy.log(`3.4. Add Variable`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('interval', false, false, '', '', '', undefined, undefined);
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('job', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('instance', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('instance');
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR);
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Apply');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`3.5. Add Panel Group`);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
-
- cy.log(`3.6. Add Panel`);
- persesDashboardsPage.clickEditActionButton('AddPanel');
- persesDashboardsPanel.addPanelShouldBeLoaded();
- persesDashboardsPanel.addPanel('Up', 'Panel Group Up', persesDashboardsAddListPanelType.TIME_SERIES_CHART, 'This is a line chart test', 'up');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`3.7. Back and check panel`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.clickDashboard(dashboardName);
- persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
- persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
- persesDashboardsPage.assertVariableBeVisible('interval');
- persesDashboardsPage.assertVariableBeVisible('job');
- persesDashboardsPage.assertVariableBeVisible('instance');
-
- cy.log(`3.8. Click on Edit button`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`3.9. Click on Edit Variables button and Delete all variables`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`3.10. Assert variables not exist`);
- persesDashboardsPage.assertVariableNotExist('interval');
- persesDashboardsPage.assertVariableNotExist('job');
- persesDashboardsPage.assertVariableNotExist('instance');
-
- cy.log(`3.11. Delete Panel`);
- persesDashboardsPanel.deletePanel('Up');
- persesDashboardsPanel.clickDeletePanelButton();
-
- cy.log(`3.12. Delete Panel Group`);
- persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
- persesDashboardsPanelGroup.clickDeletePanelGroupButton();
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.get('h2').contains(persesDashboardsEmptyDashboard.TITLE).scrollIntoView().should('be.visible');
- cy.get('p').contains(persesDashboardsEmptyDashboard.DESCRIPTION).scrollIntoView().should('be.visible');
-
- });
-
- //TODO: Verify Create project dropdown not only showing perses projects, but all namespaces you have access to, independently of having perses object (that creates a perses project)
- // it(`4.${perspective.name} perspective - Verify Create project dropdown not only showing perses projects, but all namespaces you have access to, independently of having perses object (that creates a perses project)`, () => {
- // cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- // listPersesDashboardsPage.shouldBeLoaded();
-
- // cy.log(`4.2. Click on Create button`);
- // listPersesDashboardsPage.clickCreateButton();
- // persesCreateDashboardsPage.createDashboardShouldBeLoaded();
-
- // cy.log(`4.3. Verify Project dropdown`);
- // persesCreateDashboardsPage.assertProjectDropdown('openshift-cluster-observability-operator');
- // openshift-monitoringas an example of a namespace that you have access to and does not have any perses object created yet, but you are able to create a dashboard
- // persesCreateDashboardsPage.assertProjectDropdown('openshift-monitoring);
+ it(
+ `2.${perspective.name} perspective - Create Dashboard with duplicated name in the ` +
+ `same project`,
+ () => {
+ //dashboard name with spaces
+ let dashboardName = 'Dashboard to test duplication';
+ const randomSuffix = Math.random().toString(5);
+ dashboardName += randomSuffix;
+ cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`2.2. Click on Create button`);
+ listPersesDashboardsPage.clickCreateButton();
+
+ cy.log(`2.3. Verify Project dropdown`);
+ persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+
+ cy.log(`2.4. Create another dashboard with the same name`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesCreateDashboardsPage.assertDuplicatedNameValidation();
+
+ //dashboard name without spaces
+ cy.log(`2.5. Create another dashboard with the same name without spaces`);
+ dashboardName = 'DashboardToTestDuplication';
+ dashboardName += randomSuffix;
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+
+ cy.log(`2.6. Create another dashboard with the same name without spaces`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesCreateDashboardsPage.assertDuplicatedNameValidation();
+
+ cy.log(`2.7. Create another dashboard with the same name in other project`);
+ persesCreateDashboardsPage.selectProject('perses-dev');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+ },
+ );
+
+ it(
+ `3.${perspective.name} perspective - Create Dashboard with panel groups, panels ` +
+ `and variables`,
+ () => {
+ let dashboardName = 'Testing Dashboard - UP ';
+ const randomSuffix = Math.random().toString(5);
+ dashboardName += randomSuffix;
+ cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.log(`3.2. Click on Create button`);
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+
+ cy.log(`3.3. Create Dashboard`);
+ persesCreateDashboardsPage.selectProject('perses-dev');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+
+ cy.log(`3.4. Add Variable`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'interval',
+ false,
+ false,
+ '',
+ '',
+ '',
+ undefined,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'job',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'instance',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName(
+ 'instance',
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(
+ persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR,
+ );
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Apply');
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`3.5. Add Panel Group`);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('AddGroup');
+ persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
+
+ cy.log(`3.6. Add Panel`);
+ persesDashboardsPage.clickEditActionButton('AddPanel');
+ persesDashboardsPanel.addPanelShouldBeLoaded();
+ persesDashboardsPanel.addPanel(
+ 'Up',
+ 'Panel Group Up',
+ persesDashboardsAddListPanelType.TIME_SERIES_CHART,
+ 'This is a line chart test',
+ 'up',
+ );
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`3.7. Back and check panel`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.clickDashboard(dashboardName);
+ persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
+ persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
+ persesDashboardsPage.assertVariableBeVisible('interval');
+ persesDashboardsPage.assertVariableBeVisible('job');
+ persesDashboardsPage.assertVariableBeVisible('instance');
+
+ cy.log(`3.8. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`3.9. Click on Edit Variables button and Delete all variables`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`3.10. Assert variables not exist`);
+ persesDashboardsPage.assertVariableNotExist('interval');
+ persesDashboardsPage.assertVariableNotExist('job');
+ persesDashboardsPage.assertVariableNotExist('instance');
+
+ cy.log(`3.11. Delete Panel`);
+ persesDashboardsPanel.deletePanel('Up');
+ persesDashboardsPanel.clickDeletePanelButton();
+
+ cy.log(`3.12. Delete Panel Group`);
+ persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
+ persesDashboardsPanelGroup.clickDeletePanelGroupButton();
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.get('h2')
+ .contains(persesDashboardsEmptyDashboard.TITLE)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.get('p')
+ .contains(persesDashboardsEmptyDashboard.DESCRIPTION)
+ .scrollIntoView()
+ .should('be.visible');
+ },
+ );
+
+ //TODO: Verify Create project dropdown not only showing perses projects,
+ // but all namespaces you have access to, independently of having perses object
+ // (that creates a perses project)
+ // it(`4.${perspective.name} perspective -
+ // Verify Create project dropdown not only showing perses projects,
+ // but all namespaces you have access to, independently of having perses object
+ // (that creates a perses project)`, () => {
+ // cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ // listPersesDashboardsPage.shouldBeLoaded();
+
+ // cy.log(`4.2. Click on Create button`);
+ // listPersesDashboardsPage.clickCreateButton();
+ // persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+
+ // cy.log(`4.3. Verify Project dropdown`);
+ // persesCreateDashboardsPage.assertProjectDropdown('openshift-cluster-observability-operator');
+ // openshift-monitoringas an example of a namespace that you have access to and
+ // does not have any perses object created yet, but you are able to create a dashboard
+ // persesCreateDashboardsPage.assertProjectDropdown('openshift-monitoring);
// });
-
}
diff --git a/web/cypress/support/perses/04.coo_import_perses_admin.cy.ts b/web/cypress/support/perses/04.coo_import_perses_admin.cy.ts
index 2e25c6139..aee80d33d 100644
--- a/web/cypress/support/perses/04.coo_import_perses_admin.cy.ts
+++ b/web/cypress/support/perses/04.coo_import_perses_admin.cy.ts
@@ -1,7 +1,7 @@
-import { listPersesDashboardsPage } from "../../views/perses-dashboards-list-dashboards";
+import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { persesDashboardsPage } from '../../views/perses-dashboards';
-import { persesImportDashboardsPage } from "../../views/perses-dashboards-import-dashboard";
-import { nav } from "../../views/nav";
+import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard';
+import { nav } from '../../views/nav';
export interface PerspectiveConfig {
name: string;
@@ -13,7 +13,6 @@ export function runCOOImportPersesTests(perspective: PerspectiveConfig) {
}
export function testCOOImportPerses(perspective: PerspectiveConfig) {
-
it(`1. ${perspective.name} perspective - Import Dashboard - wrong format`, () => {
cy.log(`1.1 use sidebar nav to go to Observe > Dashboards (Perses)`);
listPersesDashboardsPage.shouldBeLoaded();
@@ -23,21 +22,27 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
persesImportDashboardsPage.importDashboardShouldBeLoaded();
cy.log(`1.3 Upload wrong format file`);
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/accelerators-dashboard-cr-v1alpha1.yaml');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/accelerators-dashboard-cr-v1alpha1.yaml',
+ );
persesImportDashboardsPage.assertUnableToDetectDashboardFormat();
cy.log(`1.4 Clear file`);
persesImportDashboardsPage.clickClearFileButton();
-
+
cy.log(`1.5 Upload another wrong format file`);
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/accelerators-dashboard-cr-v1alpha2.yaml');
- persesImportDashboardsPage.assertUnableToDetectDashboardFormat();
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/accelerators-dashboard-cr-v1alpha2.yaml',
+ );
+ persesImportDashboardsPage.assertUnableToDetectDashboardFormat();
cy.log(`1.6 Clear file`);
persesImportDashboardsPage.clickClearFileButton();
cy.log(`1.7 Upload Grafana dashboard file`);
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/grafana_to_check_errors.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/grafana_to_check_errors.json',
+ );
persesImportDashboardsPage.assertGrafanaDashboardDetected();
cy.log(`1.8 Select a project`);
@@ -48,10 +53,10 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
cy.log(`1.10 Assert failed to migrate Grafana dashboard`);
persesImportDashboardsPage.assertFailedToMigrateGrafanaDashboard();
-
+ persesDashboardsPage.closeAlert();
+
cy.log(`1.11 Cancel import`);
persesImportDashboardsPage.clickCancelButton();
-
});
it(`2. ${perspective.name} perspective - Import Dashboard - ACM Grafana dashboard`, () => {
@@ -63,7 +68,9 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
persesImportDashboardsPage.importDashboardShouldBeLoaded();
cy.log(`2.3 Upload Grafana dashboard file`);
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/acm-vm-status.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/acm-vm-status.json',
+ );
persesImportDashboardsPage.assertGrafanaDashboardDetected();
cy.log(`2.4 Select a project`);
@@ -71,16 +78,19 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
cy.log(`2.5 Import dashboard`);
persesImportDashboardsPage.clickImportFileButton();
- persesDashboardsPage.closeSuccessAlert();
cy.log(`2.6 Assert dashboard is imported`);
- persesDashboardsPage.shouldBeLoadedEditionMode('Service Level dashboards / Virtual Machines by Time in Status');
+ persesDashboardsPage.shouldBeLoadedEditionMode(
+ 'Service Level dashboards / Virtual Machines by Time in Status',
+ );
cy.log(`2.7 Back to list of dashboards`);
persesDashboardsPage.backToListPersesDashboardsPage();
cy.log(`2.8 Filter by Name`);
- listPersesDashboardsPage.filter.byName('Service Level dashboards / Virtual Machines by Time in Status');
+ listPersesDashboardsPage.filter.byName(
+ 'Service Level dashboards / Virtual Machines by Time in Status',
+ );
listPersesDashboardsPage.countDashboards('1');
listPersesDashboardsPage.clearAllFilters();
cy.wait(2000);
@@ -88,13 +98,15 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
cy.log(`2.9 Import the same dashboard - Duplicated error`);
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/acm-vm-status.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/acm-vm-status.json',
+ );
persesImportDashboardsPage.assertGrafanaDashboardDetected();
persesImportDashboardsPage.selectProject('openshift-cluster-observability-operator');
persesImportDashboardsPage.clickImportFileButton();
persesImportDashboardsPage.assertDuplicatedDashboardError();
persesImportDashboardsPage.clickCancelButton();
-
+ persesDashboardsPage.closeAlert();
});
it(`3. ${perspective.name} perspective - Import Dashboard - Perses dashboard - JSON file`, () => {
@@ -106,7 +118,9 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
persesImportDashboardsPage.importDashboardShouldBeLoaded();
cy.log(`3.3 Upload Perses dashboard JSON file`);
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
cy.log(`3.4 Select a project`);
@@ -114,7 +128,7 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
cy.log(`3.5 Import dashboard`);
persesImportDashboardsPage.clickImportFileButton();
- persesDashboardsPage.closeSuccessAlert();
+ persesDashboardsPage.closeAlert();
cy.log(`3.6 Assert dashboard is imported`);
persesDashboardsPage.shouldBeLoadedEditionMode('Testing Perses dashboard - JSON');
@@ -131,13 +145,14 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
cy.log(`3.9 Import the same dashboard - Duplicated error`);
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
persesImportDashboardsPage.selectProject('openshift-cluster-observability-operator');
persesImportDashboardsPage.clickImportFileButton();
persesImportDashboardsPage.assertDuplicatedDashboardError();
persesImportDashboardsPage.clickCancelButton();
-
});
it(`4. ${perspective.name} perspective - Import Dashboard - Perses dashboard - YAML file`, () => {
@@ -149,7 +164,9 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
persesImportDashboardsPage.importDashboardShouldBeLoaded();
cy.log(`4.3 Upload Perses dashboard YAML file`);
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
cy.log(`4.4 Select a project`);
@@ -157,7 +174,7 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
cy.log(`4.5 Import dashboard`);
persesImportDashboardsPage.clickImportFileButton();
- persesDashboardsPage.closeSuccessAlert();
+ persesDashboardsPage.closeAlert();
cy.log(`4.6 Assert dashboard is imported`);
persesDashboardsPage.shouldBeLoadedEditionMode('Testing Perses dashboard - YAML');
@@ -170,24 +187,25 @@ export function testCOOImportPerses(perspective: PerspectiveConfig) {
listPersesDashboardsPage.countDashboards('1');
listPersesDashboardsPage.clearAllFilters();
cy.wait(2000);
-
+
cy.log(`4.9 Import the same dashboard - Duplicated error`);
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
persesImportDashboardsPage.selectProject('openshift-cluster-observability-operator');
persesImportDashboardsPage.clickImportFileButton();
persesImportDashboardsPage.assertDuplicatedDashboardError();
persesImportDashboardsPage.clickCancelButton();
-
});
it(`5. ${perspective.name} perspective - Delete imported dashboard`, () => {
const dashboardsToDelete = [
'Testing Perses dashboard - JSON',
'Testing Perses dashboard - YAML',
- 'Service Level dashboards / Virtual Machines by Time in Status'
+ 'Service Level dashboards / Virtual Machines by Time in Status',
];
cy.log(`5.1 Navigate to Observe > Dashboards (Perses)`);
diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user1.cy.ts b/web/cypress/support/perses/99.coo_rbac_perses_user1.cy.ts
index 46bac9512..a6f51a097 100644
--- a/web/cypress/support/perses/99.coo_rbac_perses_user1.cy.ts
+++ b/web/cypress/support/perses/99.coo_rbac_perses_user1.cy.ts
@@ -1,7 +1,13 @@
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 {
+ persesDashboardsAddListVariableSource,
+ persesDashboardSampleQueries,
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+ persesDashboardsEmptyDashboard,
+} from '../../fixtures/perses/constants';
import { persesDashboardsEditVariables } from '../../views/perses-dashboards-edit-variables';
import { persesDashboardsPanelGroup } from '../../views/perses-dashboards-panelgroup';
import { persesAriaLabels } from '../../../src/components/data-test';
@@ -21,53 +27,77 @@ export function runCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
/**
* User1 has access to:
- * - openshift-cluster-observability-operator namespace as persesdashboard-editor-role and persesdatasource-editor-role
- * - observ-test namespace as persesdashboard-viewer-role and persesdatasource-viewer-role
- * - no access to perses-dev, empty-namespace3, empty-namespace4 namespaces
- * - openshift-monitoring namespace as view role
+ * - openshift-cluster-observability-operator: persesdashboard-editor-role,
+ * persesdatasource-editor-role
+ * - observ-test: persesdashboard-viewer-role, persesdatasource-viewer-role
+ * - no access to perses-dev, empty-namespace3, empty-namespace4
+ * - openshift-monitoring: view role
*/
export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
-
- it(`1.${perspective.name} perspective - List Dashboards - Namespace validation and Dashboard search`, () => {
- cy.log(`1.1. Namespace validation`);
- listPersesDashboardsPage.shouldBeLoaded();
- cy.assertNamespace('All Projects', true);
- cy.assertNamespace('openshift-cluster-observability-operator', true);
- cy.assertNamespace('observ-test', true);
- cy.assertNamespace('openshift-monitoring', true);
- cy.assertNamespace('perses-dev', false);
- cy.assertNamespace('empty-namespace3', false);
- cy.assertNamespace('empty-namespace4', false);
-
- cy.log(`1.2. All Projects validation - Dashboard search - ${persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2]} dashboard`);
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.removeTag(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
-
- cy.log(`1.3. All Projects validation - Dashboard search - ${persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[2]} dashboard`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.countDashboards('2');
- listPersesDashboardsPage.removeTag(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
-
- cy.log(`1.4. All Projects validation - Dashboard search - ${persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]} dashboard`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.removeTag(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.removeTag('perses-dev');
-
- cy.log(`1.5. All Projects validation - Dashboard search - empty state`);
- listPersesDashboardsPage.filter.byProject('empty-namespace3');
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.removeTag('empty-namespace3');
-
- cy.log(`1.6. All Projects validation - Dashboard search - empty state`);
- listPersesDashboardsPage.filter.byProject('openshift-monitoring');
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.removeTag('openshift-monitoring');
-
- });
+ it(
+ `1.${perspective.name} perspective - List Dashboards - Namespace validation and ` +
+ `Dashboard search`,
+ () => {
+ cy.log(`1.1. Namespace validation`);
+ listPersesDashboardsPage.shouldBeLoaded();
+ cy.assertNamespace('All Projects', true);
+ cy.assertNamespace('openshift-cluster-observability-operator', true);
+ cy.assertNamespace('observ-test', true);
+ cy.assertNamespace('openshift-monitoring', true);
+ cy.assertNamespace('perses-dev', false);
+ cy.assertNamespace('empty-namespace3', false);
+ cy.assertNamespace('empty-namespace4', false);
+
+ cy.log(
+ `1.2. All Projects validation - Dashboard search - ` +
+ `${persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2]} dashboard`,
+ );
+ cy.changeNamespace('All Projects');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+ listPersesDashboardsPage.removeTag(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+
+ cy.log(
+ `1.3. All Projects validation - Dashboard search - ` +
+ `${persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[2]} dashboard`,
+ );
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.countDashboards('2');
+ listPersesDashboardsPage.removeTag(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+
+ cy.log(
+ `1.4. All Projects validation - Dashboard search - ` +
+ `${persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]} dashboard`,
+ );
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.removeTag(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.removeTag('perses-dev');
+
+ cy.log(`1.5. All Projects validation - Dashboard search - empty state`);
+ listPersesDashboardsPage.filter.byProject('empty-namespace3');
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.removeTag('empty-namespace3');
+
+ cy.log(`1.6. All Projects validation - Dashboard search - empty state`);
+ listPersesDashboardsPage.filter.byProject('openshift-monitoring');
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.removeTag('openshift-monitoring');
+ },
+ );
it(`2.${perspective.name} perspective - Edit button validation - Editable dashboard`, () => {
cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -78,11 +108,15 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`2.3. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`2.4. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
persesDashboardsPage.shouldBeLoaded1();
cy.log(`2.5. Click on Edit button`);
@@ -91,15 +125,24 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
persesDashboardsPage.assertEditModePanelGroupButtons('Headlines');
//already expanded
persesDashboardsPage.assertPanelActionButtons('CPU Usage');
- // tiny panel and modal is opened. So, expand first and then assert the buttons and finally collapse
- // due to modal is opened and page is refreshed, it is not easy to assert buttons in the modal
+ // Tiny panel + modal: expand first, assert buttons, then collapse. Modal refresh makes modal
+ // assertions unreliable.
persesDashboardsPage.assertPanelActionButtons('CPU Utilisation');
cy.log(`2.6. Click on Edit Variables button - Add components`);
persesDashboardsPage.clickEditActionButton('EditVariables');
persesDashboardsEditVariables.clickButton('Add Variable');
//https://issues.redhat.com/browse/OU-1159 - Custom All Value is not working
- persesDashboardsEditVariables.addListVariable('ListVariable', true, true, 'AAA', 'Test', 'Test', undefined, undefined);
+ persesDashboardsEditVariables.addListVariable(
+ 'ListVariable',
+ true,
+ true,
+ 'AAA',
+ 'Test',
+ 'Test',
+ undefined,
+ undefined,
+ );
cy.log(`2.7. Add variable`);
persesDashboardsEditVariables.clickButton('Add');
@@ -115,15 +158,27 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
persesDashboardsPanelGroup.addPanelGroup('PanelGroup Perform Changes and Save', 'Open', '');
cy.log(`2.11. Click on Add Panel button`);
- persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup Perform Changes and Save', 'addPanel');
- persesDashboardsPanel.addPanel('Panel Perform Changes and Save', 'PanelGroup Perform Changes and Save', persesDashboardsAddListPanelType.TIME_SERIES_CHART, undefined, 'up');
+ persesDashboardsPanelGroup.clickPanelGroupAction(
+ 'PanelGroup Perform Changes and Save',
+ 'addPanel',
+ );
+ persesDashboardsPanel.addPanel(
+ 'Panel Perform Changes and Save',
+ 'PanelGroup Perform Changes and Save',
+ persesDashboardsAddListPanelType.TIME_SERIES_CHART,
+ undefined,
+ 'up',
+ );
cy.wait(2000);
cy.log(`2.13. Click on Save button`);
persesDashboardsPage.clickEditActionButton('Save');
cy.wait(2000);
- cy.log(`2.14. Assert Panel with Data - Export Time Series Data As CSV button is visible and clickable `);
+ cy.log(
+ `2.14. Assert Panel with Data - Export Time Series Data As CSV button is ` +
+ `visible and clickable`,
+ );
cy.wait(2000);
cy.byAriaLabel(persesAriaLabels.PanelExportTimeSeriesDataAsCSV).eq(0).click({ force: true });
cy.wait(1000);
@@ -134,12 +189,20 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.log(`2.15. Back and check changes`);
persesDashboardsPage.backToListPersesDashboardsPage();
cy.changeNamespace('openshift-cluster-observability-operator');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
persesDashboardsPage.shouldBeLoaded1();
persesDashboardsPage.searchAndSelectVariable('ListVariable', 'All');
persesDashboardsPage.panelGroupHeaderAssertion('PanelGroup Perform Changes and Save', 'Open');
- persesDashboardsPage.assertPanel('Panel Perform Changes and Save', 'PanelGroup Perform Changes and Save', 'Open');
+ persesDashboardsPage.assertPanel(
+ 'Panel Perform Changes and Save',
+ 'PanelGroup Perform Changes and Save',
+ 'Open',
+ );
cy.log(`2.16. Click on Edit Variables button - Delete components`);
persesDashboardsPage.clickEditButton();
@@ -153,13 +216,15 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
persesDashboardsPanel.clickDeletePanelButton();
cy.log(`2.18. Click on Delete Panel Group button`);
- persesDashboardsPanelGroup.clickPanelGroupAction('PanelGroup Perform Changes and Save', 'delete');
+ persesDashboardsPanelGroup.clickPanelGroupAction(
+ 'PanelGroup Perform Changes and Save',
+ 'delete',
+ );
persesDashboardsPanelGroup.clickDeletePanelGroupButton();
persesDashboardsPage.clickEditActionButton('Save');
persesDashboardsPage.assertPanelGroupNotExist('PanelGroup Perform Changes and Save');
- persesDashboardsPage.assertPanelNotExist('Panel Perform Changes and Save');
+ persesDashboardsPage.assertPanelNotExist('Panel Perform Changes and Save');
persesDashboardsPage.assertVariableNotExist('ListVariable');
-
});
it(`3.${perspective.name} perspective - Edit button validation - Not editable dashboard`, () => {
@@ -171,21 +236,24 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`3.3. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`3.4. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
persesDashboardsPage.shouldBeLoaded1();
cy.log(`3.5. Verify Edit button is not editable`);
persesDashboardsPage.assertEditButtonIsDisabled();
-
});
/**
- * When we have admin permission or editor permission to at least one namespace,
- * the Create button is always enabled and Select project dropdown is filtering out namespaces that we do not have access to
+ * With admin or editor permission on at least one namespace, Create stays enabled and the
+ * project dropdown hides namespaces we cannot access.
*/
it(`4.${perspective.name} perspective - Create button validation - Disabled / Enabled`, () => {
cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -198,12 +266,12 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertCreateButtonIsEnabled();
listPersesDashboardsPage.clickCreateButton();
persesCreateDashboardsPage.createDashboardShouldBeLoaded();
- persesCreateDashboardsPage.assertProjectDropdown('openshift-cluster-observability-operator');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace3');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesCreateDashboardsPage.assertProjectDropdown('openshift-cluster-observability-operator');
persesCreateDashboardsPage.createDashboardDialogCancelButton();
cy.log(`4.4 change namespace to openshift-cluster-observability-operator`);
@@ -217,102 +285,147 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.log(`4.7. Verify Create button is enabled`);
listPersesDashboardsPage.assertCreateButtonIsEnabled();
-
});
- it(`5.${perspective.name} perspective - Create Dashboard with panel groups, panels and variables`, () => {
- let dashboardName = 'Testing Dashboard - UP ';
- let randomSuffix = Math.random().toString(5);
- dashboardName += randomSuffix;
- cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- listPersesDashboardsPage.shouldBeLoaded();
-
- cy.changeNamespace('openshift-cluster-observability-operator');
-
- cy.log(`5.2. Click on Create button`);
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
-
- cy.log(`5.3. Create Dashboard`);
- persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- cy.log(`5.4. Add Variable`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('interval', false, false, '', '', '', undefined, undefined);
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('job', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('instance', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('instance');
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR);
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Apply');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`5.5. Add Panel Group`);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
-
- cy.log(`5.6. Add Panel`);
- persesDashboardsPage.clickEditActionButton('AddPanel');
- persesDashboardsPanel.addPanelShouldBeLoaded();
- persesDashboardsPanel.addPanel('Up', 'Panel Group Up', persesDashboardsAddListPanelType.TIME_SERIES_CHART, 'This is a line chart test', 'up');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`5.7. Back and check panel`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- cy.changeNamespace('openshift-cluster-observability-operator');
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.clickDashboard(dashboardName);
- persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
- persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
- persesDashboardsPage.assertVariableBeVisible('interval');
- persesDashboardsPage.assertVariableBeVisible('job');
- persesDashboardsPage.assertVariableBeVisible('instance');
-
- cy.log(`5.8. Click on Edit button`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`5.9. Click on Edit Variables button and Delete all variables`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`5.10. Assert variables not exist`);
- persesDashboardsPage.assertVariableNotExist('interval');
- persesDashboardsPage.assertVariableNotExist('job');
- persesDashboardsPage.assertVariableNotExist('instance');
-
- cy.log(`5.11. Delete Panel`);
- persesDashboardsPanel.deletePanel('Up');
- persesDashboardsPanel.clickDeletePanelButton();
-
- cy.log(`5.12. Delete Panel Group`);
- persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
- persesDashboardsPanelGroup.clickDeletePanelGroupButton();
- persesDashboardsPage.clickEditActionButton('Save');
- persesDashboardsPage.closeSuccessAlert();
-
- cy.get('h2').contains(persesDashboardsEmptyDashboard.TITLE).scrollIntoView().should('be.visible');
- cy.get('p').contains(persesDashboardsEmptyDashboard.DESCRIPTION).scrollIntoView().should('be.visible');
-
- });
+ it(
+ `5.${perspective.name} perspective - Create Dashboard with panel groups, panels ` +
+ `and variables`,
+ () => {
+ let dashboardName = 'Testing Dashboard - UP ';
+ const randomSuffix = Math.random().toString(5);
+ dashboardName += randomSuffix;
+ cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ listPersesDashboardsPage.shouldBeLoaded();
+
+ cy.changeNamespace('openshift-cluster-observability-operator');
+
+ cy.log(`5.2. Click on Create button`);
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+
+ cy.log(`5.3. Create Dashboard`);
+ persesCreateDashboardsPage.selectProject('openshift-cluster-observability-operator');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+
+ cy.log(`5.4. Add Variable`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'interval',
+ false,
+ false,
+ '',
+ '',
+ '',
+ undefined,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'job',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'instance',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName(
+ 'instance',
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(
+ persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR,
+ );
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Apply');
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`5.5. Add Panel Group`);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('AddGroup');
+ persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
+
+ cy.log(`5.6. Add Panel`);
+ persesDashboardsPage.clickEditActionButton('AddPanel');
+ persesDashboardsPanel.addPanelShouldBeLoaded();
+ persesDashboardsPanel.addPanel(
+ 'Up',
+ 'Panel Group Up',
+ persesDashboardsAddListPanelType.TIME_SERIES_CHART,
+ 'This is a line chart test',
+ 'up',
+ );
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`5.7. Back and check panel`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ cy.changeNamespace('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.clickDashboard(dashboardName);
+ persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
+ persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
+ persesDashboardsPage.assertVariableBeVisible('interval');
+ persesDashboardsPage.assertVariableBeVisible('job');
+ persesDashboardsPage.assertVariableBeVisible('instance');
+
+ cy.log(`5.8. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`5.9. Click on Edit Variables button and Delete all variables`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`5.10. Assert variables not exist`);
+ persesDashboardsPage.assertVariableNotExist('interval');
+ persesDashboardsPage.assertVariableNotExist('job');
+ persesDashboardsPage.assertVariableNotExist('instance');
+
+ cy.log(`5.11. Delete Panel`);
+ persesDashboardsPanel.deletePanel('Up');
+ persesDashboardsPanel.clickDeletePanelButton();
+
+ cy.log(`5.12. Delete Panel Group`);
+ persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
+ persesDashboardsPanelGroup.clickDeletePanelGroupButton();
+ persesDashboardsPage.clickEditActionButton('Save');
+ persesDashboardsPage.closeAlert();
+
+ cy.get('h2')
+ .contains(persesDashboardsEmptyDashboard.TITLE)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.get('p')
+ .contains(persesDashboardsEmptyDashboard.DESCRIPTION)
+ .scrollIntoView()
+ .should('be.visible');
+ },
+ );
it(`6.${perspective.name} perspective - Kebab icon - Enabled / Disabled`, () => {
cy.log(`6.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -322,7 +435,9 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.changeNamespace('observ-test');
cy.log(`6.3. Assert Kebab icon is disabled`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.assertKebabIconDisabled();
cy.log(`6.4. Change namespace to openshift-cluster-observability-operator`);
@@ -330,7 +445,9 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.log(`6.5. Assert Kebab icon is enabled`);
listPersesDashboardsPage.clearAllFilters();
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.assertKebabIconOptions();
listPersesDashboardsPage.clickKebabIcon();
@@ -341,7 +458,9 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.log(`6.3. Filter by Project and Name`);
listPersesDashboardsPage.filter.byProject('observ-test');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.assertKebabIconDisabled();
@@ -349,19 +468,19 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.log(`6.4. Filter by Project and Name`);
listPersesDashboardsPage.filter.byProject('openshift-cluster-observability-operator');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.countDashboards('1');
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.assertKebabIconOptions();
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clearAllFilters();
-
});
-
it(`7.${perspective.name} perspective - Rename to a new dashboard name`, () => {
let dashboardName = 'Renamed dashboard ';
- let randomSuffix = Math.random().toString(5);
+ const randomSuffix = Math.random().toString(5);
dashboardName += randomSuffix;
cy.log(`7.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -371,9 +490,11 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.changeNamespace('openshift-cluster-observability-operator');
cy.log(`7.3. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`7.4. Click on the Kebab icon - Rename`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickRenameDashboardOption();
@@ -398,27 +519,34 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.countDashboards('1');
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickRenameDashboardOption();
- listPersesDashboardsPage.renameDashboardEnterName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.renameDashboardEnterName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.renameDashboardRenameButton();
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
+
cy.log(`7.7. Filter by Name`);
cy.changeNamespace('openshift-cluster-observability-operator');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
persesDashboardsPage.shouldBeLoaded1();
- persesDashboardsPage.shouldBeLoadedAfterRename(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ persesDashboardsPage.shouldBeLoadedAfterRename(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
persesDashboardsPage.backToListPersesDashboardsPage();
-
});
it(`8.${perspective.name} perspective - Duplicate and verify project dropdown and Delete`, () => {
let dashboardName = 'Duplicate dashboard ';
- let randomSuffix = Math.random().toString(5);
+ const randomSuffix = Math.random().toString(5);
dashboardName += randomSuffix;
cy.log(`8.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -428,24 +556,30 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.changeNamespace('openshift-cluster-observability-operator');
cy.log(`8.3. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`8.4. Click on the Kebab icon - Duplicate`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDuplicateOption();
cy.log(`8.5. Assert project dropdown options`);
- listPersesDashboardsPage.assertDuplicateProjectDropdownExists('openshift-cluster-observability-operator');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('observ-test');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('perses-dev');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('empty-namespace3');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('empty-namespace4');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('openshift-monitoring');
+ listPersesDashboardsPage.assertDuplicateProjectDropdownExists(
+ 'openshift-cluster-observability-operator',
+ );
cy.log(`8.6. Enter new dashboard name`);
listPersesDashboardsPage.duplicateDashboardEnterName(dashboardName);
- listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown(
+ 'openshift-cluster-observability-operator',
+ );
listPersesDashboardsPage.duplicateDashboardDuplicateButton();
persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
persesDashboardsPage.shouldBeLoadedAfterDuplicate(dashboardName);
@@ -459,7 +593,6 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDeleteOption();
listPersesDashboardsPage.deleteDashboardDeleteButton();
- persesDashboardsPage.closeSuccessAlert();
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
@@ -470,33 +603,30 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.countDashboards('0');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
});
it(`9.${perspective.name} perspective - Delete dashboard`, () => {
cy.log(`9.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
listPersesDashboardsPage.shouldBeLoaded();
- cy.log(`9.3. Filter by Name`);
+ cy.log(`9.2. Filter by Name`);
listPersesDashboardsPage.filter.byName('Testing Dashboard - UP');
listPersesDashboardsPage.countDashboards('1');
- cy.log(`9.4. Click on the Kebab icon - Delete`);
+ cy.log(`9.3. Click on the Kebab icon - Delete`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDeleteOption();
listPersesDashboardsPage.deleteDashboardDeleteButton();
- persesDashboardsPage.closeSuccessAlert();
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
- cy.log(`9.5. Filter by Name`);
+ cy.log(`9.4. Filter by Name`);
listPersesDashboardsPage.filter.byName('Testing Dashboard - UP');
listPersesDashboardsPage.countDashboards('0');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
});
it(`10.${perspective.name} perspective - Import button validation - Enabled / Disabled`, () => {
@@ -510,18 +640,20 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertImportButtonIsEnabled();
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
cy.log(`10.4. Verify project dropdown options`);
- persesImportDashboardsPage.assertProjectDropdown('openshift-cluster-observability-operator');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace3');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesImportDashboardsPage.assertProjectDropdown('openshift-cluster-observability-operator');
persesImportDashboardsPage.clickCancelButton();
-
+
cy.log(`10.5 change namespace to openshift-cluster-observability-operator`);
cy.changeNamespace('openshift-cluster-observability-operator');
@@ -546,7 +678,9 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertImportButtonIsEnabled();
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
cy.log(`11.4. Select a project`);
@@ -554,7 +688,6 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.log(`11.5. Import dashboard`);
persesImportDashboardsPage.clickImportFileButton();
- persesDashboardsPage.closeSuccessAlert();
cy.log(`11.6. Assert dashboard is imported`);
persesDashboardsPage.shouldBeLoadedEditionMode('Testing Perses dashboard - YAML');
@@ -570,7 +703,9 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
cy.log(`11.9. Import the same dashboard - Duplicated error`);
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
persesImportDashboardsPage.selectProject('openshift-cluster-observability-operator');
persesImportDashboardsPage.clickImportFileButton();
@@ -594,5 +729,4 @@ export function testCOORBACPersesTestsDevUser1(perspective: PerspectiveConfig) {
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
});
-
}
diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts b/web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts
index 6c19bf1bf..5813b627f 100644
--- a/web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts
+++ b/web/cypress/support/perses/99.coo_rbac_perses_user2.cy.ts
@@ -1,6 +1,9 @@
import { persesDashboardsPage } from '../../views/perses-dashboards';
import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
-import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
+import {
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+} from '../../fixtures/perses/constants';
export interface PerspectiveConfig {
name: string;
@@ -13,59 +16,86 @@ export function runCOORBACPersesTestsDevUser2(perspective: PerspectiveConfig) {
/**
* User2 has access to:
- * - perses-dev namespace as persesdashboard-viewer-role and persesdatasource-viewer-role
- * - no access to openshift-cluster-observability-operator and observ-test namespaces
- * - openshift-monitoring as view role
+ * - perses-dev: persesdashboard-viewer-role, persesdatasource-viewer-role
+ * - no access to openshift-cluster-observability-operator, observ-test
+ * - openshift-monitoring: view role
*/
export function testCOORBACPersesTestsDevUser2(perspective: PerspectiveConfig) {
-
- it(`1.${perspective.name} perspective - List Dashboards - Namespace validation and Dashboard search`, () => {
- cy.log(`1.1. Namespace validation`);
- listPersesDashboardsPage.shouldBeLoaded();
- cy.assertNamespace('All Projects', true);
- cy.assertNamespace('openshift-cluster-observability-operator', false);
- cy.assertNamespace('observ-test', false);
- cy.assertNamespace('empty-namespace3', false);
- cy.assertNamespace('empty-namespace4', false);
- cy.assertNamespace('openshift-monitoring', true);
- cy.assertNamespace('perses-dev', true);
-
- cy.log(`1.2. All Projects validation - Dashboard search - ${persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]} dashboard`);
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.removeTag(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.removeTag('perses-dev');
-
- cy.changeNamespace('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
- listPersesDashboardsPage.countDashboards('1');
- listPersesDashboardsPage.removeTag(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
-
- cy.log(`1.3. All Projects validation - Dashboard search - ${persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2]} dashboard`);
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.removeTag(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
-
- cy.log(`1.4. All Projects validation - Dashboard search - ${persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[2]} dashboard`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.removeTag(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0]);
-
- cy.log(`1.5. All Projects validation - Dashboard search - empty state`);
- listPersesDashboardsPage.filter.byProject('empty-namespace4');
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.removeTag('empty-namespace4');
-
- cy.log(`1.6. All Projects validation - Dashboard search - empty state`);
- listPersesDashboardsPage.filter.byProject('openshift-monitoring');
- listPersesDashboardsPage.emptyState();
- listPersesDashboardsPage.removeTag('openshift-monitoring');
-
- });
+ it(
+ `1.${perspective.name} perspective - List Dashboards - Namespace validation and ` +
+ `Dashboard search`,
+ () => {
+ cy.log(`1.1. Namespace validation`);
+ listPersesDashboardsPage.shouldBeLoaded();
+ cy.assertNamespace('All Projects', true);
+ cy.assertNamespace('openshift-cluster-observability-operator', false);
+ cy.assertNamespace('observ-test', false);
+ cy.assertNamespace('empty-namespace3', false);
+ cy.assertNamespace('empty-namespace4', false);
+ cy.assertNamespace('openshift-monitoring', true);
+ cy.assertNamespace('perses-dev', true);
+
+ cy.log(
+ `1.2. All Projects validation - Dashboard search - ` +
+ `${persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2]} dashboard`,
+ );
+ cy.changeNamespace('All Projects');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+ listPersesDashboardsPage.filter.byProject('perses-dev');
+ listPersesDashboardsPage.countDashboards('1');
+ listPersesDashboardsPage.removeTag(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.removeTag('perses-dev');
+
+ cy.changeNamespace('perses-dev');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+ listPersesDashboardsPage.countDashboards('1');
+ listPersesDashboardsPage.removeTag(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
+
+ cy.log(
+ `1.3. All Projects validation - Dashboard search - ` +
+ `${persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2]} dashboard`,
+ );
+ cy.changeNamespace('All Projects');
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.removeTag(
+ persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0],
+ );
+
+ cy.log(
+ `1.4. All Projects validation - Dashboard search - ` +
+ `${persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[2]} dashboard`,
+ );
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.removeTag(
+ persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[0],
+ );
+
+ cy.log(`1.5. All Projects validation - Dashboard search - empty state`);
+ listPersesDashboardsPage.filter.byProject('empty-namespace4');
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.removeTag('empty-namespace4');
+
+ cy.log(`1.6. All Projects validation - Dashboard search - empty state`);
+ listPersesDashboardsPage.filter.byProject('openshift-monitoring');
+ listPersesDashboardsPage.emptyState();
+ listPersesDashboardsPage.removeTag('openshift-monitoring');
+ },
+ );
it(`2.${perspective.name} perspective - Edit button validation - Not Editable dashboard`, () => {
cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -76,14 +106,17 @@ export function testCOORBACPersesTestsDevUser2(perspective: PerspectiveConfig) {
listPersesDashboardsPage.shouldBeLoaded();
cy.log(`2.3. Filter by Name`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
cy.log(`2.4. Click on a dashboard`);
- listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.clickDashboard(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
persesDashboardsPage.shouldBeLoaded1();
persesDashboardsPage.assertEditButtonIsDisabled();
-
});
it(`3.${perspective.name} perspective - Create button validation - Disabled`, () => {
@@ -102,7 +135,6 @@ export function testCOORBACPersesTestsDevUser2(perspective: PerspectiveConfig) {
cy.log(`3.5. Change namespace to openshift-monitoring`);
cy.changeNamespace('openshift-monitoring');
listPersesDashboardsPage.assertCreateButtonIsDisabled();
-
});
it(`4.${perspective.name} perspective - Kebab icon - Disabled`, () => {
@@ -113,7 +145,9 @@ export function testCOORBACPersesTestsDevUser2(perspective: PerspectiveConfig) {
cy.changeNamespace('perses-dev');
cy.log(`4.3. Assert Kebab icon is disabled`);
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.assertKebabIconDisabled();
listPersesDashboardsPage.clearAllFilters();
@@ -122,11 +156,12 @@ export function testCOORBACPersesTestsDevUser2(perspective: PerspectiveConfig) {
cy.log(`4.5. Assert Kebab icon is disabled`);
listPersesDashboardsPage.filter.byProject('perses-dev');
- listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0]);
+ listPersesDashboardsPage.filter.byName(
+ persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[0],
+ );
listPersesDashboardsPage.countDashboards('1');
listPersesDashboardsPage.assertKebabIconDisabled();
listPersesDashboardsPage.clearAllFilters();
-
});
it(`5.${perspective.name} perspective - Import button validation - Disabled`, () => {
@@ -146,7 +181,5 @@ export function testCOORBACPersesTestsDevUser2(perspective: PerspectiveConfig) {
cy.log(`5.6. Change namespace to All Projects`);
cy.changeNamespace('All Projects');
listPersesDashboardsPage.assertImportButtonIsDisabled();
-
});
-
}
diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user3.cy.ts b/web/cypress/support/perses/99.coo_rbac_perses_user3.cy.ts
index 9d930a0d3..1b80978c5 100644
--- a/web/cypress/support/perses/99.coo_rbac_perses_user3.cy.ts
+++ b/web/cypress/support/perses/99.coo_rbac_perses_user3.cy.ts
@@ -1,7 +1,12 @@
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 {
+ 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';
@@ -20,75 +25,85 @@ export function runCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
}
let dashboardName = 'Testing Dashboard - UP ';
-let randomSuffix = Math.random().toString(5);
+const randomSuffix = Math.random().toString(5);
dashboardName += randomSuffix;
/**
* User3 has access to:
- * - empty-namespace3 namespace as persesdashboard-editor-role and persesdatasource-editor-role
- * - no access to openshift-cluster-observability-operator, observ-test, perses-dev namespaces, empty-namespace4 namespaces
- * - openshift-monitoring namespace as view role
+ * - empty-namespace3: persesdashboard-editor-role, persesdatasource-editor-role
+ * - no access to openshift-cluster-observability-operator, observ-test, perses-dev,
+ * empty-namespace4
+ * - openshift-monitoring: view role
*/
export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
-
- it(`1.${perspective.name} perspective - List Dashboards - Namespace validation and Dashboard search`, () => {
- cy.log(`1.1. Namespace validation`);
- listPersesDashboardsPage.noDashboardsFoundState();
- cy.assertNamespace('All Projects', true);
- cy.assertNamespace('openshift-cluster-observability-operator', false);
- cy.assertNamespace('observ-test', false);
- cy.assertNamespace('perses-dev', false);
- cy.assertNamespace('empty-namespace3', true);
- cy.assertNamespace('empty-namespace4', false);
- cy.assertNamespace('openshift-monitoring', true);
-
- cy.log(`1.2. All Projects validation - Dashboard search - empty state`);
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsEnabled();
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
- persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
- persesCreateDashboardsPage.createDashboardDialogCancelButton();
-
- cy.log(`1.3. empty-namespace3 validation - Dashboard search - empty state`);
- cy.changeNamespace('empty-namespace3');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsEnabled();
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
- persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
- persesCreateDashboardsPage.createDashboardDialogCancelButton();
-
- cy.log(`1.4. openshift-monitoring validation - Dashboard search - empty state`);
- cy.changeNamespace('openshift-monitoring');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsEnabled();
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
- persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
- persesCreateDashboardsPage.createDashboardDialogCancelButton();
-
- });
+ it(
+ `1.${perspective.name} perspective - List Dashboards - Namespace validation and ` +
+ `Dashboard search`,
+ () => {
+ cy.log(`1.1. Namespace validation`);
+ listPersesDashboardsPage.noDashboardsFoundState();
+ cy.assertNamespace('All Projects', true);
+ cy.assertNamespace('openshift-cluster-observability-operator', false);
+ cy.assertNamespace('observ-test', false);
+ cy.assertNamespace('perses-dev', false);
+ cy.assertNamespace('empty-namespace3', true);
+ cy.assertNamespace('empty-namespace4', false);
+ cy.assertNamespace('openshift-monitoring', true);
+
+ cy.log(`1.2. All Projects validation - Dashboard search - empty state`);
+ cy.changeNamespace('All Projects');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsEnabled();
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown(
+ 'openshift-cluster-observability-operator',
+ );
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
+ persesCreateDashboardsPage.createDashboardDialogCancelButton();
+
+ cy.log(`1.3. empty-namespace3 validation - Dashboard search - empty state`);
+ cy.changeNamespace('empty-namespace3');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsEnabled();
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown(
+ 'openshift-cluster-observability-operator',
+ );
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
+
+ persesCreateDashboardsPage.createDashboardDialogCancelButton();
+
+ cy.log(`1.4. openshift-monitoring validation - Dashboard search - empty state`);
+ cy.changeNamespace('openshift-monitoring');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsEnabled();
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown(
+ 'openshift-cluster-observability-operator',
+ );
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
+ persesCreateDashboardsPage.createDashboardDialogCancelButton();
+ },
+ );
/**
- * When we have admin permission or editor permission to at least one namespace,
- * the Create button is always enabled and Select project dropdown is filtering out namespaces that we do not have access to
+ * With admin or editor permission on at least one namespace, Create stays enabled and the
+ * project dropdown hides namespaces we cannot access.
*/
it(`2.${perspective.name} perspective - Create button validation - Disabled / Enabled`, () => {
cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -101,11 +116,11 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertCreateButtonIsEnabled();
listPersesDashboardsPage.clickCreateButton();
persesCreateDashboardsPage.createDashboardShouldBeLoaded();
- persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesCreateDashboardsPage.assertProjectDropdown('empty-namespace3');
persesCreateDashboardsPage.createDashboardDialogCancelButton();
cy.log(`2.4 change namespace to openshift-monitoring`);
@@ -119,99 +134,144 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
cy.log(`2.7. Verify Create button is enabled`);
listPersesDashboardsPage.assertCreateButtonIsEnabled();
-
});
- it(`3.${perspective.name} perspective - Create Dashboard with panel groups, panels and variables`, () => {
- cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- listPersesDashboardsPage.noDashboardsFoundState();
+ it(
+ `3.${perspective.name} perspective - Create Dashboard with panel groups, panels ` +
+ `and variables`,
+ () => {
+ cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ listPersesDashboardsPage.noDashboardsFoundState();
+
+ cy.changeNamespace('openshift-monitoring');
+
+ cy.log(`3.2. Click on Create button`);
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+
+ cy.log(`3.3. Create Dashboard`);
+ persesCreateDashboardsPage.selectProject('empty-namespace3');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+
+ cy.log(`3.4. Add Variable`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'interval',
+ false,
+ false,
+ '',
+ '',
+ '',
+ undefined,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'job',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'instance',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName(
+ 'instance',
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(
+ persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR,
+ );
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Apply');
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`3.5. Add Panel Group`);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('AddGroup');
+ persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
+
+ cy.log(`3.6. Add Panel`);
+ persesDashboardsPage.clickEditActionButton('AddPanel');
+ persesDashboardsPanel.addPanelShouldBeLoaded();
+ persesDashboardsPanel.addPanel(
+ 'Up',
+ 'Panel Group Up',
+ persesDashboardsAddListPanelType.TIME_SERIES_CHART,
+ 'This is a line chart test',
+ 'up',
+ );
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`3.7. Back and check panel`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ cy.changeNamespace('empty-namespace3');
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.clickDashboard(dashboardName);
+ persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
+ persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
+ persesDashboardsPage.assertVariableBeVisible('interval');
+ persesDashboardsPage.assertVariableBeVisible('job');
+ persesDashboardsPage.assertVariableBeVisible('instance');
+
+ cy.log(`3.8. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`3.9. Click on Edit Variables button and Delete all variables`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`3.10. Assert variables not exist`);
+ persesDashboardsPage.assertVariableNotExist('interval');
+ persesDashboardsPage.assertVariableNotExist('job');
+ persesDashboardsPage.assertVariableNotExist('instance');
+
+ cy.log(`3.11. Delete Panel`);
+ persesDashboardsPanel.deletePanel('Up');
+ persesDashboardsPanel.clickDeletePanelButton();
+
+ cy.log(`3.12. Delete Panel Group`);
+ persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
+ persesDashboardsPanelGroup.clickDeletePanelGroupButton();
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.get('h2')
+ .contains(persesDashboardsEmptyDashboard.TITLE)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.get('p')
+ .contains(persesDashboardsEmptyDashboard.DESCRIPTION)
+ .scrollIntoView()
+ .should('be.visible');
+ },
+ );
- cy.changeNamespace('openshift-monitoring');
-
- cy.log(`3.2. Click on Create button`);
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
-
- cy.log(`3.3. Create Dashboard`);
- persesCreateDashboardsPage.selectProject('empty-namespace3');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- cy.log(`3.4. Add Variable`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('interval', false, false, '', '', '', undefined, undefined);
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('job', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('instance', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('instance');
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR);
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Apply');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`3.5. Add Panel Group`);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
-
- cy.log(`3.6. Add Panel`);
- persesDashboardsPage.clickEditActionButton('AddPanel');
- persesDashboardsPanel.addPanelShouldBeLoaded();
- persesDashboardsPanel.addPanel('Up', 'Panel Group Up', persesDashboardsAddListPanelType.TIME_SERIES_CHART, 'This is a line chart test', 'up');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`3.7. Back and check panel`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- cy.changeNamespace('empty-namespace3');
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.clickDashboard(dashboardName);
- persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
- persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
- persesDashboardsPage.assertVariableBeVisible('interval');
- persesDashboardsPage.assertVariableBeVisible('job');
- persesDashboardsPage.assertVariableBeVisible('instance');
-
- cy.log(`3.8. Click on Edit button`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`3.9. Click on Edit Variables button and Delete all variables`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`3.10. Assert variables not exist`);
- persesDashboardsPage.assertVariableNotExist('interval');
- persesDashboardsPage.assertVariableNotExist('job');
- persesDashboardsPage.assertVariableNotExist('instance');
-
- cy.log(`3.11. Delete Panel`);
- persesDashboardsPanel.deletePanel('Up');
- persesDashboardsPanel.clickDeletePanelButton();
-
- cy.log(`3.12. Delete Panel Group`);
- persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
- persesDashboardsPanelGroup.clickDeletePanelGroupButton();
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.get('h2').contains(persesDashboardsEmptyDashboard.TITLE).scrollIntoView().should('be.visible');
- cy.get('p').contains(persesDashboardsEmptyDashboard.DESCRIPTION).scrollIntoView().should('be.visible');
-
- });
-
it(`4.${perspective.name} perspective - Kebab icon - Enabled / Disabled`, () => {
cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
listPersesDashboardsPage.shouldBeLoaded();
@@ -237,13 +297,11 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertKebabIconOptions();
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clearAllFilters();
-
});
-
it(`5.${perspective.name} perspective - Rename to a new dashboard name`, () => {
let renamedDashboardName = 'Renamed dashboard ';
- let randomSuffix = Math.random().toString(5);
+ const randomSuffix = Math.random().toString(5);
renamedDashboardName += randomSuffix;
cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -255,7 +313,7 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
cy.log(`5.3. Filter by Name`);
listPersesDashboardsPage.filter.byName(dashboardName);
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`5.4. Click on the Kebab icon - Rename`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickRenameDashboardOption();
@@ -284,7 +342,7 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
listPersesDashboardsPage.renameDashboardRenameButton();
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');
-
+
cy.log(`5.7. Filter by Name`);
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
@@ -294,12 +352,11 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
persesDashboardsPage.shouldBeLoaded1();
persesDashboardsPage.shouldBeLoadedAfterRename(dashboardName);
persesDashboardsPage.backToListPersesDashboardsPage();
-
});
it(`6.${perspective.name} perspective - Duplicate and verify project dropdown and Delete`, () => {
let duplicatedDashboardName = 'Duplicate dashboard ';
- let randomSuffix = Math.random().toString(5);
+ const randomSuffix = Math.random().toString(5);
duplicatedDashboardName += randomSuffix;
cy.log(`6.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -311,18 +368,20 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
cy.log(`6.3. Filter by Name`);
listPersesDashboardsPage.filter.byName(dashboardName);
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`6.4. Click on the Kebab icon - Duplicate`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDuplicateOption();
cy.log(`6.5. Assert project dropdown options`);
- listPersesDashboardsPage.assertDuplicateProjectDropdownExists('empty-namespace3');
- listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists(
+ 'openshift-cluster-observability-operator',
+ );
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('openshift-monitoring');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('observ-test');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('perses-dev');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('empty-namespace4');
+ listPersesDashboardsPage.assertDuplicateProjectDropdownExists('empty-namespace3');
cy.log(`6.6. Enter new dashboard name`);
listPersesDashboardsPage.duplicateDashboardEnterName(duplicatedDashboardName);
@@ -340,7 +399,6 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDeleteOption();
listPersesDashboardsPage.deleteDashboardDeleteButton();
- persesDashboardsPage.closeSuccessAlert();
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');
@@ -351,7 +409,6 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
listPersesDashboardsPage.countDashboards('0');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
});
it(`7.${perspective.name} perspective - Delete dashboard`, () => {
@@ -389,18 +446,22 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertImportButtonIsEnabled();
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
cy.log(`8.4. Verify project dropdown options`);
- persesImportDashboardsPage.assertProjectDropdown('empty-namespace3');
- persesImportDashboardsPage.assertProjectNotExistsInDropdown('openshift-cluster-observability-operator');
+ persesImportDashboardsPage.assertProjectNotExistsInDropdown(
+ 'openshift-cluster-observability-operator',
+ );
persesImportDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('openshift-monitoring');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesImportDashboardsPage.assertProjectDropdown('empty-namespace3');
persesImportDashboardsPage.clickCancelButton();
-
+
cy.log(`8.5 change namespace to openshift-monitoring`);
cy.changeNamespace('openshift-monitoring');
@@ -425,7 +486,9 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertImportButtonIsEnabled();
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
cy.log(`9.4. Select a project`);
@@ -433,11 +496,13 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
cy.log(`9.5. Import dashboard`);
persesImportDashboardsPage.clickImportFileButton();
- persesDashboardsPage.closeSuccessAlert();
cy.log(`9.6. Assert dashboard is imported`);
persesDashboardsPage.shouldBeLoadedEditionMode('Testing Perses dashboard - YAML');
- cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown).contains(persesDashboardsTimeRange.LAST_30_MINUTES).scrollIntoView().should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown)
+ .contains(persesDashboardsTimeRange.LAST_30_MINUTES)
+ .scrollIntoView()
+ .should('be.visible');
cy.log(`9.7. Back to list of dashboards`);
persesDashboardsPage.backToListPersesDashboardsPage();
@@ -451,7 +516,9 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
cy.log(`9.9. Import the same dashboard - Duplicated error`);
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.yaml');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.yaml',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
persesImportDashboardsPage.selectProject('empty-namespace3');
persesImportDashboardsPage.clickImportFileButton();
@@ -475,6 +542,4 @@ export function testCOORBACPersesTestsDevUser3(perspective: PerspectiveConfig) {
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
});
-
-
}
diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts b/web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts
index db76cafc9..b5e1690ab 100644
--- a/web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts
+++ b/web/cypress/support/perses/99.coo_rbac_perses_user4.cy.ts
@@ -1,4 +1,3 @@
-import { persesImportDashboardsPage } from '../../views/perses-dashboards-import-dashboard';
import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
export interface PerspectiveConfig {
@@ -12,39 +11,42 @@ export function runCOORBACPersesTestsDevUser4(perspective: PerspectiveConfig) {
/**
* User4 has access to:
- * - empty-namespace4 namespace as persesdashboard-viewer-role and persesdatasource-viewer-role
- * - no access to openshift-cluster-observability-operator, observ-test, perses-dev namespaces, empty-namespace3 namespaces
- * - openshift-monitoring namespace as view role
+ * - empty-namespace4: persesdashboard-viewer-role, persesdatasource-viewer-role
+ * - no access to openshift-cluster-observability-operator, observ-test, perses-dev,
+ * empty-namespace3
+ * - openshift-monitoring: view role
*/
export function testCOORBACPersesTestsDevUser4(perspective: PerspectiveConfig) {
+ it(
+ `1.${perspective.name} perspective - List Dashboards - Namespace validation and ` +
+ `Dashboard search`,
+ () => {
+ cy.log(`1.1. Namespace validation`);
+ listPersesDashboardsPage.noDashboardsFoundState();
+ cy.assertNamespace('All Projects', true);
+ cy.assertNamespace('openshift-cluster-observability-operator', false);
+ cy.assertNamespace('observ-test', false);
+ cy.assertNamespace('perses-dev', false);
+ cy.assertNamespace('empty-namespace3', false);
+ cy.assertNamespace('empty-namespace4', true);
+ cy.assertNamespace('openshift-monitoring', true);
- it(`1.${perspective.name} perspective - List Dashboards - Namespace validation and Dashboard search`, () => {
- cy.log(`1.1. Namespace validation`);
- listPersesDashboardsPage.noDashboardsFoundState();
- cy.assertNamespace('All Projects', true);
- cy.assertNamespace('openshift-cluster-observability-operator', false);
- cy.assertNamespace('observ-test', false);
- cy.assertNamespace('perses-dev', false);
- cy.assertNamespace('empty-namespace3', false);
- cy.assertNamespace('empty-namespace4', true);
- cy.assertNamespace('openshift-monitoring', true);
-
- cy.log(`1.2. All Projects validation - Dashboard search - empty state`);
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsDisabled();
+ cy.log(`1.2. All Projects validation - Dashboard search - empty state`);
+ cy.changeNamespace('All Projects');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsDisabled();
- cy.log(`1.3. empty-namespace4 validation - Dashboard search - empty state`);
- cy.changeNamespace('empty-namespace4');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsDisabled();
+ cy.log(`1.3. empty-namespace4 validation - Dashboard search - empty state`);
+ cy.changeNamespace('empty-namespace4');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsDisabled();
- cy.log(`1.4. openshift-monitoring validation - Dashboard search - empty state`);
- cy.changeNamespace('openshift-monitoring');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsDisabled();
-
- });
+ cy.log(`1.4. openshift-monitoring validation - Dashboard search - empty state`);
+ cy.changeNamespace('openshift-monitoring');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsDisabled();
+ },
+ );
it(`2.${perspective.name} perspective - Import button validation - Disabled`, () => {
cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -52,7 +54,7 @@ export function testCOORBACPersesTestsDevUser4(perspective: PerspectiveConfig) {
cy.log(`2.2 change namespace to empty-namespace4`);
cy.changeNamespace('empty-namespace4');
-
+
cy.log(`2.3. Verify Import button is disabled`);
listPersesDashboardsPage.assertImportButtonIsDisabled();
@@ -60,13 +62,10 @@ export function testCOORBACPersesTestsDevUser4(perspective: PerspectiveConfig) {
cy.changeNamespace('openshift-monitoring');
cy.log(`2.5. Verify Import button is disabled`);
listPersesDashboardsPage.assertImportButtonIsDisabled();
-
+
cy.log(`2.6. Change namespace to All Projects`);
cy.changeNamespace('All Projects');
cy.log(`2.7. Verify Import button is disabled`);
listPersesDashboardsPage.assertImportButtonIsDisabled();
-
});
-
-
-}
\ No newline at end of file
+}
diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user5.cy.ts b/web/cypress/support/perses/99.coo_rbac_perses_user5.cy.ts
index 3ef66916a..85b2fde7b 100644
--- a/web/cypress/support/perses/99.coo_rbac_perses_user5.cy.ts
+++ b/web/cypress/support/perses/99.coo_rbac_perses_user5.cy.ts
@@ -1,7 +1,11 @@
import { persesDashboardsPage } from '../../views/perses-dashboards';
import { listPersesDashboardsPage } from '../../views/perses-dashboards-list-dashboards';
import { persesCreateDashboardsPage } from '../../views/perses-dashboards-create-dashboard';
-import { persesDashboardsAddListVariableSource, persesDashboardSampleQueries, persesDashboardsEmptyDashboard } from '../../fixtures/perses/constants';
+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';
@@ -19,147 +23,200 @@ export function runCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
}
let dashboardName = 'Testing Dashboard - UP ';
-let randomSuffix = Math.random().toString(5);
+const randomSuffix = Math.random().toString(5);
dashboardName += randomSuffix;
/**
* User5 has access to:
- * - openshift-monitoring namespace as admin
- * - no access to openshift-cluster-observability-operator, observ-test, perses-dev namespaces, empty-namespace3 namespaces, empty-namespace4 namespaces
+ * - openshift-monitoring: admin
+ * - no access to openshift-cluster-observability-operator, observ-test, perses-dev,
+ * empty-namespace3, empty-namespace4
*/
export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
+ it(
+ `1.${perspective.name} perspective - List Dashboards - Namespace validation and ` +
+ `Dashboard search`,
+ () => {
+ cy.log(`1.1. Namespace validation`);
+ listPersesDashboardsPage.noDashboardsFoundState();
+ cy.assertNamespace('All Projects', true);
+ cy.assertNamespace('openshift-monitoring', true);
+ cy.assertNamespace('openshift-cluster-observability-operator', false);
+ cy.assertNamespace('observ-test', false);
+ cy.assertNamespace('perses-dev', false);
+ cy.assertNamespace('empty-namespace3', false);
+ cy.assertNamespace('empty-namespace4', false);
+
+ cy.log(`1.2. All Projects validation - Dashboard search - empty state`);
+ cy.changeNamespace('All Projects');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsEnabled();
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown(
+ 'openshift-cluster-observability-operator',
+ );
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace3');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesCreateDashboardsPage.assertProjectDropdown('openshift-monitoring');
+ persesCreateDashboardsPage.createDashboardDialogCancelButton();
+
+ cy.log(`1.3. openshift-monitoring validation - Dashboard search - empty state`);
+ cy.changeNamespace('openshift-monitoring');
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.assertCreateButtonIsEnabled();
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown(
+ 'openshift-cluster-observability-operator',
+ );
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace3');
+ persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesCreateDashboardsPage.assertProjectDropdown('openshift-monitoring');
+ persesCreateDashboardsPage.createDashboardDialogCancelButton();
+ },
+ );
+
+ it(
+ `2.${perspective.name} perspective - Create Dashboard with panel groups, panels ` +
+ `and variables`,
+ () => {
+ cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
+ listPersesDashboardsPage.noDashboardsFoundState();
+
+ cy.changeNamespace('openshift-monitoring');
+
+ cy.log(`2.2. Click on Create button`);
+ listPersesDashboardsPage.clickCreateButton();
+ persesCreateDashboardsPage.createDashboardShouldBeLoaded();
+
+ cy.log(`2.3. Create Dashboard`);
+ persesCreateDashboardsPage.selectProject('openshift-monitoring');
+ persesCreateDashboardsPage.enterDashboardName(dashboardName);
+ persesCreateDashboardsPage.createDashboardDialogCreateButton();
+ persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
+ persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
+
+ cy.log(`2.4. Add Variable`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'interval',
+ false,
+ false,
+ '',
+ '',
+ '',
+ undefined,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
+ persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'job',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Add Variable');
+ persesDashboardsEditVariables.addListVariable(
+ 'instance',
+ false,
+ false,
+ '',
+ '',
+ '',
+ persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE,
+ undefined,
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName(
+ 'instance',
+ );
+ persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(
+ persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR,
+ );
+ persesDashboardsEditVariables.clickButton('Add');
+
+ persesDashboardsEditVariables.clickButton('Apply');
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`2.5. Add Panel Group`);
+ persesDashboardsPage.clickEditButton();
+ persesDashboardsPage.clickEditActionButton('AddGroup');
+ persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
+
+ cy.log(`2.6. Add Panel`);
+ persesDashboardsPage.clickEditActionButton('AddPanel');
+ persesDashboardsPanel.addPanelShouldBeLoaded();
+ persesDashboardsPanel.addPanel(
+ 'Up',
+ 'Panel Group Up',
+ persesDashboardsAddListPanelType.TIME_SERIES_CHART,
+ 'This is a line chart test',
+ 'up',
+ );
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.log(`2.7. Back and check panel`);
+ persesDashboardsPage.backToListPersesDashboardsPage();
+ cy.changeNamespace('openshift-monitoring');
+ listPersesDashboardsPage.filter.byName(dashboardName);
+ listPersesDashboardsPage.clickDashboard(dashboardName);
+ persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
+ persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
+ persesDashboardsPage.assertVariableBeVisible('interval');
+ persesDashboardsPage.assertVariableBeVisible('job');
+ persesDashboardsPage.assertVariableBeVisible('instance');
+
+ cy.log(`2.8. Click on Edit button`);
+ persesDashboardsPage.clickEditButton();
+
+ cy.log(`2.9. Click on Edit Variables button and Delete all variables`);
+ persesDashboardsPage.clickEditActionButton('EditVariables');
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickDeleteVariableButton(0);
+ persesDashboardsEditVariables.clickButton('Apply');
+
+ cy.log(`2.10. Assert variables not exist`);
+ persesDashboardsPage.assertVariableNotExist('interval');
+ persesDashboardsPage.assertVariableNotExist('job');
+ persesDashboardsPage.assertVariableNotExist('instance');
+
+ cy.log(`2.11. Delete Panel`);
+ persesDashboardsPanel.deletePanel('Up');
+ persesDashboardsPanel.clickDeletePanelButton();
+
+ cy.log(`2.12. Delete Panel Group`);
+ persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
+ persesDashboardsPanelGroup.clickDeletePanelGroupButton();
+ persesDashboardsPage.clickEditActionButton('Save');
+
+ cy.get('h2')
+ .contains(persesDashboardsEmptyDashboard.TITLE)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.get('p')
+ .contains(persesDashboardsEmptyDashboard.DESCRIPTION)
+ .scrollIntoView()
+ .should('be.visible');
+ },
+ );
- it(`1.${perspective.name} perspective - List Dashboards - Namespace validation and Dashboard search`, () => {
- cy.log(`1.1. Namespace validation`);
- listPersesDashboardsPage.noDashboardsFoundState();
- cy.assertNamespace('All Projects', true);
- cy.assertNamespace('openshift-monitoring', true);
- cy.assertNamespace('openshift-cluster-observability-operator', false);
- cy.assertNamespace('observ-test', false);
- cy.assertNamespace('perses-dev', false);
- cy.assertNamespace('empty-namespace3', false);
- cy.assertNamespace('empty-namespace4', false);
-
- cy.log(`1.2. All Projects validation - Dashboard search - empty state`);
- cy.changeNamespace('All Projects');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsEnabled();
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
- persesCreateDashboardsPage.assertProjectDropdown('openshift-monitoring');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace3');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
- persesCreateDashboardsPage.createDashboardDialogCancelButton();
-
- cy.log(`1.3. openshift-monitoring validation - Dashboard search - empty state`);
- cy.changeNamespace('openshift-monitoring');
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.assertCreateButtonIsEnabled();
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
- persesCreateDashboardsPage.assertProjectDropdown('openshift-monitoring');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('openshift-cluster-observability-operator');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace3');
- persesCreateDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
- persesCreateDashboardsPage.createDashboardDialogCancelButton();
-
- });
-
- it(`2.${perspective.name} perspective - Create Dashboard with panel groups, panels and variables`, () => {
- cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
- listPersesDashboardsPage.noDashboardsFoundState();
-
- cy.changeNamespace('openshift-monitoring');
-
- cy.log(`2.2. Click on Create button`);
- listPersesDashboardsPage.clickCreateButton();
- persesCreateDashboardsPage.createDashboardShouldBeLoaded();
-
- cy.log(`2.3. Create Dashboard`);
- persesCreateDashboardsPage.selectProject('openshift-monitoring');
- persesCreateDashboardsPage.enterDashboardName(dashboardName);
- persesCreateDashboardsPage.createDashboardDialogCreateButton();
- persesDashboardsPage.shouldBeLoadedEditionMode(dashboardName);
- persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard();
-
- cy.log(`2.4. Add Variable`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('interval', false, false, '', '', '', undefined, undefined);
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('1m');
- persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue('5m');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('job', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('job');
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Add Variable');
- persesDashboardsEditVariables.addListVariable('instance', false, false, '', '', '', persesDashboardsAddListVariableSource.PROMETHEUS_LABEL_VARIABLE, undefined);
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_enterLabelName('instance');
- persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector(persesDashboardSampleQueries.CPU_LINE_MULTI_SERIES_SERIES_SELECTOR);
- persesDashboardsEditVariables.clickButton('Add');
-
- persesDashboardsEditVariables.clickButton('Apply');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`2.5. Add Panel Group`);
- persesDashboardsPage.clickEditButton();
- persesDashboardsPage.clickEditActionButton('AddGroup');
- persesDashboardsPanelGroup.addPanelGroup('Panel Group Up', 'Open', '');
-
- cy.log(`2.6. Add Panel`);
- persesDashboardsPage.clickEditActionButton('AddPanel');
- persesDashboardsPanel.addPanelShouldBeLoaded();
- persesDashboardsPanel.addPanel('Up', 'Panel Group Up', persesDashboardsAddListPanelType.TIME_SERIES_CHART, 'This is a line chart test', 'up');
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.log(`2.7. Back and check panel`);
- persesDashboardsPage.backToListPersesDashboardsPage();
- cy.changeNamespace('openshift-monitoring');
- listPersesDashboardsPage.filter.byName(dashboardName);
- listPersesDashboardsPage.clickDashboard(dashboardName);
- persesDashboardsPage.panelGroupHeaderAssertion('Panel Group Up', 'Open');
- persesDashboardsPage.assertPanel('Up', 'Panel Group Up', 'Open');
- persesDashboardsPage.assertVariableBeVisible('interval');
- persesDashboardsPage.assertVariableBeVisible('job');
- persesDashboardsPage.assertVariableBeVisible('instance');
-
- cy.log(`2.8. Click on Edit button`);
- persesDashboardsPage.clickEditButton();
-
- cy.log(`2.9. Click on Edit Variables button and Delete all variables`);
- persesDashboardsPage.clickEditActionButton('EditVariables');
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickDeleteVariableButton(0);
- persesDashboardsEditVariables.clickButton('Apply');
-
- cy.log(`2.10. Assert variables not exist`);
- persesDashboardsPage.assertVariableNotExist('interval');
- persesDashboardsPage.assertVariableNotExist('job');
- persesDashboardsPage.assertVariableNotExist('instance');
-
- cy.log(`2.11. Delete Panel`);
- persesDashboardsPanel.deletePanel('Up');
- persesDashboardsPanel.clickDeletePanelButton();
-
- cy.log(`2.12. Delete Panel Group`);
- persesDashboardsPanelGroup.clickPanelGroupAction('Panel Group Up', 'delete');
- persesDashboardsPanelGroup.clickDeletePanelGroupButton();
- persesDashboardsPage.clickEditActionButton('Save');
-
- cy.get('h2').contains(persesDashboardsEmptyDashboard.TITLE).scrollIntoView().should('be.visible');
- cy.get('p').contains(persesDashboardsEmptyDashboard.DESCRIPTION).scrollIntoView().should('be.visible');
-
- });
-
it(`3.${perspective.name} perspective - Kebab icon - Enabled / Disabled`, () => {
cy.log(`3.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
listPersesDashboardsPage.shouldBeLoaded();
@@ -185,13 +242,11 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertKebabIconOptions();
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clearAllFilters();
-
});
-
it(`4.${perspective.name} perspective - Rename to a new dashboard name`, () => {
let renamedDashboardName = 'Renamed dashboard ';
- let randomSuffix = Math.random().toString(5);
+ const randomSuffix = Math.random().toString(5);
renamedDashboardName += randomSuffix;
cy.log(`4.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -203,7 +258,7 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
cy.log(`4.3. Filter by Name`);
listPersesDashboardsPage.filter.byName(dashboardName);
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`4.4. Click on the Kebab icon - Rename`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickRenameDashboardOption();
@@ -236,7 +291,7 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
cy.wait(5000);
-
+
cy.log(`4.7. Filter by Name`);
listPersesDashboardsPage.filter.byName(dashboardName);
listPersesDashboardsPage.countDashboards('1');
@@ -244,12 +299,11 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
persesDashboardsPage.shouldBeLoaded1();
persesDashboardsPage.shouldBeLoadedAfterRename(dashboardName);
persesDashboardsPage.backToListPersesDashboardsPage();
-
});
it(`5.${perspective.name} perspective - Duplicate and verify project dropdown and Delete`, () => {
let duplicatedDashboardName = 'Duplicate dashboard ';
- let randomSuffix = Math.random().toString(5);
+ const randomSuffix = Math.random().toString(5);
duplicatedDashboardName += randomSuffix;
cy.log(`5.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -261,18 +315,20 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
cy.log(`5.3. Filter by Name`);
listPersesDashboardsPage.filter.byName(dashboardName);
listPersesDashboardsPage.countDashboards('1');
-
+
cy.log(`5.4. Click on the Kebab icon - Duplicate`);
listPersesDashboardsPage.clickKebabIcon();
listPersesDashboardsPage.clickDuplicateOption();
cy.log(`5.5. Assert project dropdown options`);
- listPersesDashboardsPage.assertDuplicateProjectDropdownExists('openshift-monitoring');
- listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('openshift-cluster-observability-operator');
+ listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists(
+ 'openshift-cluster-observability-operator',
+ );
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('empty-namespace3');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('observ-test');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('perses-dev');
listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists('empty-namespace4');
+ listPersesDashboardsPage.assertDuplicateProjectDropdownExists('openshift-monitoring');
cy.log(`5.6. Enter new dashboard name`);
listPersesDashboardsPage.duplicateDashboardEnterName(duplicatedDashboardName);
@@ -300,7 +356,6 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
listPersesDashboardsPage.countDashboards('0');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
-
});
it(`6.${perspective.name} perspective - Delete dashboard`, () => {
@@ -324,7 +379,6 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
listPersesDashboardsPage.filter.byName('Testing Dashboard - UP');
listPersesDashboardsPage.countDashboards('0');
listPersesDashboardsPage.clearAllFilters();
-
});
it(`7.${perspective.name} perspective - Import button validation - Enabled / Disabled`, () => {
@@ -338,18 +392,22 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertImportButtonIsEnabled();
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
-
+
cy.log(`7.4. Verify project dropdown options`);
- persesImportDashboardsPage.assertProjectDropdown('openshift-monitoring');
- persesImportDashboardsPage.assertProjectNotExistsInDropdown('openshift-cluster-observability-operator');
+ persesImportDashboardsPage.assertProjectNotExistsInDropdown(
+ 'openshift-cluster-observability-operator',
+ );
persesImportDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace3');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('observ-test');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('perses-dev');
persesImportDashboardsPage.assertProjectNotExistsInDropdown('empty-namespace4');
+ persesImportDashboardsPage.assertProjectDropdown('openshift-monitoring');
persesImportDashboardsPage.clickCancelButton();
-
+
cy.log(`7.5. Change namespace to All Projects`);
cy.changeNamespace('All Projects');
@@ -368,7 +426,9 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
listPersesDashboardsPage.assertImportButtonIsEnabled();
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
cy.log(`8.4. Select a project`);
@@ -376,7 +436,6 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
cy.log(`8.5. Import dashboard`);
persesImportDashboardsPage.clickImportFileButton();
- persesDashboardsPage.closeSuccessAlert();
cy.log(`8.6. Assert dashboard is imported`);
persesDashboardsPage.shouldBeLoadedEditionMode('Testing Perses dashboard - JSON');
@@ -389,11 +448,13 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
listPersesDashboardsPage.countDashboards('1');
listPersesDashboardsPage.clearAllFilters();
cy.wait(2000);
-
+
cy.log(`8.9. Import the same dashboard - Duplicated error`);
listPersesDashboardsPage.clickImportButton();
persesImportDashboardsPage.importDashboardShouldBeLoaded();
- persesImportDashboardsPage.uploadFile('./cypress/fixtures/coo/coo141_perses/import/testing-perses-dashboard.json');
+ persesImportDashboardsPage.uploadFile(
+ './cypress/fixtures/coo/coo140_perses/import/testing-perses-dashboard.json',
+ );
persesImportDashboardsPage.assertPersesDashboardDetected();
persesImportDashboardsPage.selectProject('openshift-monitoring');
persesImportDashboardsPage.clickImportFileButton();
@@ -419,6 +480,4 @@ export function testCOORBACPersesTestsDevUser5(perspective: PerspectiveConfig) {
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
cy.wait(2000);
});
-
-
}
diff --git a/web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts b/web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts
index b3f5eabc6..fc4689934 100644
--- a/web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts
+++ b/web/cypress/support/perses/99.coo_rbac_perses_user6.cy.ts
@@ -14,15 +14,18 @@ export function runCOORBACPersesTestsDevUser6(perspective: PerspectiveConfig) {
* - no access to any namespaces
*/
export function testCOORBACPersesTestsDevUser6(perspective: PerspectiveConfig) {
-
- it(`1.${perspective.name} perspective - List Dashboards - Namespace validation and Dashboard search`, () => {
- cy.log(`1.1. Namespace validation`);
- listPersesDashboardsPage.noDashboardsFoundState();
- listPersesDashboardsPage.projectDropdownNotExists();
-
- cy.log(`1.2. Create button validation`);
- listPersesDashboardsPage.assertCreateButtonIsDisabled();
- });
+ it(
+ `1.${perspective.name} perspective - List Dashboards - Namespace validation and ` +
+ `Dashboard search`,
+ () => {
+ cy.log(`1.1. Namespace validation`);
+ listPersesDashboardsPage.noDashboardsFoundState();
+ listPersesDashboardsPage.projectDropdownNotExists();
+
+ cy.log(`1.2. Create button validation`);
+ listPersesDashboardsPage.assertCreateButtonIsDisabled();
+ },
+ );
it(`2.${perspective.name} perspective - Import button validation - Disabled`, () => {
cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses)`);
@@ -31,6 +34,4 @@ export function testCOORBACPersesTestsDevUser6(perspective: PerspectiveConfig) {
cy.log(`2.2. Verify Import button is disabled`);
listPersesDashboardsPage.assertImportButtonIsDisabled();
});
-
-
-}
\ No newline at end of file
+}
diff --git a/web/cypress/support/selectors.ts b/web/cypress/support/selectors.ts
index 7d1f18bdb..47d9e8176 100644
--- a/web/cypress/support/selectors.ts
+++ b/web/cypress/support/selectors.ts
@@ -6,7 +6,9 @@ import Shadow = Cypress.Shadow;
export {};
declare global {
+ // eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable {
byTestID(
selector: string,
@@ -20,8 +22,14 @@ declare global {
): Chainable>;
byDataID(selector: string): Chainable>;
bySemanticElement(element: string, text?: string): Chainable>;
- byAriaLabel(label: string, options?: Partial): Chainable>;
- byPFRole(role: string, options?: Partial): Chainable>;
+ byAriaLabel(
+ label: string,
+ options?: Partial,
+ ): Chainable>;
+ byPFRole(
+ role: string,
+ options?: Partial,
+ ): Chainable>;
byDataTestID(
selector: string,
options?: Partial,
@@ -31,7 +39,9 @@ declare global {
}
// any command added below, must be added to global Cypress interface above
-Cypress.Commands.add('byOUIAID', (selector: string) => cy.get(`[data-ouia-component-id^="${selector}"]`));
+Cypress.Commands.add('byOUIAID', (selector: string) =>
+ cy.get(`[data-ouia-component-id^="${selector}"]`),
+);
Cypress.Commands.add('byClass', (selector: string) => cy.get(`[class="${selector}"]`));
@@ -43,9 +53,12 @@ Cypress.Commands.add(
);
//MaterialUI data-testid selectors
-Cypress.Commands.add('byDataTestID', (selector: string, options?: Partial) => {
- cy.get(`[data-testid="${selector}"]`, options);
-});
+Cypress.Commands.add(
+ 'byDataTestID',
+ (selector: string, options?: Partial) => {
+ cy.get(`[data-testid="${selector}"]`, options);
+ },
+);
// deprecated! new IDs should use 'data-test', ie. `cy.byTestID(...)`
Cypress.Commands.add('byLegacyTestID', (selector: string) =>
@@ -65,12 +78,12 @@ Cypress.Commands.add(
'byAriaLabel',
(label: string, options?: Partial) => {
return cy.get(`[aria-label="${label}"]`, options);
- }
+ },
);
Cypress.Commands.add(
'byPFRole',
(role: string, options?: Partial) => {
return cy.get(`[role="${role}"]`, options);
- }
-);
\ No newline at end of file
+ },
+);
diff --git a/web/cypress/support/test-tags.d.ts b/web/cypress/support/test-tags.d.ts
index 4b10efaa5..547a80825 100644
--- a/web/cypress/support/test-tags.d.ts
+++ b/web/cypress/support/test-tags.d.ts
@@ -1,6 +1,13 @@
type BasicTag = '@smoke' | '@demo' | '@flaky' | '@xfail' | '@slow';
-type HighLevelComponentTag = '@monitoring' | '@incidents' | '@coo' | '@virtualization' | '@alerts' | '@metrics' | '@dashboards';
+type HighLevelComponentTag =
+ | '@monitoring'
+ | '@incidents'
+ | '@coo'
+ | '@virtualization'
+ | '@alerts'
+ | '@metrics'
+ | '@dashboards';
type SpecificFeatureTag = `@${string}-${string}`;
@@ -9,6 +16,7 @@ type JiraTag = `@JIRA-${string}`;
type AllowedTag = BasicTag | HighLevelComponentTag | SpecificFeatureTag | JiraTag;
type TestTags = AllowedTag | AllowedTag[];
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
declare namespace Cypress {
interface SuiteConfigOverrides {
tags?: TestTags;
@@ -19,4 +27,3 @@ declare namespace Cypress {
}
export {};
-
diff --git a/web/cypress/views/acm-alerting-page.ts b/web/cypress/views/acm-alerting-page.ts
index 1c8ee8a86..8b3fc5be3 100644
--- a/web/cypress/views/acm-alerting-page.ts
+++ b/web/cypress/views/acm-alerting-page.ts
@@ -1,10 +1,8 @@
-import { DataTestIDs, Classes } from "../../src/components/data-test";
-
export const acmAlertingPage = {
shouldBeLoaded: () => {
cy.log('acmAlertingPage.shouldBeLoaded');
cy.get('body', { timeout: 60000 }).should('contain.text', 'Alerting');
- cy.get('section.pf-v6-c-page__main-section h1').should('have.text', 'Alerting')
+ cy.get('section.pf-v6-c-page__main-section h1').should('have.text', 'Alerting');
// To Do:
// other page check could be list here
},
diff --git a/web/cypress/views/alerting-rule-details-page.ts b/web/cypress/views/alerting-rule-details-page.ts
index 90462502b..85aa2ee46 100644
--- a/web/cypress/views/alerting-rule-details-page.ts
+++ b/web/cypress/views/alerting-rule-details-page.ts
@@ -1,67 +1,72 @@
-import { commonPages } from "./common";
-import { detailsPage } from "./details-page";
-import { DataTestIDs, Classes } from '../../src/components/data-test';
+import { commonPages } from './common';
+import { detailsPage } from './details-page';
+import { DataTestIDs } from '../../src/components/data-test';
export const alertingRuleDetailsPage = {
assertAlertingRuleDetailsPage: (title: string) => {
- cy.log('alertingRuleDetailsPage.assertAlertingRuleDetailsPage');
- commonPages.titleShouldHaveText(title);
- cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).contains('AR').should('be.visible');
- detailsPage.sectionHeaderShouldExist('Alerting rule details');
- detailsPage.sectionHeaderShouldExist('Active alerts');
- cy.byTestID(DataTestIDs.Expression).should('be.visible');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraph).scrollIntoView().should('be.visible');
- cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraphTimespanDropdown).should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should('be.visible');
- cy.byTestID(DataTestIDs.MetricResetZoomButton).should('be.visible');
- },
-
- clickOnActiveAlerts: (desc: string) => {
- cy.log('alertingRuleDetailsPage.clickOnActiveAlerts');
- cy.byTestID(DataTestIDs.AlertResourceLink)
- .first()
- .should('have.text', desc)
- .click();
- },
-
- clickAlertingRulesBreadcrumb:() => {
- cy.log('alertingRuleDetailsPage.clickAlertingRulesBreadcrumb');
- try {
- cy.byTestID(DataTestIDs.Breadcrumb).contains('Alerting rules').click();
- } catch (error) {
- cy.log(`${error.message}`);
- throw error;
- }
- },
+ cy.log('alertingRuleDetailsPage.assertAlertingRuleDetailsPage');
+ commonPages.titleShouldHaveText(title);
+ cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).contains('AR').should('be.visible');
+ detailsPage.sectionHeaderShouldExist('Alerting rule details');
+ detailsPage.sectionHeaderShouldExist('Active alerts');
+ cy.byTestID(DataTestIDs.Expression).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraph).scrollIntoView().should('be.visible');
+ cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphTimespanDropdown).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricResetZoomButton).should('be.visible');
+ },
- assertNoKebab: () => {
- cy.log('alertingRuleDetailsPage.assertNoKebab');
- try {
- cy.byTestID(DataTestIDs.AlertResourceLink).scrollIntoView();
- cy.byTestID(DataTestIDs.KebabDropdownButton).should('not.exist');
- }catch (error) {
- cy.log(`${error.message}`);
- throw error;
- }
- },
+ clickOnActiveAlerts: (desc: string) => {
+ cy.log('alertingRuleDetailsPage.clickOnActiveAlerts');
+ cy.byTestID(DataTestIDs.AlertResourceLink).first().should('have.text', desc).click();
+ },
- clickOnKebabSilenceAlert:()=>{
- cy.log('alertingRuleDetailsPage.clickOnKebabSilenceAlert');
- cy.byTestID(DataTestIDs.KebabDropdownButton).scrollIntoView().should('be.visible').click();
- cy.byPFRole('menuitem').contains('Silence alert').should('be.visible').click();
- },
+ clickAlertingRulesBreadcrumb: () => {
+ cy.log('alertingRuleDetailsPage.clickAlertingRulesBreadcrumb');
+ try {
+ cy.byTestID(DataTestIDs.Breadcrumb).contains('Alerting rules').click();
+ } catch (error) {
+ cy.log(`${error.message}`);
+ throw error;
+ }
+ },
- clickHideGraphButton:()=>{
- cy.log('alertingRuleDetailsPage.clickHideGraphButton');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).scrollIntoView().contains('Hide graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
- },
+ assertNoKebab: () => {
+ cy.log('alertingRuleDetailsPage.assertNoKebab');
+ try {
+ cy.byTestID(DataTestIDs.AlertResourceLink).scrollIntoView();
+ cy.byTestID(DataTestIDs.KebabDropdownButton).should('not.exist');
+ } catch (error) {
+ cy.log(`${error.message}`);
+ throw error;
+ }
+ },
- clickShowGraphButton:()=>{
- cy.log('alertingRuleDetailsPage.clickShowGraphButton');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).scrollIntoView().contains('Show graph').should('be.visible').click();
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
- },
+ clickOnKebabSilenceAlert: () => {
+ cy.log('alertingRuleDetailsPage.clickOnKebabSilenceAlert');
+ cy.byTestID(DataTestIDs.KebabDropdownButton).scrollIntoView().should('be.visible').click();
+ cy.byPFRole('menuitem').contains('Silence alert').should('be.visible').click();
+ },
+
+ clickHideGraphButton: () => {
+ cy.log('alertingRuleDetailsPage.clickHideGraphButton');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .scrollIntoView()
+ .contains('Hide graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+ },
+
+ clickShowGraphButton: () => {
+ cy.log('alertingRuleDetailsPage.clickShowGraphButton');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .scrollIntoView()
+ .contains('Show graph')
+ .should('be.visible')
+ .click();
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ },
};
diff --git a/web/cypress/views/alerting-rule-list-page.ts b/web/cypress/views/alerting-rule-list-page.ts
index 807956c41..01a16f4b4 100644
--- a/web/cypress/views/alerting-rule-list-page.ts
+++ b/web/cypress/views/alerting-rule-list-page.ts
@@ -1,5 +1,5 @@
-import { DataTestIDs, Classes } from "../../src/components/data-test";
-import { listPage } from "./list-page";
+import { DataTestIDs, Classes } from '../../src/components/data-test';
+import { listPage } from './list-page';
export const alertingRuleListPage = {
shouldBeLoaded: () => {
@@ -14,9 +14,9 @@ export const alertingRuleListPage = {
filter: {
/**
- *
- * @param tab alerts-tab, silences, alerting-rules
- */
+ *
+ * @param tab alerts-tab, silences, alerting-rules
+ */
assertNoClearAllFilters: () => {
cy.log('alertingRuleListPage.filter.assertNoclearAllFilters');
try {
@@ -26,13 +26,15 @@ export const alertingRuleListPage = {
throw error;
}
},
-
},
clickAlertingRule: (alertRule: string) => {
cy.log('alertingRuleListPage.clickAlertingRule');
try {
- cy.byTestID(DataTestIDs.AlertingRuleResourceLink).contains(alertRule).should('be.visible').click();
+ cy.byTestID(DataTestIDs.AlertingRuleResourceLink)
+ .contains(alertRule)
+ .should('be.visible')
+ .click();
} catch (error) {
cy.log(`${error.message}`);
throw error;
@@ -59,5 +61,4 @@ export const alertingRuleListPage = {
cy.bySemanticElement('button', 'Clear all filters').should('not.exist');
cy.byOUIAID(DataTestIDs.Table).should('not.exist');
},
-
};
diff --git a/web/cypress/views/common.ts b/web/cypress/views/common.ts
index 80e21a4aa..e439c0b3c 100644
--- a/web/cypress/views/common.ts
+++ b/web/cypress/views/common.ts
@@ -1,9 +1,9 @@
-import { detailsPage } from "./details-page";
-import { nav } from "./nav";
-import { DataTestIDs, Classes } from "../../src/components/data-test";
+import { detailsPage } from './details-page';
+import { DataTestIDs } from '../../src/components/data-test';
export const commonPages = {
- projectDropdownShouldNotExist: () => cy.byLegacyTestID('namespace-bar-dropdown').should('not.exist'),
+ projectDropdownShouldNotExist: () =>
+ cy.byLegacyTestID('namespace-bar-dropdown').should('not.exist'),
projectDropdownShouldExist: () => cy.byLegacyTestID('namespace-bar-dropdown').should('exist'),
titleShouldHaveText: (title: string) => {
cy.wait(15000);
@@ -19,18 +19,17 @@ export const commonPages = {
linkShouldExist: (linkName: string) => {
cy.log('commonPages.linkShouldExist - ' + `${linkName}`);
cy.bySemanticElement('button', linkName).should('be.visible');
-
},
clickBellIcon: () => {
cy.log('commonPages.clickBellIcon');
cy.byAriaLabel('Notification drawer').should('be.visible').click();
-
},
bellIconClickAlert: (alert: string) => {
cy.log('commonPages.bellIconClickAlert');
- cy
- .get('pf-v6-c-notification-drawer__list-item-header, .pf-v5-c-notification-drawer__list-item-header')
+ cy.get(
+ '.pf-v6-c-notification-drawer__list-item-header, .pf-v5-c-notification-drawer__list-item-header',
+ )
.contains(alert)
.click();
},
@@ -40,10 +39,10 @@ export const commonPages = {
cy.byPFRole('dialog').should('be.visible');
if (yes) {
- cy.byTestID(DataTestIDs.ExpireSilenceButton).should('be.visible').click({force: true});
+ cy.byTestID(DataTestIDs.ExpireSilenceButton).should('be.visible').click({ force: true });
} else {
- cy.byTestID(DataTestIDs.CancelButton).should('be.visible').click({force: true});
- };
+ cy.byTestID(DataTestIDs.CancelButton).should('be.visible').click({ force: true });
+ }
cy.byTestID(DataTestIDs.ExpireSilenceButton).should('not.exist');
},
@@ -56,7 +55,6 @@ export const commonPages = {
cy.byTestID(DataTestIDs.AlertingRuleResourceLink).scrollIntoView();
cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).contains('AR').should('be.visible');
cy.byTestID(DataTestIDs.AlertingRuleResourceLink).contains(alert).should('be.visible');
-
},
alertRule: () => {
cy.log('commonPages.detailsPage.alertRule');
@@ -65,21 +63,24 @@ export const commonPages = {
cy.byTestID(DataTestIDs.AlertResourceLink).scrollIntoView();
cy.byTestID(DataTestIDs.AlertResourceLink).should('have.length.at.least', 1);
},
- common: (alert: string, severity: string) => {
+ common: (alert: string) => {
cy.log('commonPages.detailsPage.common');
commonPages.titleShouldHaveText(alert);
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).contains('Hide graph').should('be.visible');
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .contains('Hide graph')
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
cy.byTestID(DataTestIDs.MetricResetZoomButton).should('be.visible');
- cy.byAriaLabel('Inspect').should('be.visible'); //pf-5 cy.byAriaLabel('View in Metrics').should('be.visible').click();
+ cy.byAriaLabel('Inspect').should('be.visible'); //pf-5 cy.byAriaLabel('View in Metrics').should('be.visible').click();
},
administration_clusterSettings: () => {
cy.log('commonPages.detailsPage.administration_clusterSettings');
cy.byLegacyTestID('horizontal-link-Configuration').should('be.visible').click();
- cy.byLegacyTestID('item-filter', { timeout: 250000 }).should('be.visible').type('Alertmanager')
+ cy.byLegacyTestID('item-filter', { timeout: 250000 })
+ .should('be.visible')
+ .type('Alertmanager');
cy.bySemanticElement('a').contains('Alertmanager').should('be.visible').click();
cy.bySemanticElement('button').contains('Create Receiver').should('be.visible');
},
- }
-
-}
\ No newline at end of file
+ },
+};
diff --git a/web/cypress/views/details-page.ts b/web/cypress/views/details-page.ts
index 6fc1e5cfe..1667a980c 100644
--- a/web/cypress/views/details-page.ts
+++ b/web/cypress/views/details-page.ts
@@ -1,4 +1,4 @@
-import { commonPages } from "./common";
+import { commonPages } from './common';
import { DataTestIDs, Classes } from '../../src/components/data-test';
export const detailsPage = {
@@ -6,7 +6,7 @@ export const detailsPage = {
cy.log('detailsPage.sectionHeaderShouldExist');
cy.get(Classes.SectionHeader).contains(sectionHeading).should('be.visible');
},
-
+
labelShouldExist: (labelName: string) => {
cy.log('detailsPage.labelShouldExist');
cy.get(Classes.LabelTag).contains(labelName);
@@ -15,12 +15,15 @@ export const detailsPage = {
clickAlertRule: (alert: string) => {
cy.log('detailsPage.clickAlertRule');
cy.byTestID(DataTestIDs.AlertingRuleResourceLink).scrollIntoView();
- try{
- cy.byTestID(DataTestIDs.AlertingRuleResourceLink).contains(alert).should('be.visible').click();
- commonPages.detailsPage.alertRule;
+ try {
+ cy.byTestID(DataTestIDs.AlertingRuleResourceLink)
+ .contains(alert)
+ .should('be.visible')
+ .click();
+ commonPages.detailsPage.alertRule();
} catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
},
@@ -31,36 +34,32 @@ export const detailsPage = {
cy.byTestID(DataTestIDs.AlertResourceLink).contains(desc).should('be.visible').click();
} catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
},
- clickInspectAlertPage: () =>{
+ clickInspectAlertPage: () => {
cy.log('detailsPage.clickInspectAlertPage');
try {
cy.byAriaLabel('Inspect').should('be.visible');
- cy.get(`a[aria-label="Inspect"]` , { timeout: 10000 }).click();
+ cy.get(`a[aria-label="Inspect"]`, { timeout: 10000 }).click();
} catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
},
clickOnSilencedBy: (alertname: string) => {
- cy.log('detailsPage.clickOnSilencedBy');
- try {
- cy.byLegacyTestID(DataTestIDs.SilenceResourceLink)
- .contains(alertname)
- .scrollIntoView();
- cy.byLegacyTestID(DataTestIDs.SilenceResourceLink)
- .contains(alertname)
- .click({force: true});
- } catch (error) {
+ cy.log('detailsPage.clickOnSilencedBy');
+ try {
+ cy.byLegacyTestID(DataTestIDs.SilenceResourceLink).contains(alertname).scrollIntoView();
+ cy.byLegacyTestID(DataTestIDs.SilenceResourceLink).contains(alertname).click({ force: true });
+ } catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
},
-
+
assertSilencedAlert: () => {
cy.log('detailsPage.assertSilencedAlert');
try {
@@ -68,10 +67,9 @@ export const detailsPage = {
detailsPage.clickOnSilenceByKebab();
cy.byPFRole('menuitem').contains('Edit silence').should('be.visible');
cy.byPFRole('menuitem').contains('Expire silence').should('be.visible');
-
} catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
},
@@ -82,44 +80,46 @@ export const detailsPage = {
cy.get('table').should('be.visible');
cy.wait(2000);
cy.get('table').find(Classes.SilenceKebabDropdown).should('be.visible');
- cy.get('table').find(Classes.SilenceKebabDropdown).should('be.visible').click({force: true});
+ cy.get('table')
+ .find(Classes.SilenceKebabDropdown)
+ .should('be.visible')
+ .click({ force: true });
} catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
},
-
- editSilence:() => {
+
+ editSilence: () => {
cy.log('detailsPage.editSilence');
try {
detailsPage.clickOnSilenceByKebab();
cy.byPFRole('menuitem').contains('Edit silence').should('be.visible').click();
} catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
},
/**
- *
+ *
* @param yes boolean: true to expire and false to cancel
*/
- expireSilence:(yes: boolean) => {
+ expireSilence: (yes: boolean) => {
cy.log('detailsPage.expireSilence');
try {
detailsPage.clickOnSilenceByKebab();
- cy.byPFRole('menuitem').contains('Expire silence').should('be.visible').click({force: true});
+ cy.byPFRole('menuitem')
+ .contains('Expire silence')
+ .should('be.visible')
+ .click({ force: true });
commonPages.confirmExpireAlert(yes);
} catch (error) {
cy.log(`${error.message}`);
- throw error;
+ throw error;
}
-
-
},
- clickSilenceAlertButton:()=>{
+ clickSilenceAlertButton: () => {
cy.log('detailsPage.clickSilenceAlertButton');
cy.byTestID(DataTestIDs.SilenceButton).should('be.visible').click();
},
-
-
};
diff --git a/web/cypress/views/incidents-page.ts b/web/cypress/views/incidents-page.ts
index c241897b4..b47fb639a 100644
--- a/web/cypress/views/incidents-page.ts
+++ b/web/cypress/views/incidents-page.ts
@@ -1,155 +1,199 @@
import { nav } from './nav';
import { DataTestIDs } from '../../src/components/data-test';
-
export const incidentsPage = {
-
- // Centralized element selectors - all selectors defined in one place
- elements: {
- // Page structure
- toolbar: () => cy.byTestID(DataTestIDs.IncidentsPage.Toolbar),
- loadingSpinner: () => cy.byTestID(DataTestIDs.IncidentsPage.LoadingSpinner),
-
- // Controls and filters
- daysSelect: () => cy.byTestID(DataTestIDs.IncidentsPage.DaysSelect),
- daysSelectToggle: () => cy.byTestID(DataTestIDs.IncidentsPage.DaysSelectToggle),
-
- // Filter type selection (first step)
- filtersSelect: () => cy.byTestID(DataTestIDs.IncidentsPage.FiltersSelect),
- filtersSelectToggle: () => cy.byTestID(DataTestIDs.IncidentsPage.FiltersSelectToggle),
- filtersSelectList: () => cy.byTestID(DataTestIDs.IncidentsPage.FiltersSelectList),
- filtersSelectOption: (filterType: string) => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectOption}-${filterType.toLowerCase()}`),
-
- // Specific filter selects (second step) - only visible when filter type is selected
- severityFilterSelect: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelect}-severity`),
- severityFilterToggle: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectToggle}-severity`),
- severityFilterList: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectList}-severity`),
- severityFilterOption: (severity: string) => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectOption}-severity-${severity.toLowerCase()}`),
-
- stateFilterSelect: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelect}-state`),
- stateFilterToggle: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectToggle}-state`),
- stateFilterList: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectList}-state`),
- stateFilterOption: (state: string) => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectOption}-state-${state.toLowerCase()}`),
-
- incidentIdFilterSelect: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelect}-incident id`),
- incidentIdFilterToggle: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectToggle}-incident id`),
- incidentIdFilterList: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectList}-incident id`),
- incidentIdFilterOption: (incidentId: string) => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectOption}-incident id-${incidentId.toLowerCase()}`),
-
- // Filter chips (active filters with remove buttons)
- // Note: PatternFly ToolbarFilter doesn't pass through data-test attributes,
- // so we use semantic selectors based on the category labels
- severityFilterChip: () => incidentsPage.elements.toolbar().contains('span', 'Severity').parent(),
- stateFilterChip: () => incidentsPage.elements.toolbar().contains('span', 'State').parent(),
- incidentIdFilterChip: () => incidentsPage.elements.toolbar().contains('span', 'Incident ID').parent(),
- filterChipValue: (value: string) => incidentsPage.elements.toolbar().contains('span', value),
-
- clearAllFiltersButton: () => cy.byTestID(DataTestIDs.IncidentsPage.Toolbar).contains('button', 'Clear all filters'),
- toggleChartsButton: () => cy.byTestID(DataTestIDs.IncidentsPage.ToggleChartsButton),
-
- // Charts and visualizations
- incidentsChartTitle: () => cy.byTestID(DataTestIDs.IncidentsChart.Title),
- incidentsChartCard: () => cy.byTestID(DataTestIDs.IncidentsChart.Card),
- incidentsChartContainer: () => cy.byTestID(DataTestIDs.IncidentsChart.ChartContainer),
- incidentsChartLoadingSpinner: () => cy.byTestID(DataTestIDs.IncidentsChart.LoadingSpinner),
- incidentsChartBars: () => cy.byTestID(DataTestIDs.IncidentsChart.ChartBars),
- incidentsChartBar: (groupId: string) => cy.byTestID(`${DataTestIDs.IncidentsChart.ChartBar}-${groupId}`),
- incidentsChartBarsVisiblePaths: () => {
- return cy.get('body').then($body => {
- // There is a delay between the element being rendered and the paths being visible.
- // The case when no paths are visible is valid, so we can not use should or conditional testing semantics.
- cy.wait(500);
- // We need to use the $body as both cases when the element is there or not are valid.
- const exists = $body.find('g[role="presentation"][data-test*="incidents-chart-bar-"]').length > 0;
- if (exists) {
- return cy.get('g[role="presentation"][data-test*="incidents-chart-bar-"]')
- .find('path[role="presentation"]')
- .filter((index, element) => {
- const fillOpacity = Cypress.$(element).css('fill-opacity') || Cypress.$(element).attr('fill-opacity');
- return parseFloat(fillOpacity || '0') > 0;
- });
- } else {
- cy.log('Chart bars were not found. Test continues.');
- return cy.wrap([]);
- }
- });
- },
- incidentsChartBarsVisiblePathsNonEmpty: () => {
- return cy.get('g[role="presentation"][data-test*="incidents-chart-bar-"]')
- .should('exist')
- .find('path[role="presentation"]')
- .should('have.length.greaterThan', 0)
- .filter((index, element) => {
- const fillOpacity = Cypress.$(element).css('fill-opacity') || Cypress.$(element).attr('fill-opacity');
- return parseFloat(fillOpacity || '0') > 0;
- });
- },
- incidentsChartBarsGroups: () => cy.byTestID(DataTestIDs.IncidentsChart.ChartBars)
- .find('g[role="presentation"][data-test*="incidents-chart-bar-"]'),
- incidentsChartSvg: () => incidentsPage.elements.incidentsChartCard().find('svg'),
-
- alertsChartTitle: () => cy.byTestID(DataTestIDs.AlertsChart.Title),
- alertsChartCard: () => cy.byTestID(DataTestIDs.AlertsChart.Card),
- alertsChartContainer: () => cy.byTestID(DataTestIDs.AlertsChart.ChartContainer),
- alertsChartSvg: () => incidentsPage.elements.alertsChartCard().find('svg'),
- alertsChartBarsGroups: () => incidentsPage.elements.alertsChartSvg().find('g[role="presentation"]'),
- alertsChartBarsPaths: () => incidentsPage.elements.alertsChartSvg().find('path[role="presentation"]'),
- alertsChartBarsVisiblePaths: () => {
- return cy.get('body').then($body => {
- const exists = $body.find('g[role="presentation"][data-test*="alerts-chart-bar-"]').length > 0;
- if (exists) {
- return cy.get('g[role="presentation"][data-test*="alerts-chart-bar-"]')
- .find('path[role="presentation"]')
- .filter((index, element) => {
- const fillOpacity = Cypress.$(element).css('fill-opacity') || Cypress.$(element).attr('fill-opacity');
- return parseFloat(fillOpacity || '0') > 0;
- });
- } else {
- cy.log('Alert chart bars were not found. Test continues.');
- return cy.wrap([]);
- }
+ // Centralized element selectors - all selectors defined in one place
+ elements: {
+ // Page structure
+ toolbar: () => cy.byTestID(DataTestIDs.IncidentsPage.Toolbar),
+ loadingSpinner: () => cy.byTestID(DataTestIDs.IncidentsPage.LoadingSpinner),
+
+ // Controls and filters
+ daysSelect: () => cy.byTestID(DataTestIDs.IncidentsPage.DaysSelect),
+ daysSelectToggle: () => cy.byTestID(DataTestIDs.IncidentsPage.DaysSelectToggle),
+
+ // Filter type selection (first step)
+ filtersSelect: () => cy.byTestID(DataTestIDs.IncidentsPage.FiltersSelect),
+ filtersSelectToggle: () => cy.byTestID(DataTestIDs.IncidentsPage.FiltersSelectToggle),
+ filtersSelectList: () => cy.byTestID(DataTestIDs.IncidentsPage.FiltersSelectList),
+ filtersSelectOption: (filterType: string) =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectOption}-${filterType.toLowerCase()}`),
+
+ // Specific filter selects (second step) - only visible when filter type is selected
+ severityFilterSelect: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelect}-severity`),
+ severityFilterToggle: () =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectToggle}-severity`),
+ severityFilterList: () =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectList}-severity`),
+ severityFilterOption: (severity: string) =>
+ cy.byTestID(
+ `${DataTestIDs.IncidentsPage.FiltersSelectOption}-severity-${severity.toLowerCase()}`,
+ ),
+
+ stateFilterSelect: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelect}-state`),
+ stateFilterToggle: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectToggle}-state`),
+ stateFilterList: () => cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectList}-state`),
+ stateFilterOption: (state: string) =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectOption}-state-${state.toLowerCase()}`),
+
+ incidentIdFilterSelect: () =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelect}-incident id`),
+ incidentIdFilterToggle: () =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectToggle}-incident id`),
+ incidentIdFilterList: () =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.FiltersSelectList}-incident id`),
+ incidentIdFilterOption: (incidentId: string) =>
+ cy.byTestID(
+ `${DataTestIDs.IncidentsPage.FiltersSelectOption}-incident id-${incidentId.toLowerCase()}`,
+ ),
+
+ // Filter chips (active filters with remove buttons)
+ // Note: PatternFly ToolbarFilter doesn't pass through data-test attributes,
+ // so we use semantic selectors based on the category labels
+ severityFilterChip: () =>
+ incidentsPage.elements.toolbar().contains('span', 'Severity').parent(),
+ stateFilterChip: () => incidentsPage.elements.toolbar().contains('span', 'State').parent(),
+ incidentIdFilterChip: () =>
+ incidentsPage.elements.toolbar().contains('span', 'Incident ID').parent(),
+ filterChipValue: (value: string) => incidentsPage.elements.toolbar().contains('span', value),
+
+ clearAllFiltersButton: () =>
+ cy.byTestID(DataTestIDs.IncidentsPage.Toolbar).contains('button', 'Clear all filters'),
+ toggleChartsButton: () => cy.byTestID(DataTestIDs.IncidentsPage.ToggleChartsButton),
+
+ // Charts and visualizations
+ incidentsChartTitle: () => cy.byTestID(DataTestIDs.IncidentsChart.Title),
+ incidentsChartCard: () => cy.byTestID(DataTestIDs.IncidentsChart.Card),
+ incidentsChartContainer: () => cy.byTestID(DataTestIDs.IncidentsChart.ChartContainer),
+ incidentsChartLoadingSpinner: () => cy.byTestID(DataTestIDs.IncidentsChart.LoadingSpinner),
+ incidentsChartBars: () => cy.byTestID(DataTestIDs.IncidentsChart.ChartBars),
+ incidentsChartBar: (groupId: string) =>
+ cy.byTestID(`${DataTestIDs.IncidentsChart.ChartBar}-${groupId}`),
+ incidentsChartBarsVisiblePaths: () => {
+ return cy.get('body').then(($body) => {
+ // There is a delay between the element being rendered and the paths being visible.
+ // The case when no paths are visible is valid, so we can not use should or conditional
+ // testing semantics.
+ cy.wait(500);
+ // We need to use the $body as both cases when the element is there or not are valid.
+ const exists =
+ $body.find('g[role="presentation"][data-test*="incidents-chart-bar-"]').length > 0;
+ if (exists) {
+ return cy
+ .get('g[role="presentation"][data-test*="incidents-chart-bar-"]')
+ .find('path[role="presentation"]')
+ .filter((index, element) => {
+ const fillOpacity =
+ Cypress.$(element).css('fill-opacity') || Cypress.$(element).attr('fill-opacity');
+ return parseFloat(fillOpacity || '0') > 0;
+ });
+ } else {
+ cy.log('Chart bars were not found. Test continues.');
+ return cy.wrap([]);
+ }
+ });
+ },
+ incidentsChartBarsVisiblePathsNonEmpty: () => {
+ return cy
+ .get('g[role="presentation"][data-test*="incidents-chart-bar-"]')
+ .should('exist')
+ .find('path[role="presentation"]')
+ .should('have.length.greaterThan', 0)
+ .filter((index, element) => {
+ const fillOpacity =
+ Cypress.$(element).css('fill-opacity') || Cypress.$(element).attr('fill-opacity');
+ return parseFloat(fillOpacity || '0') > 0;
});
- },
- alertsChartEmptyState: () => cy.byTestID(DataTestIDs.AlertsChart.EmptyState),
-
- // Tables and data
- incidentsTable: () => cy.byTestID(DataTestIDs.IncidentsTable.Table),
- incidentsTableRow: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsTable.Row}-${index}`),
- incidentsTableExpandButton: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsTable.ExpandButton}-${index}`).find('button'),
- incidentsTableComponentCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsTable.ComponentCell}-${index}`),
- incidentsTableSeverityCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsTable.SeverityCell}-${index}`),
- incidentsTableStateCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsTable.StateCell}-${index}`),
-
- // Details table (expanded row)
- incidentsDetailsTable: () => cy.byTestID(DataTestIDs.IncidentsDetailsTable.Table),
- incidentsDetailsLoadingSpinner: () => cy.byTestID(DataTestIDs.IncidentsDetailsTable.LoadingSpinner),
- incidentsDetailsRow: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.Row}-${index}`),
- incidentsDetailsAlertRuleCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.AlertRuleCell}-${index}`),
- incidentsDetailsAlertRuleLink: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.AlertRuleLink}-${index}`),
- incidentsDetailsNamespaceCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.NamespaceCell}-${index}`),
- incidentsDetailsSeverityCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.SeverityCell}-${index}`),
- incidentsDetailsStateCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.StateCell}-${index}`),
- incidentsDetailsStartCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.StartCell}-${index}`),
- incidentsDetailsEndCell: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.EndCell}-${index}`),
-
- // Generic selectors for incident table rows and details table rows
- incidentsTableRows: () => incidentsPage.elements.incidentsTable().find(`tbody[data-test*="${DataTestIDs.IncidentsTable.Row}-"]`),
- incidentsDetailsTableRows: () => incidentsPage.elements.incidentsDetailsTable().find('tbody tr'),
-
- // Days select options
- daysSelectList: () => cy.byTestID(DataTestIDs.IncidentsPage.DaysSelectList),
- daysSelectOption: (days: string) => cy.byTestID(`${DataTestIDs.IncidentsPage.DaysSelectOption}-${days.replace(' ', '-')}`),
-
- // Tooltips (custom Victory chart tooltips)
- tooltip: () => cy.get('.incidents__tooltip'),
- tooltipWrap: () => cy.get('.incidents__tooltip-wrap'),
- tooltipArrow: () => cy.get('.incidents__tooltip-arrow'),
-
- alertsChartTooltip: () => incidentsPage.elements.alertsChartCard().find('.incidents__tooltip'),
},
-
-
-
+ incidentsChartBarsGroups: () =>
+ cy
+ .byTestID(DataTestIDs.IncidentsChart.ChartBars)
+ .find('g[role="presentation"][data-test*="incidents-chart-bar-"]'),
+ incidentsChartSvg: () => incidentsPage.elements.incidentsChartCard().find('svg'),
+
+ alertsChartTitle: () => cy.byTestID(DataTestIDs.AlertsChart.Title),
+ alertsChartCard: () => cy.byTestID(DataTestIDs.AlertsChart.Card),
+ alertsChartContainer: () => cy.byTestID(DataTestIDs.AlertsChart.ChartContainer),
+ alertsChartSvg: () => incidentsPage.elements.alertsChartCard().find('svg'),
+ alertsChartBarsGroups: () =>
+ incidentsPage.elements.alertsChartSvg().find('g[role="presentation"]'),
+ alertsChartBarsPaths: () =>
+ incidentsPage.elements.alertsChartSvg().find('path[role="presentation"]'),
+ alertsChartBarsVisiblePaths: () => {
+ return cy.get('body').then(($body) => {
+ const exists =
+ $body.find('g[role="presentation"][data-test*="alerts-chart-bar-"]').length > 0;
+ if (exists) {
+ return cy
+ .get('g[role="presentation"][data-test*="alerts-chart-bar-"]')
+ .find('path[role="presentation"]')
+ .filter((index, element) => {
+ const fillOpacity =
+ Cypress.$(element).css('fill-opacity') || Cypress.$(element).attr('fill-opacity');
+ return parseFloat(fillOpacity || '0') > 0;
+ });
+ } else {
+ cy.log('Alert chart bars were not found. Test continues.');
+ return cy.wrap([]);
+ }
+ });
+ },
+ alertsChartEmptyState: () => cy.byTestID(DataTestIDs.AlertsChart.EmptyState),
+
+ // Tables and data
+ incidentsTable: () => cy.byTestID(DataTestIDs.IncidentsTable.Table),
+ incidentsTableRow: (index: number) => cy.byTestID(`${DataTestIDs.IncidentsTable.Row}-${index}`),
+ incidentsTableExpandButton: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsTable.ExpandButton}-${index}`).find('button'),
+ incidentsTableComponentCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsTable.ComponentCell}-${index}`),
+ incidentsTableSeverityCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsTable.SeverityCell}-${index}`),
+ incidentsTableStateCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsTable.StateCell}-${index}`),
+
+ // Details table (expanded row)
+ incidentsDetailsTable: () => cy.byTestID(DataTestIDs.IncidentsDetailsTable.Table),
+ incidentsDetailsLoadingSpinner: () =>
+ cy.byTestID(DataTestIDs.IncidentsDetailsTable.LoadingSpinner),
+ incidentsDetailsRow: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.Row}-${index}`),
+ incidentsDetailsAlertRuleCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.AlertRuleCell}-${index}`),
+ incidentsDetailsAlertRuleLink: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.AlertRuleLink}-${index}`),
+ incidentsDetailsNamespaceCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.NamespaceCell}-${index}`),
+ incidentsDetailsSeverityCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.SeverityCell}-${index}`),
+ incidentsDetailsStateCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.StateCell}-${index}`),
+ incidentsDetailsStartCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.StartCell}-${index}`),
+ incidentsDetailsEndCell: (index: number) =>
+ cy.byTestID(`${DataTestIDs.IncidentsDetailsTable.EndCell}-${index}`),
+
+ // Generic selectors for incident table rows and details table rows
+ incidentsTableRows: () =>
+ incidentsPage.elements
+ .incidentsTable()
+ .find(`tbody[data-test*="${DataTestIDs.IncidentsTable.Row}-"]`),
+ incidentsDetailsTableRows: () =>
+ incidentsPage.elements.incidentsDetailsTable().find('tbody tr'),
+
+ // Days select options
+ daysSelectList: () => cy.byTestID(DataTestIDs.IncidentsPage.DaysSelectList),
+ daysSelectOption: (days: string) =>
+ cy.byTestID(`${DataTestIDs.IncidentsPage.DaysSelectOption}-${days.replace(' ', '-')}`),
+
+ // Tooltips (custom Victory chart tooltips)
+ tooltip: () => cy.get('.incidents__tooltip'),
+ tooltipWrap: () => cy.get('.incidents__tooltip-wrap'),
+ tooltipArrow: () => cy.get('.incidents__tooltip-arrow'),
+
+ alertsChartTooltip: () => incidentsPage.elements.alertsChartCard().find('.incidents__tooltip'),
+ },
+
goTo: () => {
cy.log('incidentsPage.goTo');
nav.sidenav.clickNavLink(['Observe', 'Alerting']);
@@ -161,7 +205,9 @@ export const incidentsPage = {
cy.log('incidentsPage.setDays');
incidentsPage.elements.daysSelectToggle().scrollIntoView().click();
const dayKey = value.replace(' ', '-');
- cy.byTestID(`${DataTestIDs.IncidentsPage.DaysSelectOption}-${dayKey}`).should('be.visible').click();
+ cy.byTestID(`${DataTestIDs.IncidentsPage.DaysSelectOption}-${dayKey}`)
+ .should('be.visible')
+ .click();
incidentsPage.elements.daysSelectToggle().should('contain.text', value);
},
@@ -169,15 +215,18 @@ export const incidentsPage = {
kind: 'severity' | 'state',
name: 'Critical' | 'Warning' | 'Informative' | 'Firing' | 'Resolved',
) => {
- const listSelector = kind === 'severity'
- ? `[data-test="${DataTestIDs.IncidentsPage.FiltersSelectList}-severity"]`
- : `[data-test="${DataTestIDs.IncidentsPage.FiltersSelectList}-state"]`;
+ const listSelector =
+ kind === 'severity'
+ ? `[data-test="${DataTestIDs.IncidentsPage.FiltersSelectList}-severity"]`
+ : `[data-test="${DataTestIDs.IncidentsPage.FiltersSelectList}-state"]`;
if (kind === 'severity') {
incidentsPage.elements.severityFilterToggle().click();
incidentsPage.elements.severityFilterList().should('be.visible');
cy.wait(250);
- incidentsPage.elements.severityFilterOption(name as 'Critical' | 'Warning' | 'Informative').click();
+ incidentsPage.elements
+ .severityFilterOption(name as 'Critical' | 'Warning' | 'Informative')
+ .click();
} else {
incidentsPage.elements.stateFilterToggle().click();
incidentsPage.elements.stateFilterList().should('be.visible');
@@ -213,7 +262,8 @@ export const incidentsPage = {
cy.log(`incidentsPage.deselectFilterValue: ${name}`);
const chipSelector = `[data-test="${DataTestIDs.IncidentsPage.Toolbar}"] span`;
const isChipPresent = ($body: JQuery) =>
- $body.find(chipSelector).filter((_, element) => Cypress.$(element).text().trim() === name).length > 0;
+ $body.find(chipSelector).filter((_, element) => Cypress.$(element).text().trim() === name)
+ .length > 0;
cy.get('body').then(($body) => {
if (!isChipPresent($body)) {
@@ -236,7 +286,8 @@ export const incidentsPage = {
}
cy.log(
- `Retrying deselection for "${name}" because option click was visible but selection state did not change`,
+ `Retrying deselection for "${name}" because option click was
+ visible but selection state did not change`,
);
return attemptDeselect(attempt + 1);
});
@@ -248,7 +299,6 @@ export const incidentsPage = {
toggleFilter: (name: 'Critical' | 'Warning' | 'Informative' | 'Firing' | 'Resolved') => {
cy.log('incidentsPage.toggleFilter');
-
const isSeverityFilter = ['Critical', 'Warning', 'Informative'].includes(name);
const filterType = isSeverityFilter ? 'Severity' : 'State';
const valueToggleSelector = isSeverityFilter
@@ -285,18 +335,19 @@ export const incidentsPage = {
cy.log(`incidentsPage.removeFilter: Removing ${value} from ${category} filters`);
// Bulletproof approach: directly target the close button by its specific aria-label
// This is the most reliable selector since each button has a unique aria-label
- incidentsPage.elements.toolbar()
+ incidentsPage.elements
+ .toolbar()
.find(`button[aria-label="Close ${value}"]`)
.click({ force: true });
},
removeFilterCategory: (category: 'Severity' | 'State' | 'Incident ID') => {
const chipElementMap = {
- 'Severity': () => incidentsPage.elements.severityFilterChip(),
- 'State': () => incidentsPage.elements.stateFilterChip(),
+ Severity: () => incidentsPage.elements.severityFilterChip(),
+ State: () => incidentsPage.elements.stateFilterChip(),
'Incident ID': () => incidentsPage.elements.incidentIdFilterChip(),
};
-
+
chipElementMap[category]().within(() => {
cy.get('button[aria-label*="Close"]').click({ force: true });
});
@@ -310,57 +361,55 @@ export const incidentsPage = {
/**
* Selects an incident from the chart by clicking on a bar at the specified index.
* BUG: Problems with multi-severity incidents (multiple paths in a single incident bar)
- *
+ *
* @param index - Zero-based index of the incident bar to click (default: 0)
* @returns Promise that resolves when the incidents table is visible
*/
selectIncidentByBarIndex: (index = 0) => {
cy.log(`incidentsPage.selectIncidentByBarIndex: ${index} (clicking visible path elements)`);
-
- return incidentsPage.elements.incidentsChartBarsVisiblePaths()
+
+ return incidentsPage.elements
+ .incidentsChartBarsVisiblePaths()
.should('have.length.greaterThan', index)
.then(($paths) => {
if (index >= $paths.length) {
throw new Error(`Index ${index} exceeds available paths (${$paths.length})`);
}
-
- return cy.wrap($paths.eq(index))
- .click({ force: true });
+
+ return cy.wrap($paths.eq(index)).click({ force: true });
})
.then(() => {
cy.wait(2000);
- return incidentsPage.elements.incidentsTable()
- .scrollIntoView()
- .should('exist');
+ return incidentsPage.elements.incidentsTable().scrollIntoView().should('exist');
});
},
deselectIncidentByBar: () => {
cy.log('incidentsPage.deselectIncidentByBar');
- return incidentsPage.elements.incidentsChartBarsVisiblePaths()
+ return incidentsPage.elements
+ .incidentsChartBarsVisiblePaths()
.then(($paths) => {
if ($paths.length === 0) {
throw new Error('No paths found in incidents chart');
}
- return cy.wrap($paths.eq(0))
- .click({ force: true });
+ return cy.wrap($paths.eq(0)).click({ force: true });
})
.then(() => {
- return incidentsPage.elements.incidentsTable()
- .should('not.exist');
+ return incidentsPage.elements.incidentsTable().should('not.exist');
});
},
/**
* Selects an incident by its ID (data-test attribute).
* More reliable than index-based selection, especially for multi-severity incidents.
- *
+ *
* @param incidentId - The incident ID to select (e.g., 'etcd-six-alerts-001')
* @returns Promise that resolves when the incidents table is visible
*/
selectIncidentById: (incidentId: string) => {
cy.log(`incidentsPage.selectIncidentById: ${incidentId}`);
- return incidentsPage.elements.incidentsChartBarsGroups()
+ return incidentsPage.elements
+ .incidentsChartBarsGroups()
.filter(`[data-test*="${incidentId}"]`)
.should('have.length', 1)
.first()
@@ -369,22 +418,21 @@ export const incidentsPage = {
.click({ force: true })
.then(() => {
cy.wait(2000);
- return incidentsPage.elements.incidentsTable()
- .scrollIntoView()
- .should('exist');
+ return incidentsPage.elements.incidentsTable().scrollIntoView().should('exist');
});
},
/**
* Deselects the currently selected incident by clicking it again.
* Uses the incident ID to reliably find and click the bar.
- *
+ *
* @param incidentId - The incident ID to deselect (e.g., 'etcd-six-alerts-001')
* @returns Promise that resolves when the incidents table is hidden
*/
deselectIncidentById: (incidentId: string) => {
cy.log(`incidentsPage.deselectIncidentById: ${incidentId}`);
- return incidentsPage.elements.incidentsChartBarsGroups()
+ return incidentsPage.elements
+ .incidentsChartBarsGroups()
.filter(`[data-test*="${incidentId}"]`)
.should('have.length', 1)
.first()
@@ -392,15 +440,13 @@ export const incidentsPage = {
.first()
.click({ force: true })
.then(() => {
- return incidentsPage.elements.incidentsTable()
- .should('not.exist');
+ return incidentsPage.elements.incidentsTable().should('not.exist');
});
},
expandRow: (rowIndex = 0) => {
cy.log('incidentsPage.expandRow');
- incidentsPage.elements.incidentsTableExpandButton(rowIndex)
- .click({ force: true });
+ incidentsPage.elements.incidentsTableExpandButton(rowIndex).click({ force: true });
},
waitForTooltip: () => {
@@ -410,23 +456,28 @@ export const incidentsPage = {
hoverOverIncidentBar: (index: number) => {
cy.log(`incidentsPage.hoverOverIncidentBar: ${index}`);
- incidentsPage.elements.incidentsChartBarsGroups()
+ incidentsPage.elements
+ .incidentsChartBarsGroups()
.eq(index)
.find('path[role="presentation"]')
.then(($paths) => {
- const visiblePath = $paths.filter((i, el) => {
- const fillOpacity = Cypress.$(el).css('fill-opacity') || Cypress.$(el).attr('fill-opacity');
- return parseFloat(fillOpacity || '0') > 0;
- }).first();
-
+ const visiblePath = $paths
+ .filter((i, el) => {
+ const fillOpacity =
+ Cypress.$(el).css('fill-opacity') || Cypress.$(el).attr('fill-opacity');
+ return parseFloat(fillOpacity || '0') > 0;
+ })
+ .first();
+
if (visiblePath.length > 0) {
const rect = visiblePath[0].getBoundingClientRect();
const x = rect.left + rect.width / 2;
const y = rect.top + rect.height / 2;
-
+
cy.log(`Hovering at coordinates: x=${x}, y=${y}`);
-
- incidentsPage.elements.incidentsChartSvg()
+
+ incidentsPage.elements
+ .incidentsChartSvg()
.first()
.trigger('mousemove', { clientX: x, clientY: y, force: true })
.wait(100);
@@ -446,7 +497,9 @@ export const incidentsPage = {
*/
getIncidentBarVisibleSegments: (barIndex: number) => {
cy.log(`incidentsPage.getIncidentBarVisibleSegments: ${barIndex}`);
- return incidentsPage.elements.incidentsChartBarsGroups().eq(barIndex)
+ return incidentsPage.elements
+ .incidentsChartBarsGroups()
+ .eq(barIndex)
.find('path[role="presentation"]')
.then(($paths) => {
return $paths.filter((_, el) => {
@@ -468,11 +521,15 @@ export const incidentsPage = {
cy.log(`incidentsPage.hoverOverIncidentBarSegment: bar=${barIndex}, segment=${segmentIndex}`);
incidentsPage.getIncidentBarVisibleSegments(barIndex).then((segments) => {
if (segmentIndex >= segments.length) {
- throw new Error(`Segment ${segmentIndex} not found (only ${segments.length} visible segments in bar ${barIndex})`);
+ throw new Error(
+ `Segment ${segmentIndex} not found (only ${segments.length}
+ visible segments in bar ${barIndex})`,
+ );
}
const path = segments[segmentIndex];
const rect = path.getBoundingClientRect();
- incidentsPage.elements.incidentsChartSvg()
+ incidentsPage.elements
+ .incidentsChartSvg()
.first()
.trigger('mousemove', {
clientX: rect.left + rect.width / 2,
@@ -486,7 +543,8 @@ export const incidentsPage = {
getIncidentBarRect: (index: number) => {
cy.log(`incidentsPage.getIncidentBarRect: ${index}`);
- return incidentsPage.elements.incidentsChartBarsGroups()
+ return incidentsPage.elements
+ .incidentsChartBarsGroups()
.eq(index)
.then(($group) => {
const rect = $group[0].getBoundingClientRect();
@@ -498,14 +556,15 @@ export const incidentsPage = {
width: rect.width,
height: rect.height,
x: rect.x,
- y: rect.y
+ y: rect.y,
});
});
},
getAlertBarRect: (index: number) => {
cy.log(`incidentsPage.getAlertBarRect: ${index}`);
- return incidentsPage.elements.alertsChartBarsPaths()
+ return incidentsPage.elements
+ .alertsChartBarsPaths()
.eq(index)
.then(($bar) => {
const rect = $bar[0].getBoundingClientRect();
@@ -517,21 +576,23 @@ export const incidentsPage = {
width: rect.width,
height: rect.height,
x: rect.x,
- y: rect.y
+ y: rect.y,
});
});
},
hoverOverAlertBar: (index: number) => {
cy.log(`incidentsPage.hoverOverAlertBar: ${index}`);
- incidentsPage.elements.alertsChartBarsPaths()
+ incidentsPage.elements
+ .alertsChartBarsPaths()
.eq(index)
.then(($bar) => {
const rect = $bar[0].getBoundingClientRect();
const x = rect.left + rect.width / 2;
const y = rect.top + rect.height / 2;
-
- incidentsPage.elements.alertsChartSvg()
+
+ incidentsPage.elements
+ .alertsChartSvg()
.first()
.trigger('mousemove', { clientX: x, clientY: y, force: true })
.wait(100);
@@ -555,69 +616,100 @@ export const incidentsPage = {
/**
* Checks if an alert name appears anywhere in the current incidents table text content.
- *
+ *
* @param alertName - Name of the alert to search for
* @param incidentIndex - Zero-based incident index for logging purposes
* @returns Promise resolving to true if alert name is found in table text
*/
- checkComponentRowInIncidentTableForAlert: (alertName: string, incidentIndex: number): Cypress.Chainable => {
- return incidentsPage.elements.incidentsTable().invoke('text').then((text) => {
- if (String(text).includes(alertName)) {
- cy.log(`Found alert "${alertName}" in incident ${incidentIndex + 1} table content`);
- cy.log(text);
- return cy.wrap(true);
- }
- return cy.wrap(false);
- });
+ checkComponentRowInIncidentTableForAlert: (
+ alertName: string,
+ incidentIndex: number,
+ ): Cypress.Chainable => {
+ return incidentsPage.elements
+ .incidentsTable()
+ .invoke('text')
+ .then((text) => {
+ if (String(text).includes(alertName)) {
+ cy.log(`Found alert "${alertName}" in incident ${incidentIndex + 1} table content`);
+ cy.log(text);
+ return cy.wrap(true);
+ }
+ return cy.wrap(false);
+ });
},
/**
* Recursively expands and checks incident table rows for a specific alert.
* Continues until alert is found or all rows are checked.
- *
+ *
* @param alertName - Name of the alert to search for
* @param incidentIndex - Zero-based incident index for logging
* @param totalRows - Total number of rows to check
* @param currentRowIndex - Current row being checked (default: 0)
* @returns Promise resolving to true if alert is found in any row
*/
- checkComponentInIncident: (alertName: string, incidentIndex: number, totalRows: number, currentRowIndex: number = 0): Cypress.Chainable => {
+ checkComponentInIncident: (
+ alertName: string,
+ incidentIndex: number,
+ totalRows: number,
+ currentRowIndex: number = 0,
+ ): Cypress.Chainable => {
if (currentRowIndex >= totalRows) {
cy.log(`Checked all ${totalRows} rows in incident ${incidentIndex + 1}, alert not found`);
return cy.wrap(false);
}
-
+
cy.log(`Expanding and checking row ${currentRowIndex} in incident ${incidentIndex + 1}`);
incidentsPage.expandRow(currentRowIndex);
-
- return incidentsPage.checkComponentRowInIncidentTableForAlert(alertName, incidentIndex)
+
+ return incidentsPage
+ .checkComponentRowInIncidentTableForAlert(alertName, incidentIndex)
.then((found) => {
if (found) {
- cy.log(`Found alert "${alertName}" in expanded row ${currentRowIndex} of incident ${incidentIndex + 1}`);
+ cy.log(
+ `Found alert "${alertName}" in expanded row ${currentRowIndex} of incident ${
+ incidentIndex + 1
+ }`,
+ );
return cy.wrap(true);
}
- return incidentsPage.checkComponentInIncident(alertName, incidentIndex, totalRows, currentRowIndex + 1);
+ return incidentsPage.checkComponentInIncident(
+ alertName,
+ incidentIndex,
+ totalRows,
+ currentRowIndex + 1,
+ );
});
},
/**
- * Searches for an alert in all components (usually connected with namespaces) of a single incident.
+ * Searches for an alert in all components (usually connected with namespaces) of a single
+ * incident.
* First checks main table content, then recursively expands and checks each row.
- *
+ *
* @param alertName - Name of the alert to search for
* @param incidentIndex - Zero-based incident index for logging
* @returns Promise resolving to true if alert is found anywhere in the incident
*/
- searchAllComponentsInIncident: (alertName: string, incidentIndex: number): Cypress.Chainable => {
- cy.log(`incidentsPage.searchAllRowsInIncident: Checking all rows in incident ${incidentIndex + 1} for alert "${alertName}"`);
-
- return incidentsPage.checkComponentRowInIncidentTableForAlert(alertName, incidentIndex)
+ searchAllComponentsInIncident: (
+ alertName: string,
+ incidentIndex: number,
+ ): Cypress.Chainable => {
+ cy.log(
+ `incidentsPage.searchAllRowsInIncident: Checking all rows in incident ${
+ incidentIndex + 1
+ } for alert "${alertName}"`,
+ );
+
+ return incidentsPage
+ .checkComponentRowInIncidentTableForAlert(alertName, incidentIndex)
.then((foundInMain) => {
if (foundInMain) {
return cy.wrap(true);
}
-
- return incidentsPage.elements.incidentsTable()
+
+ return incidentsPage.elements
+ .incidentsTable()
.find('tbody[data-test*="incidents-table-row-"]')
.then(($rows) => {
const totalRows = $rows.length;
@@ -625,7 +717,7 @@ export const incidentsPage = {
cy.log(`No rows found in incident ${incidentIndex + 1}`);
return cy.wrap(false);
}
-
+
cy.log(`Found ${totalRows} incident rows to check in incident ${incidentIndex + 1}`);
return incidentsPage.checkComponentInIncident(alertName, incidentIndex, totalRows);
});
@@ -635,14 +727,21 @@ export const incidentsPage = {
/**
* Searches for an alert within a specific incident by selecting it and checking all components.
* Combines incident selection with comprehensive component search.
- *
+ *
* @param alertName - Name of the alert to search for
* @param incidentIndex - Zero-based index of the incident to search
* @returns Promise resolving to true if alert is found in the incident
*/
- searchForAlertInIncident: (alertName: string, incidentIndex: number): Cypress.Chainable => {
- cy.log(`incidentsPage.searchForAlertInIncident: Checking incident ${incidentIndex + 1} for alert "${alertName}"`);
-
+ searchForAlertInIncident: (
+ alertName: string,
+ incidentIndex: number,
+ ): Cypress.Chainable => {
+ cy.log(
+ `incidentsPage.searchForAlertInIncident: Checking incident ${
+ incidentIndex + 1
+ } for alert "${alertName}"`,
+ );
+
return cy
.wrap(null)
.then(() => {
@@ -653,35 +752,44 @@ export const incidentsPage = {
},
/**
- * Recursively traverses all incident bars in the chart, searching each one for a specific alert.
- * Uses internal recursive function to systematically check each incident until found or exhausted.
- *
+ * Recursively traverses all incident bars in the chart, searching each one for a specific
+ * alert.
+ * Uses internal recursive function to systematically check each incident until found or
+ * exhausted.
+ *
* @param alertName - Name of the alert to search for
* @param totalIncidents - Total number of incidents to traverse
* @returns Promise resolving to true if alert is found in any incident
*/
- traverseAllIncidentsBars: (alertName: string, totalIncidents: number): Cypress.Chainable => {
- cy.log(`incidentsPage.searchAllIncidents: Searching ${totalIncidents} incidents for alert "${alertName}"`);
-
+ traverseAllIncidentsBars: (
+ alertName: string,
+ totalIncidents: number,
+ ): Cypress.Chainable => {
+ cy.log(
+ `incidentsPage.searchAllIncidents: Searching ${totalIncidents} incidents for alert ` +
+ `"${alertName}"`,
+ );
+
const searchNextIncidentBar = (currentIndex: number): Cypress.Chainable => {
if (currentIndex >= totalIncidents) {
cy.log(`Checked all ${totalIncidents} incidents, alert "${alertName}" not found`);
return cy.wrap(false);
}
- return incidentsPage.searchForAlertInIncident(alertName, currentIndex)
- .then((found) => {
- if (found) {
- return cy.wrap(true);
- }
- incidentsPage.deselectIncidentByBar();
- // Wait for the incident to be deselected
- // Quick workaround, could be improved by waiting for the number of paths to change, but it
- // does not has to if 1 initially. The check for the alert table non existance is already implemented,
- // but there seems to be a short delay between the alert table closing and new bars rendering.
- cy.wait(500)
- return searchNextIncidentBar(currentIndex + 1);
- });
+ return incidentsPage.searchForAlertInIncident(alertName, currentIndex).then((found) => {
+ if (found) {
+ return cy.wrap(true);
+ }
+ incidentsPage.deselectIncidentByBar();
+ // Wait for the incident to be deselected
+ // Quick workaround, could be improved by waiting for the number of paths to change, but
+ // it does not has to if 1 initially. The check for the alert table non existance is
+ // already implemented,
+ // but there seems to be a short delay between the alert table closing and new bars
+ // rendering.
+ cy.wait(500);
+ return searchNextIncidentBar(currentIndex + 1);
+ });
};
return searchNextIncidentBar(0);
@@ -690,80 +798,79 @@ export const incidentsPage = {
/**
* Main entry point for finding an alert across all incidents in the chart.
* Prepares the page, gets visible incident bars, and initiates comprehensive search.
- *
+ *
* @param alertName - Name of the alert to search for across all incidents
* @returns Promise resolving to true if alert is found in any incident
*/
findIncidentWithAlert: (alertName: string): Cypress.Chainable => {
cy.log(`incidentsPage.findIncidentWithAlert: Starting search for alert "${alertName}"`);
-
+
incidentsPage.prepareIncidentsPageForSearch();
-
- return incidentsPage.elements.incidentsChartBarsVisiblePaths()
- .then(($paths) => {
- const totalPaths = $paths.length;
- if (totalPaths === 0) {
- cy.log('No visible incident bar paths found in chart');
- return cy.wrap(false);
- }
-
- return incidentsPage.traverseAllIncidentsBars(alertName, totalPaths);
- });
+
+ return incidentsPage.elements.incidentsChartBarsVisiblePaths().then(($paths) => {
+ const totalPaths = $paths.length;
+ if (totalPaths === 0) {
+ cy.log('No visible incident bar paths found in chart');
+ return cy.wrap(false);
+ }
+
+ return incidentsPage.traverseAllIncidentsBars(alertName, totalPaths);
+ });
},
/**
* Gets structured information about alerts in the currently selected incident.
* Expands all incident rows and collects alert details from the expanded tables.
- *
+ *
* @returns Promise resolving to an array of alert information objects
*/
getSelectedIncidentAlerts: () => {
- cy.log('incidentsPage.getSelectedIncidentAlerts: Collecting alert information from selected incident');
+ cy.log(
+ 'incidentsPage.getSelectedIncidentAlerts: Collecting alert information from selected incident',
+ );
incidentsPage.elements.incidentsDetailsTable().should('exist');
-
- return incidentsPage.elements.incidentsTableRows()
- .then(($rows) => {
- const totalRows = $rows.length;
- if (totalRows === 0) {
- cy.log('No incident rows found');
- return cy.wrap([]);
- }
- cy.log(`Found ${totalRows} incident rows to expand`);
-
- // Expand all rows first
- for (let i = 0; i < totalRows; i++) {
- incidentsPage.expandRow(i);
- }
-
- // Wait for all details to load
- cy.wait(1000);
-
- // Count alert rows using the generic selector for details table rows
- return incidentsPage.elements.incidentsDetailsTableRows()
- .then(($detailRows) => {
- const alerts = [];
-
- // Create alert info objects with row indices and element references
- for (let i = 0; i < $detailRows.length; i++) {
- alerts.push({
- index: i,
- // Provide direct element reference for the row
- getRow: () => cy.wrap($detailRows.eq(i)),
- // Provide cell getters using column selectors based on data-label attributes
- getAlertRuleCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="alertname"]'),
- getNamespaceCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="namespace"]'),
- getSeverityCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="severity"]'),
- getStateCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="alertstate"]'),
- getStartCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="firingstart"]'),
- getEndCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="firingend"]')
- });
- }
-
- cy.log(`Collected information for ${alerts.length} alerts`);
- return cy.wrap(alerts);
+ return incidentsPage.elements.incidentsTableRows().then(($rows) => {
+ const totalRows = $rows.length;
+ if (totalRows === 0) {
+ cy.log('No incident rows found');
+ return cy.wrap([]);
+ }
+
+ cy.log(`Found ${totalRows} incident rows to expand`);
+
+ // Expand all rows first
+ for (let i = 0; i < totalRows; i++) {
+ incidentsPage.expandRow(i);
+ }
+
+ // Wait for all details to load
+ cy.wait(1000);
+
+ // Count alert rows using the generic selector for details table rows
+ return incidentsPage.elements.incidentsDetailsTableRows().then(($detailRows) => {
+ const alerts = [];
+
+ // Create alert info objects with row indices and element references
+ for (let i = 0; i < $detailRows.length; i++) {
+ alerts.push({
+ index: i,
+ // Provide direct element reference for the row
+ getRow: () => cy.wrap($detailRows.eq(i)),
+ // Provide cell getters using column selectors based on data-label attributes
+ getAlertRuleCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="alertname"]'),
+ getNamespaceCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="namespace"]'),
+ getSeverityCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="severity"]'),
+ getStateCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="alertstate"]'),
+ getStartCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="firingstart"]'),
+ getEndCell: () => cy.wrap($detailRows.eq(i)).find('td[data-label*="firingend"]'),
});
+ }
+
+ cy.log(`Collected information for ${alerts.length} alerts`);
+ return cy.wrap(alerts);
});
- }
-};
\ No newline at end of file
+ });
+ },
+};
diff --git a/web/cypress/views/legacy-dashboards.ts b/web/cypress/views/legacy-dashboards.ts
index 83691d9fa..bc55c8839 100644
--- a/web/cypress/views/legacy-dashboards.ts
+++ b/web/cypress/views/legacy-dashboards.ts
@@ -1,71 +1,138 @@
-import { commonPages } from "./common";
-import { LegacyDashboardPageTestIDs, DataTestIDs, Classes, IDs, LegacyTestIDs } from "../../src/components/data-test";
-import { MonitoringPageTitles, LegacyDashboardsTimeRange, MonitoringRefreshInterval, LegacyDashboardsDashboardDropdown, API_PERFORMANCE_DASHBOARD_PANELS, LegacyDashboardsDashboardDropdownNamespace, KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS } from "../fixtures/monitoring/constants";
-import { clickIfExist } from "./utils";
-
+import { commonPages } from './common';
+import { LegacyDashboardPageTestIDs, DataTestIDs, Classes } from '../../src/components/data-test';
+import {
+ MonitoringPageTitles,
+ LegacyDashboardsTimeRange,
+ MonitoringRefreshInterval,
+ LegacyDashboardsDashboardDropdown,
+ API_PERFORMANCE_DASHBOARD_PANELS,
+ LegacyDashboardsDashboardDropdownNamespace,
+ KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS,
+} from '../fixtures/monitoring/constants';
export const legacyDashboardsPage = {
-
shouldBeLoaded: () => {
cy.log('legacyDashboardsPage.shouldBeLoaded');
commonPages.titleShouldHaveText(MonitoringPageTitles.DASHBOARDS);
- cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).contains(LegacyDashboardsTimeRange.LAST_30_MINUTES).should('be.visible');
- cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).contains(MonitoringRefreshInterval.THIRTY_SECONDS).should('be.visible');
-
- cy.byLegacyTestID('namespace-bar-dropdown').find('span').invoke('text').then((text) => {
- if (text === 'Project: All Projects') {
- cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('input').should('have.value', LegacyDashboardsDashboardDropdown.API_PERFORMANCE[0]).and('be.visible');
- } else {
- cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('input').should('have.value', LegacyDashboardsDashboardDropdownNamespace.K8S_COMPUTE_RESOURCES_NAMESPACE_PODS[0]).and('be.visible');
- }
- });
+ cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown)
+ .contains(LegacyDashboardsTimeRange.LAST_30_MINUTES)
+ .should('be.visible');
+ cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown)
+ .contains(MonitoringRefreshInterval.THIRTY_SECONDS)
+ .should('be.visible');
+
+ cy.byLegacyTestID('namespace-bar-dropdown')
+ .find('span')
+ .invoke('text')
+ .then((text) => {
+ if (text === 'Project: All Projects') {
+ cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown)
+ .find('input')
+ .should('have.value', LegacyDashboardsDashboardDropdown.API_PERFORMANCE[0])
+ .and('be.visible');
+ } else {
+ cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown)
+ .find('input')
+ .should(
+ 'have.value',
+ LegacyDashboardsDashboardDropdownNamespace.K8S_COMPUTE_RESOURCES_NAMESPACE_PODS[0],
+ )
+ .and('be.visible');
+ }
+ });
},
clickTimeRangeDropdown: (timeRange: LegacyDashboardsTimeRange) => {
cy.log('legacyDashboardsPage.clickTimeRangeDropdown');
- cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).find('button').should('be.visible').click();
- cy.get('#'+LegacyDashboardPageTestIDs.DashboardTimeRangeDropdownMenu).find(Classes.MenuItem).contains(timeRange).should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
+ cy.get('#' + LegacyDashboardPageTestIDs.DashboardTimeRangeDropdownMenu)
+ .find(Classes.MenuItem)
+ .contains(timeRange)
+ .should('be.visible')
+ .click();
},
timeRangeDropdownAssertion: () => {
cy.log('legacyDashboardsPage.timeRangeDropdownAssertion');
- cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).find('button').should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
const timeRanges = Object.values(LegacyDashboardsTimeRange);
timeRanges.forEach((timeRange) => {
cy.log('Time range: ' + timeRange);
- cy.get('#'+LegacyDashboardPageTestIDs.DashboardTimeRangeDropdownMenu).find(Classes.MenuItem).contains(timeRange).should('be.visible');
+ cy.get('#' + LegacyDashboardPageTestIDs.DashboardTimeRangeDropdownMenu)
+ .find(Classes.MenuItem)
+ .contains(timeRange)
+ .should('be.visible');
});
- cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown).find('button').should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.TimeRangeDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
},
clickRefreshIntervalDropdown: (interval: MonitoringRefreshInterval) => {
cy.log('legacyDashboardsPage.clickRefreshIntervalDropdown');
- cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).find('button').should('be.visible').click();
- cy.get('#'+LegacyDashboardPageTestIDs.DashboardRefreshIntervalDropdownMenu).find(Classes.MenuItem).contains(interval).should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
+ cy.get('#' + LegacyDashboardPageTestIDs.DashboardRefreshIntervalDropdownMenu)
+ .find(Classes.MenuItem)
+ .contains(interval)
+ .should('be.visible')
+ .click();
},
refreshIntervalDropdownAssertion: () => {
cy.log('legacyDashboardsPage.refreshIntervalDropdownAssertion');
- cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).find('button').should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
const intervals = Object.values(MonitoringRefreshInterval);
intervals.forEach((interval) => {
cy.log('Refresh interval: ' + interval);
- cy.get('#'+LegacyDashboardPageTestIDs.DashboardRefreshIntervalDropdownMenu).find(Classes.MenuItem).contains(interval).should('be.visible');
+ cy.get('#' + LegacyDashboardPageTestIDs.DashboardRefreshIntervalDropdownMenu)
+ .find(Classes.MenuItem)
+ .contains(interval)
+ .should('be.visible');
});
- cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown).find('button').should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.PollIntervalDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
},
clickDashboardDropdown: (dashboard: keyof typeof LegacyDashboardsDashboardDropdown) => {
cy.log('legacyDashboardsPage.clickDashboardDropdown');
- cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('button').scrollIntoView().should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
cy.wait(2000);
- cy.get(Classes.MenuItem).contains(LegacyDashboardsDashboardDropdown[dashboard][0]).should('be.visible').click();
+ cy.get(Classes.MenuItem)
+ .contains(LegacyDashboardsDashboardDropdown[dashboard][0])
+ .should('be.visible')
+ .click();
},
- dashboardDropdownAssertion: (constants: typeof LegacyDashboardsDashboardDropdown | typeof LegacyDashboardsDashboardDropdownNamespace) => {
+ dashboardDropdownAssertion: (
+ constants:
+ | typeof LegacyDashboardsDashboardDropdown
+ | typeof LegacyDashboardsDashboardDropdownNamespace,
+ ) => {
cy.log('legacyDashboardsPage.dashboardDropdownAssertion');
- cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('button').should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
const dashboards = Object.values(constants);
dashboards.forEach((dashboard) => {
cy.log('Dashboard: ' + dashboard[0]);
@@ -74,7 +141,10 @@ export const legacyDashboardsPage = {
cy.get(Classes.MenuItem).should('contain', dashboard[0]).and('contain', dashboard[1]);
}
});
- cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('button').should('be.visible').click();
+ cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown)
+ .find('button')
+ .should('be.visible')
+ .click();
},
dashboardAPIPerformancePanelAssertion: () => {
@@ -94,7 +164,9 @@ export const legacyDashboardsPage = {
function formatDataTestID(panel: KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS): string {
return panel.toLowerCase().replace(/\s+/g, '-').concat('-chart');
}
- const dataTestIDs = Object.values(KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS).map(formatDataTestID);
+ const dataTestIDs = Object.values(KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS).map(
+ formatDataTestID,
+ );
dataTestIDs.forEach((dataTestID) => {
cy.log('Data test ID: ' + dataTestID);
cy.byTestID(dataTestID).scrollIntoView().should('be.visible');
@@ -105,7 +177,7 @@ export const legacyDashboardsPage = {
cy.log('legacyDashboardsPage.clickKebabDropdown');
cy.byTestID(DataTestIDs.KebabDropdownButton).eq(index).click();
},
-
+
exportAsCSV: (clearFolder: boolean, fileNameExp: string) => {
cy.log('metricsPage.exportAsCSV');
let downloadedFileName: string | null = null;
@@ -116,26 +188,30 @@ export const legacyDashboardsPage = {
}
cy.byTestID(LegacyDashboardPageTestIDs.ExportAsCsv).should('be.visible').click();
- cy.waitUntil(() => {
- return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
- const matchingFile = currentFiles.find(file => file.includes(expectedFileNamePattern));
- if (matchingFile) {
- downloadedFileName = matchingFile;
- return true;
- }
- return false;
- });
- }, {
- timeout: 20000,
- interval: 1000,
- errorMsg: `CSV file matching "${expectedFileNamePattern}" was not downloaded within timeout.`
- });
+ cy.waitUntil(
+ () => {
+ return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
+ const matchingFile = currentFiles.find((file) => file.includes(expectedFileNamePattern));
+ if (matchingFile) {
+ downloadedFileName = matchingFile;
+ return true;
+ }
+ return false;
+ });
+ },
+ {
+ timeout: 20000,
+ interval: 1000,
+ errorMsg: [
+ `CSV file matching "${expectedFileNamePattern}"`,
+ 'was not downloaded within timeout.',
+ ].join(' '),
+ },
+ );
cy.then(() => {
- expect(downloadedFileName).to.not.be.null;
+ expect(downloadedFileName).to.not.equal(null);
cy.task('doesFileExist', { fileName: downloadedFileName }).should('be.true');
});
-
},
-
};
diff --git a/web/cypress/views/list-page.ts b/web/cypress/views/list-page.ts
index f4b910f17..22c3a66bf 100644
--- a/web/cypress/views/list-page.ts
+++ b/web/cypress/views/list-page.ts
@@ -1,10 +1,9 @@
-import { getPFVersion } from "./utils";
-import { DataTestIDs, Classes, LegacyTestIDs } from "../../src/components/data-test";
+import { getPFVersion } from './utils';
+import { DataTestIDs, Classes, LegacyTestIDs } from '../../src/components/data-test';
export const listPage = {
-
/**
- *
+ *
* @param tab
*/
tabShouldHaveText: (tab: string) => {
@@ -13,15 +12,11 @@ export const listPage = {
},
/**
- *
+ *
* @param clearFolder true = clear folder, false = do not clear folder
* @param fileNameExp i.e openshift.csv
- * @param alertName
- * @param severity
- * @param state
- * @param total
*/
- exportAsCSV: (clearFolder: boolean, fileNameExp: RegExp, alertName: string, severity: string, state: string, total: number) => {
+ exportAsCSV: (clearFolder: boolean, fileNameExp: RegExp) => {
cy.log('listPage.exportAsCSV');
let downloadedFileName: string | null = null;
const downloadsFolder = Cypress.config('downloadsFolder');
@@ -31,61 +26,67 @@ export const listPage = {
}
cy.byTestID(DataTestIDs.DownloadCSVButton).should('be.visible').click();
- cy.waitUntil(() => {
- return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
- const matchingFile = currentFiles.find(file => expectedFileNamePattern.test(file));
- if (matchingFile) {
- downloadedFileName = matchingFile;
- return true;
- }
- return false;
- });
- }, {
- timeout: 20000,
- interval: 1000,
- errorMsg: `CSV file matching "${expectedFileNamePattern}" was not downloaded within timeout.`
- });
+ cy.waitUntil(
+ () => {
+ return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
+ const matchingFile = currentFiles.find((file) => expectedFileNamePattern.test(file));
+ if (matchingFile) {
+ downloadedFileName = matchingFile;
+ return true;
+ }
+ return false;
+ });
+ },
+ {
+ timeout: 20000,
+ interval: 1000,
+ errorMsg: [
+ `CSV file matching "${expectedFileNamePattern}"`,
+ 'was not downloaded within timeout.',
+ ].join(' '),
+ },
+ );
cy.then(() => {
- expect(downloadedFileName).to.not.be.null;
+ expect(downloadedFileName).to.not.equal(null);
cy.task('doesFileExist', { fileName: downloadedFileName }).should('be.true');
});
-
},
-
filter: {
/**
- * @param name
+ * @param name
*/
byName: (name: string) => {
cy.log('listPage.filter.byName');
try {
- cy.byTestID(DataTestIDs.NameLabelDropdown).scrollIntoView().click();
- cy.byTestID(DataTestIDs.NameLabelDropdownOptions).contains('Name').click();
- cy.byTestID(DataTestIDs.NameInput).scrollIntoView().as('input').should('be.visible');
- cy.get('@input', { timeout: 10000 }).scrollIntoView().type(name + '{enter}');
- cy.get('@input', { timeout: 10000 }).scrollIntoView().should('have.attr', 'value', name);
-
- }
- catch (error) {
+ cy.byTestID(DataTestIDs.NameLabelDropdown).scrollIntoView().click();
+ cy.byTestID(DataTestIDs.NameLabelDropdownOptions).contains('Name').click();
+ cy.byTestID(DataTestIDs.NameInput).scrollIntoView().as('input').should('be.visible');
+ cy.get('@input', { timeout: 10000 })
+ .scrollIntoView()
+ .type(name + '{enter}');
+ cy.get('@input', { timeout: 10000 }).scrollIntoView().should('have.attr', 'value', name);
+ } catch (error) {
cy.log(`${error.message}`);
throw error;
}
},
/**
- * @param label
+ * @param label
*/
byLabel: (label: string) => {
cy.log('listPage.filter.byLabel');
cy.byTestID(DataTestIDs.NameLabelDropdown).scrollIntoView().click();
cy.byTestID(DataTestIDs.NameLabelDropdownOptions).contains('Label').click();
- cy.byLegacyTestID(LegacyTestIDs.ItemFilter).scrollIntoView()
- .as('input').should('be.visible');
- cy.get('@input', { timeout: 10000 }).scrollIntoView().type(label + '{enter}').should('have.attr', 'value', label);
+ cy.byLegacyTestID(LegacyTestIDs.ItemFilter).scrollIntoView().as('input').should('be.visible');
+ cy.get('@input', { timeout: 10000 })
+ .scrollIntoView()
+ .type(label + '{enter}')
+ .should('have.attr', 'value', label);
cy.byTestID(DataTestIDs.LabelSuggestion).contains(label).click();
},
-
+
clearAllFilters: () => {
cy.log('listPage.filter.clearAllFilters');
try {
@@ -97,14 +98,18 @@ export const listPage = {
},
/**
- *
+ *
* @param toOpen true = open, false = nothing
* @param toClose true = close, false = nothing
*/
clickFilter: (toOpen: boolean, toClose: boolean) => {
cy.log('listPage.filter.clickFilter');
if (toOpen) {
- cy.get(Classes.FilterDropdown).contains('Filter').scrollIntoView().should('be.visible').click();
+ cy.get(Classes.FilterDropdown)
+ .contains('Filter')
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
}
if (toClose) {
cy.get(Classes.FilterDropdownExpanded).contains('Filter').should('be.visible').click();
@@ -112,7 +117,7 @@ export const listPage = {
},
/**
- *
+ *
* @param open true = open, false = nothing
* @param option i.e. Firing
* @param close true = close, false = nothing
@@ -121,53 +126,74 @@ export const listPage = {
cy.log('listPage.filter.selectFilterOption');
if (open) {
listPage.filter.clickFilter(open, false);
- };
+ }
cy.get(Classes.FilterDropdownOption).contains(option).should('be.visible').click();
if (close) {
listPage.filter.clickFilter(false, close);
- };
+ }
},
/**
* Click on the X for the whole tag group
- * @param groupTagName
+ * @param groupTagName
*/
removeMainTag: (groupTagName: string) => {
cy.log('listPage.filter.removeMainTag');
- cy.get(Classes.MainTag).contains(groupTagName).parent().next('div').children('button').click();
+ cy.get(Classes.MainTag)
+ .contains(groupTagName)
+ .parent()
+ .next('div')
+ .children('button')
+ .click();
},
/**
- *
- * @param tagName alerts-tab: Firing, Pending, Silenced, Critical, Warning, Info, None, Platform, User
- * silences: Active, Pending, Expired
- * alerting-rules: Firing, Pending, Silenced, Not Firing, Critical, Warning, Info, None, Platform, User
+ *
+ * @param tagName alerts-tab: Firing, Pending, Silenced, Critical, Warning, Info, None,
+ * Platform, User
+ * silences: Active, Pending, Expired
+ * alerting-rules: Firing, Pending, Silenced, Not Firing, Critical, Warning, Info, None,
+ * Platform, User
*/
removeIndividualTag: (tagName: string) => {
cy.log('listPage.filter.removeIndividualTag');
- cy.get(Classes.IndividualTag).contains(tagName).parent().next('span').children('button').click();
+ cy.get(Classes.IndividualTag)
+ .contains(tagName)
+ .parent()
+ .next('span')
+ .children('button')
+ .click();
},
/**
- *
- * @param groupTagName alerts-tab (Alert State, Severity, Source), Silence State, alerting-rules (Alert State, Severity, Source)
+ *
+ * @param groupTagName alerts-tab (Alert State, Severity, Source), Silence State,
+ * alerting-rules (Alert State, Severity, Source)
*/
clickOn1more: (groupTagName: string) => {
cy.log('listPage.filter.clickOn1more');
- cy.get(Classes.MoreLessTag).contains(groupTagName).siblings('ul').children('li').contains('1 more').click();
-
+ cy.get(Classes.MoreLessTag)
+ .contains(groupTagName)
+ .siblings('ul')
+ .children('li')
+ .contains('1 more')
+ .click();
},
/**
- *
- * @param groupTagName alerts-tab (Alert State, Severity, Source), Silence State, alerting-rules (Alert State, Severity, Source)
+ *
+ * @param groupTagName alerts-tab (Alert State, Severity, Source), Silence State,
+ * alerting-rules (Alert State, Severity, Source)
*/
clickOnShowLess: (groupTagName: string) => {
cy.log('listPage.filter.clickOnShowLess');
- cy.get(Classes.MoreLessTag).contains(groupTagName).siblings('ul').children('li').contains('Show less').click();
-
+ cy.get(Classes.MoreLessTag)
+ .contains(groupTagName)
+ .siblings('ul')
+ .children('li')
+ .contains('Show less')
+ .click();
},
-
},
ARRows: {
shouldBeLoaded: () => {
@@ -178,7 +204,7 @@ export const listPage = {
cy.log('listPage.ARRows.countShouldBe');
cy.byTestID(DataTestIDs.AlertingRuleResourceIcon).should('have.length', count);
},
-
+
//pf-6 only
ARShouldBe: (alert: string, severity: string, total: number, state: string) => {
cy.log('listPage.ARRows.ARShouldBe');
@@ -190,7 +216,6 @@ export const listPage = {
cy.byTestID(DataTestIDs.AlertingRuleTotalAlertsBadge).contains(total).should('exist');
cy.byTestID(DataTestIDs.AlertingRuleStateBadge).contains(state).should('exist');
}
-
},
AShouldBe: (alert: string, severity: string, namespace: string) => {
cy.log('listPage.ARRows.AShouldBe');
@@ -198,7 +223,6 @@ export const listPage = {
cy.byTestID(DataTestIDs.AlertResourceLink).contains(alert).should('exist');
cy.byTestID(DataTestIDs.SeverityBadge).contains(severity).should('exist');
cy.byTestID(DataTestIDs.AlertNamespace).contains(namespace).should('exist'); //pf-6 only
-
},
//pf-6 only
expandRow: () => {
@@ -208,11 +232,9 @@ export const listPage = {
if ($provider.find(Classes.ExpandedRow).length > 0) {
cy.log('Already expanded');
} else {
- cy.get(Classes.ToExpandRow, { timeout: 10000 })
- .eq(2)
- .click();
+ cy.get(Classes.ToExpandRow, { timeout: 10000 }).eq(2).click();
}
- })
+ });
} catch (error) {
cy.log(`${error.message}`);
throw error;
@@ -222,9 +244,7 @@ export const listPage = {
clickAlertingRule: () => {
cy.log('listPage.ARRows.clickAlertingRule');
try {
- cy.byTestID(DataTestIDs.AlertingRuleResourceLink)
- .should('be.visible')
- .click();
+ cy.byTestID(DataTestIDs.AlertingRuleResourceLink).should('be.visible').click();
} catch (error) {
cy.log(`${error.message}`);
throw error;
@@ -233,9 +253,7 @@ export const listPage = {
clickAlert: () => {
cy.log('listPage.ARRows.clickAlert');
try {
- cy.byTestID(DataTestIDs.AlertResourceLink)
- .should('be.visible')
- .click();
+ cy.byTestID(DataTestIDs.AlertResourceLink).should('be.visible').click();
} catch (error) {
cy.log(`${error.message}`);
throw error;
diff --git a/web/cypress/views/metrics.ts b/web/cypress/views/metrics.ts
index d2cf4bac6..8a6a304ed 100644
--- a/web/cypress/views/metrics.ts
+++ b/web/cypress/views/metrics.ts
@@ -1,17 +1,29 @@
-import { commonPages } from "./common";
-import { DataTestIDs, Classes, LegacyTestIDs, IDs } from "../../src/components/data-test";
-import { MetricsPageUnits, MonitoringRefreshInterval, MetricsPageQueryInput, MetricsPageActions, MetricGraphEmptyState, MetricsPagePredefinedQueries, MetricsPageQueryKebabDropdown, GraphTimespan } from "../fixtures/monitoring/constants";
+import { commonPages } from './common';
+import { DataTestIDs, Classes, IDs } from '../../src/components/data-test';
+import {
+ MetricsPageUnits,
+ MonitoringRefreshInterval,
+ MetricsPageQueryInput,
+ MetricsPageActions,
+ MetricGraphEmptyState,
+ MetricsPagePredefinedQueries,
+ MetricsPageQueryKebabDropdown,
+ GraphTimespan,
+} from '../fixtures/monitoring/constants';
export const metricsPage = {
-
shouldBeLoaded: () => {
cy.log('metricsPage.shouldBeLoaded');
commonPages.titleShouldHaveText('Metrics');
- cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown).contains(MetricsPageUnits.NO_UNITS).should('be.visible');
- cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MonitoringRefreshInterval.REFRESH_OFF).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown)
+ .contains(MetricsPageUnits.NO_UNITS)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricDropdownPollInterval)
+ .contains(MonitoringRefreshInterval.REFRESH_OFF)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
+ cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageNoQueryEnteredTitle).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageNoQueryEntered).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageInsertExampleQueryButton).should('be.visible');
@@ -24,8 +36,12 @@ export const metricsPage = {
redirectedToMetricsPageWithDatapoints: () => {
cy.log('metricsPage.redirectedToMetricsPage');
commonPages.titleShouldHaveText('Metrics');
- cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown).contains(MetricsPageUnits.NO_UNITS).should('be.visible');
- cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MonitoringRefreshInterval.REFRESH_OFF).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown)
+ .contains(MetricsPageUnits.NO_UNITS)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricDropdownPollInterval)
+ .contains(MonitoringRefreshInterval.REFRESH_OFF)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
@@ -38,10 +54,14 @@ export const metricsPage = {
cy.byTestID(DataTestIDs.MetricsPageRunQueriesButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).eq(0).should('be.visible');
cy.get(Classes.MetricsPageExpandedRowIcon).eq(0).should('be.visible');
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('not.have.text', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(0).should('have.attr', 'checked');
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('not.have.text', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(0)
+ .should('have.attr', 'checked');
cy.byTestID(DataTestIDs.KebabDropdownButton).eq(0).should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageQueryTable).eq(0).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).eq(0).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageSeriesButton).eq(0).should('be.visible');
@@ -53,8 +73,12 @@ export const metricsPage = {
redirectedToMetricsPageWithoutDatapoints: () => {
cy.log('metricsPage.redirectedToMetricsPageWithoutDatapoints');
commonPages.titleShouldHaveText('Metrics');
- cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown).contains(MetricsPageUnits.NO_UNITS).should('be.visible');
- cy.byTestID(DataTestIDs.MetricDropdownPollInterval).contains(MonitoringRefreshInterval.REFRESH_OFF).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphUnitsDropDown)
+ .contains(MetricsPageUnits.NO_UNITS)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricDropdownPollInterval)
+ .contains(MonitoringRefreshInterval.REFRESH_OFF)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricHideShowGraphButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
@@ -63,16 +87,24 @@ export const metricsPage = {
cy.byTestID(DataTestIDs.MetricResetZoomButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricStackedCheckbox).should('be.visible');
cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).should('be.visible');
- cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound).contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound)
+ .contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND)
+ .should('be.visible');
cy.byTestID(DataTestIDs.TypeaheadSelectInput).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageAddQueryButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageRunQueriesButton).should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageExpandCollapseRowButton).eq(0).should('be.visible');
cy.get(Classes.MetricsPageExpandedRowIcon).eq(0).should('be.visible');
- cy.get(Classes.MetricsPageQueryInput).eq(0).should('not.have.text', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(0).should('have.attr', 'checked');
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(0)
+ .should('not.have.text', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(0)
+ .should('have.attr', 'checked');
cy.byTestID(DataTestIDs.KebabDropdownButton).eq(0).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageYellowNoDatapointsFound).contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageYellowNoDatapointsFound)
+ .contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageQueryTable).eq(0).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).eq(0).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageSeriesButton).eq(0).should('not.exist');
@@ -121,7 +153,7 @@ export const metricsPage = {
},
unitsAxisYAssertion: (unit: MetricsPageUnits) => {
- cy.log('metricsPage.unitsAxisYAssertion');
+ cy.log(`metricsPage.unitsAxisYAssertion: ${unit}`);
cy.get('[id^="' + IDs.ChartAxis1ChartLabel + '"]').should('be.visible');
cy.get('[id^="' + IDs.ChartAxis1ChartLabel + '"]').should('not.contain', 'undefined');
},
@@ -164,16 +196,28 @@ export const metricsPage = {
clickActions: () => {
cy.log('metricsPage.clickActions');
- cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('have.attr', 'aria-expanded', 'false').click();
+ cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton)
+ .should('have.attr', 'aria-expanded', 'false')
+ .click();
},
actionsDropdownAssertion: () => {
cy.log('metricsPage.actionsDropdownAssertion');
- cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('have.attr', 'aria-expanded', 'false').click();
- cy.byTestID(DataTestIDs.MetricsPageAddQueryDropdownItem).contains(MetricsPageActions.ADD_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageDeleteAllQueriesDropdownItem).contains(MetricsPageActions.DELETE_ALL_QUERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExpandCollapseAllDropdownItem).contains(MetricsPageActions.COLLAPSE_ALL_QUERY_TABLES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton).should('have.attr', 'aria-expanded', 'true').click();
+ cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton)
+ .should('have.attr', 'aria-expanded', 'false')
+ .click();
+ cy.byTestID(DataTestIDs.MetricsPageAddQueryDropdownItem)
+ .contains(MetricsPageActions.ADD_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDeleteAllQueriesDropdownItem)
+ .contains(MetricsPageActions.DELETE_ALL_QUERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseAllDropdownItem)
+ .contains(MetricsPageActions.COLLAPSE_ALL_QUERY_TABLES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageActionsDropdownButton)
+ .should('have.attr', 'aria-expanded', 'true')
+ .click();
},
clickActionsAddQuery: () => {
@@ -189,23 +233,28 @@ export const metricsPage = {
},
/**
- *
+ *
* @param toExpand true: expand all query tables, false: collapse all query tables
*/
clickActionsExpandCollapseAllQuery: (toExpand: boolean) => {
cy.log('metricsPage.clickActionsExpandCollapseAllQuery');
metricsPage.clickActions();
if (toExpand) {
- cy.byTestID(DataTestIDs.MetricsPageExpandCollapseAllDropdownItem).contains(MetricsPageActions.EXPAND_ALL_QUERY_TABLES).click();
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseAllDropdownItem)
+ .contains(MetricsPageActions.EXPAND_ALL_QUERY_TABLES)
+ .click();
} else {
- cy.byTestID(DataTestIDs.MetricsPageExpandCollapseAllDropdownItem).contains(MetricsPageActions.COLLAPSE_ALL_QUERY_TABLES).click();
+ cy.byTestID(DataTestIDs.MetricsPageExpandCollapseAllDropdownItem)
+ .contains(MetricsPageActions.COLLAPSE_ALL_QUERY_TABLES)
+ .click();
}
},
/**
- *
+ *
* @param expand true: to assert it is expanded, false: to assert it is collapsed
- * @param withQuery if there is any row with query,true: to assert the query table is visible, false: to assert the query table is not visible
+ * @param withQuery if there is any row with query,true: to assert the query table is visible,
+ * false: to assert the query table is not visible
*/
expandCollapseAllQueryAssertion: (expanded: boolean) => {
cy.log('metricsPage.expandCollapseAllQueryAssertion');
@@ -214,65 +263,130 @@ export const metricsPage = {
for (let i = 0; i < rowIconsCount; i++) {
if (expanded) {
cy.get(Classes.MetricsPageRows).find('li').eq(i).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(i).should('have.attr', 'checked');
- } else { //collapsed
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(i)
+ .should('have.attr', 'checked');
+ } else {
+ //collapsed
cy.get(Classes.MetricsPageRows).find('li').eq(i).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(i).should('have.attr', 'checked'); //collapsed does not change switch state when from actions
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(i)
+ .should('have.attr', 'checked'); //collapsed does not change switch state when from actions
}
}
- })
+ });
},
/**
- *
+ *
* @param expand true: to expand the row, false: to collapse the row
* @param index index of the row to expand or collapse, starting from 0
*/
expandCollapseRow: (index: number) => {
cy.log('metricsPage.expandCollapseRow');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).should('be.visible').click()
+ cy.get(Classes.MetricsPageRows).find('li').eq(index).should('be.visible').click();
},
/**
* assertion for expand/collapse All rows from Actions dropdown, not manually
- * @param expanded
- * @param index
- * @param withQuery
+ * @param expanded
+ * @param index
+ * @param withQuery
*/
- expandCollapseRowAssertion: (expanded: boolean, index: number, withQuery: boolean, withSwitch: boolean) => {
+ expandCollapseRowAssertion: (
+ expanded: boolean,
+ index: number,
+ withQuery: boolean,
+ withSwitch: boolean,
+ ) => {
cy.log('metricsPage.expandCollapseRowAssertion');
if (withQuery) {
- cy.get(Classes.MetricsPageQueryInput).eq(index).should('not.contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(index)
+ .should('not.contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
} else {
- cy.get(Classes.MetricsPageQueryInput).eq(index).should('contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(index)
+ .should('contain', MetricsPageQueryInput.EXPRESSION_PRESS_SHIFT_ENTER_FOR_NEWLINES);
}
if (expanded) {
if (withQuery) {
cy.get(Classes.MetricsPageRows).find('li').eq(index).scrollIntoView().should('be.visible');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]').should('have.attr', 'checked');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageQueryTable + '"]').should('be.visible');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageSelectAllUnselectAllButton + '"]').should('be.visible');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').should('have.length.gt', 0);
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]')
+ .should('have.attr', 'checked');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageQueryTable + '"]')
+ .should('be.visible');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageSelectAllUnselectAllButton + '"]')
+ .should('be.visible');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .should('have.length.gt', 0);
} else {
cy.get(Classes.MetricsPageRows).find('li').eq(index).should('be.visible');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]').should('have.attr', 'checked');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageQueryTable + '"]').should('not.exist');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageSelectAllUnselectAllButton + '"]').should('not.exist');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').should('not.exist');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]')
+ .should('have.attr', 'checked');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageQueryTable + '"]')
+ .should('not.exist');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageSelectAllUnselectAllButton + '"]')
+ .should('not.exist');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .should('not.exist');
}
} else {
- if (withSwitch){
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]').should('not.have.attr', 'checked');
- }
- else {
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]').should('have.attr', 'checked');
+ if (withSwitch) {
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]')
+ .should('not.have.attr', 'checked');
+ } else {
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageDisableEnableQuerySwitch + '"]')
+ .should('have.attr', 'checked');
}
cy.get(Classes.MetricsPageRows).find('li').eq(index).should('be.visible');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageQueryTable + '"]').should('not.exist');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageSelectAllUnselectAllButton + '"]').should('not.exist');
- cy.get(Classes.MetricsPageRows).find('li').eq(index).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').should('not.exist');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageQueryTable + '"]')
+ .should('not.exist');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageSelectAllUnselectAllButton + '"]')
+ .should('not.exist');
+ cy.get(Classes.MetricsPageRows)
+ .find('li')
+ .eq(index)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .should('not.exist');
}
},
@@ -289,7 +403,10 @@ export const metricsPage = {
clickGraphTimespanDropdown: (timespan: GraphTimespan) => {
cy.log('metricsPage.clickGraphTimespanDropdown');
- cy.byTestID(DataTestIDs.MetricGraphTimespanDropdown).scrollIntoView().should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricGraphTimespanDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
cy.get(Classes.MenuItem).contains(timespan).should('be.visible').click();
cy.byPFRole('progressbar').should('be.visible');
cy.byPFRole('progressbar').should('not.exist');
@@ -297,7 +414,10 @@ export const metricsPage = {
enterGraphTimespan: (timespan: GraphTimespan) => {
cy.log('metricsPage.enterGraphTimespan');
- cy.byTestID(DataTestIDs.MetricGraphTimespanInput).scrollIntoView().should('be.visible').type('{selectall}{backspace}', {delay: 1000});
+ cy.byTestID(DataTestIDs.MetricGraphTimespanInput)
+ .scrollIntoView()
+ .should('be.visible')
+ .type('{selectall}{backspace}', { delay: 1000 });
cy.byTestID(DataTestIDs.MetricGraphTimespanInput).type(timespan);
cy.byTestID(DataTestIDs.MetricGraphTimespanInput).should('have.attr', 'value', timespan);
cy.byPFRole('progressbar').should('be.visible');
@@ -322,19 +442,28 @@ export const metricsPage = {
clickHideGraphButton: () => {
cy.log('metricsPage.clickHideGraphButton');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).scrollIntoView().should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
cy.byTestID(DataTestIDs.MetricGraph).should('not.exist');
},
clickShowGraphButton: () => {
cy.log('metricsPage.clickShowGraphButton');
- cy.byTestID(DataTestIDs.MetricHideShowGraphButton).scrollIntoView().should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricHideShowGraphButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
cy.byTestID(DataTestIDs.MetricGraph).should('be.visible');
},
clickDisconnectedCheckbox: () => {
cy.log('metricsPage.clickDisconnectedCheckbox');
- cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox).scrollIntoView().should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricDisconnectedCheckbox)
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
},
clickStackedCheckbox: () => {
@@ -344,14 +473,20 @@ export const metricsPage = {
clickStackedCheckboxAndAssert: () => {
cy.log('metricsPage.clickStackedCheckboxAndAssert');
- cy.get('[id^="' + IDs.ChartAxis1ChartLabel + '"]').invoke('text').as('yAxisLabel');
+ cy.get('[id^="' + IDs.ChartAxis1ChartLabel + '"]')
+ .invoke('text')
+ .as('yAxisLabel');
cy.byTestID(DataTestIDs.MetricStackedCheckbox).scrollIntoView().should('be.visible').click();
cy.get('[id^="' + IDs.ChartAxis1ChartLabel + '"]').then(() => {
cy.get('@yAxisLabel').then((value) => {
cy.get('[id^="' + IDs.ChartAxis1ChartLabel + '"]').should('not.contain', value);
});
});
- cy.byTestID(DataTestIDs.MetricStackedCheckbox).should('have.attr', 'data-checked-state', 'true');
+ cy.byTestID(DataTestIDs.MetricStackedCheckbox).should(
+ 'have.attr',
+ 'data-checked-state',
+ 'true',
+ );
},
graphCardInlineInfoAssertion: (visible: boolean) => {
@@ -377,7 +512,10 @@ export const metricsPage = {
clickPredefinedQuery: (query: MetricsPagePredefinedQueries) => {
cy.log('metricsPage.clickPredefinedQuery');
cy.byTestID(DataTestIDs.TypeaheadSelectInput).scrollIntoView().should('be.visible').click();
- cy.get(Classes.MetricsPagePredefinedQueriesMenuItem).contains(query).should('be.visible').click();
+ cy.get(Classes.MetricsPagePredefinedQueriesMenuItem)
+ .contains(query)
+ .should('be.visible')
+ .click();
},
clickKebabDropdown: (index: number) => {
@@ -388,56 +526,85 @@ export const metricsPage = {
kebabDropdownAssertionWithoutQuery: () => {
cy.log('metricsPage.kebabDropdownAssertionWithoutQuery');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DELETE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DELETE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('not.exist');
- cy.byTestID(DataTestIDs.KebabDropdownButton).eq(0).should('have.attr', 'aria-expanded', 'true').click();
+ cy.byTestID(DataTestIDs.KebabDropdownButton)
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true')
+ .click();
},
kebabDropdownAssertionWithQuery: () => {
cy.log('metricsPage.kebabDropdownAssertionWithQuery');
metricsPage.clickKebabDropdown(0);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem).contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DELETE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem).contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV).should('be.visible');
- cy.byTestID(DataTestIDs.KebabDropdownButton).eq(0).should('have.attr', 'aria-expanded', 'true').click();
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DISABLE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageHideShowAllSeriesDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.HIDE_ALL_SERIES)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDeleteQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DELETE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDuplicateQueryDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.DUPLICATE_QUERY)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem)
+ .contains(MetricsPageQueryKebabDropdown.EXPORT_AS_CSV)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.KebabDropdownButton)
+ .eq(0)
+ .should('have.attr', 'aria-expanded', 'true')
+ .click();
},
clickKebabDropdownItem: (option: MetricsPageQueryKebabDropdown, index: number) => {
cy.log('metricsPage.clickKebabDropdownItem');
metricsPage.clickKebabDropdown(index);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(option).should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(option)
+ .should('be.visible')
+ .click();
},
assertKebabDropdownItem: (option: MetricsPageQueryKebabDropdown, index: number) => {
cy.log('metricsPage.assertKebabDropdownItem');
metricsPage.clickKebabDropdown(index);
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem).contains(option).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQueryDropdownItem)
+ .contains(option)
+ .should('be.visible');
},
/** viewport width: 1920px
- * viewport height: 1080px
- * configurations from cypress.config.ts:
- * 5m - 20 labels
- * 15m - 15 labels
- * 30m - 30 labels - 15 labels
- * 1h - 12 labels
- * 2h - 24 labels
- * 6h - 12 labels
- * 12h - 12 labels
- * 1d - 24 labels
- * 2h - 16 labels
- * 1w - 14 labels
- * 2w - 14 labels
- */
+ * viewport height: 1080px
+ * configurations from cypress.config.ts:
+ * 5m - 20 labels
+ * 15m - 15 labels
+ * 30m - 30 labels - 15 labels
+ * 1h - 12 labels
+ * 2h - 24 labels
+ * 6h - 12 labels
+ * 12h - 12 labels
+ * 1d - 24 labels
+ * 2h - 16 labels
+ * 1w - 14 labels
+ * 2w - 14 labels
+ */
graphAxisXAssertion: (graphTimespan: GraphTimespan) => {
cy.log('metricsPage.graphAxisAssertion');
- cy.get('body').then($body => {
+ cy.get('body').then(($body) => {
if ($body.find('[id^="' + IDs.ChartAxis0ChartLabel + '"]').length > 0) {
switch (graphTimespan) {
case GraphTimespan.FIVE_MINUTES:
@@ -478,7 +645,10 @@ export const metricsPage = {
break;
}
} else {
- cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound).scrollIntoView().contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound)
+ .scrollIntoView()
+ .contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND)
+ .should('be.visible');
}
});
},
@@ -486,7 +656,9 @@ export const metricsPage = {
enterQueryInput: (index: number, query: string) => {
cy.log('metricsPage.enterQueryInput');
cy.get(Classes.MetricsPageQueryInput).eq(index).should('be.visible').clear();
- cy.get(Classes.MetricsPageQueryInput).eq(index).type(query + '{enter}');
+ cy.get(Classes.MetricsPageQueryInput)
+ .eq(index)
+ .type(query + '{enter}');
},
clickRunQueriesButton: () => {
@@ -496,54 +668,94 @@ export const metricsPage = {
clickDisableEnableQuerySwitch: (index: number) => {
cy.log('metricsPage.clickDisableEnableQuerySwitch');
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(index).parent('label').should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(index)
+ .parent('label')
+ .should('be.visible')
+ .click();
},
disableEnableQuerySwitchAssertion: (index: number, enabled: boolean) => {
cy.log('metricsPage.disableEnableQuerySwitchAssertion');
if (enabled) {
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(index).should('have.attr', 'checked');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(index)
+ .should('have.attr', 'checked');
} else {
- cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch).eq(index).should('not.have.attr', 'checked');
+ cy.byTestID(DataTestIDs.MetricsPageDisableEnableQuerySwitch)
+ .eq(index)
+ .should('not.have.attr', 'checked');
}
},
clickSeriesButton: (rowIndex: number, seriesIndex: number, toEnable: boolean) => {
cy.log('metricsPage.clickSeriesButton');
if (toEnable) {
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(rowIndex).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').eq(seriesIndex).should('have.attr', 'aria-label', 'Show series').click();
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(rowIndex)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .eq(seriesIndex)
+ .should('have.attr', 'aria-label', 'Show series')
+ .click();
} else {
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(rowIndex).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').eq(seriesIndex).should('have.attr', 'aria-label', 'Hide series').click();
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(rowIndex)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .eq(seriesIndex)
+ .should('have.attr', 'aria-label', 'Hide series')
+ .click();
}
},
- seriesButtonAssertion: (rowIndex: number, seriesIndex: number, enabled: boolean) => {
+ seriesButtonAssertion: (rowIndex: number, seriesIndex: number, enabled: boolean) => {
cy.log('metricsPage.seriesButtonAssertion');
if (enabled) {
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(rowIndex).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').eq(seriesIndex).should('have.attr', 'aria-label', 'Hide series');
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(rowIndex)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .eq(seriesIndex)
+ .should('have.attr', 'aria-label', 'Hide series');
} else {
- cy.get(Classes.MetricsPageExpandedRowIcon).eq(rowIndex).find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]').eq(seriesIndex).should('have.attr', 'aria-label', 'Show series');
+ cy.get(Classes.MetricsPageExpandedRowIcon)
+ .eq(rowIndex)
+ .find('[data-test="' + DataTestIDs.MetricsPageSeriesButton + '"]')
+ .eq(seriesIndex)
+ .should('have.attr', 'aria-label', 'Show series');
}
},
selectAllUnselectAllButtonAssertion: (rowIndex: number, unselectAll: boolean) => {
cy.log('metricsPage.selectAllUnselectAllButtonAssertion');
if (unselectAll) {
- cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).eq(rowIndex).contains('Unselect all').should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton)
+ .eq(rowIndex)
+ .contains('Unselect all')
+ .should('be.visible');
} else {
- cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).eq(rowIndex).contains('Select all').should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton)
+ .eq(rowIndex)
+ .contains('Select all')
+ .should('be.visible');
}
},
clickSelectAllUnselectAllButton: (rowIndex: number, unselectAll: boolean) => {
cy.log('metricsPage.clickSelectAllUnselectAllButton');
if (unselectAll) {
- cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).eq(rowIndex).contains('Unselect all').should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton)
+ .eq(rowIndex)
+ .contains('Unselect all')
+ .should('be.visible')
+ .click();
} else {
- cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).eq(rowIndex).contains('Select all').should('be.visible').click();
+ cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton)
+ .eq(rowIndex)
+ .contains('Select all')
+ .should('be.visible')
+ .click();
}
},
-
+
exportAsCSV: (clearFolder: boolean, fileNameExp: string) => {
cy.log('metricsPage.exportAsCSV');
let downloadedFileName: string | null = null;
@@ -554,36 +766,44 @@ export const metricsPage = {
}
cy.byTestID(DataTestIDs.MetricsPageExportCsvDropdownItem).should('be.visible').click();
- cy.waitUntil(() => {
- return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
- const matchingFile = currentFiles.find(file => file.includes(expectedFileNamePattern));
- if (matchingFile) {
- downloadedFileName = matchingFile;
- return true;
- }
- return false;
- });
- }, {
- timeout: 20000,
- interval: 1000,
- errorMsg: `CSV file matching "${expectedFileNamePattern}" was not downloaded within timeout.`
- });
+ cy.waitUntil(
+ () => {
+ return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
+ const matchingFile = currentFiles.find((file) => file.includes(expectedFileNamePattern));
+ if (matchingFile) {
+ downloadedFileName = matchingFile;
+ return true;
+ }
+ return false;
+ });
+ },
+ {
+ timeout: 20000,
+ interval: 1000,
+ errorMsg: [
+ `CSV file matching "${expectedFileNamePattern}"`,
+ 'was not downloaded within timeout.',
+ ].join(' '),
+ },
+ );
cy.then(() => {
- expect(downloadedFileName).to.not.be.null;
+ expect(downloadedFileName).to.not.equal(null);
cy.task('doesFileExist', { fileName: downloadedFileName }).should('be.true');
});
-
},
noDatapointsFound: () => {
cy.log('metricsPage.noDatapointsFound');
- cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound).contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND).should('be.visible');
- cy.byTestID(DataTestIDs.MetricsPageYellowNoDatapointsFound).contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND).should('be.visible');
+ cy.byTestID(DataTestIDs.MetricGraphNoDatapointsFound)
+ .contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.MetricsPageYellowNoDatapointsFound)
+ .contains(MetricGraphEmptyState.NO_DATAPOINTS_FOUND)
+ .should('be.visible');
cy.byTestID(DataTestIDs.MetricsPageInsertExampleQueryButton).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageQueryTable).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageSelectAllUnselectAllButton).should('not.exist');
cy.byTestID(DataTestIDs.MetricsPageSeriesButton).should('not.exist');
},
-
};
diff --git a/web/cypress/views/nav.ts b/web/cypress/views/nav.ts
index 16fab1abc..096d99109 100644
--- a/web/cypress/views/nav.ts
+++ b/web/cypress/views/nav.ts
@@ -10,10 +10,12 @@ export const nav = {
changePerspectiveTo: (...perspectives: string[]) => {
cy.get('body').then((body) => {
if (body.find('button[data-test-id="perspective-switcher-toggle"]:visible').length > 0) {
- cy.byLegacyTestID('perspective-switcher-toggle').scrollIntoView().click({ force: true });
+ cy.byLegacyTestID('perspective-switcher-toggle')
+ .scrollIntoView()
+ .click({ force: true });
cy.get('[data-test-id="perspective-switcher-menu-option"]').then(($options) => {
- const foundPerspective = perspectives.find(p => $options.text().includes(p));
+ const foundPerspective = perspectives.find((p) => $options.text().includes(p));
if (foundPerspective) {
cy.byLegacyTestID('perspective-switcher-menu-option')
.contains(foundPerspective)
@@ -23,7 +25,6 @@ export const nav = {
cy.get('body').type('{esc}');
}
});
-
}
});
cy.wait(2000);
@@ -31,8 +32,8 @@ export const nav = {
shouldHaveText: (perspective: string) => {
cy.log('Should have text - ' + `${perspective}`);
cy.byLegacyTestID('perspective-switcher-toggle').contains(perspective).should('be.visible');
- }
- }
+ },
+ },
},
tabs: {
/**
@@ -40,8 +41,8 @@ export const nav = {
* @param tabname - The name of the tab to switch to
*/
switchTab: (tabname: string) => {
- cy.get(Classes.HorizontalNav).contains(tabname).should('be.visible').click({force: true});
+ cy.get(Classes.HorizontalNav).contains(tabname).should('be.visible').click({ force: true });
cy.wait(2000);
- }
-}
+ },
+ },
};
diff --git a/web/cypress/views/operator-hub-page.ts b/web/cypress/views/operator-hub-page.ts
index 2f8404138..50fc92462 100644
--- a/web/cypress/views/operator-hub-page.ts
+++ b/web/cypress/views/operator-hub-page.ts
@@ -3,7 +3,8 @@ import * as helperfuncs from '../views/utils';
export const operatorHubPage = {
installOperator: (operatorName, csName, installNamespace?) => {
cy.visit(
- `/operatorhub/subscribe?pkg=${operatorName}&catalog=${csName}&catalogNamespace=openshift-marketplace&targetNamespace=undefined`,
+ `/operatorhub/subscribe?pkg=${operatorName}&catalog=${csName}` +
+ `&catalogNamespace=openshift-marketplace&targetNamespace=undefined`,
);
cy.get('body').should('be.visible');
if (installNamespace) {
@@ -21,4 +22,4 @@ export const operatorHubPage = {
.children()
.contains(`${csvStatus}`, { timeout: 120000 });
},
-};
\ No newline at end of file
+};
diff --git a/web/cypress/views/overview-page.ts b/web/cypress/views/overview-page.ts
index 1f2055d78..5d5dc86d4 100644
--- a/web/cypress/views/overview-page.ts
+++ b/web/cypress/views/overview-page.ts
@@ -1,11 +1,9 @@
-import { commonPages } from "./common";
+import { commonPages } from './common';
export const overviewPage = {
-
shouldBeLoaded: () => {
cy.log('overviewPage.shouldBeLoaded');
commonPages.titleShouldHaveText('Overview');
-
},
clickStatusViewAlerts: () => {
@@ -15,12 +13,18 @@ export const overviewPage = {
clickStatusViewDetails: (position: number) => {
cy.log('overviewPage.clickStatusViewAlerts');
- cy.byClass('co-status-card__alert-item-more').contains('View details').eq(position).should('be.visible').click();
+ cy.byClass('co-status-card__alert-item-more')
+ .contains('View details')
+ .eq(position)
+ .should('be.visible')
+ .click();
},
clickClusterUtilizationViewCPU: () => {
cy.log('overviewPage.clickClusterUtilizationViewCPU');
- cy.byAriaLabel('View CPU metrics in query browser').scrollIntoView().should('be.visible').click();
- }
-
-}
+ cy.byAriaLabel('View CPU metrics in query browser')
+ .scrollIntoView()
+ .should('be.visible')
+ .click();
+ },
+};
diff --git a/web/cypress/views/perses-dashboards-create-dashboard.ts b/web/cypress/views/perses-dashboards-create-dashboard.ts
index 55a43389e..cbcaa8b2f 100644
--- a/web/cypress/views/perses-dashboards-create-dashboard.ts
+++ b/web/cypress/views/perses-dashboards-create-dashboard.ts
@@ -1,11 +1,12 @@
-import { Classes, IDs, persesAriaLabels } from "../../src/components/data-test";
-import { persesCreateDashboard, persesDashboardsModalTitles } from "../fixtures/perses/constants";
+import { Classes, IDs, persesAriaLabels } from '../../src/components/data-test';
+import { persesCreateDashboard, persesDashboardsModalTitles } from '../fixtures/perses/constants';
export const persesCreateDashboardsPage = {
-
createDashboardShouldBeLoaded: () => {
cy.log('persesCreateDashboardsPage.createDashboardShouldBeLoaded');
- cy.byPFRole('dialog').find('h1').should('have.text', persesDashboardsModalTitles.CREATE_DASHBOARD);
+ cy.byPFRole('dialog')
+ .find('h1')
+ .should('have.text', persesDashboardsModalTitles.CREATE_DASHBOARD);
cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible');
cy.get('#' + IDs.persesDashboardCreateDashboardName).should('be.visible');
cy.byPFRole('dialog').find('button').contains('Create').should('be.visible');
@@ -14,62 +15,75 @@ export const persesCreateDashboardsPage = {
selectProject: (project: string) => {
cy.log('persesCreateDashboardsPage.selectProject');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).clear().type(project);
cy.byPFRole('option').contains(project).should('be.visible').click({ force: true });
},
-
+
assertProjectDropdown: (project: string) => {
cy.log('persesCreateDashboardsPage.assertProjectDropdown');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).clear().type(project);
cy.byPFRole('option').contains(project).should('be.visible');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('option').contains(project).should('be.visible').click({ force: true });
},
assertProjectNotExistsInDropdown: (project: string) => {
cy.log('persesCreateDashboardsPage.assertProjectNotExistsInDropdown');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
- cy.byPFRole('listbox').find('li').then((items) => {
- items.each((index, item) => {
- cy.log('Project: ' + item.innerText);
- if (item.innerText === project) {
- expect(item).to.not.exist;
- }
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
+ cy.byPFRole('listbox')
+ .find('li')
+ .then((items) => {
+ items.each((index, item) => {
+ cy.log('Project: ' + item.innerText);
+ if (item.innerText === project) {
+ cy.wrap(item).should('not.exist');
+ }
+ });
});
- });
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
},
enterDashboardName: (name: string) => {
cy.log('persesCreateDashboardsPage.enterDashboardName');
- cy.get('#' + IDs.persesDashboardCreateDashboardName).should('be.visible').clear().type(name);
+ cy.get('#' + IDs.persesDashboardCreateDashboardName)
+ .should('be.visible')
+ .clear()
+ .type(name);
},
createDashboardDialogCreateButton: () => {
cy.log('persesCreateDashboardsPage.clickCreateButton');
- cy.byPFRole('dialog').find('button').contains('Create').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Create')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
assertMaxLengthValidation: () => {
cy.log('persesCreateDashboardsPage.assertMaxLengthValidation');
- cy.byPFRole('dialog').find('h4').should('have.text', persesCreateDashboard.DIALOG_MAX_LENGTH_VALIDATION).should('be.visible');
+ cy.byPFRole('dialog')
+ .find(Classes.PersesCreateDashboardDashboardNameError)
+ .should('have.text', `${persesCreateDashboard.DIALOG_MAX_LENGTH_VALIDATION}`)
+ .should('be.visible');
},
- assertDuplicatedNameValidation: (dashboardName: string) => {
+ assertDuplicatedNameValidation: () => {
cy.log('persesCreateDashboardsPage.assertDuplicatedNameValidation');
- if (dashboardName.includes(' ')) {
- cy.byPFRole('dialog').find('h4').should('have.text', persesCreateDashboard.DIALOG_DUPLICATED_NAME_BKD_VALIDATION).should('be.visible');
- } else {
- cy.byPFRole('dialog').find(Classes.PersesCreateDashboardDashboardNameError).should('have.text', `${persesCreateDashboard.DIALOG_DUPLICATED_NAME_PF_VALIDATION_PREFIX}"${dashboardName}"${persesCreateDashboard.DIALOG_DUPLICATED_NAME_PF_VALIDATION_SUFFIX}`).should('be.visible');
- }
+ cy.get(Classes.PersesDuplicateDashboardNameError)
+ .should('have.text', persesCreateDashboard.DIALOG_DUPLICATED_NAME_BKD_VALIDATION)
+ .should('be.visible');
},
createDashboardDialogCancelButton: () => {
cy.log('persesCreateDashboardsPage.clickCancelButton');
- cy.byPFRole('dialog').find('button').contains('Cancel').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
-
-}
+};
diff --git a/web/cypress/views/perses-dashboards-edit-datasources.ts b/web/cypress/views/perses-dashboards-edit-datasources.ts
index c7c1bcfdc..6adfece39 100644
--- a/web/cypress/views/perses-dashboards-edit-datasources.ts
+++ b/web/cypress/views/perses-dashboards-edit-datasources.ts
@@ -1,70 +1,151 @@
-import { commonPages } from "./common";
-import { persesAriaLabels, persesMUIDataTestIDs, editPersesDashboardsAddDatasource, IDs } from "../../src/components/data-test";
-import { persesDashboardsModalTitles, persesDashboardsRequiredFields } from "../fixtures/perses/constants";
+import { commonPages } from './common';
+import {
+ persesAriaLabels,
+ persesMUIDataTestIDs,
+ editPersesDashboardsAddDatasource,
+ IDs,
+} from '../../src/components/data-test';
+import {
+ persesDashboardsModalTitles,
+ persesDashboardsRequiredFields,
+} from '../fixtures/perses/constants';
export const persesDashboardsEditDatasources = {
-
shouldBeLoaded: () => {
cy.log('persesDashboardsEditVariables.shouldBeLoaded');
commonPages.titleModalShouldHaveText(persesDashboardsModalTitles.EDIT_DASHBOARD_DATASOURCES);
cy.byAriaLabel(persesAriaLabels.EditDashboardDatasourcesTable).should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('button').contains('Apply').should('be.visible').and('have.attr', 'disabled');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('button').contains('Cancel').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('button').contains('Add Datasource').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('button')
+ .contains('Apply')
+ .should('be.visible')
+ .and('have.attr', 'disabled');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('button')
+ .contains('Add Datasource')
+ .should('be.visible');
},
- assertDatasource: (index: number, name: string, type: 'PrometheusDatasource' | 'TempoDatasource', description: string) => {
+ assertDatasource: (
+ index: number,
+ name: string,
+ type: 'PrometheusDatasource' | 'TempoDatasource',
+ description: string,
+ ) => {
cy.log('persesDashboardsEditDatasources.assertDatasource');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('tbody').find('tr').eq(index).find('th').contains(name).should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('tbody').find('tr').eq(index).find('td').eq(0).contains(type).should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('tbody')
+ .find('tr')
+ .eq(index)
+ .find('th')
+ .contains(name)
+ .should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('tbody')
+ .find('tr')
+ .eq(index)
+ .find('td')
+ .eq(0)
+ .contains(type)
+ .should('be.visible');
if (description !== '') {
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('tbody').find('tr').eq(index).find('td').eq(1).contains(description).should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('tbody')
+ .find('tr')
+ .eq(index)
+ .find('td')
+ .eq(1)
+ .contains(description)
+ .should('be.visible');
}
},
assertDatasourceNotExist: (name: string) => {
cy.log('persesDashboardsEditDatasources.assertDatasource');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('th').contains(name).should('not.exist');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('th')
+ .contains(name)
+ .should('not.exist');
},
clickButton: (button: 'Apply' | 'Cancel' | 'Add Datasource' | 'Add') => {
cy.log('persesDashboardsEditDatasources.clickButton');
if (button === 'Cancel') {
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('button').contains(button).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('button')
+ .contains(button)
+ .should('be.visible')
+ .click();
cy.wait(1000);
cy.get('body').then((body) => {
- if (body.find('#'+IDs.persesDashboardDiscardChangesDialog).length > 0 && body.find('#'+IDs.persesDashboardDiscardChangesDialog).is(':visible')) {
- cy.bySemanticElement('button', 'Discard Changes').scrollIntoView().should('be.visible').click({ force: true });
+ if (
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).length > 0 &&
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).is(':visible')
+ ) {
+ cy.bySemanticElement('button', 'Discard Changes')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
}
});
} else {
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('button').contains(button).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('button')
+ .contains(button)
+ .should('be.visible')
+ .click();
}
},
- addDatasource: (name: string, defaultDatasource: boolean, pluginOptions: 'Prometheus Datasource' | 'Tempo Datasource', displayLabel?: string, description?: string) => {
+ addDatasource: (
+ name: string,
+ defaultDatasource: boolean,
+ pluginOptions: 'Prometheus Datasource' | 'Tempo Datasource',
+ displayLabel?: string,
+ description?: string,
+ ) => {
cy.log('persesDashboardsEditDatasources.addDatasource');
- cy.get('input[name="'+editPersesDashboardsAddDatasource.inputName+'"]').clear().type(name);
+ cy.get('input[name="' + editPersesDashboardsAddDatasource.inputName + '"]')
+ .clear()
+ .type(name);
if (displayLabel !== undefined) {
- cy.get('input[name="'+editPersesDashboardsAddDatasource.inputDisplayLabel+'"]').clear().type(displayLabel);
+ cy.get('input[name="' + editPersesDashboardsAddDatasource.inputDisplayLabel + '"]')
+ .clear()
+ .type(displayLabel);
}
if (description !== undefined) {
- cy.get('input[name="'+editPersesDashboardsAddDatasource.inputDescription+'"]').clear().type(description);
+ cy.get('input[name="' + editPersesDashboardsAddDatasource.inputDescription + '"]')
+ .clear()
+ .type(description);
}
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('input[name="'+editPersesDashboardsAddDatasource.inputDefaultDatasource+'"]').then((checkbox) => {
- if ((checkbox.not(':checked') && defaultDatasource) || (checkbox.is(':checked') && !defaultDatasource)) {
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('input[name="'+editPersesDashboardsAddDatasource.inputDefaultDatasource+'"]').click();
- }
- });
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('input[name="' + editPersesDashboardsAddDatasource.inputDefaultDatasource + '"]')
+ .then((checkbox) => {
+ if (
+ (checkbox.not(':checked') && defaultDatasource) ||
+ (checkbox.is(':checked') && !defaultDatasource)
+ ) {
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('input[name="' + editPersesDashboardsAddDatasource.inputDefaultDatasource + '"]')
+ .click();
+ }
+ });
persesDashboardsEditDatasources.clickDropdownAndSelectOption('Source', pluginOptions);
-
},
clickDropdownAndSelectOption: (label: string, option: string) => {
cy.log('persesDashboardsEditVariables.selectVariableType');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('label').contains(label).siblings('div').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('label')
+ .contains(label)
+ .siblings('div')
+ .click();
cy.get('li').contains(option).should('be.visible').click();
},
@@ -73,23 +154,46 @@ export const persesDashboardsEditDatasources = {
switch (field) {
case 'Name':
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('label').contains(field).siblings('p').should('have.text', persesDashboardsRequiredFields.AddVariableNameField);
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find('label')
+ .contains(field)
+ .siblings('p')
+ .should('have.text', persesDashboardsRequiredFields.AddVariableNameField);
break;
}
},
clickDiscardChangesButton: () => {
cy.log('persesDashboardsEditVariables.clickDiscardChangesButton');
- cy.bySemanticElement('button', 'Discard Changes').scrollIntoView().should('be.visible').click({ force: true });
+ cy.bySemanticElement('button', 'Discard Changes')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
clickEditDatasourceButton: (index: number) => {
cy.log('persesDashboardsEditDatasources.clickEditDatasourceButton');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('[data-testid="'+persesMUIDataTestIDs.editDashboardEditVariableDatasourceEditButton+'"]').eq(index).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find(
+ '[data-testid="' +
+ persesMUIDataTestIDs.editDashboardEditVariableDatasourceEditButton +
+ '"]',
+ )
+ .eq(index)
+ .should('be.visible')
+ .click();
},
clickDeleteDatasourceButton: (index: number) => {
cy.log('persesDashboardsEditDatasources.clickDeleteDatasourceButton');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal).find('[data-testid="'+persesMUIDataTestIDs.editDashboardEditVariableDatasourceDeleteButton+'"]').eq(index).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardDatasourcesModal)
+ .find(
+ '[data-testid="' +
+ persesMUIDataTestIDs.editDashboardEditVariableDatasourceDeleteButton +
+ '"]',
+ )
+ .eq(index)
+ .should('be.visible')
+ .click();
},
-}
+};
diff --git a/web/cypress/views/perses-dashboards-edit-variables.ts b/web/cypress/views/perses-dashboards-edit-variables.ts
index 5aaeb4c0e..7bb9f6a63 100644
--- a/web/cypress/views/perses-dashboards-edit-variables.ts
+++ b/web/cypress/views/perses-dashboards-edit-variables.ts
@@ -1,18 +1,39 @@
-import { commonPages } from "./common";
-import { persesAriaLabels, persesMUIDataTestIDs, IDs, editPersesDashboardsAddVariable } from "../../src/components/data-test";
-import { persesDashboardsModalTitles, persesDashboardsAddListVariableSource, persesDashboardsAddListVariableSort, persesDashboardsRequiredFields } from "../fixtures/perses/constants";
+import { commonPages } from './common';
+import {
+ persesAriaLabels,
+ persesMUIDataTestIDs,
+ IDs,
+ editPersesDashboardsAddVariable,
+} from '../../src/components/data-test';
+import {
+ persesDashboardsModalTitles,
+ persesDashboardsAddListVariableSource,
+ persesDashboardsAddListVariableSort,
+ persesDashboardsRequiredFields,
+} from '../fixtures/perses/constants';
export const persesDashboardsEditVariables = {
-
shouldBeLoaded: () => {
cy.log('persesDashboardsEditVariables.shouldBeLoaded');
commonPages.titleModalShouldHaveText(persesDashboardsModalTitles.EDIT_DASHBOARD_VARIABLES);
cy.byAriaLabel(persesAriaLabels.EditDashboardVariablesTable).should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('button').contains('Apply').should('be.visible').and('have.attr', 'disabled');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('button').contains('Cancel').should('be.visible');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('button').contains('Add Variable').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('button')
+ .contains('Apply')
+ .should('be.visible')
+ .and('have.attr', 'disabled');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('button')
+ .contains('Add Variable')
+ .should('be.visible');
commonPages.titleModalShouldHaveText(persesDashboardsModalTitles.DASHBOARD_BUILT_IN_VARIABLES);
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('#'+IDs.persesDashboardEditVariablesModalBuiltinButton).should('have.attr', 'aria-expanded', 'false');
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('#' + IDs.persesDashboardEditVariablesModalBuiltinButton)
+ .should('have.attr', 'aria-expanded', 'false');
},
clickButton: (button: 'Apply' | 'Cancel' | 'Add Variable' | 'Add' | 'Run Query') => {
@@ -20,48 +41,79 @@ export const persesDashboardsEditVariables = {
cy.wait(3000);
if (button === 'Cancel') {
cy.get('body').then((body) => {
- if (body.find('#'+IDs.persesDashboardDiscardChangesDialog).length > 0 && body.find('#'+IDs.persesDashboardDiscardChangesDialog).is(':visible')) {
- cy.bySemanticElement('button', 'Discard Changes').scrollIntoView().should('be.visible').click({ force: true });
+ if (
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).length > 0 &&
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).is(':visible')
+ ) {
+ cy.bySemanticElement('button', 'Discard Changes')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
}
});
} else {
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('button').contains(button).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('button')
+ .contains(button)
+ .should('be.visible')
+ .click();
}
},
- addTextVariable: (name: string, constant: boolean, displayLabel?: string, description?: string, value?: string) => {
+ addTextVariable: (
+ name: string,
+ constant: boolean,
+ displayLabel?: string,
+ description?: string,
+ value?: string,
+ ) => {
cy.log('persesDashboardsEditVariables.addTextVariable');
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputName+'"]').clear().type(name);
-
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputName + '"]')
+ .clear()
+ .type(name);
+
const displayLabelInput = displayLabel !== undefined ? displayLabel : name;
const descriptionInput = description !== undefined ? description : name;
const valueInput = value !== undefined ? value : '';
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputDisplayLabel+'"]').clear().type(displayLabelInput);
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputDescription+'"]').clear().type(descriptionInput);
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputValue+'"]').clear().type(valueInput);
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputDisplayLabel + '"]')
+ .clear()
+ .type(displayLabelInput);
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputDescription + '"]')
+ .clear()
+ .type(descriptionInput);
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputValue + '"]')
+ .clear()
+ .type(valueInput);
if (constant) {
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputConstant+'"]').click();
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputConstant + '"]').click();
}
},
addListVariable: (
- name: string,
- allowMultiple: boolean,
- allowAllValue: boolean,
- customAllValue?: string,
- displayLabel?: string,
- description?: string,
- source?: persesDashboardsAddListVariableSource,
- sort?: persesDashboardsAddListVariableSort) => {
+ name: string,
+ allowMultiple: boolean,
+ allowAllValue: boolean,
+ customAllValue?: string,
+ displayLabel?: string,
+ description?: string,
+ source?: persesDashboardsAddListVariableSource,
+ sort?: persesDashboardsAddListVariableSort,
+ ) => {
cy.log('persesDashboardsEditVariables.addListVariable');
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputName+'"]').clear().type(name);
-
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputName + '"]')
+ .clear()
+ .type(name);
+
if (displayLabel !== undefined && displayLabel !== '') {
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputDisplayLabel+'"]').clear().type(displayLabel);
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputDisplayLabel + '"]')
+ .clear()
+ .type(displayLabel);
}
- if (description !== undefined && description !== '' ) {
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputDescription+'"]').clear().type(description);
+ if (description !== undefined && description !== '') {
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputDescription + '"]')
+ .clear()
+ .type(description);
}
persesDashboardsEditVariables.clickDropdownAndSelectOption('Type', 'List');
@@ -72,12 +124,14 @@ export const persesDashboardsEditVariables = {
persesDashboardsEditVariables.clickDropdownAndSelectOption('Sort', sort);
}
if (allowMultiple) {
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputAllowMultiple+'"]').click();
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputAllowMultiple + '"]').click();
}
if (allowAllValue) {
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputAllowAllValue+'"]').click();
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputAllowAllValue + '"]').click();
if (customAllValue !== undefined && customAllValue !== '') {
- cy.get('input[name="'+editPersesDashboardsAddVariable.inputCustomAllValue+'"]').clear().type(customAllValue);
+ cy.get('input[name="' + editPersesDashboardsAddVariable.inputCustomAllValue + '"]')
+ .clear()
+ .type(customAllValue);
}
}
},
@@ -85,11 +139,22 @@ export const persesDashboardsEditVariables = {
addListVariable_staticListVariable_enterValue: (value: string) => {
cy.log('persesDashboardsEditVariables.addListVariable_staticListVariable_enterValue');
cy.wait(2000);
- cy.get('h6').contains('List Options').next('div').eq(0).find('input[role="combobox"]').click().type(value+'{enter}');
+ cy.get('h6')
+ .contains('List Options')
+ .next('div')
+ .eq(0)
+ .find('input[role="combobox"]')
+ .click()
+ .type(value + '{enter}');
cy.wait(2000);
cy.byDataTestID(persesMUIDataTestIDs.editDashboardAddVariableRunQueryButton).click();
cy.wait(2000);
- cy.get('h4').contains('Preview Values').parent('div').siblings('div').contains(value).should('be.visible');
+ cy.get('h4')
+ .contains('Preview Values')
+ .parent('div')
+ .siblings('div')
+ .contains(value)
+ .should('be.visible');
},
addListVariable_promLabelValuesVariable_enterLabelName: (labelName: string) => {
@@ -102,23 +167,34 @@ export const persesDashboardsEditVariables = {
},
addListVariable_promLabelValuesVariable_addSeriesSelector: (seriesSelector: string) => {
- cy.log('persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector');
+ cy.log(
+ 'persesDashboardsEditVariables.addListVariable_promLabelValuesVariable_addSeriesSelector',
+ );
cy.wait(2000);
cy.bySemanticElement('button', 'Add Series Selector').click();
- cy.get('label').contains('Series Selector').next('div').find('input').click().type(seriesSelector);
+ cy.get('label')
+ .contains('Series Selector')
+ .next('div')
+ .find('input')
+ .click()
+ .type(seriesSelector);
cy.wait(2000);
cy.byDataTestID(persesMUIDataTestIDs.editDashboardAddVariableRunQueryButton).click();
cy.wait(2000);
},
/**
- *
+ *
* @param label - label of the dropdown
* @param option - option to select
*/
clickDropdownAndSelectOption: (label: string, option: string) => {
cy.log('persesDashboardsEditVariables.selectVariableType');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('label').contains(label).siblings('div').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('label')
+ .contains(label)
+ .siblings('div')
+ .click();
cy.get('li').contains(option).should('be.visible').click();
},
@@ -127,42 +203,79 @@ export const persesDashboardsEditVariables = {
switch (field) {
case 'Name':
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('label').contains(field).siblings('p').should('have.text', persesDashboardsRequiredFields.AddVariableNameField);
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('label')
+ .contains(field)
+ .siblings('p')
+ .should('have.text', persesDashboardsRequiredFields.AddVariableNameField);
break;
}
},
clickDiscardChangesButton: () => {
cy.log('persesDashboardsEditVariables.clickDiscardChangesButton');
- cy.bySemanticElement('button', 'Discard Changes').scrollIntoView().should('be.visible').click({ force: true });
+ cy.bySemanticElement('button', 'Discard Changes')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
toggleVariableVisibility: (index: number, visible: boolean) => {
cy.log('persesDashboardsEditVariables.toggleVariableVisibility');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('input[type="checkbox"]').eq(index).then((checkbox) => {
- if ((checkbox.not(':checked') && visible) || (checkbox.is(':checked') && !visible)) {
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('input[type="checkbox"]').eq(index).click();
- }
- });
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('input[type="checkbox"]')
+ .eq(index)
+ .then((checkbox) => {
+ if ((checkbox.not(':checked') && visible) || (checkbox.is(':checked') && !visible)) {
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('input[type="checkbox"]')
+ .eq(index)
+ .click();
+ }
+ });
},
moveVariableUp: (index: number) => {
cy.log('persesDashboardsEditVariables.moveVariableUp');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('[data-testid="'+persesMUIDataTestIDs.editDashboardEditVariableMoveUpButton+'"]').eq(index).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('[data-testid="' + persesMUIDataTestIDs.editDashboardEditVariableMoveUpButton + '"]')
+ .eq(index)
+ .should('be.visible')
+ .click();
},
moveVariableDown: (index: number) => {
cy.log('persesDashboardsEditVariables.moveVariableDown');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('[data-testid="'+persesMUIDataTestIDs.editDashboardEditVariableMoveDownButton+'"]').eq(index).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('[data-testid="' + persesMUIDataTestIDs.editDashboardEditVariableMoveDownButton + '"]')
+ .eq(index)
+ .should('be.visible')
+ .click();
},
clickEditVariableButton: (index: number) => {
cy.log('persesDashboardsEditVariables.clickEditVariableButton');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('[data-testid="'+persesMUIDataTestIDs.editDashboardEditVariableDatasourceEditButton+'"]').eq(index).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find(
+ '[data-testid="' +
+ persesMUIDataTestIDs.editDashboardEditVariableDatasourceEditButton +
+ '"]',
+ )
+ .eq(index)
+ .should('be.visible')
+ .click();
},
clickDeleteVariableButton: (index: number) => {
cy.log('persesDashboardsEditVariables.clickDeleteVariableButton');
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('[data-testid="'+persesMUIDataTestIDs.editDashboardEditVariableDatasourceDeleteButton+'"]').eq(index).should('be.visible').click();
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find(
+ '[data-testid="' +
+ persesMUIDataTestIDs.editDashboardEditVariableDatasourceDeleteButton +
+ '"]',
+ )
+ .eq(index)
+ .should('be.visible')
+ .click();
},
-}
+};
diff --git a/web/cypress/views/perses-dashboards-import-dashboard.ts b/web/cypress/views/perses-dashboards-import-dashboard.ts
index 9f4c83acf..23672fde5 100644
--- a/web/cypress/views/perses-dashboards-import-dashboard.ts
+++ b/web/cypress/views/perses-dashboards-import-dashboard.ts
@@ -1,14 +1,22 @@
-import { Classes, IDs, persesAriaLabels } from "../../src/components/data-test";
-import { persesCreateDashboard, persesDashboardsImportDashboard, persesDashboardsModalTitles } from "../fixtures/perses/constants";
+import { Classes, IDs, persesAriaLabels } from '../../src/components/data-test';
+import {
+ persesDashboardsImportDashboard,
+ persesDashboardsModalTitles,
+} from '../fixtures/perses/constants';
export const persesImportDashboardsPage = {
-
importDashboardShouldBeLoaded: () => {
cy.log('persesImportDashboardsPage.importDashboardShouldBeLoaded');
cy.wait(2000);
- cy.byPFRole('dialog').find('h1').should('have.text', persesDashboardsModalTitles.IMPORT_DASHBOARD);
- cy.bySemanticElement('label').contains(persesDashboardsImportDashboard.DIALOG_TITLE).should('be.visible');
- cy.bySemanticElement('span').contains(persesDashboardsImportDashboard.DIALOG_UPLOAD_JSON_YAML_FILE).should('be.visible');
+ cy.byPFRole('dialog')
+ .find('h1')
+ .should('have.text', persesDashboardsModalTitles.IMPORT_DASHBOARD);
+ cy.bySemanticElement('label')
+ .contains(persesDashboardsImportDashboard.DIALOG_TITLE)
+ .should('be.visible');
+ cy.bySemanticElement('span')
+ .contains(persesDashboardsImportDashboard.DIALOG_UPLOAD_JSON_YAML_FILE)
+ .should('be.visible');
cy.get('#' + IDs.persesDashboardImportDashboardUploadFileInput).should('be.visible');
cy.byPFRole('dialog').find('button').contains('Upload').should('be.visible');
cy.byPFRole('dialog').find('button').contains('Clear').should('be.visible');
@@ -20,13 +28,13 @@ export const persesImportDashboardsPage = {
cy.log('persesImportDashboardsPage.uploadFile');
// Normalize path separators for cross-platform compatibility (Mac/Linux/Windows)
const normalizedPath = file.replace(/\\/g, '/');
-
+
cy.readFile(normalizedPath).then((content) => {
const textContent = typeof content === 'object' ? JSON.stringify(content, null, 2) : content;
-
+
// Monaco editor requires special handling - click to focus, then set value via Monaco API
cy.get(Classes.ImportDashboardTextArea).should('be.visible').click({ force: true });
-
+
cy.window().then((win) => {
const models = (win as any).monaco?.editor?.getModels?.();
if (Array.isArray(models) && models.length > 0) {
@@ -41,77 +49,116 @@ export const persesImportDashboardsPage = {
clickClearFileButton: () => {
cy.log('persesImportDashboardsPage.clearFile');
- cy.byPFRole('dialog').find('button').contains('Clear').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Clear')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
clickImportFileButton: () => {
cy.log('persesImportDashboardsPage.clickImportFileButton');
- cy.byPFRole('dialog').find('button').contains('Import').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Import')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
clickCancelButton: () => {
cy.log('persesImportDashboardsPage.clickCancelButton');
- cy.byPFRole('dialog').find('button').contains('Cancel').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
assertUnableToDetectDashboardFormat: () => {
cy.log('persesImportDashboardsPage.assertUnableToDetectDashboardFormat');
- cy.byPFRole('dialog').find('span').contains(persesDashboardsImportDashboard.DIALOG_UNABLE_TO_DETECT_DASHBOARD_FORMAT).should('be.visible');
+ cy.byPFRole('dialog')
+ .find('span')
+ .contains(persesDashboardsImportDashboard.DIALOG_UNABLE_TO_DETECT_DASHBOARD_FORMAT)
+ .should('be.visible');
},
assertGrafanaDashboardDetected: () => {
cy.log('persesImportDashboardsPage.assertGrafanaDashboardDetected');
- cy.byPFRole('dialog').find('span').contains(persesDashboardsImportDashboard.DIALOG_GRAFANA_DASHBOARD_DETECTED).should('be.visible');
+ cy.byPFRole('dialog')
+ .find('span')
+ .contains(persesDashboardsImportDashboard.DIALOG_GRAFANA_DASHBOARD_DETECTED)
+ .should('be.visible');
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).should('be.visible');
},
assertPersesDashboardDetected: () => {
cy.log('persesImportDashboardsPage.assertPersesDashboardDetected');
- cy.byPFRole('dialog').find('span').contains(persesDashboardsImportDashboard.DIALOG_PERSES_DASHBOARD_DETECTED).should('be.visible');
+ cy.byPFRole('dialog')
+ .find('span')
+ .contains(persesDashboardsImportDashboard.DIALOG_PERSES_DASHBOARD_DETECTED)
+ .should('be.visible');
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).should('be.visible');
},
selectProject: (project: string) => {
cy.log('persesImportDashboardsPage.selectProject');
- cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton)
+ .should('be.visible')
+ .click({ force: true });
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).clear().type(project);
cy.byPFRole('option').contains(project).should('be.visible').click({ force: true });
},
-
+
assertProjectDropdown: (project: string) => {
cy.log('persesImportDashboardsPage.assertProjectDropdown');
- cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton)
+ .should('be.visible')
+ .click({ force: true });
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).clear().type(project);
cy.byPFRole('option').contains(project).should('be.visible');
- cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton)
+ .should('be.visible')
+ .click({ force: true });
},
assertProjectNotExistsInDropdown: (project: string) => {
cy.log('persesImportDashboardsPage.assertProjectNotExistsInDropdown');
- cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton).should('be.visible').click({ force: true });
- cy.byPFRole('listbox').find('li').each(($item) => {
- expect($item.text().trim()).to.not.equal(project);
- });
- cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton)
+ .should('be.visible')
+ .click({ force: true });
+ cy.byPFRole('listbox')
+ .find('li')
+ .each(($item) => {
+ expect($item.text().trim()).to.not.equal(project);
+ });
+ cy.byAriaLabel(persesAriaLabels.importDashboardProjectInputButton)
+ .should('be.visible')
+ .click({ force: true });
},
assertFailedToMigrateGrafanaDashboard: () => {
cy.log('persesImportDashboardsPage.assertFailedToMigrateGrafanaDashboard');
- cy.byPFRole('dialog').find('h4').contains(persesDashboardsImportDashboard.DIALOG_FAILED_TO_MIGRATE_GRAFANA_DASHBOARD).should('be.visible');
+ cy.get('h4')
+ .contains(persesDashboardsImportDashboard.DIALOG_FAILED_TO_MIGRATE_GRAFANA_DASHBOARD)
+ .should('be.visible');
},
assertDuplicatedDashboardError: () => {
cy.log('persesImportDashboardsPage.assertDuplicatedDashboardError');
- cy.byPFRole('dialog').find('h4').contains(persesDashboardsImportDashboard.DIALOG_DUPLICATED_DASHBOARD_ERROR).should('be.visible');
+ cy.get('h4')
+ .contains(persesDashboardsImportDashboard.DIALOG_DUPLICATED_DASHBOARD_ERROR)
+ .should('be.visible');
},
dismissDuplicatedDashboardError: () => {
cy.log('persesImportDashboardsPage.dismissDuplicatedDashboardError');
- cy.byAriaLabel(persesAriaLabels.importDashboardDuplicatedDashboardError).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.importDashboardDuplicatedDashboardError)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
-
-}
+};
diff --git a/web/cypress/views/perses-dashboards-list-dashboards.ts b/web/cypress/views/perses-dashboards-list-dashboards.ts
index 4d5799ae0..139ac8c8e 100644
--- a/web/cypress/views/perses-dashboards-list-dashboards.ts
+++ b/web/cypress/views/perses-dashboards-list-dashboards.ts
@@ -1,21 +1,42 @@
-import { commonPages } from "./common";
-import { DataTestIDs, Classes, listPersesDashboardsOUIAIDs, listPersesDashboardsDataTestIDs, IDs, persesAriaLabels, LegacyTestIDs } from "../../src/components/data-test";
-import { listPersesDashboardsEmptyState, listPersesDashboardsNoDashboardsFoundState, listPersesDashboardsPageSubtitle, persesDashboardsDuplicateDashboard, persesDashboardsRenameDashboard } from "../fixtures/perses/constants";
-import { MonitoringPageTitles } from "../fixtures/monitoring/constants";
+import { commonPages } from './common';
+import {
+ DataTestIDs,
+ Classes,
+ listPersesDashboardsOUIAIDs,
+ listPersesDashboardsDataTestIDs,
+ IDs,
+ persesAriaLabels,
+ LegacyTestIDs,
+} from '../../src/components/data-test';
+import {
+ listPersesDashboardsEmptyState,
+ listPersesDashboardsNoDashboardsFoundState,
+ listPersesDashboardsPageSubtitle,
+ persesDashboardsDuplicateDashboard,
+ persesDashboardsRenameDashboard,
+} from '../fixtures/perses/constants';
+import { MonitoringPageTitles } from '../fixtures/monitoring/constants';
export const listPersesDashboardsPage = {
-
emptyState: () => {
cy.log('listPersesDashboardsPage.emptyState');
- cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateTitle).should('be.visible').contains(listPersesDashboardsEmptyState.TITLE);
- cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateBody).should('be.visible').contains(listPersesDashboardsEmptyState.BODY);
+ cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateTitle)
+ .should('be.visible')
+ .contains(listPersesDashboardsEmptyState.TITLE);
+ cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateBody)
+ .should('be.visible')
+ .contains(listPersesDashboardsEmptyState.BODY);
cy.byTestID(listPersesDashboardsDataTestIDs.ClearAllFiltersButton).should('be.visible');
},
noDashboardsFoundState: () => {
cy.log('listPersesDashboardsPage.noDashboardsFoundState');
- cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateTitle).should('be.visible').contains(listPersesDashboardsNoDashboardsFoundState.TITLE);
- cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateBody).should('be.visible').contains(listPersesDashboardsNoDashboardsFoundState.BODY);
+ cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateTitle)
+ .should('be.visible')
+ .contains(listPersesDashboardsNoDashboardsFoundState.TITLE);
+ cy.byTestID(listPersesDashboardsDataTestIDs.EmptyStateBody)
+ .should('be.visible')
+ .contains(listPersesDashboardsNoDashboardsFoundState.BODY);
cy.byTestID(listPersesDashboardsDataTestIDs.ClearAllFiltersButton).should('not.exist');
},
@@ -23,46 +44,64 @@ export const listPersesDashboardsPage = {
cy.log('listPersesDashboardsPage.shouldBeLoaded');
cy.byOUIAID(listPersesDashboardsOUIAIDs.PersesBreadcrumb).should('not.exist');
commonPages.titleShouldHaveText(MonitoringPageTitles.DASHBOARDS);
- cy.byOUIAID(listPersesDashboardsOUIAIDs.PageHeaderSubtitle).should('contain', listPersesDashboardsPageSubtitle).should('be.visible');
+ cy.byOUIAID(listPersesDashboardsOUIAIDs.PageHeaderSubtitle)
+ .should('contain', listPersesDashboardsPageSubtitle)
+ .should('be.visible');
cy.byTestID(DataTestIDs.PersesCreateDashboardButton).scrollIntoView().should('be.visible');
cy.byTestID(DataTestIDs.FavoriteStarButton).should('be.visible');
cy.byOUIAID(listPersesDashboardsOUIAIDs.PersesDashListDataViewTable).should('be.visible');
-
},
filter: {
byName: (name: string) => {
cy.log('listPersesDashboardsPage.filter.byName');
cy.wait(1000);
- cy.byOUIAID(listPersesDashboardsOUIAIDs.persesListDataViewFilters).contains('button',/Name|Project/).click( { force: true });
+ cy.byOUIAID(listPersesDashboardsOUIAIDs.persesListDataViewFilters)
+ .contains('button', /Name|Project/)
+ .click({ force: true });
cy.wait(1000);
- cy.get(Classes.FilterDropdownOption).should('be.visible').contains('Name').click( { force: true });
+ cy.get(Classes.FilterDropdownOption)
+ .should('be.visible')
+ .contains('Name')
+ .click({ force: true });
cy.wait(1000);
cy.byTestID(listPersesDashboardsDataTestIDs.NameFilter).should('be.visible').type(name);
cy.wait(1000);
- cy.byTestID(listPersesDashboardsDataTestIDs.NameFilter).find('input').should('have.attr', 'value', name);
- cy.wait(2000);
+ cy.byTestID(listPersesDashboardsDataTestIDs.NameFilter)
+ .find('input')
+ .should('have.attr', 'value', name);
+ cy.wait(4000);
},
byProject: (project: string) => {
cy.log('listPersesDashboardsPage.filter.byProject');
- cy.byOUIAID(listPersesDashboardsOUIAIDs.persesListDataViewFilters).contains('button',/Name|Project/).click( { force: true });
+ cy.byOUIAID(listPersesDashboardsOUIAIDs.persesListDataViewFilters)
+ .contains('button', /Name|Project/)
+ .click({ force: true });
cy.wait(1000);
- cy.get(Classes.FilterDropdownOption).should('be.visible').contains('Project').click( { force: true });
+ cy.get(Classes.FilterDropdownOption)
+ .should('be.visible')
+ .contains('Project')
+ .click({ force: true });
cy.wait(1000);
cy.byTestID(listPersesDashboardsDataTestIDs.ProjectFilter).should('be.visible').type(project);
cy.wait(1000);
- cy.byTestID(listPersesDashboardsDataTestIDs.ProjectFilter).find('input').should('have.attr', 'value', project);
- cy.wait(2000);
+ cy.byTestID(listPersesDashboardsDataTestIDs.ProjectFilter)
+ .find('input')
+ .should('have.attr', 'value', project);
+ cy.wait(4000);
},
},
countDashboards: (count: string) => {
cy.log('listPersesDashboardsPage.countDashboards');
cy.wait(2000);
- cy.get('#'+ IDs.persesDashboardCount,).find(Classes.PersesListDashboardCount).invoke('text').should((text) => {
- const total = text.split('of')[1].trim();
- expect(total).to.equal(count);
- });
+ cy.get('#' + IDs.persesDashboardCount)
+ .find(Classes.PersesListDashboardCount)
+ .invoke('text')
+ .should((text) => {
+ const total = text.split('of')[1].trim();
+ expect(total).to.equal(count);
+ });
},
clearAllFilters: () => {
@@ -73,11 +112,15 @@ export const listPersesDashboardsPage = {
sortBy: (column: string) => {
cy.log('listPersesDashboardsPage.sortBy');
- cy.byOUIAID(listPersesDashboardsOUIAIDs.persesListDataViewHeaderSortButton).contains(column).scrollIntoView().click();
+ cy.byOUIAID(listPersesDashboardsOUIAIDs.persesListDataViewHeaderSortButton)
+ .contains(column)
+ .scrollIntoView()
+ .click();
},
/**
- * If index is not provided, it asserts the existence of the dashboard by appending the name to the prefix to build data-test id, expecting to be unique
+ * If index is not provided, it asserts the existence of the dashboard by appending the name to
+ * the prefix to build data-test id, expecting to be unique
* If index is provided, it asserts the existence of the dashboard by the index.
* @param name - The name of the dashboard to assert
* @param index - The index of the dashboard to assert (optional)
@@ -86,46 +129,66 @@ export const listPersesDashboardsPage = {
cy.log('listPersesDashboardsPage.assertDashboardName');
const idx = index !== undefined ? index : 0;
if (index === undefined) {
- cy.byTestID(listPersesDashboardsDataTestIDs.DashboardLinkPrefix+name).should('be.visible').contains(name);
+ cy.byTestID(listPersesDashboardsDataTestIDs.DashboardLinkPrefix + name)
+ .should('be.visible')
+ .contains(name);
} else {
- cy.byOUIAID(listPersesDashboardsOUIAIDs.persesListDataViewTableDashboardNameTD+idx.toString()).should('be.visible').contains(name);
+ cy.byOUIAID(
+ listPersesDashboardsOUIAIDs.persesListDataViewTableDashboardNameTD + idx.toString(),
+ )
+ .should('be.visible')
+ .contains(name);
}
},
clickDashboard: (name: string, index?: number) => {
const idx = index !== undefined ? index : 0;
cy.log('listPersesDashboardsPage.clickDashboard');
- // cy.byTestID(listPersesDashboardsDataTestIDs.DashboardLinkPrefix+name).eq(idx).should('be.visible').click();
+ // cy.byTestID(listPersesDashboardsDataTestIDs.DashboardLinkPrefix+name).eq(idx)
+ // .should('be.visible').click();
cy.get('a').contains(name).eq(idx).should('be.visible').click();
cy.wait(15000);
},
removeTag: (value: string) => {
cy.log('listPersesDashboardsPage.removeTag');
- cy.byAriaLabel('Close '+ value).click();
+ cy.byAriaLabel('Close ' + value).click();
},
clickCreateButton: () => {
cy.log('persesDashboardsPage.clickCreateButton');
- cy.byTestID(DataTestIDs.PersesCreateDashboardButton).scrollIntoView().should('be.visible').and('not.have.attr', 'disabled');
+ cy.byTestID(DataTestIDs.PersesCreateDashboardButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .and('not.have.attr', 'disabled');
cy.byTestID(DataTestIDs.PersesCreateDashboardButton).click({ force: true });
cy.wait(2000);
},
assertCreateButtonIsEnabled: () => {
cy.log('persesDashboardsPage.assertCreateButtonIsEnabled');
- cy.byTestID(DataTestIDs.PersesCreateDashboardButton).scrollIntoView().should('be.visible').should('not.have.attr', 'disabled');
+ cy.byTestID(DataTestIDs.PersesCreateDashboardButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .should('not.have.attr', 'disabled');
},
assertCreateButtonIsDisabled: () => {
cy.log('persesDashboardsPage.assertCreateButtonIsDisabled');
- cy.byTestID(DataTestIDs.PersesCreateDashboardButton).scrollIntoView().should('be.visible').should('have.attr', 'disabled');
+ cy.byTestID(DataTestIDs.PersesCreateDashboardButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .should('have.attr', 'disabled');
},
clickKebabIcon: (index?: number) => {
const idx = index !== undefined ? index : 0;
cy.log('persesDashboardsPage.clickKebabIcon');
- cy.byAriaLabel(persesAriaLabels.persesDashboardKebabIcon).eq(idx).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.persesDashboardKebabIcon)
+ .eq(idx)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
@@ -138,81 +201,116 @@ export const listPersesDashboardsPage = {
assertKebabIconDisabled: () => {
cy.log('persesDashboardsPage.assertKebabIconDisabled');
- cy.byAriaLabel(persesAriaLabels.persesDashboardKebabIcon).scrollIntoView().should('be.visible').should('have.attr', 'disabled');
+ cy.byAriaLabel(persesAriaLabels.persesDashboardKebabIcon)
+ .scrollIntoView()
+ .should('be.visible')
+ .should('have.attr', 'disabled');
},
clickRenameDashboardOption: () => {
cy.log('listPersesDashboardsPage.clickRenameDashboardOption');
cy.wait(1000);
- cy.byPFRole('menuitem').contains('Rename dashboard').should('be.visible').click({ force: true });
+ cy.byPFRole('menuitem')
+ .contains('Rename dashboard')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(1000);
},
renameDashboardEnterName: (name: string) => {
cy.log('listPersesDashboardsPage.renameDashboardEnterName');
- cy.get('#'+IDs.persesDashboardRenameDashboardName).should('be.visible').clear().type(name);
+ cy.get('#' + IDs.persesDashboardRenameDashboardName)
+ .should('be.visible')
+ .clear()
+ .type(name);
cy.wait(1000);
},
renameDashboardCancelButton: () => {
cy.log('listPersesDashboardsPage.renameDashboardCancel');
- cy.byPFRole('dialog').find('button').contains('Cancel').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
renameDashboardRenameButton: () => {
cy.log('listPersesDashboardsPage.renameDashboardRename');
- cy.byPFRole('dialog').find('button').contains('Rename').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Rename')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
assertRenameDashboardMaxLength: () => {
cy.log('listPersesDashboardsPage.assertRenameDashboardMaxLength');
- cy.byPFRole('dialog').find(Classes.PersesCreateDashboardDashboardNameError).should('have.text', persesDashboardsRenameDashboard.DIALOG_MAX_LENGTH_VALIDATION).should('be.visible');
+ cy.byPFRole('dialog')
+ .find(Classes.PersesCreateDashboardDashboardNameError)
+ .should('have.text', persesDashboardsRenameDashboard.DIALOG_MAX_LENGTH_VALIDATION)
+ .should('be.visible');
},
clickDuplicateOption: () => {
cy.log('listPersesDashboardsPage.clickDuplicateOption');
- cy.byPFRole('menuitem').contains('Duplicate dashboard').should('be.visible').click({ force: true });
+ cy.byPFRole('menuitem')
+ .contains('Duplicate dashboard')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
assertDuplicateProjectDropdown: (project: string) => {
cy.log('listPersesDashboardsPage.assertDuplicateProjectDropdown');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).should('be.visible').clear().type(project);
cy.byPFRole('option').contains(project).should('be.visible');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
},
duplicateDashboardEnterName: (name: string) => {
cy.log('listPersesDashboardsPage.duplicateDashboardEnterName');
- cy.get('#' + IDs.persesDashboardDuplicateDashboardName).should('be.visible').clear().type(name);
+ cy.get('#' + IDs.persesDashboardDuplicateDashboardName)
+ .should('be.visible')
+ .clear()
+ .type(name);
cy.wait(1000);
},
duplicateDashboardCancelButton: () => {
cy.log('listPersesDashboardsPage.duplicateDashboardCancel');
- cy.byPFRole('dialog').find('button').contains('Cancel').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
duplicateDashboardDuplicateButton: () => {
cy.log('listPersesDashboardsPage.duplicateDashboardDuplicate');
- cy.byPFRole('dialog').find('button').contains('Duplicate').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Duplicate')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
assertDuplicateDashboardAlreadyExists: () => {
cy.log('listPersesDashboardsPage.assertDuplicateDashboardAlreadyExists');
- cy.byPFRole('dialog').find(Classes.PersesCreateDashboardDashboardNameError)
+ cy.byPFRole('dialog')
+ .find(Classes.PersesCreateDashboardDashboardNameError)
.contains(persesDashboardsDuplicateDashboard.DIALOG_DUPLICATED_NAME_VALIDATION)
.should('be.visible');
},
duplicateDashboardSelectProjectDropdown: (project: string) => {
cy.log('listPersesDashboardsPage.duplicateDashboardSelectProjectDropdown');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).clear().type(project);
cy.byPFRole('option').contains(project).should('be.visible').click({ force: true });
cy.wait(2000);
@@ -220,42 +318,55 @@ export const listPersesDashboardsPage = {
assertDuplicateProjectDropdownExists: (project: string) => {
cy.log('listPersesDashboardsPage.assertDuplicateProjectDropdownExists');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
cy.byAriaLabel(persesAriaLabels.dialogProjectInput).clear().type(project);
cy.byPFRole('option').contains(project).should('be.visible');
cy.log('Project: ' + project + ' is available in the dropdown');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
},
assertDuplicateProjectDropdownNotExists: (project: string) => {
cy.log('listPersesDashboardsPage.assertDuplicateProjectDropdownNotExists');
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
- cy.byPFRole('listbox').find('li').then((items) => {
- items.each((index, item) => {
- cy.log('Project: ' + item.innerText);
- if (item.innerText === project) {
- expect(item).to.not.exist;
- }
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
+ cy.byPFRole('listbox')
+ .find('li')
+ .then((items) => {
+ items.each((index, item) => {
+ cy.log('Project: ' + item.innerText);
+ if (item.innerText === project) {
+ expect(item).to.equal(undefined);
+ }
+ });
});
- });
- cy.get(Classes.PersesCreateDashboardProjectDropdown).should('be.visible').click({ force: true });
+ cy.byPFRole('dialog').find(Classes.PersesCreateDashboardProjectDropdown).click({ force: true });
},
clickDeleteOption: () => {
cy.log('listPersesDashboardsPage.clickDeleteOption');
- cy.byPFRole('menuitem').contains('Delete dashboard').should('be.visible').click({ force: true });
+ cy.byPFRole('menuitem')
+ .contains('Delete dashboard')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
deleteDashboardCancelButton: () => {
cy.log('listPersesDashboardsPage.deleteDashboardCancel');
- cy.byPFRole('dialog').find('button').contains('Cancel').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
deleteDashboardDeleteButton: () => {
cy.log('listPersesDashboardsPage.deleteDashboardDelete');
- cy.byPFRole('dialog').find('button').contains('Delete').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Delete')
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
@@ -267,7 +378,10 @@ export const listPersesDashboardsPage = {
clickImportButton: () => {
cy.log('listPersesDashboardsPage.clickImportButton');
- cy.byAriaLabel(persesAriaLabels.dashboardActionsMenu).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.dashboardActionsMenu)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
cy.byPFRole('menuitem').contains('Import').should('be.visible').click({ force: true });
cy.wait(2000);
@@ -275,17 +389,26 @@ export const listPersesDashboardsPage = {
dismissDuplicatedDashboardError: () => {
cy.log('listPersesDashboardsPage.dismissDuplicatedDashboardError');
- cy.byAriaLabel(persesAriaLabels.importDashboardDuplicatedDashboardError).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.importDashboardDuplicatedDashboardError)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
assertImportButtonIsEnabled: () => {
cy.log('listPersesDashboardsPage.assertImportButtonIsEnabled');
- cy.byAriaLabel(persesAriaLabels.dashboardActionsMenu).scrollIntoView().should('be.visible').should('not.have.attr', 'disabled');
+ cy.byAriaLabel(persesAriaLabels.dashboardActionsMenu)
+ .scrollIntoView()
+ .should('be.visible')
+ .should('not.have.attr', 'disabled');
},
assertImportButtonIsDisabled: () => {
cy.log('listPersesDashboardsPage.assertImportButtonIsDisabled');
- cy.byAriaLabel(persesAriaLabels.dashboardActionsMenu).scrollIntoView().should('be.visible').should('have.attr', 'disabled');
+ cy.byAriaLabel(persesAriaLabels.dashboardActionsMenu)
+ .scrollIntoView()
+ .should('be.visible')
+ .should('have.attr', 'disabled');
},
-}
+};
diff --git a/web/cypress/views/perses-dashboards-panel.ts b/web/cypress/views/perses-dashboards-panel.ts
index 7ee5a096d..e13890a7d 100644
--- a/web/cypress/views/perses-dashboards-panel.ts
+++ b/web/cypress/views/perses-dashboards-panel.ts
@@ -1,40 +1,91 @@
-import { commonPages } from "./common";
-import { persesAriaLabels, IDs, editPersesDashboardsAddPanel, Classes } from "../../src/components/data-test";
-import { persesDashboardsModalTitles, persesDashboardsAddPanelAddQueryType, persesDashboardsAddListPanelType } from "../fixtures/perses/constants";
+import { commonPages } from './common';
+import {
+ persesAriaLabels,
+ IDs,
+ editPersesDashboardsAddPanel,
+} from '../../src/components/data-test';
+import {
+ persesDashboardsModalTitles,
+ persesDashboardsAddPanelAddQueryType,
+ persesDashboardsAddListPanelType,
+} from '../fixtures/perses/constants';
export const persesDashboardsPanel = {
-
addPanelShouldBeLoaded: () => {
cy.log('persesDashboardsPanel.addPanelShouldBeLoaded');
commonPages.titleModalShouldHaveText(persesDashboardsModalTitles.ADD_PANEL);
cy.get('input[name="' + editPersesDashboardsAddPanel.inputName + '"]').should('be.visible');
- cy.get('#' + IDs.persesDashboardAddPanelForm).find('label').contains('Group').should('be.visible');
- cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]').should('be.visible');
- cy.get('#' + IDs.persesDashboardAddPanelForm).find('label').contains('Type').should('be.visible');
- cy.get('#' + IDs.persesDashboardAddPanelForm).parent('div').find('h2').siblings('div').find('button').contains('Add').should('be.visible').and('have.attr', 'disabled');
- cy.get('#' + IDs.persesDashboardAddPanelForm).parent('div').find('h2').siblings('div').find('button').contains('Cancel').should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .find('label')
+ .contains('Group')
+ .should('be.visible');
+ cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]').should(
+ 'be.visible',
+ );
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .find('label')
+ .contains('Type')
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .parent('div')
+ .find('h2')
+ .siblings('div')
+ .find('button')
+ .contains('Add')
+ .should('be.visible')
+ .and('have.attr', 'disabled');
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .parent('div')
+ .find('h2')
+ .siblings('div')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible');
},
clickButton: (button: 'Add' | 'Cancel') => {
cy.log('persesDashboardsPanel.clickButton');
if (button === 'Cancel') {
- cy.get('#' + IDs.persesDashboardAddPanelForm).siblings('div').find('button').contains(button).should('be.visible').click();
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .siblings('div')
+ .find('button')
+ .contains(button)
+ .should('be.visible')
+ .click();
cy.wait(1000);
cy.get('body').then((body) => {
- if (body.find('#' + IDs.persesDashboardDiscardChangesDialog).length > 0 && body.find('#' + IDs.persesDashboardDiscardChangesDialog).is(':visible')) {
- cy.bySemanticElement('button', 'Discard Changes').scrollIntoView().should('be.visible').click({ force: true });
+ if (
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).length > 0 &&
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).is(':visible')
+ ) {
+ cy.bySemanticElement('button', 'Discard Changes')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
}
});
} else {
- cy.get('#' + IDs.persesDashboardAddPanelForm).siblings('div').find('button').contains(button).should('be.visible').click();
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .siblings('div')
+ .find('button')
+ .contains(button)
+ .should('be.visible')
+ .click();
}
},
clickDropdownAndSelectOption: (label: string, option: string) => {
cy.log('persesDashboardsPanel.clickDropdownAndSelectOption');
- cy.get('#' + IDs.persesDashboardAddPanelForm).find('label').contains(label).siblings('div').click();
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .find('label')
+ .contains(label)
+ .siblings('div')
+ .click();
cy.wait(1000);
- cy.get('li').contains(new RegExp(`^${option}$`)).should('be.visible').click();
+ cy.get('li')
+ .contains(new RegExp(`^${option}$`))
+ .should('be.visible')
+ .click();
},
assertRequiredFieldValidation: (field: string) => {
@@ -42,20 +93,35 @@ export const persesDashboardsPanel = {
switch (field) {
case 'Name':
- cy.get('#' + IDs.persesDashboardAddPanelForm).find('label').contains(field).siblings('p').should('have.text', 'Required');
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .find('label')
+ .contains(field)
+ .siblings('p')
+ .should('have.text', 'Required');
break;
}
},
- addPanel: (name: string, group: string, type: string, description?: string, query?: string | 'up' | 'haproxy_up', legend?: string) => {
+ addPanel: (
+ name: string,
+ group: string,
+ type: string,
+ description?: string,
+ query?: string | 'up' | 'haproxy_up',
+ legend?: string,
+ ) => {
cy.log('persesDashboardsPanel.addPanel');
cy.wait(2000);
- cy.get('input[name="' + editPersesDashboardsAddPanel.inputName + '"]').clear().type(name);
+ cy.get('input[name="' + editPersesDashboardsAddPanel.inputName + '"]')
+ .clear()
+ .type(name);
if (description !== undefined && description !== '') {
- cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]').clear().type(description);
+ cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]')
+ .clear()
+ .type(description);
}
persesDashboardsPanel.clickDropdownAndSelectOption('Group', group);
-
+
cy.wait(1000);
persesDashboardsPanel.clickDropdownAndSelectOption('Type', type);
@@ -66,18 +132,21 @@ export const persesDashboardsPanel = {
// case persesDashboardsAddListPanelType.HISTOGRAM_CHART:
// case persesDashboardsAddListPanelType.PIE_CHART:
// case persesDashboardsAddListPanelType.STAT_CHART:
+ // falls through
case persesDashboardsAddListPanelType.STATUS_HISTORY_CHART:
case persesDashboardsAddListPanelType.TABLE:
case persesDashboardsAddListPanelType.TIME_SERIES_CHART:
case persesDashboardsAddListPanelType.TIME_SERIES_TABLE:
-
cy.wait(2000);
- persesDashboardsPanel.clickDropdownAndSelectOption('Query Type', persesDashboardsAddPanelAddQueryType.BAR_GAUGE_HEAT_HISTOGRAM_PIE_STAT_STATUS_TABLE_TIMESERIES.PROMETHEUS_TIME_SERIES_QUERY);
+ persesDashboardsPanel.clickDropdownAndSelectOption(
+ 'Query Type',
+ persesDashboardsAddPanelAddQueryType
+ .BAR_GAUGE_HEAT_HISTOGRAM_PIE_STAT_STATUS_TABLE_TIMESERIES.PROMETHEUS_TIME_SERIES_QUERY,
+ );
cy.wait(2000);
if (query !== undefined && query !== '') {
persesDashboardsPanel.enterPromQLQuery(query);
- }
- else {
+ } else {
persesDashboardsPanel.enterPromQLQuery('up');
}
if (legend !== undefined && legend !== '') {
@@ -85,20 +154,28 @@ export const persesDashboardsPanel = {
}
break;
}
- cy.get('#'+IDs.persesDashboardAddPanelForm).parent('div').find('h2').siblings('div').find('button').contains('Add').should('be.visible').click();
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .parent('div')
+ .find('h2')
+ .siblings('div')
+ .find('button')
+ .contains('Add')
+ .should('be.visible')
+ .click();
},
enterPromQLQuery: (query: string | 'up' | 'haproxy_up') => {
cy.log('persesDashboardsPanel.enterPromQLQuery');
- cy.get('[data-testid="promql_expression_editor"] .cm-line')
- .then(($el) => {
- $el[0].textContent = `${query}`;
- $el[0].dispatchEvent(new Event('input', { bubbles: true }));
- $el[0].dispatchEvent(new Event('blur', { bubbles: true }));
- });
+ cy.get('[data-testid="promql_expression_editor"] .cm-line').then(($el) => {
+ $el[0].textContent = `${query}`;
+ $el[0].dispatchEvent(new Event('input', { bubbles: true }));
+ $el[0].dispatchEvent(new Event('blur', { bubbles: true }));
+ });
cy.wait(3000);
cy.get('body').then(($body) => {
- const $el = $body.find('[data-testid="promql_expression_editor"] .cm-tooltip-autocomplete.cm-tooltip.cm-tooltip-below li[aria-selected="true"]');
+ const $el = $body.find(
+ '[data-testid="promql_expression_editor"] .cm-tooltip-autocomplete.cm-tooltip.cm-tooltip-below li[aria-selected="true"]',
+ );
if ($el.length > 0) {
// Use native DOM events since $el[0] is a raw DOM element
$el[0].dispatchEvent(new MouseEvent('mousedown', { bubbles: true, cancelable: true }));
@@ -109,7 +186,10 @@ export const persesDashboardsPanel = {
cy.wait(3000);
cy.get('[data-testid="promql_expression_editor"] .cm-line').click();
cy.wait(3000);
- cy.bySemanticElement('button', 'Run Query').scrollIntoView().should('be.visible').click({ force: true });
+ cy.bySemanticElement('button', 'Run Query')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(3000);
},
@@ -117,53 +197,117 @@ export const persesDashboardsPanel = {
cy.log('persesDashboardsPanel.editPanelShouldBeLoaded');
commonPages.titleModalShouldHaveText(persesDashboardsModalTitles.ADD_PANEL);
cy.get('input[name="' + editPersesDashboardsAddPanel.inputName + '"]').should('be.visible');
- cy.get('#' + IDs.persesDashboardAddPanelForm).find('label').contains('Group').should('be.visible');
- cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]').should('be.visible');
- cy.get('#' + IDs.persesDashboardAddPanelForm).find('label').contains('Type').should('be.visible');
- cy.get('#' + IDs.persesDashboardAddPanelForm).parent('div').find('h2').siblings('div').find('button').contains('Apply').should('be.visible').and('have.attr', 'disabled');
- cy.get('#' + IDs.persesDashboardAddPanelForm).parent('div').find('h2').siblings('div').find('button').contains('Cancel').should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .find('label')
+ .contains('Group')
+ .should('be.visible');
+ cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]').should(
+ 'be.visible',
+ );
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .find('label')
+ .contains('Type')
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .parent('div')
+ .find('h2')
+ .siblings('div')
+ .find('button')
+ .contains('Apply')
+ .should('be.visible')
+ .and('have.attr', 'disabled');
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .parent('div')
+ .find('h2')
+ .siblings('div')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible');
},
editPanel: (name: string, group: string, type: string, description?: string) => {
cy.log('persesDashboardsPanel.editPanel');
- cy.get('input[name="' + editPersesDashboardsAddPanel.inputName + '"]').clear().type(name);
+ cy.get('input[name="' + editPersesDashboardsAddPanel.inputName + '"]')
+ .clear()
+ .type(name);
if (description !== undefined && description !== '') {
- cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]').clear().type(description);
+ cy.get('input[name="' + editPersesDashboardsAddPanel.inputDescription + '"]')
+ .clear()
+ .type(description);
}
persesDashboardsPanel.clickDropdownAndSelectOption('Group', group);
persesDashboardsPanel.clickDropdownAndSelectOption('Type', type);
- cy.get('#' + IDs.persesDashboardAddPanelForm).parent('div').find('h2').siblings('div').find('button').contains('Apply').should('be.visible').click();
+ cy.get('#' + IDs.persesDashboardAddPanelForm)
+ .parent('div')
+ .find('h2')
+ .siblings('div')
+ .find('button')
+ .contains('Apply')
+ .should('be.visible')
+ .click();
},
- clickPanelGroupAction: (panelGroup: string, button: 'addPanel' | 'edit' | 'delete' | 'moveDown' | 'moveUp') => {
+ clickPanelGroupAction: (
+ panelGroup: string,
+ button: 'addPanel' | 'edit' | 'delete' | 'moveDown' | 'moveUp',
+ ) => {
cy.log('persesDashboardsPage.clickPanelActions');
switch (button) {
case 'addPanel':
- cy.byAriaLabel(persesAriaLabels.AddPanelToGroupPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.AddPanelToGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'edit':
- cy.byAriaLabel(persesAriaLabels.EditPanelGroupPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.EditPanelGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'delete':
- cy.byAriaLabel(persesAriaLabels.DeletePanelGroupPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.DeletePanelGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'moveDown':
- cy.byAriaLabel(persesAriaLabels.MovePanelGroupPrefix + panelGroup + persesAriaLabels.MovePanelGroupDownSuffix).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(
+ persesAriaLabels.MovePanelGroupPrefix +
+ panelGroup +
+ persesAriaLabels.MovePanelGroupDownSuffix,
+ )
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'moveUp':
- cy.byAriaLabel(persesAriaLabels.MovePanelGroupPrefix + panelGroup + persesAriaLabels.MovePanelGroupUpSuffix).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(
+ persesAriaLabels.MovePanelGroupPrefix +
+ panelGroup +
+ persesAriaLabels.MovePanelGroupUpSuffix,
+ )
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
}
},
deletePanel: (panel: string) => {
cy.log('persesDashboardsPage.deletePanel');
- cy.byAriaLabel(persesAriaLabels.EditPanelDeleteButtonPrefix + panel).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.EditPanelDeleteButtonPrefix + panel)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
clickDeletePanelButton: () => {
cy.log('persesDashboardsPage.clickDeletePanelButton');
- cy.bySemanticElement('button', 'Delete').scrollIntoView().should('be.visible').click({ force: true });
+ cy.bySemanticElement('button', 'Delete')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
-}
\ No newline at end of file
+};
diff --git a/web/cypress/views/perses-dashboards-panelgroup.ts b/web/cypress/views/perses-dashboards-panelgroup.ts
index 02cfdb7ae..4705897b4 100644
--- a/web/cypress/views/perses-dashboards-panelgroup.ts
+++ b/web/cypress/views/perses-dashboards-panelgroup.ts
@@ -1,22 +1,46 @@
-import { commonPages } from "./common";
-import { persesAriaLabels, persesMUIDataTestIDs, IDs } from "../../src/components/data-test";
-import { persesDashboardsModalTitles, persesDashboardsRequiredFields } from "../fixtures/perses/constants";
+import { commonPages } from './common';
+import { persesAriaLabels, persesMUIDataTestIDs, IDs } from '../../src/components/data-test';
+import {
+ persesDashboardsModalTitles,
+ persesDashboardsRequiredFields,
+} from '../fixtures/perses/constants';
export const persesDashboardsPanelGroup = {
-
addPanelGroupShouldBeLoaded: () => {
cy.log('persesDashboardsPanelGroup.addPanelGroupShouldBeLoaded');
commonPages.titleModalShouldHaveText(persesDashboardsModalTitles.ADD_PANEL_GROUP);
cy.byDataTestID(persesMUIDataTestIDs.addPanelGroupFormName).should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).find('input').eq(1).should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).find('input').eq(2).should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).parent('div').siblings('div').find('button').contains('Apply').should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).parent('div').siblings('div').find('button').contains('Cancel').should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .find('input')
+ .eq(1)
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .find('input')
+ .eq(2)
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .parent('div')
+ .siblings('div')
+ .find('button')
+ .contains('Apply')
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .parent('div')
+ .siblings('div')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible');
},
clickButton: (button: 'Add' | 'Cancel') => {
cy.log('persesDashboardsPanelGroup.clickButton');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).parent('div').siblings('div').find('button').contains(button).should('be.visible').click();
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .parent('div')
+ .siblings('div')
+ .find('button')
+ .contains(button)
+ .should('be.visible')
+ .click();
},
assertRequiredFieldValidation: (field: string) => {
@@ -24,7 +48,11 @@ export const persesDashboardsPanelGroup = {
switch (field) {
case 'Name':
- cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal).find('label').contains(field).siblings('p').should('have.text', persesDashboardsRequiredFields.AddVariableNameField);
+ cy.byDataTestID(persesMUIDataTestIDs.editDashboardVariablesModal)
+ .find('label')
+ .contains(field)
+ .siblings('p')
+ .should('have.text', persesDashboardsRequiredFields.AddVariableNameField);
break;
}
},
@@ -39,17 +67,37 @@ export const persesDashboardsPanelGroup = {
cy.byPFRole('dialog').find('div[role="combobox"]').eq(1).click();
cy.byPFRole('option').contains(repeat_variable).click();
}
- cy.byPFRole('dialog').find('button').contains('Add').should('be.visible').click({ force: true });
+ cy.byPFRole('dialog')
+ .find('button')
+ .contains('Add')
+ .should('be.visible')
+ .click({ force: true });
},
editPanelGroupShouldBeLoaded: () => {
cy.log('persesDashboardsPanelGroup.editPanelGroupShouldBeLoaded');
commonPages.titleModalShouldHaveText(persesDashboardsModalTitles.EDIT_PANEL_GROUP);
cy.byDataTestID(persesMUIDataTestIDs.addPanelGroupFormName).should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).find('input').eq(1).should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).find('input').eq(2).should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).parent('div').siblings('div').find('button').contains('Apply').should('be.visible');
- cy.get('#'+IDs.persesDashboardAddPanelGroupForm).parent('div').siblings('div').find('button').contains('Cancel').should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .find('input')
+ .eq(1)
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .find('input')
+ .eq(2)
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .parent('div')
+ .siblings('div')
+ .find('button')
+ .contains('Apply')
+ .should('be.visible');
+ cy.get('#' + IDs.persesDashboardAddPanelGroupForm)
+ .parent('div')
+ .siblings('div')
+ .find('button')
+ .contains('Cancel')
+ .should('be.visible');
},
editPanelGroup: (name: string, collapse_state: 'Open' | 'Closed', repeat_variable: string) => {
@@ -64,33 +112,59 @@ export const persesDashboardsPanelGroup = {
cy.bySemanticElement('button', 'Apply').should('be.visible').click();
},
- clickPanelGroupAction: (panelGroup: string, button: 'addPanel' | 'edit' | 'delete' | 'moveDown' | 'moveUp') => {
+ clickPanelGroupAction: (
+ panelGroup: string,
+ button: 'addPanel' | 'edit' | 'delete' | 'moveDown' | 'moveUp',
+ ) => {
cy.log('persesDashboardsPage.clickPanelActions');
switch (button) {
case 'addPanel':
- cy.byAriaLabel(persesAriaLabels.AddPanelToGroupPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.AddPanelToGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'edit':
- cy.byAriaLabel(persesAriaLabels.EditPanelGroupPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.EditPanelGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'delete':
- cy.byAriaLabel(persesAriaLabels.DeletePanelGroupPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.DeletePanelGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'moveDown':
- cy.byAriaLabel(persesAriaLabels.MovePanelGroupPrefix + panelGroup + persesAriaLabels.MovePanelGroupDownSuffix).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(
+ persesAriaLabels.MovePanelGroupPrefix +
+ panelGroup +
+ persesAriaLabels.MovePanelGroupDownSuffix,
+ )
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'moveUp':
- cy.byAriaLabel(persesAriaLabels.MovePanelGroupPrefix + panelGroup + persesAriaLabels.MovePanelGroupUpSuffix).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(
+ persesAriaLabels.MovePanelGroupPrefix +
+ panelGroup +
+ persesAriaLabels.MovePanelGroupUpSuffix,
+ )
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
}
-
},
clickDeletePanelGroupButton: () => {
cy.log('persesDashboardsPage.clickDeletePanelGroupButton');
- cy.bySemanticElement('button', 'Delete').scrollIntoView().should('be.visible').click({ force: true });
+ cy.bySemanticElement('button', 'Delete')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
-
-
-}
\ No newline at end of file
+};
diff --git a/web/cypress/views/perses-dashboards.ts b/web/cypress/views/perses-dashboards.ts
index 59b21c8a1..a9bbc35e2 100644
--- a/web/cypress/views/perses-dashboards.ts
+++ b/web/cypress/views/perses-dashboards.ts
@@ -1,77 +1,152 @@
-import { commonPages } from "./common";
-import { DataTestIDs, Classes, LegacyTestIDs, persesAriaLabels, persesMUIDataTestIDs, listPersesDashboardsOUIAIDs, IDs, persesDashboardDataTestIDs, listPersesDashboardsDataTestIDs } from "../../src/components/data-test";
-import { MonitoringPageTitles } from "../fixtures/monitoring/constants";
-import { listPersesDashboardsPageSubtitle, persesDashboardsEmptyDashboard, persesDashboardsModalTitles } from "../fixtures/perses/constants";
-import { persesDashboardsTimeRange, persesDashboardsRefreshInterval, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev, persesDashboardsAcceleratorsCommonMetricsPanels } from "../fixtures/perses/constants";
+import { commonPages } from './common';
+import {
+ DataTestIDs,
+ Classes,
+ LegacyTestIDs,
+ persesAriaLabels,
+ persesMUIDataTestIDs,
+ listPersesDashboardsOUIAIDs,
+ IDs,
+ persesDashboardDataTestIDs,
+ listPersesDashboardsDataTestIDs,
+} from '../../src/components/data-test';
+import { MonitoringPageTitles } from '../fixtures/monitoring/constants';
+import {
+ listPersesDashboardsPageSubtitle,
+ persesDashboardsEmptyDashboard,
+ persesDashboardsModalTitles,
+} from '../fixtures/perses/constants';
+import {
+ persesDashboardsTimeRange,
+ persesDashboardsRefreshInterval,
+ persesDashboardsDashboardDropdownCOO,
+ persesDashboardsDashboardDropdownPersesDev,
+ persesDashboardsAcceleratorsCommonMetricsPanels,
+} from '../fixtures/perses/constants';
export const persesDashboardsPage = {
-
shouldBeLoaded: () => {
cy.log('persesDashboardsPage.shouldBeLoaded');
commonPages.titleShouldHaveText(MonitoringPageTitles.DASHBOARDS);
- cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown).contains(persesDashboardsTimeRange.LAST_30_MINUTES).scrollIntoView().should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown)
+ .contains(persesDashboardsTimeRange.LAST_30_MINUTES)
+ .scrollIntoView()
+ .should('be.visible');
cy.byAriaLabel(persesAriaLabels.ZoomInButton).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.ZoomOutButton).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.RefreshButton).scrollIntoView().should('be.visible');
- cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown).scrollIntoView().should('be.visible');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('input').scrollIntoView().should('be.visible');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('button').scrollIntoView().should('be.visible');
+ cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('input')
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible');
cy.byLegacyTestID(LegacyTestIDs.PersesDashboardSection).scrollIntoView().should('be.visible');
-
},
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
shouldBeLoaded1: () => {
cy.log('persesDashboardsPage.shouldBeLoaded');
commonPages.titleShouldHaveText(MonitoringPageTitles.DASHBOARDS);
- cy.byOUIAID(listPersesDashboardsOUIAIDs.PageHeaderSubtitle).scrollIntoView().should('contain', listPersesDashboardsPageSubtitle).should('be.visible');
+ cy.byOUIAID(listPersesDashboardsOUIAIDs.PageHeaderSubtitle)
+ .scrollIntoView()
+ .should('contain', listPersesDashboardsPageSubtitle)
+ .should('be.visible');
- cy.byTestID(persesDashboardDataTestIDs.editDashboardButtonToolbar).scrollIntoView().should('be.visible');
+ cy.byTestID(persesDashboardDataTestIDs.editDashboardButtonToolbar)
+ .scrollIntoView()
+ .should('be.visible');
cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.ZoomInButton).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.ZoomOutButton).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.RefreshButton).scrollIntoView().should('be.visible');
- cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown).scrollIntoView().should('be.visible');
+ cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown)
+ .scrollIntoView()
+ .should('be.visible');
- cy.get('#' + IDs.persesDashboardDownloadButton).scrollIntoView().should('be.visible');
+ cy.get('#' + IDs.persesDashboardDownloadButton)
+ .scrollIntoView()
+ .should('be.visible');
cy.byAriaLabel(persesAriaLabels.ViewJSONButton).scrollIntoView().should('be.visible');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('input').scrollIntoView().should('be.visible');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('button').scrollIntoView().should('be.visible');
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('input')
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible');
},
shouldBeLoadedEditionMode: (dashboardName: string) => {
cy.log('persesDashboardsPage.shouldBeLoadedEditionMode');
cy.wait(10000);
commonPages.titleShouldHaveText(MonitoringPageTitles.DASHBOARDS);
- cy.byOUIAID(listPersesDashboardsOUIAIDs.PageHeaderSubtitle).scrollIntoView().should('contain', listPersesDashboardsPageSubtitle).should('be.visible');
- cy.byTestID(listPersesDashboardsDataTestIDs.PersesBreadcrumbDashboardNameItem).scrollIntoView().should('contain', dashboardName).should('be.visible');
+ cy.byOUIAID(listPersesDashboardsOUIAIDs.PageHeaderSubtitle)
+ .scrollIntoView()
+ .should('contain', listPersesDashboardsPageSubtitle)
+ .should('be.visible');
+ cy.byTestID(listPersesDashboardsDataTestIDs.PersesBreadcrumbDashboardNameItem)
+ .scrollIntoView()
+ .should('contain', dashboardName)
+ .should('be.visible');
persesDashboardsPage.assertEditModeButtons();
cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.ZoomInButton).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.ZoomOutButton).scrollIntoView().should('be.visible');
cy.byAriaLabel(persesAriaLabels.RefreshButton).scrollIntoView().should('be.visible');
- cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown).scrollIntoView().should('be.visible');
+ cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown)
+ .scrollIntoView()
+ .should('be.visible');
- cy.get('#' + IDs.persesDashboardDownloadButton).scrollIntoView().should('be.visible');
+ cy.get('#' + IDs.persesDashboardDownloadButton)
+ .scrollIntoView()
+ .should('be.visible');
cy.byAriaLabel(persesAriaLabels.EditJSONButton).scrollIntoView().should('be.visible');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('input').scrollIntoView().should('be.visible');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('input').should('have.value', dashboardName);
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('button').scrollIntoView().should('be.visible');
-
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('input')
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('input')
+ .should('have.value', dashboardName);
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible');
},
shouldBeLoadedEditionModeFromCreateDashboard: () => {
cy.log('persesDashboardsPage.shouldBeLoadedEditionModeFromCreateDashboard');
cy.wait(10000);
- cy.get('h2').contains(persesDashboardsEmptyDashboard.TITLE).scrollIntoView().should('be.visible');
- cy.get('p').contains(persesDashboardsEmptyDashboard.DESCRIPTION).scrollIntoView().should('be.visible');
-
- cy.get('h2').siblings('div').find('[aria-label="Add panel"]').scrollIntoView().should('be.visible');
- cy.get('h2').siblings('div').find('[aria-label="Edit variables"]').scrollIntoView().should('be.visible');
+ cy.get('h2')
+ .contains(persesDashboardsEmptyDashboard.TITLE)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.get('p')
+ .contains(persesDashboardsEmptyDashboard.DESCRIPTION)
+ .scrollIntoView()
+ .should('be.visible');
+
+ cy.get('h2')
+ .siblings('div')
+ .find('[aria-label="Add panel"]')
+ .scrollIntoView()
+ .should('be.visible');
+ cy.get('h2')
+ .siblings('div')
+ .find('[aria-label="Edit variables"]')
+ .scrollIntoView()
+ .should('be.visible');
},
shouldBeLoadedAfterRename: (dashboardName: string) => {
@@ -86,25 +161,43 @@ export const persesDashboardsPage = {
shouldBeLoadedAfter: (dashboardName: string) => {
cy.log('persesDashboardsPage.shouldBeLoadedAfter');
- cy.byTestID(listPersesDashboardsDataTestIDs.PersesBreadcrumbDashboardNameItem).scrollIntoView().should('contain', dashboardName).should('be.visible');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('input').should('have.value', dashboardName);
+ cy.byTestID(listPersesDashboardsDataTestIDs.PersesBreadcrumbDashboardNameItem)
+ .scrollIntoView()
+ .should('contain', dashboardName)
+ .should('be.visible');
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('input')
+ .should('have.value', dashboardName);
},
clickTimeRangeDropdown: (timeRange: persesDashboardsTimeRange) => {
cy.log('persesDashboardsPage.clickTimeRangeDropdown');
- cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown).scrollIntoView().should('be.visible').click({ force: true });
- cy.byPFRole('option').contains(timeRange).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ cy.byPFRole('option')
+ .contains(timeRange)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
timeRangeDropdownAssertion: () => {
cy.log('persesDashboardsPage.timeRangeDropdownAssertion');
- cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
const timeRanges = Object.values(persesDashboardsTimeRange);
timeRanges.forEach((timeRange) => {
cy.log('Time range: ' + timeRange);
cy.byPFRole('option').contains(timeRange).scrollIntoView().should('be.visible');
});
- cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.TimeRangeDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
clickRefreshButton: () => {
@@ -114,52 +207,96 @@ export const persesDashboardsPage = {
clickRefreshIntervalDropdown: (interval: persesDashboardsRefreshInterval) => {
cy.log('persesDashboardsPage.clickRefreshIntervalDropdown');
- cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown).scrollIntoView().should('be.visible').click({ force: true });
- cy.byPFRole('option').contains(interval).scrollIntoView().should('be.visible').click({ force: true });
+ cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ cy.byPFRole('option')
+ .contains(interval)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
refreshIntervalDropdownAssertion: () => {
cy.log('persesDashboardsPage.refreshIntervalDropdownAssertion');
- cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown).scrollIntoView().should('be.visible').click({ force: true });
+ cy.get('#' + IDs.persesDashboardRefreshIntervalDropdown)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
const intervals = Object.values(persesDashboardsRefreshInterval);
intervals.forEach((interval) => {
cy.log('Refresh interval: ' + interval);
cy.byPFRole('option').contains(interval).scrollIntoView().should('be.visible');
});
- //Closing the dropdown by clicking on the OFF option, because the dropdown is not accessible while the menu is open, even forcing it
- cy.byPFRole('option').contains(persesDashboardsRefreshInterval.OFF).scrollIntoView().should('be.visible').click({ force: true });
-
- },
-
- clickDashboardDropdown: (dashboard: keyof typeof persesDashboardsDashboardDropdownCOO | keyof typeof persesDashboardsDashboardDropdownPersesDev) => {
+ // Closing the dropdown by clicking on the OFF option, because the dropdown is not accessible
+ // while the menu is open, even forcing it
+ cy.byPFRole('option')
+ .contains(persesDashboardsRefreshInterval.OFF)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ },
+
+ clickDashboardDropdown: (
+ dashboard:
+ | keyof typeof persesDashboardsDashboardDropdownCOO
+ | keyof typeof persesDashboardsDashboardDropdownPersesDev,
+ ) => {
cy.log('persesDashboardsPage.clickDashboardDropdown');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('button').scrollIntoView().should('be.visible').click({ force: true });
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.byPFRole('option').contains(dashboard).should('be.visible').click({ force: true });
},
- dashboardDropdownAssertion: (constants: typeof persesDashboardsDashboardDropdownCOO | typeof persesDashboardsDashboardDropdownPersesDev) => {
+ dashboardDropdownAssertion: (
+ constants:
+ | typeof persesDashboardsDashboardDropdownCOO
+ | typeof persesDashboardsDashboardDropdownPersesDev,
+ ) => {
cy.log('persesDashboardsPage.dashboardDropdownAssertion');
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('button').scrollIntoView().should('be.visible').click({ force: true });
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
const dashboards = Object.values(constants);
dashboards.forEach((dashboard) => {
cy.log('Dashboard: ' + dashboard[0]);
cy.get(Classes.MenuItem).contains(dashboard[0]).scrollIntoView().should('be.visible');
if (dashboard[1] !== '') {
- cy.get(Classes.MenuItem).scrollIntoView().should('contain', dashboard[0]).and('contain', dashboard[1]);
+ cy.get(Classes.MenuItem)
+ .scrollIntoView()
+ .should('contain', dashboard[0])
+ .and('contain', dashboard[1]);
}
});
cy.wait(1000);
- cy.byTestID(DataTestIDs.PersesDashboardDropdown).find('button').scrollIntoView().should('be.visible').click({ force: true });
+ cy.byTestID(DataTestIDs.PersesDashboardDropdown)
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
panelGroupHeaderAssertion: (panelGroupHeader: string, collapse_state: 'Open' | 'Closed') => {
cy.log('persesDashboardsPage.panelGroupHeaderAssertion');
- cy.byDataTestID(persesMUIDataTestIDs.panelGroupHeader).contains(panelGroupHeader).scrollIntoView().should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.panelGroupHeader)
+ .contains(panelGroupHeader)
+ .scrollIntoView()
+ .should('be.visible');
if (collapse_state === 'Open') {
- cy.byAriaLabel(persesAriaLabels.CollapseGroupButtonPrefix + panelGroupHeader).scrollIntoView().should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.CollapseGroupButtonPrefix + panelGroupHeader)
+ .scrollIntoView()
+ .should('be.visible');
} else {
- cy.byAriaLabel(persesAriaLabels.OpenGroupButtonPrefix + panelGroupHeader).scrollIntoView().should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.OpenGroupButtonPrefix + panelGroupHeader)
+ .scrollIntoView()
+ .should('be.visible');
}
},
@@ -171,7 +308,12 @@ export const persesDashboardsPage = {
assertPanelGroupOrder: (panelGroup: string, order: number) => {
cy.log('persesDashboardsPage.assertPanelGroupOrder');
- cy.byDataTestID(persesMUIDataTestIDs.panelGroupHeader).eq(order).find('h2').contains(panelGroup).scrollIntoView().should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.panelGroupHeader)
+ .eq(order)
+ .find('h2')
+ .contains(panelGroup)
+ .scrollIntoView()
+ .should('be.visible');
},
panelHeadersAcceleratorsCommonMetricsAssertion: () => {
@@ -180,7 +322,11 @@ export const persesDashboardsPage = {
const panels = Object.values(persesDashboardsAcceleratorsCommonMetricsPanels);
panels.forEach((panel) => {
cy.log('Panel: ' + panel);
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(panel).scrollIntoView().should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(panel)
+ .scrollIntoView()
+ .should('be.visible');
});
},
@@ -196,36 +342,67 @@ export const persesDashboardsPage = {
expandPanelGroup: (panelGroup: string) => {
cy.log('persesDashboardsPage.expandPanelGroup');
- cy.byAriaLabel(persesAriaLabels.OpenGroupButtonPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.OpenGroupButtonPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
collapsePanelGroup: (panelGroup: string) => {
cy.log('persesDashboardsPage.collapsePanelGroup');
- cy.byAriaLabel(persesAriaLabels.CollapseGroupButtonPrefix + panelGroup).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.CollapseGroupButtonPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
},
- statChartValueAssertion: (panel: keyof typeof persesDashboardsAcceleratorsCommonMetricsPanels | string, noData: boolean) => {
+ statChartValueAssertion: (
+ panel: keyof typeof persesDashboardsAcceleratorsCommonMetricsPanels | string,
+ noData: boolean,
+ ) => {
cy.log('persesDashboardsPage.statChartValueAssertion');
cy.wait(2000);
if (noData) {
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(panel).scrollIntoView().parents('header').siblings('figure').find('p').should('contain', 'No data').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(panel)
+ .scrollIntoView()
+ .parents('header')
+ .siblings('figure')
+ .find('p')
+ .should('contain', 'No data')
+ .should('be.visible');
} else {
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(panel).scrollIntoView().parents('header').siblings('figure').find('h3').should('not.contain', 'No data').should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(panel)
+ .scrollIntoView()
+ .parents('header')
+ .siblings('figure')
+ .find('h3')
+ .should('not.contain', 'No data')
+ .should('be.visible');
}
},
searchAndSelectVariable: (variable: string, value: string) => {
cy.log('persesDashboardsPage.searchAndSelectVariable');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable).find('input').type(value);
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable)
+ .find('input')
+ .type(value);
cy.byPFRole('option').contains(value).click({ force: true });
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable).find('button').click({ force: true });
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable)
+ .find('button')
+ .click({ force: true });
cy.wait(1000);
},
searchAndTypeVariable: (variable: string, value: string) => {
cy.log('persesDashboardsPage.searchAndTypeVariable');
if (value !== undefined && value !== '') {
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable).find('input').type(value);
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable)
+ .find('input')
+ .type(value);
}
cy.wait(1000);
},
@@ -242,18 +419,26 @@ export const persesDashboardsPage = {
assertVariableNotBeVisible: (variable: string) => {
cy.log('persesDashboardsPage.assertVariableNotBeVisible');
- cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable).should('not.be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.variableDropdown + '-' + variable).should(
+ 'not.be.visible',
+ );
},
clickEditButton: () => {
cy.log('persesDashboardsPage.clickEditButton');
- cy.byTestID(persesDashboardDataTestIDs.editDashboardButtonToolbar).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byTestID(persesDashboardDataTestIDs.editDashboardButtonToolbar)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(2000);
},
assertEditButtonIsDisabled: () => {
cy.log('persesDashboardsPage.assertEditButtonIsDisabled');
- cy.byTestID(persesDashboardDataTestIDs.editDashboardButtonToolbar).scrollIntoView().should('be.visible').should('have.attr', 'disabled');
+ cy.byTestID(persesDashboardDataTestIDs.editDashboardButtonToolbar)
+ .scrollIntoView()
+ .should('be.visible')
+ .should('have.attr', 'disabled');
},
assertEditModeButtons: () => {
@@ -267,30 +452,51 @@ export const persesDashboardsPage = {
cy.byTestID(persesDashboardDataTestIDs.cancelButtonToolbar).should('be.visible');
},
- clickEditActionButton: (button: 'EditVariables' | 'AddPanel' | 'AddGroup' | 'Save' | 'Cancel') => {
+ clickEditActionButton: (
+ button: 'EditVariables' | 'AddPanel' | 'AddGroup' | 'Save' | 'Cancel',
+ ) => {
cy.log('persesDashboardsPage.clickEditActionButton');
cy.wait(2000);
switch (button) {
case 'EditVariables':
- cy.byAriaLabel(persesAriaLabels.EditVariablesButton).eq(0).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.EditVariablesButton)
+ .eq(0)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
- //TODO: OU-1054 target for COO1.5.0, so, commenting out for now
+ // TODO: OU-1054 target for COO1.5.0, so, commenting out for now
// case 'EditDatasources':
- // cy.byAriaLabel(persesAriaLabels.EditDatasourcesButton).scrollIntoView().should('be.visible').click({ force: true });
+ // cy.byAriaLabel(persesAriaLabels.EditDatasourcesButton)
+ // .scrollIntoView()
+ // .should('be.visible')
+ // .click({ force: true });
// break;
case 'AddPanel':
- cy.byAriaLabel(persesAriaLabels.AddPanelButton).eq(0).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.AddPanelButton)
+ .eq(0)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'AddGroup':
- cy.byAriaLabel(persesAriaLabels.AddGroupButton).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.AddGroupButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
break;
case 'Save':
- cy.bySemanticElement('button', 'Save').scrollIntoView().should('be.visible').click({ force: true });
+ cy.bySemanticElement('button', 'Save')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
persesDashboardsPage.clickSaveDashboardButton();
- persesDashboardsPage.closeSuccessAlert();
break;
case 'Cancel':
- cy.byTestID(persesDashboardDataTestIDs.cancelButtonToolbar).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byTestID(persesDashboardDataTestIDs.cancelButtonToolbar)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(1000);
persesDashboardsPage.clickDiscardChangesButton();
break;
@@ -299,36 +505,87 @@ export const persesDashboardsPage = {
assertEditModePanelGroupButtons: (panelGroup: string) => {
cy.log('persesDashboardsPage.assertEditModePanelGroupButtons');
- cy.byAriaLabel(persesAriaLabels.AddPanelToGroupPrefix + panelGroup).scrollIntoView().should('be.visible');
- cy.byAriaLabel(persesAriaLabels.EditPanelGroupPrefix + panelGroup).scrollIntoView().should('be.visible');
- cy.byAriaLabel(persesAriaLabels.DeletePanelGroupPrefix + panelGroup).scrollIntoView().should('be.visible');
- cy.byAriaLabel(persesAriaLabels.MovePanelGroupPrefix + panelGroup + persesAriaLabels.MovePanelGroupDownSuffix).scrollIntoView().should('be.visible');
- cy.byAriaLabel(persesAriaLabels.MovePanelGroupPrefix + panelGroup + persesAriaLabels.MovePanelGroupUpSuffix).scrollIntoView().should('be.visible');
- },
-
- clickPanelAction: (panel: string, button: 'expand' | 'collapse' | 'edit' | 'duplicate' | 'delete') => {
+ cy.byAriaLabel(persesAriaLabels.AddPanelToGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.EditPanelGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.DeletePanelGroupPrefix + panelGroup)
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byAriaLabel(
+ persesAriaLabels.MovePanelGroupPrefix +
+ panelGroup +
+ persesAriaLabels.MovePanelGroupDownSuffix,
+ )
+ .scrollIntoView()
+ .should('be.visible');
+ cy.byAriaLabel(
+ persesAriaLabels.MovePanelGroupPrefix + panelGroup + persesAriaLabels.MovePanelGroupUpSuffix,
+ )
+ .scrollIntoView()
+ .should('be.visible');
+ },
+
+ clickPanelAction: (
+ panel: string,
+ button: 'expand' | 'collapse' | 'edit' | 'duplicate' | 'delete',
+ ) => {
cy.log('persesDashboardsPage.clickPanelActions');
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(panel).siblings('div').eq(0).then((element1) => {
- if (element1.find('[data-testid="MenuIcon"]').length > 0 && element1.find('[data-testid="MenuIcon"]').is(':visible')) {
- cy.byAriaLabel(persesAriaLabels.EditPanelActionMenuButtonPrefix + panel).should('be.visible').click({ force: true });
- }
- });
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(panel)
+ .siblings('div')
+ .eq(0)
+ .then((element1) => {
+ if (
+ element1.find('[data-testid="MenuIcon"]').length > 0 &&
+ element1.find('[data-testid="MenuIcon"]').is(':visible')
+ ) {
+ cy.byAriaLabel(persesAriaLabels.EditPanelActionMenuButtonPrefix + panel)
+ .should('be.visible')
+ .click({ force: true });
+ }
+ });
switch (button) {
case 'expand':
- cy.byAriaLabel(persesAriaLabels.EditPanelExpandCollapseButtonPrefix + panel + persesAriaLabels.EditPanelExpandCollapseButtonSuffix).find('[data-testid="ArrowExpandIcon"]').eq(0).invoke('show').click({ force: true });
+ cy.byAriaLabel(
+ persesAriaLabels.EditPanelExpandCollapseButtonPrefix +
+ panel +
+ persesAriaLabels.EditPanelExpandCollapseButtonSuffix,
+ )
+ .find('[data-testid="ArrowExpandIcon"]')
+ .eq(0)
+ .invoke('show')
+ .click({ force: true });
break;
case 'collapse':
- cy.byAriaLabel(persesAriaLabels.EditPanelExpandCollapseButtonPrefix + panel + persesAriaLabels.EditPanelExpandCollapseButtonSuffix).find('[data-testid="ArrowCollapseIcon"]').eq(1).should('be.visible').click({ force: true });
+ cy.byAriaLabel(
+ persesAriaLabels.EditPanelExpandCollapseButtonPrefix +
+ panel +
+ persesAriaLabels.EditPanelExpandCollapseButtonSuffix,
+ )
+ .find('[data-testid="ArrowCollapseIcon"]')
+ .eq(1)
+ .should('be.visible')
+ .click({ force: true });
break;
case 'edit':
- cy.byAriaLabel(persesAriaLabels.EditPanelPrefix + panel).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.EditPanelPrefix + panel)
+ .should('be.visible')
+ .click({ force: true });
break;
case 'duplicate':
- cy.byAriaLabel(persesAriaLabels.EditPanelDuplicateButtonPrefix + panel).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.EditPanelDuplicateButtonPrefix + panel)
+ .should('be.visible')
+ .click({ force: true });
break;
case 'delete':
- cy.byAriaLabel(persesAriaLabels.EditPanelDeleteButtonPrefix + panel).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.EditPanelDeleteButtonPrefix + panel)
+ .should('be.visible')
+ .click({ force: true });
break;
}
},
@@ -336,29 +593,72 @@ export const persesDashboardsPage = {
assertPanelActionButtons: (panel: string) => {
cy.log('persesDashboardsPage.assertPanelActionButtons');
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(panel).siblings('div').eq(1).then((element1) => {
- if (element1.find('[data-testid="MenuIcon"]').length > 0 && element1.find('[data-testid="MenuIcon"]').is(':visible')) {
- cy.byAriaLabel(persesAriaLabels.EditPanelExpandCollapseButtonPrefix + panel + persesAriaLabels.EditPanelExpandCollapseButtonSuffix).find('[data-testid="ArrowExpandIcon"]').eq(0).should('be.visible').click();
- }
- cy.byAriaLabel(persesAriaLabels.EditPanelExpandCollapseButtonPrefix + panel + persesAriaLabels.EditPanelExpandCollapseButtonSuffix).should('be.visible');
- cy.byAriaLabel(persesAriaLabels.EditPanelPrefix + panel).should('be.visible');
- cy.byAriaLabel(persesAriaLabels.EditPanelDuplicateButtonPrefix + panel).should('be.visible');
- cy.byAriaLabel(persesAriaLabels.EditPanelDeleteButtonPrefix + panel).should('be.visible');
- });
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(panel)
+ .siblings('div')
+ .eq(1)
+ .then((element1) => {
+ if (
+ element1.find('[data-testid="MenuIcon"]').length > 0 &&
+ element1.find('[data-testid="MenuIcon"]').is(':visible')
+ ) {
+ cy.byAriaLabel(
+ persesAriaLabels.EditPanelExpandCollapseButtonPrefix +
+ panel +
+ persesAriaLabels.EditPanelExpandCollapseButtonSuffix,
+ )
+ .find('[data-testid="ArrowExpandIcon"]')
+ .eq(0)
+ .should('be.visible')
+ .click();
+ }
+ cy.byAriaLabel(
+ persesAriaLabels.EditPanelExpandCollapseButtonPrefix +
+ panel +
+ persesAriaLabels.EditPanelExpandCollapseButtonSuffix,
+ ).should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.EditPanelPrefix + panel).should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.EditPanelDuplicateButtonPrefix + panel).should(
+ 'be.visible',
+ );
+ cy.byAriaLabel(persesAriaLabels.EditPanelDeleteButtonPrefix + panel).should('be.visible');
+ });
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(panel).siblings('div').eq(2).then((element1) => {
- if (element1.find('[data-testid="ArrowCollapseIcon"]').length > 0 && element1.find('[data-testid="ArrowCollapseIcon"]').is(':visible')) {
- cy.byAriaLabel(persesAriaLabels.EditPanelExpandCollapseButtonPrefix + panel + persesAriaLabels.EditPanelExpandCollapseButtonSuffix).find('[data-testid="ArrowCollapseIcon"]').eq(0).click({ force: true });
- }
- });
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(panel)
+ .siblings('div')
+ .eq(2)
+ .then((element1) => {
+ if (
+ element1.find('[data-testid="ArrowCollapseIcon"]').length > 0 &&
+ element1.find('[data-testid="ArrowCollapseIcon"]').is(':visible')
+ ) {
+ cy.byAriaLabel(
+ persesAriaLabels.EditPanelExpandCollapseButtonPrefix +
+ panel +
+ persesAriaLabels.EditPanelExpandCollapseButtonSuffix,
+ )
+ .find('[data-testid="ArrowCollapseIcon"]')
+ .eq(0)
+ .click({ force: true });
+ }
+ });
},
clickSaveDashboardButton: () => {
cy.log('persesDashboardsPage.clickSaveDashboardButton');
cy.wait(2000);
cy.get('body').then((body) => {
- if (body.find('[data-testid="CloseIcon"]').length > 0 && body.find('[data-testid="CloseIcon"]').is(':visible')) {
- cy.bySemanticElement('button', 'Save Changes').scrollIntoView().should('be.visible').click({ force: true });
+ if (
+ body.find('[data-testid="CloseIcon"]').length > 0 &&
+ body.find('[data-testid="CloseIcon"]').is(':visible')
+ ) {
+ cy.bySemanticElement('button', 'Save Changes')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
}
});
cy.wait(2000);
@@ -366,15 +666,24 @@ export const persesDashboardsPage = {
backToListPersesDashboardsPage: () => {
cy.log('persesDashboardsPage.backToListPersesDashboardsPage');
- cy.byTestID(listPersesDashboardsDataTestIDs.PersesBreadcrumbDashboardItem).scrollIntoView().should('be.visible').click({ force: true });
+ cy.byTestID(listPersesDashboardsDataTestIDs.PersesBreadcrumbDashboardItem)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.wait(5000);
},
clickDiscardChangesButton: () => {
cy.log('persesDashboardsPage.clickDiscardChangesButton');
cy.get('body').then((body) => {
- if (body.find('#'+IDs.persesDashboardDiscardChangesDialog).length > 0 && body.find('#'+IDs.persesDashboardDiscardChangesDialog).is(':visible')) {
- cy.bySemanticElement('button', 'Discard Changes').scrollIntoView().should('be.visible').click({ force: true });
+ if (
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).length > 0 &&
+ body.find('#' + IDs.persesDashboardDiscardChangesDialog).is(':visible')
+ ) {
+ cy.bySemanticElement('button', 'Discard Changes')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
}
});
},
@@ -383,11 +692,22 @@ export const persesDashboardsPage = {
cy.log('persesDashboardsPage.assertPanel');
persesDashboardsPage.panelGroupHeaderAssertion(group, collapse_state);
if (collapse_state === 'Open') {
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(name).should('be.visible');
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(name)
+ .should('be.visible');
} else {
- cy.byAriaLabel(persesAriaLabels.OpenGroupButtonPrefix + group).scrollIntoView().should('be.visible').click({ force: true });
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(name).should('be.visible');
- cy.byAriaLabel(persesAriaLabels.CollapseGroupButtonPrefix + group).should('be.visible').click({ force: true });
+ cy.byAriaLabel(persesAriaLabels.OpenGroupButtonPrefix + group)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .contains(name)
+ .should('be.visible');
+ cy.byAriaLabel(persesAriaLabels.CollapseGroupButtonPrefix + group)
+ .should('be.visible')
+ .click({ force: true });
}
},
@@ -396,14 +716,21 @@ export const persesDashboardsPage = {
cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').contains(name).should('not.exist');
},
- downloadDashboard: (clearFolder: boolean, dashboardName: string, format: 'JSON' | 'YAML' | 'YAML (CR v1alpha1)' | 'YAML (CR v1alpha2)') => {
+ downloadDashboard: (
+ clearFolder: boolean,
+ dashboardName: string,
+ format: 'JSON' | 'YAML' | 'YAML (CR v1alpha1)' | 'YAML (CR v1alpha2)',
+ ) => {
cy.log('persesDashboardsPage.downloadDashboard');
if (clearFolder) {
cy.task('clearDownloads');
}
- cy.get('#'+ IDs.persesDashboardDownloadButton).scrollIntoView().should('be.visible').click({ force: true });
+ cy.get('#' + IDs.persesDashboardDownloadButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
cy.byPFRole('menuitem').contains(format).should('be.visible').click({ force: true });
cy.wait(1000);
let filename: string;
@@ -422,47 +749,68 @@ export const persesDashboardsPage = {
let downloadedFileName: string | null = null;
const downloadsFolder = Cypress.config('downloadsFolder');
const expectedFileNamePattern = fileNameExp;
-
- cy.waitUntil(() => {
- return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
- const matchingFile = currentFiles.find(file => file.includes(expectedFileNamePattern));
- if (matchingFile) {
- downloadedFileName = matchingFile;
- return true;
- }
- return false;
- });
- }, {
- timeout: 20000,
- interval: 1000,
- errorMsg: `File matching "${expectedFileNamePattern}" was not downloaded within timeout.`
- });
+
+ cy.waitUntil(
+ () => {
+ return cy.task('getFilesInFolder', downloadsFolder).then((currentFiles: string[]) => {
+ const matchingFile = currentFiles.find((file) => file.includes(expectedFileNamePattern));
+ if (matchingFile) {
+ downloadedFileName = matchingFile;
+ return true;
+ }
+ return false;
+ });
+ },
+ {
+ timeout: 20000,
+ interval: 1000,
+ errorMsg: [
+ `File matching "${expectedFileNamePattern}"`,
+ 'was not downloaded within timeout.',
+ ].join(' '),
+ },
+ );
cy.then(() => {
- expect(downloadedFileName).to.not.be.null;
+ expect(downloadedFileName).to.not.equal(null);
cy.task('doesFileExist', { fileName: downloadedFileName }).should('be.true');
});
},
viewJSON: (dashboardName: string, namespace: string) => {
- cy.log('persesDashboardsPage.viewJSON');
- cy.byAriaLabel(persesAriaLabels.ViewJSONButton).scrollIntoView().should('be.visible').click({ force: true });
- cy.byPFRole('dialog').find('h2').contains(persesDashboardsModalTitles.VIEW_JSON_DIALOG).scrollIntoView().should('be.visible');
+ cy.log(`persesDashboardsPage.viewJSON dashboard=${dashboardName} namespace=${namespace}`);
+ cy.byAriaLabel(persesAriaLabels.ViewJSONButton)
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
+ cy.byPFRole('dialog')
+ .find('h2')
+ .contains(persesDashboardsModalTitles.VIEW_JSON_DIALOG)
+ .scrollIntoView()
+ .should('be.visible');
cy.byAriaLabel('Close').should('be.visible').click({ force: true });
},
-
+
assertDuplicatedPanel: (panel: string, amount: number) => {
cy.log('persesDashboardsPage.assertDuplicatedPanel');
- cy.byDataTestID(persesMUIDataTestIDs.panelHeader).find('h6').filter(`:contains("${panel}")`).should('have.length', amount);
+ cy.byDataTestID(persesMUIDataTestIDs.panelHeader)
+ .find('h6')
+ .filter(`:contains("${panel}")`)
+ .should('have.length', amount);
},
- closeSuccessAlert: () => {
- cy.log('persesDashboardsPage.closeSuccessAlert');
+ closeAlert: () => {
+ cy.log('persesDashboardsPage.closeAlert');
cy.wait(2000);
cy.get('body').then((body) => {
if (body.find('h4').length > 0 && body.find('h4').is(':visible')) {
- cy.get('h4').siblings('div').find('button').scrollIntoView().should('be.visible').click({ force: true });
+ cy.get('h4')
+ .siblings('div')
+ .find('button')
+ .scrollIntoView()
+ .should('be.visible')
+ .click({ force: true });
}
});
},
-}
+};
diff --git a/web/cypress/views/silence-alert-page.ts b/web/cypress/views/silence-alert-page.ts
index 950eb75e0..0787945e7 100644
--- a/web/cypress/views/silence-alert-page.ts
+++ b/web/cypress/views/silence-alert-page.ts
@@ -1,12 +1,13 @@
import { DataTestIDs, Classes } from '../../src/components/data-test';
-const silenceText = 'Silences temporarily mute alerts based on a set of label selectors that you define. Notifications will not be sent for alerts that match all the listed values or regular expressions.'
-const alertText = 'Alerts with labels that match these selectors will be silenced instead of firing. Label values can be matched exactly or with a regular expression'
-const editWarningTitle = 'Overwriting current silence'
-const editMessage = 'When changes are saved, the currently existing silence will be expired and a new silence with the new configuration will take its place.'
-
+const silenceText =
+ 'Silences temporarily mute alerts based on a set of label selectors that you define. Notifications will not be sent for alerts that match all the listed values or regular expressions.';
+const alertText =
+ 'Alerts with labels that match these selectors will be silenced instead of firing. Label values can be matched exactly or with a regular expression';
+const editWarningTitle = 'Overwriting current silence';
+const editMessage =
+ 'When changes are saved, the currently existing silence will be expired and a new silence with the new configuration will take its place.';
export const silenceAlertPage = {
-
silenceAlertSectionDefault: () => {
cy.log('silenceAlertPage.silenceAlertSectionDefault');
cy.get(Classes.SilenceHelpText).eq(0).contains(silenceText).should('be.visible');
@@ -23,15 +24,21 @@ export const silenceAlertPage = {
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.StartImmediately).should('be.checked');
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).should('have.value', 'Now');
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceForToggle).should('contain', '2h');
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).should('have.value', '2h from now');
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).should(
+ 'have.value',
+ '2h from now',
+ );
},
editDurationSectionDefault: () => {
cy.log('silenceAlertPage.durationSectionDefault');
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.StartImmediately).should('be.checked'); //pf-5 cy.byTestID('[id="silence-start-immediately"]').should('be.checked');
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.StartImmediately).should('be.checked'); //pf-5 cy.byTestID('[id="silence-start-immediately"]').should('be.checked');
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).should('have.value', 'Now');
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceForToggle).should('contain', '-');
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).should('not.have.value', '2h from now');
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).should(
+ 'not.have.value',
+ '2h from now',
+ );
},
alertLabelsSectionDefault: () => {
@@ -39,64 +46,145 @@ export const silenceAlertPage = {
cy.get(Classes.SilenceHelpText).eq(1).contains(alertText).should('be.visible'); //pf-5 cy.byClass('.co-help-text.monitoring-silence-alert__paragraph').contains(alertText).should('be.visible');
},
- assertLabelNameLabelValueRegExNegMatcher: (labelName: string, labelValue: string, regEx: boolean, negMatcher: boolean) => {
+ assertLabelNameLabelValueRegExNegMatcher: (
+ labelName: string,
+ labelValue: string,
+ regEx: boolean,
+ negMatcher: boolean,
+ ) => {
cy.log('silenceAlertPage.assertLabelNameLabelValueRegExNegMatcher');
- cy.byClass('pf-v6-l-grid pf-m-all-12-col-on-sm pf-m-all-4-col-on-md pf-m-gutter').each(($row, rowIndex) => { //pf-5 cy.get('.row').each(($row, rowIndex) => {
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').invoke('val').then((cellText) => {
- if (cellText === labelName){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').invoke('val').should('equal', labelName);
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').invoke('val').should('equal', labelValue);
- if (regEx){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.Regex+'"]').should('be.checked');
- } else{
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.Regex+'"]').should('not.be.checked');
- }
- if (negMatcher){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox+'"]').should('be.checked');
- } else{
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox+'"]').should('not.be.checked');
- }
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.RemoveLabel+'"]').should('be.visible');
- } else {
- return;
- }
- })
- })
+ cy.byClass('pf-v6-l-grid pf-m-all-12-col-on-sm pf-m-all-4-col-on-md pf-m-gutter').each(
+ ($row) => {
+ //pf-5 cy.get('.row').each(($row, rowIndex) => {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .invoke('val')
+ .then((cellText) => {
+ if (cellText === labelName) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .invoke('val')
+ .should('equal', labelName);
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .invoke('val')
+ .should('equal', labelValue);
+ if (regEx) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.Regex + '"]')
+ .should('be.checked');
+ } else {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.Regex + '"]')
+ .should('not.be.checked');
+ }
+ if (negMatcher) {
+ cy.wrap($row)
+ .find(
+ '[data-test="' +
+ DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox +
+ '"]',
+ )
+ .should('be.checked');
+ } else {
+ cy.wrap($row)
+ .find(
+ '[data-test="' +
+ DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox +
+ '"]',
+ )
+ .should('not.be.checked');
+ }
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.RemoveLabel + '"]')
+ .should('be.visible');
+ } else {
+ return;
+ }
+ });
+ },
+ );
},
- assertNamespaceLabelNamespaceValueDisabled: (labelName: string, labelValue: string, disabled: boolean) => {
+ assertNamespaceLabelNamespaceValueDisabled: (
+ labelName: string,
+ labelValue: string,
+ disabled: boolean,
+ ) => {
cy.log('silenceAlertPage.assertNamespaceLabelNamespaceValueDisabled');
- cy.byClass('pf-v6-l-grid pf-m-all-12-col-on-sm pf-m-all-4-col-on-md pf-m-gutter').each(($row, rowIndex) => { //pf-5 cy.get('.row').each(($row, rowIndex) => {
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').invoke('val').then((cellText) => {
- if (cellText === labelName){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').invoke('val').should('equal', labelName);
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').invoke('val').should('equal', labelValue);
- if (disabled){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').should('have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').should('have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.Regex+'"]').should('have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox+'"]').should('have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.RemoveLabel+'"]').should('have.attr', 'disabled');
- } else{
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').should('not.have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').should('not.have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.Regex+'"]').should('not.have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox+'"]').should('not.have.attr', 'disabled');
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.RemoveLabel+'"]').should('not.have.attr', 'disabled');
- }
- } else {
- return;
- }
- })
- })
+ cy.byClass('pf-v6-l-grid pf-m-all-12-col-on-sm pf-m-all-4-col-on-md pf-m-gutter').each(
+ ($row) => {
+ //pf-5 cy.get('.row').each(($row, rowIndex) => {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .invoke('val')
+ .then((cellText) => {
+ if (cellText === labelName) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .invoke('val')
+ .should('equal', labelName);
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .invoke('val')
+ .should('equal', labelValue);
+ if (disabled) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .should('have.attr', 'disabled');
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .should('have.attr', 'disabled');
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.Regex + '"]')
+ .should('have.attr', 'disabled');
+ cy.wrap($row)
+ .find(
+ '[data-test="' +
+ DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox +
+ '"]',
+ )
+ .should('have.attr', 'disabled');
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.RemoveLabel + '"]')
+ .should('have.attr', 'disabled');
+ } else {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .should('not.have.attr', 'disabled');
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .should('not.have.attr', 'disabled');
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.Regex + '"]')
+ .should('not.have.attr', 'disabled');
+ cy.wrap($row)
+ .find(
+ '[data-test="' +
+ DataTestIDs.SilencesPageFormTestIDs.NegativeMatcherCheckbox +
+ '"]',
+ )
+ .should('not.have.attr', 'disabled');
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.RemoveLabel + '"]')
+ .should('not.have.attr', 'disabled');
+ }
+ } else {
+ return;
+ }
+ });
+ },
+ );
},
infoSectionDefault: () => {
cy.log('silenceAlertPage.infoSectionDefault');
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.Creator).invoke('val')
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.Creator)
+ .invoke('val')
.should('not.be.empty')
.should('have.attr', 'required');
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.Comment).invoke('text')
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.Comment)
+ .invoke('text')
.should('be.empty')
.should('have.attr', 'required');
},
@@ -106,75 +194,87 @@ export const silenceAlertPage = {
cy.byTestID(DataTestIDs.SilenceButton).should('be.visible');
cy.byTestID(DataTestIDs.CancelButton).should('be.visible');
},
-
+
clickCancelButton: () => {
cy.log('silenceAlertPage.clickCancelButton');
cy.byTestID(DataTestIDs.CancelButton).scrollIntoView().should('be.visible').click();
},
/**
* changeDuration only changing For (time dropdown) and Start immediately checkbox
- * @param time
- * @param startImmediately
+ * @param time
+ * @param startImmediately
*/
setForAndStartImmediately: (time: string, startImmediately: boolean) => {
cy.log('silenceAlertPage.setForAndStartImmediately');
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceForToggle).click();
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFor).should('contain', time);
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFor).contains(time).click();
-
- cy.get('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.StartImmediately+'"]').then((checkbox) => { //pf-5 cy.byTestID('[id="silence-start-immediately"]')
- if (startImmediately){
- if (!checkbox.prop('checked') ){
- cy.get('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.StartImmediately+'"]').click(); //pf-5 cy.byTestID('[id="silence-start-immediately"]').click();
- }
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).should('have.value', 'Now');
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).should('have.value', time +' from now');
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFor).should('contain', time);
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFor).contains(time).click();
- } else {
- if (checkbox.prop('checked')){
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.StartImmediately).click(); //pf-5 cy.byTestID('[id="silence-start-immediately"]').click();
- }
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).should('have.not.value', 'Now');
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).then(($fromElement) => {
- const fromText = $fromElement[0].getAttribute('value');
- expect(Date.parse(fromText) - Date.now()).to.be.lessThan(10000);
- // eslint-disable-next-line promise/no-nesting
- cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).then(($untilElement) => {
- const unit = time.slice(-1);
- const value = parseInt(time.slice(0,-1), 10);
- let silenceUntilDate = new Date(fromText);
-
- switch(unit){
- case 'm':
- silenceUntilDate.setMinutes(silenceUntilDate.getMinutes() + value);
- break;
- case 'h':
- silenceUntilDate.setHours(silenceUntilDate.getHours() + value);
- break;
- case 'd':
- silenceUntilDate.setDate(silenceUntilDate.getDate() + value);
- break;
- case 'w':
- silenceUntilDate.setDate(silenceUntilDate.getDate() + (value * 7));
- break;
- };
+ cy.get('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.StartImmediately + '"]').then(
+ (checkbox) => {
+ //pf-5 cy.byTestID('[id="silence-start-immediately"]')
+ if (startImmediately) {
+ if (!checkbox.prop('checked')) {
+ cy.get(
+ '[data-test="' + DataTestIDs.SilencesPageFormTestIDs.StartImmediately + '"]',
+ ).click();
+ // pf-5 cy.byTestID('[id="silence-start-immediately"]').click();
+ }
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).should('have.value', 'Now');
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).should(
+ 'have.value',
+ time + ' from now',
+ );
+ } else {
+ if (checkbox.prop('checked')) {
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.StartImmediately).click();
+ // pf-5 cy.byTestID('[id="silence-start-immediately"]').click();
+ }
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).should(
+ 'have.not.value',
+ 'Now',
+ );
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceFrom).then(($fromElement) => {
+ const fromText = $fromElement[0].getAttribute('value');
+ expect(Date.parse(fromText) - Date.now()).to.be.lessThan(10000);
+ cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.SilenceUntil).then(($untilElement) => {
+ const unit = time.slice(-1);
+ const value = parseInt(time.slice(0, -1), 10);
+ const silenceUntilDate = new Date(fromText);
- const formatDateTime = (date) => {
- const year = date.getFullYear();
- const month = String(date.getMonth() + 1).padStart(2, '0');
- const day = String(date.getDate()).padStart(2, '0');
- const hours = String(date.getHours()).padStart(2, '0');
- const minutes = String(date.getMinutes()).padStart(2, '0');
- const seconds = String(date.getSeconds()).padStart(2, '0');
- return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
- };
- expect(($untilElement[0].getAttribute('value'))).to.equal(formatDateTime(silenceUntilDate))
+ switch (unit) {
+ case 'm':
+ silenceUntilDate.setMinutes(silenceUntilDate.getMinutes() + value);
+ break;
+ case 'h':
+ silenceUntilDate.setHours(silenceUntilDate.getHours() + value);
+ break;
+ case 'd':
+ silenceUntilDate.setDate(silenceUntilDate.getDate() + value);
+ break;
+ case 'w':
+ silenceUntilDate.setDate(silenceUntilDate.getDate() + value * 7);
+ break;
+ }
+ const formatDateTime = (date) => {
+ const year = date.getFullYear();
+ const month = String(date.getMonth() + 1).padStart(2, '0');
+ const day = String(date.getDate()).padStart(2, '0');
+ const hours = String(date.getHours()).padStart(2, '0');
+ const minutes = String(date.getMinutes()).padStart(2, '0');
+ const seconds = String(date.getSeconds()).padStart(2, '0');
+ return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
+ };
+ expect($untilElement[0].getAttribute('value')).to.equal(
+ formatDateTime(silenceUntilDate),
+ );
+ });
});
- });
- } //else
- })//cy.get
- },//change duration
+ } //else
+ },
+ ); //cy.get
+ }, //change duration
setSilenceFrom: (fromTimestamp: string) => {
cy.log('silenceAlertPage.setSilenceFrom');
@@ -183,20 +283,18 @@ export const silenceAlertPage = {
addCreator: (creator: string) => {
cy.log('silenceAlertPage.addCreator');
- if (!creator){
+ if (!creator) {
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.Creator).clear();
- } else{
+ } else {
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.Creator).clear().type(creator);
}
-
},
addComment: (comment: string) => {
cy.log('silenceAlertPage.addComment');
cy.byTestID(DataTestIDs.SilencesPageFormTestIDs.Comment).type(comment);
-
},
- clickSubmit: () =>{
+ clickSubmit: () => {
cy.log('silenceAlertPage.clickSubmit');
cy.byTestID(DataTestIDs.SilenceButton).scrollIntoView().should('be.visible').click();
},
@@ -220,7 +318,7 @@ export const silenceAlertPage = {
/**
* pf-6 only
*/
- assertCreatorWithError:() => {
+ assertCreatorWithError: () => {
cy.log('silenceAlertPage.assertCreatorWithError');
cy.get(Classes.SilenceCreatorWithError).should('be.visible');
},
@@ -228,35 +326,57 @@ export const silenceAlertPage = {
fillLabeNameLabelValue: (labelName: string, labelValue: string, index?: number) => {
cy.log('silenceAlertPage.fillLabeNameLabelValue');
cy.get(Classes.SilenceLabelRow).each(($row, rowIndex) => {
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').invoke('val').then((cellText) => {
- if (index){
- if (rowIndex === index){
- if (!labelName){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').clear();
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .invoke('val')
+ .then(() => {
+ if (index) {
+ if (rowIndex === index) {
+ if (!labelName) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .clear();
+ } else {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .clear()
+ .type(labelName);
+ }
+ if (!labelValue) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .clear();
+ } else {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .clear()
+ .type(labelValue);
+ }
+ }
+ } else {
+ if (!labelName) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .clear();
} else {
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').clear().type(labelName);
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelName + '"]')
+ .clear()
+ .type(labelName);
}
- if (!labelValue){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').clear();
+ if (!labelValue) {
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .clear();
} else {
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').clear().type(labelValue);
+ cy.wrap($row)
+ .find('[data-test="' + DataTestIDs.SilencesPageFormTestIDs.LabelValue + '"]')
+ .clear()
+ .type(labelValue);
}
}
- }
- else{
- if (!labelName){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').clear();
- } else {
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelName+'"]').clear().type(labelName);
- }
- if (!labelValue){
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').clear();
- } else {
- cy.wrap($row).find('[data-test="'+DataTestIDs.SilencesPageFormTestIDs.LabelValue+'"]').clear().type(labelValue);
- }
- }
- })
- });
+ });
+ });
},
assertLabelNameError: () => {
@@ -266,7 +386,9 @@ export const silenceAlertPage = {
assertLabelValueError: () => {
cy.log('silenceAlertPage.assertLabelValueError');
- cy.get(Classes.SilenceAlertTitle).should('contain.text', 'invalid silence: at least one matcher must not match the empty string');
+ cy.get(Classes.SilenceAlertTitle).should(
+ 'contain.text',
+ 'invalid silence: at least one matcher must not match the empty string',
+ );
},
-
};
diff --git a/web/cypress/views/silence-details-page.ts b/web/cypress/views/silence-details-page.ts
index 6645be8e2..b3e1a2997 100644
--- a/web/cypress/views/silence-details-page.ts
+++ b/web/cypress/views/silence-details-page.ts
@@ -1,9 +1,8 @@
-import { commonPages } from "./common";
-import { detailsPage } from "./details-page";
-import { DataTestIDs } from "../../src/components/data-test";
+import { commonPages } from './common';
+import { detailsPage } from './details-page';
+import { DataTestIDs } from '../../src/components/data-test';
export const silenceDetailsPage = {
-
assertSilenceDetailsPage: (title: string, section: string, labelname: string) => {
cy.log('silenceDetailsPage.assertSilenceDetailsPage');
commonPages.titleShouldHaveText(title);
@@ -47,7 +46,7 @@ export const silenceDetailsPage = {
},
/**
- *
+ *
* @param toOpen true: to open Actions dropdown, false: assuming it is already opened
* @param yes true: confirm, false: cancel
*/
@@ -64,13 +63,13 @@ export const silenceDetailsPage = {
cy.byTestID(DataTestIDs.SilenceRecreateDropdownItem).should('be.visible').click();
},
- clickSilencesBreadcrumb:() => {
+ clickSilencesBreadcrumb: () => {
cy.log('silenceDetailsPage.clickSilencesBreadcrumb');
- try {
- cy.byTestID(DataTestIDs.Breadcrumb).contains('Silences').should('be.visible').click();
- } catch (error) {
- cy.log(`${error.message}`);
- throw error;
- }
- }
+ try {
+ cy.byTestID(DataTestIDs.Breadcrumb).contains('Silences').should('be.visible').click();
+ } catch (error) {
+ cy.log(`${error.message}`);
+ throw error;
+ }
+ },
};
diff --git a/web/cypress/views/silences-list-page.ts b/web/cypress/views/silences-list-page.ts
index 68fb0bcfd..8b13cd0fe 100644
--- a/web/cypress/views/silences-list-page.ts
+++ b/web/cypress/views/silences-list-page.ts
@@ -1,8 +1,7 @@
-import { commonPages } from "./common";
+import { commonPages } from './common';
import { DataTestIDs, Classes, LegacyTestIDs } from '../../src/components/data-test';
export const silencesListPage = {
-
shouldBeLoaded: () => {
cy.log('silencesListPage.shouldBeLoaded');
cy.byTestID(DataTestIDs.SilenceButton).should('be.visible');
@@ -11,8 +10,8 @@ export const silencesListPage = {
cy.get('table').find(Classes.TableHeaderColumn).contains('Firing alerts').should('be.visible');
cy.get('table').find(Classes.TableHeaderColumn).contains('State').should('be.visible');
cy.get('table').find(Classes.TableHeaderColumn).contains('Creator').should('be.visible');
-
},
+
firstTimeEmptyState: () => {
cy.log('silencesListPage.firstTimeEmptyState');
cy.byTestID(DataTestIDs.EmptyBoxBody).contains('No silences found').should('be.visible');
@@ -23,10 +22,24 @@ export const silencesListPage = {
cy.log('silencesListPage.emptyState');
cy.byTestID(DataTestIDs.EmptyBoxBody).contains('No Silences found').should('be.visible');
cy.bySemanticElement('button', 'Clear all filters').should('be.visible');
- cy.get(Classes.MainTag).contains('Silence State').parent().next('div').children('button').should('be.visible');
- cy.get(Classes.IndividualTag).contains('Active').parent().next('span').children('button').should('be.visible');
- cy.get(Classes.IndividualTag).contains('Pending').parent().next('span').children('button').should('be.visible');
-
+ cy.get(Classes.MainTag)
+ .contains('Silence State')
+ .parent()
+ .next('div')
+ .children('button')
+ .should('be.visible');
+ cy.get(Classes.IndividualTag)
+ .contains('Active')
+ .parent()
+ .next('span')
+ .children('button')
+ .should('be.visible');
+ cy.get(Classes.IndividualTag)
+ .contains('Pending')
+ .parent()
+ .next('span')
+ .children('button')
+ .should('be.visible');
},
createSilence: () => {
@@ -34,21 +47,19 @@ export const silencesListPage = {
cy.byTestID(DataTestIDs.SilenceButton).should('be.visible').click();
},
-
-
filter: {
/**
- * @param name
+ * @param name
*/
byName: (name: string) => {
cy.log('silencesListPage.filter.byName');
try {
- cy.byTestID(DataTestIDs.NameInput).scrollIntoView().as('input').should('be.visible');
- cy.get('@input', { timeout: 10000 }).scrollIntoView().type(name + '{enter}');
- cy.get('@input', { timeout: 10000 }).scrollIntoView().should('have.attr', 'value', name);
-
- }
- catch (error) {
+ cy.byTestID(DataTestIDs.NameInput).scrollIntoView().as('input').should('be.visible');
+ cy.get('@input', { timeout: 10000 })
+ .scrollIntoView()
+ .type(name + '{enter}');
+ cy.get('@input', { timeout: 10000 }).scrollIntoView().should('have.attr', 'value', name);
+ } catch (error) {
cy.log(`${error.message}`);
throw error;
}
@@ -58,7 +69,7 @@ export const silencesListPage = {
rows: {
shouldBe: (alert: string, state: string) => {
cy.log('silencesListPage.rows.shouldBe');
- cy.get('#'+LegacyTestIDs.SelectAllSilencesCheckbox).should('be.visible');
+ cy.get('#' + LegacyTestIDs.SelectAllSilencesCheckbox).should('be.visible');
cy.byTestID(DataTestIDs.SilenceResourceIcon).contains('S');
cy.byTestID(DataTestIDs.SilenceResourceLink).contains(alert).should('be.visible');
cy.get(Classes.SilenceState).eq(0).contains(state).should('be.visible');
@@ -96,7 +107,6 @@ export const silencesListPage = {
cy.log('silencesListPage.rows.editSilence');
silencesListPage.rows.clickAlertKebab();
cy.byTestID(DataTestIDs.SilenceEditDropdownItem).should('be.visible').click();
-
},
/**
* * @param yes boolean: true to expire and false to cancel
@@ -106,6 +116,6 @@ export const silencesListPage = {
silencesListPage.rows.clickAlertKebab();
cy.byTestID(DataTestIDs.SilenceExpireDropdownItem).should('be.visible').click();
commonPages.confirmExpireAlert(yes);
- }
+ },
},
-}
+};
diff --git a/web/cypress/views/tour.ts b/web/cypress/views/tour.ts
index b57b6b081..0c582c7db 100644
--- a/web/cypress/views/tour.ts
+++ b/web/cypress/views/tour.ts
@@ -1,43 +1,44 @@
export const guidedTour = {
- close: () => {
- const modalSelector = 'button[data-ouia-component-id="clustersOnboardingModal-ModalBoxCloseButton"]'
- cy.log('close guided tour');
- cy.get('body').then(($body) => {
- //Core platform modal
- if ($body.find(`[data-test="guided-tour-modal"]`).length > 0) {
- cy.log('Core platform modal detected, attempting to close...');
- cy.byTestID('tour-step-footer-secondary').contains('Skip tour').click();
- }
- //Kubevirt modal
- else if ($body.find(`[aria-label="Welcome modal"]`).length > 0) {
- cy.log('Kubevirt modal detected, attempting to close...');
- cy.get('[aria-label="Close"]').should('be.visible').click();
- }
- //ACM Onboarding modal
- else if ($body.find(modalSelector).length > 0) {
- cy.log('Onboarding modal detected, attempting to close...');
- cy.get(modalSelector, { timeout: 20000 })
- .should('be.visible')
- .should('not.be.disabled')
- .click({ force: true });
-
- cy.get(modalSelector, { timeout: 10000 })
- .should('not.exist')
- .then(() => cy.log('Modal successfully closed'));
- }
- // Prevents navigating away from the page before the tour is closed
- cy.wait(2000);
- });
- },
+ close: () => {
+ const modalSelector =
+ 'button[data-ouia-component-id="clustersOnboardingModal-ModalBoxCloseButton"]';
+ cy.log('close guided tour');
+ cy.get('body').then(($body) => {
+ //Core platform modal
+ if ($body.find(`[data-test="guided-tour-modal"]`).length > 0) {
+ cy.log('Core platform modal detected, attempting to close...');
+ cy.byTestID('tour-step-footer-secondary').contains('Skip tour').click();
+ }
+ //Kubevirt modal
+ else if ($body.find(`[aria-label="Welcome modal"]`).length > 0) {
+ cy.log('Kubevirt modal detected, attempting to close...');
+ cy.get('[aria-label="Close"]').should('be.visible').click();
+ }
+ //ACM Onboarding modal
+ else if ($body.find(modalSelector).length > 0) {
+ cy.log('Onboarding modal detected, attempting to close...');
+ cy.get(modalSelector, { timeout: 20000 })
+ .should('be.visible')
+ .should('not.be.disabled')
+ .click({ force: true });
- closeKubevirtTour: () => {
- cy.log('close Kubevirt tour');
- cy.get('body').then(($body) => {
- if ($body.find(`[aria-label="Welcome modal"]`).length > 0) {
- cy.get('[aria-label="Close"]').should('be.visible').click();
- }
- // Prevents navigating away from the page before the tour is closed
- cy.wait(2000);
- });
- },
- };
\ No newline at end of file
+ cy.get(modalSelector, { timeout: 10000 })
+ .should('not.exist')
+ .then(() => cy.log('Modal successfully closed'));
+ }
+ // Prevents navigating away from the page before the tour is closed
+ cy.wait(2000);
+ });
+ },
+
+ closeKubevirtTour: () => {
+ cy.log('close Kubevirt tour');
+ cy.get('body').then(($body) => {
+ if ($body.find(`[aria-label="Welcome modal"]`).length > 0) {
+ cy.get('[aria-label="Close"]').should('be.visible').click();
+ }
+ // Prevents navigating away from the page before the tour is closed
+ cy.wait(2000);
+ });
+ },
+};
diff --git a/web/cypress/views/troubleshooting-panel.ts b/web/cypress/views/troubleshooting-panel.ts
index 0238a7656..9257a9e51 100644
--- a/web/cypress/views/troubleshooting-panel.ts
+++ b/web/cypress/views/troubleshooting-panel.ts
@@ -1,19 +1,23 @@
-import { DataTestIDs, Classes, LegacyTestIDs, IDs } from "../../src/components/data-test";
+import { DataTestIDs, LegacyTestIDs } from '../../src/components/data-test';
export const troubleshootingPanelPage = {
-
openSignalCorrelation: () => {
cy.log('troubleshootingPanelPage.openSignalCorrelation');
cy.byLegacyTestID(LegacyTestIDs.ApplicationLauncher).should('be.visible').click();
cy.wait(3000);
- cy.byTestID(DataTestIDs.MastHeadApplicationItem).contains('Signal Correlation').should('be.visible').click();
+ cy.byTestID(DataTestIDs.MastHeadApplicationItem)
+ .contains('Signal Correlation')
+ .should('be.visible')
+ .click();
cy.wait(3000);
},
signalCorrelationShouldNotBeVisible: () => {
cy.log('troubleshootingPanelPage.signalCorrelationShouldNotBeVisible');
cy.byLegacyTestID(LegacyTestIDs.ApplicationLauncher).should('be.visible').click();
- cy.byTestID(DataTestIDs.MastHeadApplicationItem).contains('Signal Correlation').should('not.exist');
+ cy.byTestID(DataTestIDs.MastHeadApplicationItem)
+ .contains('Signal Correlation')
+ .should('not.exist');
cy.byLegacyTestID(LegacyTestIDs.ApplicationLauncher).should('be.visible').click();
},
@@ -24,9 +28,7 @@ export const troubleshootingPanelPage = {
cy.byButtonText('Focus').should('be.visible');
cy.get('#query-toggle').should('be.visible');
//svg path for refresh button
- cy.get('.tp-plugin__panel-query-container').find('path').eq(1).should('have.attr', 'd', 'M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z');
+ cy.byAriaLabel('Refresh').should('be.visible');
cy.byDataID('korrel8r_graph').should('be.visible');
},
-
-
};
diff --git a/web/cypress/views/utils.ts b/web/cypress/views/utils.ts
index 50164850b..bf9c9ade8 100644
--- a/web/cypress/views/utils.ts
+++ b/web/cypress/views/utils.ts
@@ -11,14 +11,14 @@ export function getValFromElement(selector: string) {
cy.get(selector).should('be.visible');
const elementText = cy.get(selector).invoke('val');
return elementText;
-};
+}
export function getTextFromElement(selector: string) {
cy.log('Get Text from Element');
cy.get(selector).should('be.visible');
const elementText = cy.get(selector).invoke('text');
return elementText;
-};
+}
// PatternFly version detection and abstraction
export function getPFVersion() {
@@ -40,4 +40,4 @@ export function getPFVersion() {
}
// Default to current version
return 'v6';
-};
\ No newline at end of file
+}
diff --git a/web/package.json b/web/package.json
index c66a43344..c07c07826 100644
--- a/web/package.json
+++ b/web/package.json
@@ -15,7 +15,7 @@
"i18n": "i18n-scripts/build-i18n.sh && node i18n-scripts/set-english-defaults.js",
"i18n-to-po": "node ./i18n-scripts/i18n-to-po.js",
"po-to-i18n": "node ./i18n-scripts/po-to-i18n.js",
- "lint": "eslint ./src",
+ "lint": "eslint ./src ./cypress",
"lint:tsc": "tsc --noEmit",
"lint-fix": "eslint ./src --fix",
"pre-commit:check": "npm run lint",
diff --git a/web/src/components/data-test.ts b/web/src/components/data-test.ts
index b77e4508e..28fa374ae 100644
--- a/web/src/components/data-test.ts
+++ b/web/src/components/data-test.ts
@@ -184,7 +184,7 @@ export const IDs = {
persesDashboardAddPanelGroupForm: 'panel-group-editor-form',
persesDashboardAddPanelForm: 'panel-editor-form',
persesDashboardDiscardChangesDialog: 'discard-dialog',
- persesDashboardCreateDashboardName: 'text-input-create-dashboard-dialog-name',
+ persesDashboardCreateDashboardName: 'create-modal-dashboard-name-form-group-text-input',
persesDashboardRenameDashboardName: 'rename-modal-text-input',
persesDashboardDuplicateDashboardName: 'duplicate-modal-dashboard-name-form-group-text-input',
persesDashboardImportDashboardUploadFileInput: 'import-dashboard-file-filename',
@@ -218,8 +218,9 @@ export const Classes = {
NamespaceDropdown: '.pf-v6-c-menu-toggle.co-namespace-dropdown__menu-toggle',
NamespaceDropdownExpanded:
'.pf-v6-c-menu-toggle.pf-m-expanded.co-namespace-dropdown__menu-toggle',
- PersesCreateDashboardProjectDropdown: '.pf-v6-c-menu-toggle.pf-m-full-width.pf-m-typeahead',
+ PersesCreateDashboardProjectDropdown: 'button[class="pf-v6-c-menu-toggle__button"]',
PersesCreateDashboardDashboardNameError: '.pf-v6-c-helper-text__item-text',
+ PersesDuplicateDashboardNameError: '.pf-v6-c-alert__title',
PersesListDashboardCount: '.pf-v6-c-menu-toggle__text',
SectionHeader: '.pf-v6-c-title.pf-m-h2, .co-section-heading',
TableHeaderColumn: '.pf-v6-c-table__button, .pf-c-table__button',