From ce9a73e6f25db0ac285c461130948aad9dd21d12 Mon Sep 17 00:00:00 2001 From: Yauhen Viazau Date: Tue, 17 Sep 2024 21:58:24 +0500 Subject: [PATCH] FAT-16558: multi-app Eureka tests updated to run on ECS --- .../create-role-add-app.cy.js | 36 +++------ .../create-role-no-capabilities-or-sets.cy.js | 4 +- .../create-role-selecting-apps.cy.js | 26 +++---- .../edit-role-add-app.cy.js | 58 +++++++------- .../edit-role-only-capabilities.cy.js | 76 +++++++------------ .../edit-role-selecting-apps-sets.cy.js | 57 +++++++------- .../edit-role-selecting-apps.cy.js | 12 +-- 7 files changed, 119 insertions(+), 150 deletions(-) diff --git a/cypress/e2e/eureka/authorization-roles/create-role-add-app.cy.js b/cypress/e2e/eureka/authorization-roles/create-role-add-app.cy.js index 791d34c802..940a990392 100644 --- a/cypress/e2e/eureka/authorization-roles/create-role-add-app.cy.js +++ b/cypress/e2e/eureka/authorization-roles/create-role-add-app.cy.js @@ -8,8 +8,8 @@ describe('Eureka', () => { describe('Authorization roles', () => { const testData = { roleName: `Auto Role C496128 ${getRandomPostfix()}`, - originalApplication: 'app-platform-minimal', - newApplication: 'app-platform-complete', + originalApplication: 'app-platform-full', + newApplication: 'app-consortia', originalCapabilitySets: [ { table: 'Settings', @@ -43,41 +43,26 @@ describe('Eureka', () => { ], newCapabilitySet: { table: 'Settings', - resource: 'UI-Users Settings Waives', + resource: 'UI-Consortia-Settings Settings Membership', action: 'View', }, newCapabilitiesInSet: [ - { - table: 'Data', - resource: 'Waives Collection', - action: 'View', - }, - { - table: 'Data', - resource: 'Waives Item', - action: 'View', - }, { table: 'Settings', - resource: 'Settings Users Enabled', - action: 'View', - }, - { - table: 'Settings', - resource: 'Settings Enabled', + resource: 'Settings Consortia-Settings Enabled', action: 'View', }, ], newCapabilities: [ { table: 'Data', - resource: 'Accounts Collection', - action: 'View', + resource: 'Consortia Consortium Item', + action: 'Edit', }, { table: 'Data', - resource: 'Accounts Item', - action: 'View', + resource: 'Consortia Sharing-Roles Item', + action: 'Create', }, ], expectedRowCounts: { @@ -85,7 +70,7 @@ describe('Eureka', () => { Settings: 3, }, capabilities: { - Data: 4, + Data: 2, Settings: 2, Procedural: 2, }, @@ -150,7 +135,8 @@ describe('Eureka', () => { AuthorizationRoles.clickSelectApplication(); AuthorizationRoles.selectApplicationInModal(testData.originalApplication); AuthorizationRoles.clickSaveInModal(); - AuthorizationRoles.verifyAppNamesInCapabilityTables([testData.originalApplication]); + // TO DO: uncomment when "full" application will be split in multiple apps + // AuthorizationRoles.verifyAppNamesInCapabilityTables([testData.originalApplication]); testData.originalCapabilitySets.forEach((capabilitySet) => { AuthorizationRoles.selectCapabilitySetCheckbox(capabilitySet); }); diff --git a/cypress/e2e/eureka/authorization-roles/create-role-no-capabilities-or-sets.cy.js b/cypress/e2e/eureka/authorization-roles/create-role-no-capabilities-or-sets.cy.js index c358cd4829..66a40ebf01 100644 --- a/cypress/e2e/eureka/authorization-roles/create-role-no-capabilities-or-sets.cy.js +++ b/cypress/e2e/eureka/authorization-roles/create-role-no-capabilities-or-sets.cy.js @@ -9,8 +9,8 @@ describe('Eureka', () => { const testData = { roleName: `Auto Role C430264 ${getRandomPostfix()}`, roleDescription: `Description ${getRandomPostfix()}`, - firstApplicationName: 'app-platform-minimal', - secondApplicationName: 'app-platform-complete', + firstApplicationName: 'app-platform-full', + secondApplicationName: 'app-consortia', }; const regExpBase = `\\?limit=\\d{1,}&query=applicationId==\\(${testData.firstApplicationName}-.{1,}or.{1,}${testData.secondApplicationName}-.{1,}\\)`; diff --git a/cypress/e2e/eureka/authorization-roles/create-role-selecting-apps.cy.js b/cypress/e2e/eureka/authorization-roles/create-role-selecting-apps.cy.js index 85997ebb4d..8b150cb645 100644 --- a/cypress/e2e/eureka/authorization-roles/create-role-selecting-apps.cy.js +++ b/cypress/e2e/eureka/authorization-roles/create-role-selecting-apps.cy.js @@ -9,42 +9,42 @@ describe('Eureka', () => { const testData = { roleName: `Auto Role C430260 ${getRandomPostfix()}`, roleDescription: `Description C430260 ${getRandomPostfix()}`, - firstApplicationName: 'app-platform-minimal', - secondApplicationName: 'app-platform-complete', + firstApplicationName: 'app-platform-full', + secondApplicationName: 'app-consortia', capabilities: [ { table: 'Data', - application: 'app-platform-complete', + application: 'app-platform-full', resource: 'Erm Entitlements Item', action: 'View', }, { - table: 'Data', - application: 'app-platform-minimal', - resource: 'Addresstypes Item', - action: 'Delete', + table: 'Settings', + application: 'app-consortia', + resource: 'Settings Consortia-Settings Enabled', + action: 'View', }, { - table: 'Settings', - application: 'app-platform-complete', - resource: 'Mod-Circulation Admin Settings', + table: 'Data', + application: 'app-consortia', + resource: 'Consortia Consortium Item', action: 'Edit', }, { table: 'Settings', - application: 'app-platform-minimal', + application: 'app-platform-full', resource: 'UI-Tags Settings', action: 'View', }, { table: 'Procedural', - application: 'app-platform-complete', + application: 'app-platform-full', resource: 'Erm Packages Collection', action: 'Execute', }, { table: 'Procedural', - application: 'app-platform-minimal', + application: 'app-platform-full', resource: 'Users-bl Password-Reset-Link Reset', action: 'Execute', }, diff --git a/cypress/e2e/eureka/authorization-roles/edit-role-add-app.cy.js b/cypress/e2e/eureka/authorization-roles/edit-role-add-app.cy.js index bd32217ff8..7a6e8e95b6 100644 --- a/cypress/e2e/eureka/authorization-roles/edit-role-add-app.cy.js +++ b/cypress/e2e/eureka/authorization-roles/edit-role-add-app.cy.js @@ -9,8 +9,8 @@ describe('Eureka', () => { const testData = { roleName: `Auto Role C496128 ${getRandomPostfix()}`, // TO DO: rewrite using >1 original apps when more apps will be consistently available - originalApplications: ['app-platform-minimal'], - newApplication: 'app-platform-complete', + originalApplications: ['app-platform-full'], + newApplication: 'app-consortia', originalCapabilitySets: [ { table: 'Settings', @@ -19,14 +19,24 @@ describe('Eureka', () => { }, { table: 'Settings', - resource: 'Settings Authorization-Roles Enabled', + resource: 'UI-Notes Settings', action: 'View', }, ], originalCapabilitiesInSets: [ + { + table: 'Data', + resource: 'Note Types Collection', + action: 'View', + }, + { + table: 'Data', + resource: 'Note Types Item', + action: 'View', + }, { table: 'Settings', - resource: 'Settings Enabled', + resource: 'Settings Notes Enabled', action: 'View', }, ], @@ -43,46 +53,40 @@ describe('Eureka', () => { }, ], newCapabilitySet: { - table: 'Data', - resource: 'Licenses Contacts', + table: 'Settings', + resource: 'UI-Consortia-Settings Settings Membership', action: 'View', }, newCapabilitiesInSet: [ { - table: 'Data', - resource: 'Licenses Contacts Collection', - action: 'View', - }, - { - table: 'Data', - resource: 'Licenses Contacts Item', + table: 'Settings', + resource: 'Settings Consortia-Settings Enabled', action: 'View', }, ], newCapabilities: [ { - table: 'Procedural', - resource: 'UI-Users Override Item Block', - action: 'Execute', + table: 'Data', + resource: 'Consortia Consortium Item', + action: 'Edit', }, { - table: 'Procedural', - resource: 'UI-Users Override Patron Block', - action: 'Execute', + table: 'Data', + resource: 'Consortia Sharing-Roles Item', + action: 'Create', }, ], expectedRowCounts: { capabilitySets: { - Data: 1, - Settings: 2, + Settings: 3, }, capabilities: { - Data: 2, - Settings: 1, - Procedural: 4, + Data: 4, + Settings: 3, + Procedural: 2, }, }, - absentCapabilitySetTable: 'Procedural', + absentCapabilitySetTables: ['Data', 'Procedural'], capabSetIds: [], capabIds: [], }; @@ -217,7 +221,9 @@ describe('Eureka', () => { Object.entries(testData.expectedRowCounts.capabilitySets).forEach(([table, count]) => { AuthorizationRoles.checkCountOfCapabilitySetRows(table, count); }); - AuthorizationRoles.verifyCapabilitySetTableAbsent(testData.absentCapabilitySetTable); + testData.absentCapabilitySetTables.forEach((table) => { + AuthorizationRoles.verifyCapabilitySetTableAbsent(table); + }); Object.entries(testData.expectedRowCounts.capabilities).forEach(([table, count]) => { AuthorizationRoles.checkCountOfCapabilityRows(table, count); }); diff --git a/cypress/e2e/eureka/authorization-roles/edit-role-only-capabilities.cy.js b/cypress/e2e/eureka/authorization-roles/edit-role-only-capabilities.cy.js index eadc3a43ca..6cbf782fb3 100644 --- a/cypress/e2e/eureka/authorization-roles/edit-role-only-capabilities.cy.js +++ b/cypress/e2e/eureka/authorization-roles/edit-role-only-capabilities.cy.js @@ -11,124 +11,100 @@ describe('Eureka', () => { roleDescription: `Description C436929 ${getRandomPostfix()}`, updatedRoleName: `Auto Role C436929 ${getRandomPostfix()} UPD`, updatedRoleDescription: `Description C436929 ${getRandomPostfix()} UPD`, - originalApplications: ['app-platform-minimal', 'app-platform-complete'], + originalApplications: ['app-platform-full', 'app-consortia'], originalCapabilitySets: [ { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Data', resource: 'Calendar', action: 'View', }, { - application: 'app-platform-minimal', + application: 'app-consortia', table: 'Procedural', - resource: 'UI-Notes Item Assign-Unassign', + resource: 'Consortia Inventory Share Local Instance', action: 'Execute', }, ], originalCapabilitiesInSets: [ { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Data', resource: 'Calendar Endpoint Calendars', action: 'View', }, { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Data', resource: 'Calendar Endpoint Calendars CalendarId', action: 'View', }, { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Data', resource: 'Calendar Endpoint Dates', action: 'View', }, { - application: 'app-platform-minimal', + application: 'app-consortia', table: 'Data', - resource: 'Note Links Collection', - action: 'Edit', - }, - { - application: 'app-platform-minimal', - table: 'Data', - resource: 'Note Types Collection', - action: 'View', - }, - { - application: 'app-platform-minimal', - table: 'Data', - resource: 'Note Types Item', + resource: 'Consortia Sharing-Instances Collection', action: 'View', }, { - application: 'app-platform-minimal', + application: 'app-consortia', table: 'Data', - resource: 'Notes Collection', + resource: 'Consortia Sharing-Instances Item', action: 'View', }, { - application: 'app-platform-minimal', - table: 'Data', - resource: 'Notes Domain', - action: 'Manage', - }, - { - application: 'app-platform-minimal', + application: 'app-consortia', table: 'Data', - resource: 'Notes Item', - action: 'View', + resource: 'Consortia Sharing-Instances Item', + action: 'Create', }, { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Data', - resource: 'UI-Notes Item', - action: 'View', - }, - { - application: 'app-platform-minimal', - table: 'Settings', - resource: 'Module Notes Enabled', + resource: 'Inventory-Storage Authorities Collection', action: 'View', }, ], originalCapabilities: [ { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Data', resource: 'Owners Item', action: 'Create', }, { - application: 'app-platform-minimal', - table: 'Procedural', - resource: 'Roles Collection', - action: 'Execute', + application: 'app-consortia', + table: 'Settings', + resource: 'Module Consortia-Settings Enabled', + action: 'View', }, ], newCapabilitySet: { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Settings', resource: 'UI-Tags Settings', action: 'View', }, newCapabilitiesInSet: [ { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Settings', resource: 'Settings Tags Enabled', action: 'View', }, { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Data', resource: 'Configuration Entries Collection', action: 'View', }, { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Settings', resource: 'Settings Tags Enabled', action: 'View', @@ -253,7 +229,7 @@ describe('Eureka', () => { expect(calls).to.have.length(0); }); AuthorizationRoles.checkCapabilitySetsAccordionCounter('2'); - AuthorizationRoles.checkCapabilitiesAccordionCounter('13'); + AuthorizationRoles.checkCapabilitiesAccordionCounter('9'); AuthorizationRoles.clickOnCapabilitySetsAccordion(); AuthorizationRoles.verifyCapabilitySetCheckboxChecked(testData.originalCapabilitySets[1]); AuthorizationRoles.verifyCapabilitySetCheckboxChecked(testData.newCapabilitySet); diff --git a/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps-sets.cy.js b/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps-sets.cy.js index 3594d16a0b..f8b3df2865 100644 --- a/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps-sets.cy.js +++ b/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps-sets.cy.js @@ -10,71 +10,71 @@ describe('Eureka', () => { roleName: `Auto Role C430262 ${getRandomPostfix()}`, roleDescription: `Description ${getRandomPostfix()}`, // TO DO: rewrite using >1 original apps when more apps will be consistently available - originalApplications: ['app-platform-complete'], - newApplication: 'app-platform-minimal', + originalApplications: ['app-consortia'], + newApplication: 'app-platform-full', originalCapabilitySets: [ { - application: 'app-platform-complete', - table: 'Data', - resource: 'Calendar', - action: 'View', + application: 'app-consortia', + table: 'Procedural', + resource: 'Consortia Inventory Share Local Instance', + action: 'Execute', }, ], originalCapabilitiesInSets: [ { - application: 'app-platform-complete', + application: 'app-consortia', table: 'Data', - resource: 'Calendar Endpoint Calendars', + resource: 'Consortia Sharing-Instances Collection', action: 'View', }, { - application: 'app-platform-complete', + application: 'app-consortia', table: 'Data', - resource: 'Calendar Endpoint Calendars CalendarId', + resource: 'Consortia Sharing-Instances Item', action: 'View', }, { - application: 'app-platform-complete', + application: 'app-consortia', table: 'Data', - resource: 'Calendar Endpoint Dates', - action: 'View', + resource: 'Consortia Sharing-Instances Item', + action: 'Create', }, ], originalCapabilities: [ { - application: 'app-platform-complete', + application: 'app-consortia', table: 'Data', - resource: 'Owners Item', - action: 'Create', + resource: 'Consortia Consortium Item', + action: 'Edit', }, { - application: 'app-platform-complete', - table: 'Procedural', - resource: 'Orders Item Approve', - action: 'Execute', + application: 'app-consortia', + table: 'Data', + resource: 'Consortia Sharing-Roles Item', + action: 'Create', }, ], newCapabilitySet: { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Settings', resource: 'UI-Tags Settings', action: 'View', }, newCapabilitiesInSet: [ { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Settings', resource: 'Settings Enabled', action: 'View', }, { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Settings', resource: 'Settings Tags Enabled', action: 'View', }, { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Data', resource: 'Configuration Entries Collection', action: 'View', @@ -82,19 +82,19 @@ describe('Eureka', () => { ], newCapabilities: [ { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Procedural', resource: 'Login Password', action: 'Execute', }, { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Data', resource: 'UI-Tags', action: 'Edit', }, { - application: 'app-platform-minimal', + application: 'app-platform-full', table: 'Data', resource: 'UI-Tags', action: 'Manage', @@ -194,7 +194,8 @@ describe('Eureka', () => { cy.wait('@capabilities').its('response.statusCode').should('eq', 200); cy.wait('@capabilitySets').its('response.statusCode').should('eq', 200); cy.wait(2000); - AuthorizationRoles.verifyAppNamesInCapabilityTables([testData.newApplication]); + // TO DO: uncomment when "full" app will be split in multiple apps + // AuthorizationRoles.verifyAppNamesInCapabilityTables([testData.newApplication]); AuthorizationRoles.selectCapabilitySetCheckbox(testData.newCapabilitySet); testData.newCapabilities.forEach((capability) => { AuthorizationRoles.selectCapabilityCheckbox(capability); diff --git a/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps.cy.js b/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps.cy.js index 53d40bf920..65f8576d74 100644 --- a/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps.cy.js +++ b/cypress/e2e/eureka/authorization-roles/edit-role-selecting-apps.cy.js @@ -12,29 +12,29 @@ describe('Eureka', () => { updatedRoleName: `Auto Role C430265 ${getRandomPostfix()} UPD`, updateRoleDescription: `Description ${getRandomPostfix()} UPD`, // TO DO: rewrite using >1 original apps when more apps will be consistently available - originalApplications: ['app-platform-complete'], - newApplication: 'app-platform-minimal', + originalApplications: ['app-platform-full'], + newApplication: 'app-consortia', originalCapabilities: [ { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Data', resource: 'Owners Item', action: 'Create', }, { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Procedural', resource: 'Orders Item Approve', action: 'Execute', }, { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Data', resource: 'UI-Users Perms', action: 'Edit', }, { - application: 'app-platform-complete', + application: 'app-platform-full', table: 'Settings', resource: 'Erm Settings', action: 'View',