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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { nav } from '../../views/nav';
import { runBVTCOOPersesTests } from '../../support/perses/00.coo_bvt_perses.cy';
import { runBVTCOOPersesTests } from '../../support/perses/00.coo_bvt_perses_admin.cy';
import { guidedTour } from '../../views/tour';

// Set constants for the operators that need to be installed for tests.
Expand All @@ -18,16 +18,13 @@ const MP = {
operatorName: 'Cluster Monitoring Operator',
};

describe('BVT: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke', '@dashboards'] }, () => {
describe('BVT: COO - Dashboards (Perses) - Administrator perspective', { tags: ['@smoke', '@dashboards', '@perses'] }, () => {

before(() => {
cy.beforeBlockCOO(MCP, MP);
});

beforeEach(() => {
cy.visit('/');
guidedTour.close();
cy.validateLogin();
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
});

Expand Down
38 changes: 38 additions & 0 deletions web/cypress/e2e/perses/00.coo_bvt_perses_admin_1.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { nav } from '../../views/nav';
//TODO: rename after customizable-dashboards gets merged
import { runBVTCOOPersesTests1 } from '../../support/perses/00.coo_bvt_perses_admin_1.cy';
import { guidedTour } from '../../views/tour';

// 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);
});

beforeEach(() => {
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
});

//TODO: rename after customizable-dashboards gets merged
runBVTCOOPersesTests1({
name: 'Administrator',
});

});
56 changes: 56 additions & 0 deletions web/cypress/e2e/perses/01.coo_list_perses_admin.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { nav } from '../../views/nav';
import { 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.
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 @dashboards when customizable-dashboards gets merged
describe('COO - Dashboards (Perses) - List perses dashboards', { tags: ['@perses', '@dashboards-'] }, () => {

before(() => {
cy.beforeBlockCOO(MCP, MP);
});

beforeEach(() => {
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
cy.changeNamespace('All Projects');
});

runCOOListPersesTests({
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);
});

beforeEach(() => {
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
cy.changeNamespace('All Projects');
});

runCOOListPersesTestsNamespace({
name: 'Administrator',
});

});

19 changes: 14 additions & 5 deletions web/cypress/fixtures/perses/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ export enum persesDashboardsRefreshInterval {
}

export const persesDashboardsDashboardDropdownCOO = {
ACCELERATORS_COMMON_METRICS:['Accelerators common metrics', 'perses'],
K8S_COMPUTE_RESOURCES_CLUSTER: ['Kubernetes / Compute Resources / Cluster', 'perses'],
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'],
}

