Skip to content

Commit

Permalink
FAT-18018: tests updated
Browse files Browse the repository at this point in the history
  • Loading branch information
zentestuken committed Jan 23, 2025
1 parent 3fdd14e commit 4645f49
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Eureka', () => {

it(
'C633353 [UID-151] "Permissions" tabs are not shown in Settings > Users, Settings > Developer (eureka)',
{ tags: ['smoke', 'eureka', 'eurekaPhase1', 'C633353'] },
{ tags: ['smoke', 'eureka', 'C633353'] },
() => {
usersSubTabsPresent.forEach((presentSubTab) => {
SettingsPane.checkTabPresentInSecondPane(usersTabName, presentSubTab);
Expand Down
18 changes: 6 additions & 12 deletions cypress/e2e/eureka/users/assigned-roles-in-user-view.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,12 @@ import { APPLICATION_NAMES } from '../../../support/constants';
describe('Eureka', () => {
describe('Users', () => {
const testData = {
role0Name: `Auto Role 0 C464314 ${getRandomPostfix()}`,
roleAName: `Auto Role A C464314 ${getRandomPostfix()}`,
roleBName: `Auto Role B C464314 ${getRandomPostfix()}`,
role0Name: `Auto Role 0 C627435 ${getRandomPostfix()}`,
roleAName: `Auto Role A C627435 ${getRandomPostfix()}`,
roleBName: `Auto Role B C627435 ${getRandomPostfix()}`,
};

const capabSetsToAssign = [
{ type: 'Settings', resource: 'UI-Authorization-Roles Settings Admin', action: 'View' },
{ type: 'Data', resource: 'Capabilities', action: 'Manage' },
{ type: 'Data', resource: 'Role-Capability-Sets', action: 'Manage' },
{ type: 'Data', resource: 'Roles Users', action: 'Manage' },
{ type: 'Data', resource: 'UI-Users', action: 'View' },
];
const capabSetsToAssign = [{ type: 'Data', resource: 'UI-Users Roles', action: 'Manage' }];

const capabsToAssign = [{ type: 'Settings', resource: 'Settings Enabled', action: 'View' }];

Expand Down Expand Up @@ -94,8 +88,8 @@ describe('Eureka', () => {
});

it(
'C464314 Assigned roles shown in user detailed view (eureka)',
{ tags: ['criticalPath', 'eureka', 'eurekaPhase1', 'C464314'] },
'C627435 [UIU-3301] Assigned roles shown in user detailed view while having ui-users.roles - Manage (eureka)',
{ tags: ['criticalPath', 'eureka', 'eurekaPhase1', 'C627435'] },
() => {
UsersSearchPane.selectUserFromList(testData.userB.username);
UsersCard.verifyUserRolesCounter('1');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,26 @@ describe('Eureka', () => {
describe('Users', () => {
const randomPostfix = getRandomPostfix();
const testData = {
roleAName: `Auto Role A C499897 ${randomPostfix}`,
roleBName: `Auto Role B C499897 ${randomPostfix}`,
roleAName: `Auto Role A C627437 ${randomPostfix}`,
roleBName: `Auto Role B C627437 ${randomPostfix}`,
promotePath: '/users-keycloak/auth-users',
userBody: {
type: 'staff',
active: true,
username: `userc499897${randomPostfix}`,
username: `userc627437${randomPostfix}`,
patronGroup: '',
personal: {
lastName: `Last c499897 ${randomPostfix}`,
firstName: `First c499897 ${randomPostfix}`,
lastName: `Last c627437 ${randomPostfix}`,
firstName: `First c627437 ${randomPostfix}`,
email: '[email protected]',
preferredContactTypeId: '002',
},
},
};

const capabSetsToAssign = [
{ type: 'Settings', resource: 'UI-Authorization-Roles Settings Admin', action: 'View' },
{ type: 'Data', resource: 'Roles Users', action: 'Manage' },
{ type: 'Data', resource: 'UI-Users', action: 'View' },
{ type: 'Data', resource: 'UI-Users', action: 'Edit' },
];
const capabSetsToAssign = [{ type: 'Data', resource: 'UI-Users Roles', action: 'Manage' }];

const capabsToAssign = [
{ type: 'Data', resource: 'UI-Users', action: 'View' },
{ type: 'Data', resource: 'UI-Users', action: 'Edit' },
{ type: 'Settings', resource: 'Settings Enabled', action: 'View' },
{ type: 'Data', resource: 'Users-Keycloak Auth-Users Item', action: 'View' },
{ type: 'Data', resource: 'Users-Keycloak Auth-Users Item', action: 'Create' },
];
const capabsToAssign = [{ type: 'Settings', resource: 'Settings Enabled', action: 'View' }];

before('Create users, roles', () => {
cy.getAdminToken();
Expand Down Expand Up @@ -87,8 +76,8 @@ describe('Eureka', () => {
});

it(
'C499897 Assigning roles to a user without Keycloak record when editing user (eureka)',
{ tags: ['smoke', 'eureka', 'C499897'] },
'C627437 [UIU-3301] Assigning roles to a user without Keycloak record when editing user while having ui-users.roles - Manage (eureka)',
{ tags: ['smoke', 'eureka', 'C627437'] },
() => {
UsersSearchPane.searchByKeywords(testData.userBody.username);
UsersSearchPane.selectUserFromList(testData.userBody.username);
Expand Down
26 changes: 7 additions & 19 deletions cypress/e2e/eureka/users/assigning-roles-user-edit.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,14 @@ import { APPLICATION_NAMES } from '../../../support/constants';
describe('Eureka', () => {
describe('Users', () => {
const testData = {
roleAName: `Auto Role A C466113 ${getRandomPostfix()}`,
roleBName: `Auto Role B C466113 ${getRandomPostfix()}`,
roleCName: `Auto Role C C466113 ${getRandomPostfix()}`,
roleAName: `Auto Role A C633471 ${getRandomPostfix()}`,
roleBName: `Auto Role B C633471 ${getRandomPostfix()}`,
roleCName: `Auto Role C C633471 ${getRandomPostfix()}`,
};

const capabSetsToAssign = [
{ type: 'Settings', resource: 'UI-Authorization-Roles Settings Admin', action: 'View' },
{ type: 'Data', resource: 'Capabilities', action: 'Manage' },
{ type: 'Data', resource: 'Role-Capability-Sets', action: 'Manage' },
{ type: 'Data', resource: 'Roles Users', action: 'Manage' },
{ type: 'Data', resource: 'UI-Users', action: 'View' },
{ type: 'Data', resource: 'UI-Users', action: 'Edit' },
];
const capabSetsToAssign = [{ type: 'Data', resource: 'UI-Users Roles', action: 'Manage' }];

const capabsToAssign = [
{ type: 'Data', resource: 'UI-Users', action: 'View' },
{ type: 'Data', resource: 'UI-Users', action: 'Edit' },
{ type: 'Settings', resource: 'Settings Enabled', action: 'View' },
{ type: 'Data', resource: 'Users-Keycloak Auth-Users Item', action: 'View' },
];
const capabsToAssign = [{ type: 'Settings', resource: 'Settings Enabled', action: 'View' }];

before('Create users, roles', () => {
cy.getAdminToken();
Expand Down Expand Up @@ -98,8 +86,8 @@ describe('Eureka', () => {
});

it(
'C466113 Assigning roles to a user when editing user (eureka)',
{ tags: ['smoke', 'eureka', 'eurekaPhase1', 'C466113'] },
'C633471 [UIU-3301] Assigning roles to a user when editing user while having ui-users.roles - Manage (eureka)',
{ tags: ['smoke', 'eureka', 'eurekaPhase1', 'C633471'] },
() => {
UsersSearchPane.selectUserFromList(testData.userA.username);
UsersCard.verifyUserRolesCounter('0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ describe('Eureka', () => {

const roleToRemove = testData.allRoleNamesSorted[6];

const capabSetsForTestUser = [
{ type: 'Data', resource: 'UI-Users Roles', action: 'Manage' },
{ type: 'Data', resource: 'UI-Users', action: 'Edit' },
];
const capabSetsForTestUser = [{ type: 'Data', resource: 'UI-Users Roles', action: 'Manage' }];

before('Create users, roles', () => {
cy.getAdminToken();
Expand Down Expand Up @@ -75,8 +72,8 @@ describe('Eureka', () => {
});

it(
'C476793 Roles rows are sorted when viewing/editing a user (eureka)',
{ tags: ['extendedPath', 'eureka', 'C476793'] },
'C627440 [UIU-3301] Roles rows are sorted when viewing/editing a user while having ui-users.roles - Manage (eureka)',
{ tags: ['extendedPath', 'eureka', 'C627440'] },
() => {
UsersCard.verifyUserRolesCounter(originalRoleNamesRandomized.length + '');
UsersCard.clickUserRolesAccordion();
Expand Down
28 changes: 8 additions & 20 deletions cypress/e2e/eureka/users/unassigning-roles-user-edit.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,15 @@ import UsersSearchPane from '../../../support/fragments/users/usersSearchPane';
describe('Eureka', () => {
describe('Users', () => {
const testData = {
roleAName: `Auto Role A C466114 ${getRandomPostfix()}`,
roleBName: `Auto Role B C466114 ${getRandomPostfix()}`,
roleCName: `Auto Role C C466114 ${getRandomPostfix()}`,
roleDName: `Auto Role D C466114 ${getRandomPostfix()}`,
roleAName: `Auto Role A C627439 ${getRandomPostfix()}`,
roleBName: `Auto Role B C627439 ${getRandomPostfix()}`,
roleCName: `Auto Role C C627439 ${getRandomPostfix()}`,
roleDName: `Auto Role D C627439 ${getRandomPostfix()}`,
};

const capabSetsToAssign = [
{ type: 'Settings', resource: 'UI-Authorization-Roles Settings Admin', action: 'View' },
{ type: 'Data', resource: 'Capabilities', action: 'Manage' },
{ type: 'Data', resource: 'Role-Capability-Sets', action: 'Manage' },
{ type: 'Data', resource: 'Roles Users', action: 'Manage' },
{ type: 'Data', resource: 'UI-Users', action: 'View' },
{ type: 'Data', resource: 'UI-Users', action: 'Edit' },
];
const capabSetsToAssign = [{ type: 'Data', resource: 'UI-Users Roles', action: 'Manage' }];

const capabsToAssign = [
{ type: 'Data', resource: 'UI-Users', action: 'View' },
{ type: 'Data', resource: 'UI-Users', action: 'Edit' },
{ type: 'Settings', resource: 'Settings Enabled', action: 'View' },
{ type: 'Data', resource: 'Users-Keycloak Auth-Users Item', action: 'View' },
];
const capabsToAssign = [{ type: 'Settings', resource: 'Settings Enabled', action: 'View' }];

before('Create users, roles', () => {
cy.getAdminToken();
Expand Down Expand Up @@ -121,8 +109,8 @@ describe('Eureka', () => {
});

it(
'C466114 Unassigning roles when editing user (eureka)',
{ tags: ['smoke', 'eureka', 'eurekaPhase1', 'C466114'] },
'C627439 [UIU-3301] Unassigning roles when editing user while having ui-users.roles - Manage (eureka)',
{ tags: ['smoke', 'eureka', 'eurekaPhase1', 'C627439'] },
() => {
UsersCard.verifyUserRolesCounter('4');
UserEdit.openEdit();
Expand Down

0 comments on commit 4645f49

Please sign in to comment.