Skip to content

Commit

Permalink
Add fixes ECS EUREKA
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorBohdan committed Dec 20, 2024
1 parent c140acb commit a3f98f4
Show file tree
Hide file tree
Showing 20 changed files with 77 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ describe('Consortia', () => {
TopMenuNavigation.navigateToApp('Consortium manager');
ConsortiumManager.verifyStatusOfConsortiumManager();
ConsortiumManager.verifyMembersSelected();
ConsortiumManager.verifyPaneIncludesSettings(settingsList.sort());
ConsortiumManager.verifyPaneIncludesSettings(settingsList);
const randomSetting = Arrays.getRandomElement(settingsList);
chooseSettingItem(randomSetting, 1);
cy.pause();
cy.wait(4000);
ConsortiumManager.clickSelectMembers();
SelectMembers.changeSelectAllCheckbox('check');
SelectMembers.verifyStatusOfSelectMembersModal(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ describe('Consortia', () => {

ConsortiumManagerApp.chooseSettingsItem(settingsItems.inventory);
AlternativeTitleTypesConsortiumManager.choose();

ConsortiaControlledVocabularyPaneset.createViaUi(true, alternativeTitleTypes3);
ConsortiaControlledVocabularyPaneset.clickSave();

let rowDataToCheck = [
alternativeTitleTypes3.name,
'consortium',
Expand Down Expand Up @@ -154,7 +154,7 @@ describe('Consortia', () => {

SelectMembers.saveAndClose();
ConsortiumManagerApp.verifyListIsEmpty();
ConsortiaControlledVocabularyPaneset.verifyNewButtonDisabled();
ConsortiaControlledVocabularyPaneset.verifyNewButtonAbsent();

cy.visit(SettingsMenu.alternativeTitleTypes);
ConsortiaControlledVocabularyPaneset.verifyRecordInTheList(rowDataToCheck.slice(0, -1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ describe('Consortia', () => {
const rowDataToCheck = [...Object.values(sharedPatronGroups1), moment().format('l'), 'All'];

before('Create users data', () => {
cy.clearCookies({ domain: null });
cy.getAdminToken()
.then(() => {
cy.createTempUser([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('Consortium manager', () => {
describe('View settings', () => {
describe('View Request cancellation reasons', () => {
before('create test data', () => {
cy.clearCookies({ domain: null });
cy.getAdminToken();
RequestCancellationReasonsConsortiumManager.createViaApi(testData.centralSharedReason).then(
(newReason) => {
Expand Down Expand Up @@ -66,7 +67,7 @@ describe('Consortium manager', () => {
waiter: ConsortiumManagerApp.waitLoading,
});
SelectMembers.selectAllMembers();
ConsortiumManagerApp.verifyStatusOfConsortiumManager(7);
ConsortiumManagerApp.verifyStatusOfConsortiumManager(13);
ConsortiumManagerApp.chooseSettingsItem(settingsItems.circulation);
RequestCancellationReasonsConsortiumManager.choose();

Expand Down Expand Up @@ -118,7 +119,7 @@ describe('Consortium manager', () => {
cy.login(testData.user400666.username, testData.user400666.password);
ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college);
cy.visit(SettingsMenu.circulationRequestCancellationReasonsPath);

cy.wait(4000);

Check failure on line 122 in cypress/e2e/consortia/consortium-manager/user-is-not-able-to-edit-and-delete-from-member-tenant-circulation.cy.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Expected indentation of 10 spaces but found 0

Check failure on line 122 in cypress/e2e/consortia/consortium-manager/user-is-not-able-to-edit-and-delete-from-member-tenant-circulation.cy.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Expected indentation of 10 spaces but found 0
CancellationReason.verifyReasonInTheList({
name: testData.centralSharedReason.payload.name,
});
Expand All @@ -127,10 +128,7 @@ describe('Consortium manager', () => {
name: testData.collegeLocalReason.name,
actions: ['edit', 'trash'],
});

CancellationReason.clickTrashButtonForReason({
name: testData.collegeLocalReason.name,
});
CancellationReason.clickTrashButtonForReason(testData.collegeLocalReason.name);

ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.university);
cy.visit(SettingsMenu.circulationRequestCancellationReasonsPath);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ describe('Consortium manager', () => {
name: testData.centralSharedHoldingsNoteTypes.payload.name,
source: 'consortium',
});

HoldingsNoteTypes.verifyLocalHoldingsNoteTypesInTheList({
name: testData.collegeLocalHoldingsNoteType.name,
actions: ['edit', 'trash'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Consortium manager', () => {
permissions.inventoryCRUDItemNoteTypes.gui,
permissions.uiCreateEditDeleteLoanTypes.gui,
]);
ItemNoteTypes.createNoteTypeViaApi(testData.collegeLocalItemNoteTypes);
ItemNoteTypes.createItemNoteTypeViaApi(testData.collegeLocalItemNoteTypes);
LoanTypes.createLoanTypesViaApi(testData.collegeLocalLoanTypes);
cy.resetTenant();
cy.getAdminToken();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ describe('Consortium manager', () => {
describe('View settings', () => {
describe('View Departments', () => {
before('create test data', () => {
cy.clearCookies({ domain: null });

cy.getAdminToken();
DepartmentsConsortiumManager.createViaApi(testData.centralSharedDepartment).then(
(newDepartment) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('Consortia', () => {
tenantErrors.code,
tenantErrors.name,
);
ConsortiumManager.cancelEditingTenantInformation(2);
ConsortiumManager.cancelEditingTenantInformation(6);
},
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ export default {
].forEach((header) => {
cy.expect(MultiColumnListHeader(header).exists());
});
cy.wait(4000);
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export default {
cy.expect(newButton.is({ disabled: status }));
},

verifyNewButtonAbsent() {
cy.expect(newButton.absent());
},

verifyEditModeIsActive() {
this.verifyNewButtonDisabled();
cy.expect([
Expand All @@ -52,6 +56,7 @@ export default {
this.fillInTextField({ [textFieldName]: value });
});
cy.do(isShared && memberLibrariesShare.click());
cy.wait(4000);
},

clickCancel() {
Expand All @@ -60,6 +65,7 @@ export default {

clickSave() {
cy.do(saveButton.click());
cy.wait(4000);
},

confirmDelete() {
Expand All @@ -74,16 +80,14 @@ export default {
performAction(recordName, action) {
// actions are selected by button name: trash(delete) or edit
cy.do(
MultiColumnListRow({ content: including(recordName) })
MultiColumnListRow({ isContainer: true, content: including(recordName) })
.find(Button({ icon: action }))
.click(),
);
},

verifyRecordInTheList(record, actionButtons = []) {
MultiColumnListRow({
content: including(record[0]),
})
MultiColumnListRow({ isContainer: true, content: including(record[0]) })
.rowIndexInParent()
.then((rowIndexInParent) => {
cy.wrap(record).each((text, columnIndex) => {
Expand Down Expand Up @@ -165,6 +169,6 @@ export default {
},

verifyRecordNotInTheList(name) {
cy.expect(MultiColumnListRow({ content: including(name) }).absent());
cy.expect(MultiColumnListRow({ isContainer: true, content: including(name) }).absent());
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const messages = {
};

export const settingsItems = {
authorizationPolicies: 'Authorization policies',
authorizationRoles: 'Authorization roles',
circulation: 'Circulation',
inventory: 'Inventory',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,6 @@ export default {
['Name', 'Source', 'Last updated', 'Member libraries', 'Actions'].forEach((header) => {
cy.expect(MultiColumnListHeader(header).exists());
});
cy.wait(4000);
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -56,42 +56,37 @@ export default {
},

verifyNoReasonInTheList(name) {
cy.expect(MultiColumnListRow({ content: including(name) }).absent());
cy.expect(MultiColumnListRow({ isContainer: true, content: including(name) }).absent());
},

verifyReasonInTheList({ name, description = '', publicDescription = '', actions = [] }) {
cy.get('div[class*="mclCell-"]')
.contains(name)
.parents('div[class*="mclRow-"]')
.then(($row) => {
if (description) {
cy.wrap($row).find('div[class*="mclCell-"]').eq(1).should('contain.text', description);
}

if (publicDescription) {
cy.wrap($row)
.find('div[class*="mclCell-"]')
.eq(2)
.should('contain.text', publicDescription);
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.expect([
row.exists(),
row.find(MultiColumnListCell({ columnIndex: 1, content: description })).exists(),
row.find(MultiColumnListCell({ columnIndex: 2, content: publicDescription })).exists(),
]);
if (actions.length === 0) {
cy.expect(row.find(actionsCell).has({ content: '' }));
} else {
Object.values(reasonsActions).forEach((action) => {
const buttonSelector = row.find(actionsCell).find(Button({ icon: action }));
if (actions.includes(action)) {
cy.expect(buttonSelector.exists());
} else {
cy.expect(buttonSelector.absent());
}

const actionsCell = $row.find('div[class*="mclCell-"]').eq(4);
actions.forEach((action) => {
if (action === 'edit') {
cy.get(actionsCell).find('button[icon="edit"]').should('exist');
} else if (action === 'trash') {
cy.get(actionsCell).find('button[icon="trash"]').should('exist');
}
});
});
}
},
verifyReasonAbsentInTheList({ name }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
cy.expect(row.absent());
},

clickEditButtonForReason(name) {
const row = EditableListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.do(
row
Expand All @@ -102,14 +97,13 @@ export default {
},

clickTrashButtonForReason(name) {
const row = EditableListRow({ content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.do(
row
.find(actionsCell)
cy.do([
MultiColumnListRow({ isContainer: true, content: including(name) })
.find(MultiColumnListCell({ columnIndex: 3 }))
.find(Button({ icon: 'trash' }))
.click(),
);
Button('Delete').click(),
]);
},

clickTrashButtonConfirm() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default {
isDefaultSearchParamsRequired: false,
}),
verifyConsortiumHoldingsNoteTypesInTheList({ name, source = 'consortium', actions = [] }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.expect([
row.exists(),
Expand All @@ -47,9 +47,10 @@ export default {
});
}
},

Check failure on line 50 in cypress/support/fragments/settings/inventory/holdings/holdingsNoteTypes.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Trailing spaces not allowed

Check failure on line 50 in cypress/support/fragments/settings/inventory/holdings/holdingsNoteTypes.js

View workflow job for this annotation

GitHub Actions / github-actions-ci

Trailing spaces not allowed

verifyLocalHoldingsNoteTypesInTheList({ name, source = 'local', actions = [] }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.expect([
row.exists(),
Expand All @@ -70,13 +71,13 @@ export default {
},

verifyHoldingsNoteTypesAbsentInTheList({ name }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
cy.expect(row.absent());
},

clickTrashButtonForHoldingsNoteTypes(name) {
cy.do([
MultiColumnListRow({ content: including(name) })
MultiColumnListRow({ isContainer: true, content: including(name) })
.find(MultiColumnListCell({ columnIndex: 3 }))
.find(Button({ icon: 'trash' }))
.click(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
}),

verifyConsortiumHoldingsTypeInTheList({ name, source = 'consortium', actions = [] }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.expect([
row.exists(),
Expand All @@ -51,7 +51,7 @@ export default {
},

verifyLocalHoldingsTypeInTheList({ name, source = 'local', actions = [] }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.expect([
row.exists(),
Expand All @@ -72,13 +72,13 @@ export default {
},

verifyHoldingsTypesAbsentInTheList({ name }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
cy.expect(row.absent());
},

clickTrashButtonForHoldingsType(name) {
cy.do([
MultiColumnListRow({ content: including(name) })
MultiColumnListRow({ isContainer: true, content: including(name) })
.find(MultiColumnListCell({ columnIndex: 3 }))
.find(Button({ icon: 'trash' }))
.click(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default {
},

verifyConsortiumItemNoteTypesInTheList({ name, source = 'consortium', actions = [] }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.expect([
row.exists(),
Expand All @@ -57,7 +57,7 @@ export default {
},

verifyLocalItemNoteTypesInTheList({ name, source = 'local', actions = [] }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
const actionsCell = MultiColumnListCell({ columnIndex: 3 });
cy.expect([
row.exists(),
Expand All @@ -78,13 +78,13 @@ export default {
},

verifyItemNoteTypesAbsentInTheList({ name }) {
const row = MultiColumnListRow({ content: including(name) });
const row = MultiColumnListRow({ isContainer: true, content: including(name) });
cy.expect(row.absent());
},

clickTrashButtonForItemNoteTypes(name) {
cy.do([
MultiColumnListRow({ content: including(name) })
MultiColumnListRow({ isContainer: true, content: including(name) })
.find(MultiColumnListCell({ columnIndex: 3 }))
.find(Button({ icon: 'trash' }))
.click(),
Expand Down
Loading

0 comments on commit a3f98f4

Please sign in to comment.