export const persesDashboardsDashboardDropdownPersesDev = {
PERSES_DASHBOARD_SAMPLE: ['Perses Dashboard Sample', 'perses'],
PROMETHEUS_OVERVIEW: ['Prometheus / Overview', 'perses'],
THANOS_COMPACT_OVERVIEW: ['Thanos / Compact / Overview', 'perses'],
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 {
Expand All @@ -39,4 +40,12 @@ export enum persesDashboardsAcceleratorsCommonMetricsPanels {
TEMPERATURE_CELCIUS = 'Temperature (Celsius)',
SM_CLOCK_HERTZ = 'SM Clock (Hertz)',
MEMORY_CLOCK_HERTZ = 'Memory Clock (Hertz)',
}

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.',

}
4 changes: 3 additions & 1 deletion web/cypress/support/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ Cypress.on('uncaught:exception', (err) => {
message.includes('Unauthorized') ||
message.includes('Bad Gateway') ||
message.includes(`Cannot read properties of null (reading 'default')`) ||
message.includes(`(intermediate value) is not a function`)
message.includes(`(intermediate value) is not a function`) ||
//TODO: OU-1158
message.includes(`[ Federation Runtime ]: Failed to load script resources. #RUNTIME-008`)
) {
console.warn('Ignored frontend exception:', err.message);
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { persesDashboardsAcceleratorsCommonMetricsPanels, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
import { commonPages } from '../../views/common';
import { persesDashboardsPage } from '../../views/perses-dashboards';
import { persesDataTestIDs } from '../../../src/components/data-test';
import { persesMUIDataTestIDs } from '../../../src/components/data-test';

export interface PerspectiveConfig {
name: string;
Expand Down Expand Up @@ -31,7 +31,7 @@ export function testBVTCOOPerses(perspective: PerspectiveConfig) {
cy.log(`2.1. use sidebar nav to go to Observe > Dashboards (Perses) > Accelerators common metrics dashboard`);
cy.changeNamespace('openshift-cluster-observability-operator');
persesDashboardsPage.clickDashboardDropdown(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0] as keyof typeof persesDashboardsDashboardDropdownCOO);
cy.byDataTestID(persesDataTestIDs.variableDropdown+'-cluster').should('be.visible');
cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-cluster').should('be.visible');
persesDashboardsPage.panelGroupHeaderAssertion('Accelerators');
persesDashboardsPage.panelHeadersAcceleratorsCommonMetricsAssertion();
persesDashboardsPage.expandPanel(persesDashboardsAcceleratorsCommonMetricsPanels.GPU_UTILIZATION);
Expand All @@ -42,10 +42,10 @@ export function testBVTCOOPerses(perspective: PerspectiveConfig) {
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(persesDataTestIDs.variableDropdown+'-job').should('be.visible');
cy.byDataTestID(persesDataTestIDs.variableDropdown+'-instance').should('be.visible');
cy.byDataTestID(persesDataTestIDs.variableDropdown+'-interval').should('be.visible');
cy.byDataTestID(persesDataTestIDs.variableDropdown+'-text').should('be.visible');
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');
persesDashboardsPage.expandPanel('RAM Used');
persesDashboardsPage.collapsePanel('RAM Used');
Expand Down
56 changes: 56 additions & 0 deletions web/cypress/support/perses/00.coo_bvt_perses_admin_1.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { persesDashboardsAcceleratorsCommonMetricsPanels, persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
import { persesDashboardsPage } from '../../views/perses-dashboards';
import { persesMUIDataTestIDs } from '../../../src/components/data-test';
import { listPersesDashboardsPage } from '../../views/list-perses-dashboards';

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[2]);
persesDashboardsPage.shouldBeLoaded();
});

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[2]);
cy.wait(2000);
persesDashboardsPage.clickDashboardDropdown(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0] as keyof typeof persesDashboardsDashboardDropdownCOO);
cy.byDataTestID(persesMUIDataTestIDs.variableDropdown+'-cluster').should('be.visible');
persesDashboardsPage.panelGroupHeaderAssertion('Accelerators');
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[2]);
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');
persesDashboardsPage.expandPanel('RAM Used');
persesDashboardsPage.collapsePanel('RAM Used');
persesDashboardsPage.statChartValueAssertion('RAM Used', true);
persesDashboardsPage.searchAndSelectVariable('job', 'node-exporter');
persesDashboardsPage.statChartValueAssertion('RAM Used', false);

});

}
76 changes: 76 additions & 0 deletions web/cypress/support/perses/01.coo_list_perses_admin.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { persesDashboardsDashboardDropdownCOO, persesDashboardsDashboardDropdownPersesDev } from '../../fixtures/perses/constants';
import { commonPages } from '../../views/common';
import { listPersesDashboardsPage } from "../../views/list-perses-dashboards";
import { persesDashboardsPage } from '../../views/perses-dashboards';

export interface PerspectiveConfig {
name: string;
beforeEach?: () => void;
}

export function runCOOListPersesTests(perspective: PerspectiveConfig) {
testCOOListPerses(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[2]);
listPersesDashboardsPage.countDashboards('1');

cy.log(`1.3. Clear all filters`);
listPersesDashboardsPage.clearAllFilters();

cy.log(`1.4. Filter by Project and Name`);
listPersesDashboardsPage.filter.byProject('perses-dev');
listPersesDashboardsPage.countDashboards('3');
listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[2]);
listPersesDashboardsPage.countDashboards('1');

cy.log(`1.5. Clear all filters`);
listPersesDashboardsPage.clearAllFilters();

cy.log(`1.6. Filter by Project`);
listPersesDashboardsPage.filter.byProject('perses-dev');

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[2], 0);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[2], 1);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[2], 2);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2], 3);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[2], 4);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[2], 5);

cy.log(`1.9. Sort by Dashboard - Descending`);
listPersesDashboardsPage.sortBy('Dashboard');
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[2], 0);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PROMETHEUS_OVERVIEW[2], 1);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownPersesDev.PERSES_DASHBOARD_SAMPLE[2], 2);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.K8S_COMPUTE_RESOURCES_CLUSTER[2], 3);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.APM_DASHBOARD[2], 4);
listPersesDashboardsPage.assertDashboardName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[2], 5);

cy.log(`1.10. Filter by Name - Empty state`);
listPersesDashboardsPage.filter.byName(persesDashboardsDashboardDropdownCOO.ACCELERATORS_COMMON_METRICS[0]);
listPersesDashboardsPage.emptyState();
listPersesDashboardsPage.countDashboards('0');

cy.log(`1.11. Clear all filters`);
listPersesDashboardsPage.clearAllFilters();

cy.log(`1.12. Click on a dashboard`);
listPersesDashboardsPage.clickDashboard(persesDashboardsDashboardDropdownPersesDev.THANOS_COMPACT_OVERVIEW[2]);
//TODO: change back to shouldBeLoaded when customizable-dashboards gets merged
// persesDashboardsPage.shouldBeLoaded1();
});

}
Loading