Skip to content

Commit

Permalink
PMM-12710: Fix RBAC Tests (#868)
Browse files Browse the repository at this point in the history
* PMM-12710 Update api endpoints

* PMM-12710 Update inventory & enums

* PMM-13242 trigger test run

* PMM-13242 test run

* PMM-13242 update delete location path

* PMM-13242 change agent status Running

* PMM-13242 update pgsm and pgss tests

* PMM-13242 fix access control tests

* PMM-13242 tweak pgsm pgss tests

* PMM-13242 update inventory api

* PMM-13242 update inventory api

* PMM-13242 update waitForRunningState in inventory api

* PMM-13242 more updates to inventory and mongo-exporter tests

* PMM-13242 update artifacts in workflow

* PMM-13242 update artifacts in workflow

* PMM-13267 update tags

* PMM-13267 pdsm and pgss tests

* PMM-13267 pdsm and pgss tests

* PMM-13267 increase timeout for repl lag

* PMM-13267 pgsm test

* PMM-12710: Fix for PMM-T878 - Verify adding annotation specific dashboard @nightly @dashboards @annotations

* PMM-12710: Fix for PMM-T554

* PMM-12710: Fix for PMM-T1699

* PMM-12710: Fix for collapsed dashboard panels

* PMM-12710: Fix for collapsed dashboard panels

* PMM-12710: New Dashboards

* PMM-12710: Fix test T432

* PMM-12710: Fix test T324

* PMM-12710: Fix test T1226

* PMM-12710: Fix test T1141

* PMM-12710: Fix tests

* PMM-12710: Fix tests

* PMM-12710: Fix tests

* PMM-12710: Fix tests

* PMM-12710: Fix tests

* PMM-12710: Fix tests for rbac

---------

Co-authored-by: Matej Kubinec <matej.kubinec@3pillarglobal.com>
Co-authored-by: yurkovychv <vasyl.yurkovych@percona.com>
  • Loading branch information
3 people authored Oct 1, 2024
1 parent 384e8d0 commit 48175f7
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions tests/configuration/verifyRoleBasedAccessControl_test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Feature('PMM Server Role Based Access Control (RBAC)');
Feature('PMM Server Role Based Access Control (RBAC)').retry(2);

const newPsUser = { username: 'rbac_ps_test_user', password: 'Test1234!' };
const newPgUser = { username: 'rbac_pg_test_user', password: 'Test1234!' };
let rbacPsUserId;
let rbacPgUserId;
let psRole = {
name: 'psRole',
name: `psRole_${Date.now()}`,
description: 'Test PS Role',
label: 'service_type',
operator: '=',
value: 'mysql',
};
const pgRole = {
name: 'pgRole',
name: `pgRole_${Date.now()}`,
description: 'Test PG Role',
label: 'service_type',
operator: '=',
Expand Down Expand Up @@ -51,8 +51,12 @@ Scenario(
async ({
I, dashboardPage, accessRolesPage, rolesApi,
}) => {
const psRoleId = await rolesApi.createRole(psRole);
const pgRoleId = await rolesApi.createRole(pgRole);
await rolesApi.createRole(psRole);
await rolesApi.createRole(pgRole);

const roles = await rolesApi.listRoles();
const psRoleId = roles.find((role) => role.title === psRole.name).role_id;
const pgRoleId = roles.find((role) => role.title === pgRole.name).role_id;

await rolesApi.assignRole([psRoleId], rbacPsUserId);
await rolesApi.assignRole([pgRoleId], rbacPgUserId);
Expand Down Expand Up @@ -81,7 +85,7 @@ Scenario(
dashboardPage.waitForDashboardOpened();
await dashboardPage.expandEachDashboardRow();
dashboardPage.waitForDashboardOpened();
await dashboardPage.verifyThatAllGraphsNoData(1);
await dashboardPage.verifyThatAllGraphsNoData(3);

I.amOnPage(dashboardPage.postgresqlInstanceOverviewDashboard.cleanUrl);
dashboardPage.waitForDashboardOpened();
Expand Down Expand Up @@ -111,7 +115,7 @@ Scenario(
dashboardPage.waitForDashboardOpened();
await dashboardPage.expandEachDashboardRow();
dashboardPage.waitForDashboardOpened();
await dashboardPage.verifyThatAllGraphsNoData();
await dashboardPage.verifyThatAllGraphsNoData(2);
},
);

Expand Down

0 comments on commit 48175f7

Please sign in to comment.