Skip to content

Commit

Permalink
FAT-16558: multi-app Eureka tests updated to run on ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
zentestuken committed Sep 17, 2024
1 parent 0c75f9f commit ce9a73e
Show file tree
Hide file tree
Showing 7 changed files with 119 additions and 150 deletions.
36 changes: 11 additions & 25 deletions cypress/e2e/eureka/authorization-roles/create-role-add-app.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -43,49 +43,34 @@ 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: {
capabilitySets: {
Settings: 3,
},
capabilities: {
Data: 4,
Data: 2,
Settings: 2,
Procedural: 2,
},
Expand Down Expand Up @@ -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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,}\\)`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down
58 changes: 32 additions & 26 deletions cypress/e2e/eureka/authorization-roles/edit-role-add-app.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
},
],
Expand All @@ -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: [],
};
Expand Down Expand Up @@ -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);
});
Expand Down
Loading

0 comments on commit ce9a73e

Please sign in to comment.