Skip to content
Merged
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
30 changes: 16 additions & 14 deletions web/cypress/e2e/perses/02.coo_edit_perses_admin.cy.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
import { nav } from '../../views/nav';
import { runCOOEditPersesTests1 } from '../../support/perses/02.coo_edit_perses_admin_1.cy';
import { runCOOEditPersesTests } from '../../support/perses/02.coo_edit_perses_admin.cy';
import { operatorAuthUtils } from '../../support/commands/auth-commands';

// 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 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',
};
// const MP = {
// namespace: 'openshift-monitoring',
// operatorName: 'Cluster Monitoring Operator',
// };

//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, { dashboards: true, troubleshootingPanel: false });
operatorAuthUtils.loginAndAuth();
// cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
cy.cleanupPersesTestDashboardsBeforeTests();
});

Expand Down
30 changes: 16 additions & 14 deletions web/cypress/e2e/perses/03.coo_create_perses_admin.cy.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import { nav } from '../../views/nav';
import { runCOOCreatePersesTests } from '../../support/perses/03.coo_create_perses_admin.cy';
import { operatorAuthUtils } from '../../support/commands/auth-commands';

// 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 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',
};
// const MP = {
// namespace: 'openshift-monitoring',
// operatorName: 'Cluster Monitoring Operator',
// };

//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, { dashboards: true, troubleshootingPanel: false });
// cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
operatorAuthUtils.loginAndAuth();
cy.cleanupPersesTestDashboardsBeforeTests();
cy.setupPersesRBACandExtraDashboards();
});
Expand Down
31 changes: 17 additions & 14 deletions web/cypress/e2e/perses/04.coo_import_perses_admin.cy.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
import { nav } from '../../views/nav';
import { runCOOImportPersesTests } from '../../support/perses/04.coo_import_perses_admin.cy';
import { operatorAuthUtils } from '../../support/commands/auth-commands';

// 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 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',
};
// const MP = {
// namespace: 'openshift-monitoring',
// operatorName: 'Cluster Monitoring Operator',
// };

//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, { dashboards: true, troubleshootingPanel: false });
// cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
operatorAuthUtils.loginAndAuth();
cy.cleanupPersesTestDashboardsBeforeTests();
cy.setupPersesRBACandExtraDashboards();
});

beforeEach(() => {
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
cy.wait(2000);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
cy.wait(5000);
cy.changeNamespace('All Projects');
Expand Down
2 changes: 1 addition & 1 deletion web/cypress/e2e/perses/05.coo_tempo_loki_admin.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const CLO = {

describe(
'COO - Dashboards (Perses) - Perses Global Datasources with Tempo and Loki',
{ tags: ['@perses', '@dashboards'] },
{ tags: ['@perses-ivt', '@dashboards'] },
() => {
before(() => {
cy.beforeBlockTempo(TEMPO);
Expand Down
29 changes: 8 additions & 21 deletions web/cypress/e2e/perses/99.coo_rbac_perses_user1.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,17 @@ const MP = {
operatorName: 'Cluster Monitoring Operator',
};

//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
describe(
'RBAC User1: COO - Dashboards (Perses) - Administrator perspective',
{ tags: ['@perses', '@perses-dev'] },
{ tags: ['@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)
// Setup COO and Perses dashboards (requires admin privileges)
cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
cy.cleanupPersesTestDashboardsBeforeTests();
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')}`,
// );

// Step 4: Clear Cypress session cache and logout
// 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(() => {
Expand All @@ -54,7 +39,7 @@ describe(
cy.clearAllLocalStorage();
cy.clearAllSessionStorage();

// Step 5: Re-login as dev user (now without cluster-admin role)
// 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(
Expand All @@ -67,7 +52,9 @@ describe(
});

beforeEach(() => {
cy.switchPerspective('Core platform');
nav.sidenav.clickNavLink(['Observe', 'Dashboards']);
cy.wait(2000);
nav.sidenav.clickNavLink(['Observe', 'Dashboards (Perses)']);
});

Expand All @@ -77,7 +64,7 @@ describe(

//TODO: rename after customizable-dashboards gets merged
runCOORBACPersesTestsDevUser1({
name: 'Administrator',
name: 'Core platform',
});
},
);
38 changes: 22 additions & 16 deletions web/cypress/e2e/perses/99.coo_rbac_perses_user2.cy.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser2 } from '../../support/perses/99.coo_rbac_perses_user2.cy';
import { operatorAuthUtils } from '../../support/commands/auth-commands';

// 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 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',
};
// const MP = {
// namespace: 'openshift-monitoring',
// operatorName: 'Cluster Monitoring Operator',
// };

//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
describe(
'RBAC User2: COO - Dashboards (Perses) - Administrator perspective',
{ tags: ['@perses', '@perses-dev'] },
{ tags: ['@perses-dev'] },
() => {
before(() => {
//TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
Expand All @@ -31,7 +32,9 @@ describe(
// );

// Step 2: Setup COO and Perses dashboards (requires admin privileges)
cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
// cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
operatorAuthUtils.loginAndAuth();
cy.cleanupPersesTestDashboardsBeforeTests();
cy.setupPersesRBACandExtraDashboards();

//TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
Expand Down Expand Up @@ -67,8 +70,11 @@ describe(
});

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

Expand All @@ -78,7 +84,7 @@ describe(

//TODO: rename after customizable-dashboards gets merged
runCOORBACPersesTestsDevUser2({
name: 'Administrator',
name: 'Core platform',
});
},
);
39 changes: 23 additions & 16 deletions web/cypress/e2e/perses/99.coo_rbac_perses_user3.cy.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
import { nav } from '../../views/nav';
import { runCOORBACPersesTestsDevUser3 } from '../../support/perses/99.coo_rbac_perses_user3.cy';
import { operatorAuthUtils } from '../../support/commands/auth-commands';

// 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 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',
};
// const MP = {
// namespace: 'openshift-monitoring',
// operatorName: 'Cluster Monitoring Operator',
// };

//TODO: change tag to @smoke, @dashboards, @perses when customizable-dashboards gets merged
describe(
'RBAC User3: COO - Dashboards (Perses) - Administrator perspective',
{ tags: ['@perses', '@perses-dev'] },
{ tags: ['@perses-dev'] },
() => {
before(() => {
//TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
Expand All @@ -31,7 +32,9 @@ describe(
// );

// Step 2: Setup COO and Perses dashboards (requires admin privileges)
cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
// cy.beforeBlockCOO(MCP, MP, { dashboards: true, troubleshootingPanel: false });
operatorAuthUtils.loginAndAuth();
cy.cleanupPersesTestDashboardsBeforeTests();
cy.setupPersesRBACandExtraDashboards();

//TODO: https://issues.redhat.com/browse/OCPBUGS-58468 - when it gets fixed, installation can be don using non-admin user
Expand Down Expand Up @@ -67,8 +70,12 @@ describe(
});

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

after(() => {
Expand All @@ -77,7 +84,7 @@ describe(

//TODO: rename after customizable-dashboards gets merged
runCOORBACPersesTestsDevUser3({
name: 'Administrator',
name: 'Core platform',
});
},
);
Loading