From 4645f49645185a64eea4d85374bbff89e69204d3 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Thu, 23 Jan 2025 19:39:13 +0500 Subject: [PATCH] FAT-18018: tests updated --- .../settings-permission-tabs-absent.cy.js | 2 +- .../users/assigned-roles-in-user-view.cy.js | 18 ++++-------- ...ing-roles-user-edit-without-keycloak.cy.js | 29 ++++++------------- .../users/assigning-roles-user-edit.cy.js | 26 +++++------------ .../roles-sorting-in-user-view-edit.cy.js | 9 ++---- .../users/unassigning-roles-user-edit.cy.js | 28 +++++------------- 6 files changed, 34 insertions(+), 78 deletions(-) diff --git a/cypress/e2e/eureka/settings/settings-permission-tabs-absent.cy.js b/cypress/e2e/eureka/settings/settings-permission-tabs-absent.cy.js index a9bdab38f8..7531b7022b 100644 --- a/cypress/e2e/eureka/settings/settings-permission-tabs-absent.cy.js +++ b/cypress/e2e/eureka/settings/settings-permission-tabs-absent.cy.js @@ -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); diff --git a/cypress/e2e/eureka/users/assigned-roles-in-user-view.cy.js b/cypress/e2e/eureka/users/assigned-roles-in-user-view.cy.js index 8485a4b40e..f908ffb25f 100644 --- a/cypress/e2e/eureka/users/assigned-roles-in-user-view.cy.js +++ b/cypress/e2e/eureka/users/assigned-roles-in-user-view.cy.js @@ -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' }]; @@ -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'); diff --git a/cypress/e2e/eureka/users/assigning-roles-user-edit-without-keycloak.cy.js b/cypress/e2e/eureka/users/assigning-roles-user-edit-without-keycloak.cy.js index 1461ac5f48..5f42ea404a 100644 --- a/cypress/e2e/eureka/users/assigning-roles-user-edit-without-keycloak.cy.js +++ b/cypress/e2e/eureka/users/assigning-roles-user-edit-without-keycloak.cy.js @@ -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: 'testuser@test.org', 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(); @@ -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); diff --git a/cypress/e2e/eureka/users/assigning-roles-user-edit.cy.js b/cypress/e2e/eureka/users/assigning-roles-user-edit.cy.js index d93c33bf40..304b5981c3 100644 --- a/cypress/e2e/eureka/users/assigning-roles-user-edit.cy.js +++ b/cypress/e2e/eureka/users/assigning-roles-user-edit.cy.js @@ -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(); @@ -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'); diff --git a/cypress/e2e/eureka/users/roles-sorting-in-user-view-edit.cy.js b/cypress/e2e/eureka/users/roles-sorting-in-user-view-edit.cy.js index 9a370ccdd4..03eb3e6bcf 100644 --- a/cypress/e2e/eureka/users/roles-sorting-in-user-view-edit.cy.js +++ b/cypress/e2e/eureka/users/roles-sorting-in-user-view-edit.cy.js @@ -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(); @@ -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(); diff --git a/cypress/e2e/eureka/users/unassigning-roles-user-edit.cy.js b/cypress/e2e/eureka/users/unassigning-roles-user-edit.cy.js index 084cfd1e8a..765d93cdf6 100644 --- a/cypress/e2e/eureka/users/unassigning-roles-user-edit.cy.js +++ b/cypress/e2e/eureka/users/unassigning-roles-user-edit.cy.js @@ -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(); @@ -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();