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
4 changes: 1 addition & 3 deletions web/cypress/e2e/coo/01.coo_ivt.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@smoke', '@coo']
it('1. Virtualization perspective - Observe Menu', () => {
cy.log('Virtualization perspective - Observe Menu and verify all submenus');
cy.switchPerspective('Virtualization');
cy.byAriaLabel('Welcome modal').should('be.visible');
guidedTour.closeKubevirtTour();
troubleshootingPanelPage.signalCorrelationShouldNotBeVisible();
cy.switchPerspective('Administrator');
cy.switchPerspective('Core platform', 'Administrator');

});

Expand Down
5 changes: 0 additions & 5 deletions web/cypress/e2e/virtualization/00.coo_ivt.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,13 @@ describe('Installation: Virtualization', { tags: ['@virtualization', '@slow'] },
it('1. Virtualization perspective - Observe Menu', () => {
cy.log('Virtualization perspective - Observe Menu and verify all submenus');
cy.switchPerspective('Virtualization');
guidedTour.closeKubevirtTour();
});
});

describe('IVT: Monitoring + Virtualization', { tags: ['@smoke', '@virtualization'] }, () => {

beforeEach(() => {
cy.visit('/');
guidedTour.close();
cy.validateLogin();
cy.switchPerspective('Virtualization');
guidedTour.closeKubevirtTour();
nav.sidenav.clickNavLink(['Observe', 'Metrics']);
commonPages.titleShouldHaveText('Metrics');
cy.changeNamespace("All Projects");
Expand Down
4 changes: 0 additions & 4 deletions web/cypress/e2e/virtualization/01.coo_ivt_alerts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization'
it('1. Virtualization perspective - Observe Menu', () => {
cy.log('Virtualization perspective - Observe Menu and verify all submenus');
cy.switchPerspective('Virtualization');
guidedTour.closeKubevirtTour();
});
});

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");
Expand Down
6 changes: 0 additions & 6 deletions web/cypress/e2e/virtualization/02.coo_ivt_metrics_1.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization'
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');
Expand All @@ -80,10 +77,7 @@ describe('Regression: Monitoring - Metrics (Virtualization)', { tags: ['@virtual
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');
Expand Down
7 changes: 0 additions & 7 deletions web/cypress/e2e/virtualization/02.coo_ivt_metrics_2.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,13 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization'
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');
Expand All @@ -80,10 +76,7 @@ describe('Regression: Monitoring - Metrics (Virtualization)', { tags: ['@virtual
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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,13 @@ describe('IVT: Monitoring UIPlugin + Virtualization', { tags: ['@virtualization'
it('1. Virtualization perspective - Observe Menu', () => {
cy.log('Virtualization perspective - Observe Menu and verify all submenus');
cy.switchPerspective('Virtualization');
guidedTour.closeKubevirtTour();
});
});

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");
Expand All @@ -77,10 +73,7 @@ describe('Regression: Monitoring - Legacy Dashboards (Virtualization)', { tags:

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);
Expand Down
5 changes: 0 additions & 5 deletions web/cypress/e2e/virtualization/04.coo_ivt_perses.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,13 @@ describe('Installation: Virtualization', { tags: ['@virtualization', '@slow'] },
it('1. Installation: Virtualization', () => {
cy.log('Installation: Virtualization');
cy.switchPerspective('Virtualization');
guidedTour.closeKubevirtTour();
});
});

describe('IVT: COO - Dashboards (Perses) - Virtualization perspective', { tags: ['@virtualization', '@dashboards'] }, () => {

beforeEach(() => {
cy.visit('/');
guidedTour.close();
cy.validateLogin();
cy.switchPerspective('Virtualization');
guidedTour.closeKubevirtTour();
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
commonPages.titleShouldHaveText('Dashboards');
});
Expand Down
12 changes: 7 additions & 5 deletions web/cypress/support/commands/auth-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export {};
declare global {
namespace Cypress {
interface Chainable {
switchPerspective(perspective: string);
switchPerspective(...perspectives: string[]);
uiLogin(provider: string, username: string, password: string, oauthurl?: string);
uiLogout();
cliLogin(username?, password?, hostapi?);
Expand Down Expand Up @@ -119,7 +119,8 @@ declare global {
cy.validateLogin();
});

Cypress.Commands.add('switchPerspective', (perspective: string) => {
Cypress.Commands.add('switchPerspective', (...perspectives: string[]) => {
cy.log('switchPerspective - ' + `${perspectives.join(' or ')}`);
/* If side bar is collapsed then expand it
before switching perspecting */
cy.wait(2000);
Expand All @@ -128,8 +129,9 @@ declare global {
cy.get('#nav-toggle').click();
}
});
nav.sidenav.switcher.changePerspectiveTo(perspective);
cy.validateLogin();
nav.sidenav.switcher.changePerspectiveTo(...perspectives);
cy.wait(3000);
guidedTour.close();
});

// To avoid influence from upstream login change
Expand Down Expand Up @@ -160,7 +162,7 @@ declare global {
cy.byTestID('username', { timeout: 120000 }).should('be.visible');
},
);
cy.switchPerspective('Administrator');
cy.switchPerspective('Core platform', 'Administrator');
});

Cypress.Commands.add('uiLogout', () => {
Expand Down
10 changes: 8 additions & 2 deletions web/cypress/support/commands/operator-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'cypress-wait-until';
import { operatorHubPage } from '../../views/operator-hub-page';
import { nav } from '../../views/nav';
import { DataTestIDs, LegacyTestIDs } from '../../../src/components/data-test';
import { commonPages } from '../../views/common';

export { };

Expand Down Expand Up @@ -718,6 +719,8 @@ Cypress.Commands.add('beforeBlock', (MP: { namespace: string, operatorName: stri
cacheAcrossSpecs: true,
validate() {
cy.validateLogin();
cy.wait(5000);
cy.switchPerspective('Core platform', 'Administrator');
},
},
);
Expand Down Expand Up @@ -760,9 +763,12 @@ Cypress.Commands.add('beforeBlock', (MP: { namespace: string, operatorName: stri
cacheAcrossSpecs: true,
validate() {
cy.validateLogin();
cy.switchPerspective('Core platform', 'Administrator');
// Additional validation for COO setup
cy.visit('/monitoring/v2/dashboards');
cy.url().should('include', '/monitoring/v2/dashboards');
cy.wait(5000);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
cy.wait(10000);
commonPages.titleShouldHaveText('Dashboards');
},
},
);
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/support/commands/utility-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Cypress.Commands.add('waitUntilWithCustomTimeout', (

Cypress.Commands.add('podImage', (pod: string, namespace: string) => {
cy.log('Get pod image');
cy.switchPerspective('Core platform');
cy.switchPerspective('Core platform', 'Administrator');
cy.wait(5000);
cy.clickNavLink(['Workloads', 'Pods']);
cy.changeNamespace(namespace);
Expand Down
12 changes: 6 additions & 6 deletions web/cypress/support/commands/virtualization-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const virtualizationUtils = {
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.switchPerspective('Core platform', 'Administrator');
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');
Expand Down Expand Up @@ -101,7 +102,7 @@ const virtualizationUtils = {
}
);
});

cy.switchPerspective('Core platform', 'Administrator');
cy.get('#page-sidebar').then(($sidebar) => {
const section = $sidebar.text().includes('Ecosystem') ? 'Ecosystem' : 'Operators';
nav.sidenav.clickNavLink([section, 'Installed Operators']);
Expand Down Expand Up @@ -217,11 +218,9 @@ const virtualizationUtils = {
cacheAcrossSpecs: true,
validate() {
cy.validateLogin();
// Additional validation for Virtualization setup
cy.visit('/k8s/all-namespaces/virtualization-overview');
cy.url().should('include', '/k8s/all-namespaces/virtualization-overview');
guidedTour.closeKubevirtTour();

cy.wait(10000);
cy.switchPerspective('Virtualization');

},
},
);
Expand All @@ -234,6 +233,7 @@ const virtualizationUtils = {
virtualizationUtils.installVirtualization(KBV);
virtualizationUtils.waitForVirtualizationReady(KBV);
virtualizationUtils.setupHyperconverged(KBV);
cy.switchPerspective('Virtualization');
cy.log('Before block Virtualization (no session) completed');
}
});
Expand Down
6 changes: 2 additions & 4 deletions web/cypress/support/monitoring/03.reg_legacy_dashboards.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { nav } from '../../views/nav';
import { legacyDashboardsPage } from '../../views/legacy-dashboards';
import { API_PERFORMANCE_DASHBOARD_PANELS, LegacyDashboardsDashboardDropdown, MetricsPageQueryInput, WatchdogAlert } from '../../fixtures/monitoring/constants';
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';
Expand Down Expand Up @@ -35,9 +35,7 @@ export function testLegacyDashboardsRegression(perspective: PerspectiveConfig) {
legacyDashboardsPage.clickDashboardDropdown('API_PERFORMANCE');

cy.log('1.5 Dashboard API Performance panels');
for (const panel of Object.values(API_PERFORMANCE_DASHBOARD_PANELS)) {
legacyDashboardsPage.dashboardAPIPerformancePanelAssertion(panel);
}
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();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { nav } from '../../views/nav';
import { legacyDashboardsPage } from '../../views/legacy-dashboards';
import { KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS, LegacyDashboardsDashboardDropdownNamespace, MetricsPageQueryInputByNamespace, WatchdogAlert } from '../../fixtures/monitoring/constants';
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';
Expand Down Expand Up @@ -34,9 +34,7 @@ export function testLegacyDashboardsRegressionNamespace(perspective: Perspective
legacyDashboardsPage.dashboardDropdownAssertion(LegacyDashboardsDashboardDropdownNamespace);

cy.log('1.5 Dashboard Kubernetes Compute Resources Namespace Pods panels');
for (const panel of Object.values(KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS)) {
legacyDashboardsPage.dashboardKubernetesComputeResourcesNamespacePodsPanelAssertion(panel);
}
legacyDashboardsPage.dashboardKubernetesComputeResourcesNamespacePodsPanelAssertion();

cy.log('1.6 Inspect - CPU Utilisation (from requests)');
cy.byTestID(LegacyDashboardPageTestIDs.Inspect).eq(0).scrollIntoView().should('be.visible').click();
Expand Down
1 change: 1 addition & 0 deletions web/cypress/views/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const commonPages = {
projectDropdownShouldNotExist: () => cy.byLegacyTestID('namespace-bar-dropdown').should('not.exist'),
projectDropdownShouldExist: () => cy.byLegacyTestID('namespace-bar-dropdown').should('exist'),
titleShouldHaveText: (title: string) => {
cy.wait(2000);
cy.log('commonPages.titleShouldHaveText - ' + `${title}`);
cy.bySemanticElement('h1', title).scrollIntoView().should('be.visible');
},
Expand Down
15 changes: 6 additions & 9 deletions web/cypress/views/legacy-dashboards.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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";

export const legacyDashboardsPage = {

Expand Down Expand Up @@ -77,26 +76,24 @@ export const legacyDashboardsPage = {
cy.byTestID(LegacyDashboardPageTestIDs.DashboardDropdown).find('button').should('be.visible').click();
},

dashboardAPIPerformancePanelAssertion: (panel: API_PERFORMANCE_DASHBOARD_PANELS) => {
dashboardAPIPerformancePanelAssertion: () => {
cy.log('legacyDashboardsPage.dashboardAPIPerformancePanelAssertion');
function formatDataTestID(panel: API_PERFORMANCE_DASHBOARD_PANELS): string {
return panel.toLowerCase().replace(/\s+/g, '-').concat('-chart');
}
const dataTestID = Object.values(API_PERFORMANCE_DASHBOARD_PANELS).map(formatDataTestID);
dataTestID.forEach((dataTestID) => {
cy.log('Data test ID: ' + dataTestID);
const dataTestIDs = Object.values(API_PERFORMANCE_DASHBOARD_PANELS).map(formatDataTestID);
dataTestIDs.forEach((dataTestID) => {
cy.byTestID(dataTestID).scrollIntoView().should('be.visible');
});
},

dashboardKubernetesComputeResourcesNamespacePodsPanelAssertion: (panel: KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS) => {
dashboardKubernetesComputeResourcesNamespacePodsPanelAssertion: () => {
cy.log('legacyDashboardsPage.dashboardKubernetesComputeResourcesNamespacePodsPanelAssertion');
function formatDataTestID(panel: KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS): string {
return panel.toLowerCase().replace(/\s+/g, '-').concat('-chart');
}
const dataTestID = Object.values(KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS).map(formatDataTestID);
dataTestID.forEach((dataTestID) => {
cy.log('Data test ID: ' + dataTestID);
const dataTestIDs = Object.values(KUBERNETES_COMPUTE_RESOURCES_NAMESPACE_PODS_PANELS).map(formatDataTestID);
dataTestIDs.forEach((dataTestID) => {
cy.byTestID(dataTestID).scrollIntoView().should('be.visible');
});
},
Expand Down
23 changes: 16 additions & 7 deletions web/cypress/views/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ export const nav = {
cy.clickNavLink(path);
},
switcher: {
changePerspectiveTo: (perspective: string) => {
changePerspectiveTo: (...perspectives: string[]) => {
cy.log('changePerspectiveTo - ' + perspectives.join(' or '));
cy.get('body').then((body) => {
if (body.find('#perspective-switcher-toggle').length > 0) {
cy.log('Switch perspective - ' + `${perspective}`);
cy.byLegacyTestID('perspective-switcher-toggle').scrollIntoView().should('be.visible').click({force: true});
cy.byLegacyTestID('perspective-switcher-menu-option').contains(perspective).should('be.visible');
cy.byLegacyTestID('perspective-switcher-menu-option').contains(perspective).should('be.visible').click({force: true});
if (body.find('[data-test-id="perspective-switcher-toggle"]:visible').length > 0) {
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));
if (foundPerspective) {
cy.byLegacyTestID('perspective-switcher-menu-option')
.contains(foundPerspective)
.click({ force: true });
} else {
cy.log('No matching perspective found');
cy.get('body').type('{esc}');
}
});
}
});

},
shouldHaveText: (perspective: string) => {
cy.log('Should have text - ' + `${perspective}`);
Expand Down
1 change: 1 addition & 0 deletions web/cypress/views/silences-list-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export const silencesListPage = {

editSilence: () => {
cy.log('silencesListPage.rows.editSilence');
cy.wait(2000);
silencesListPage.rows.clickAlertKebab();
cy.byTestID(DataTestIDs.SilenceEditDropdownItem).should('be.visible').click();

Expand Down