diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-notes-remove-all-add-same-type.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-notes-remove-all-add-same-type.cy.js index 848ef3f27e..8cf8544e4a 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-notes-remove-all-add-same-type.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-item-notes-remove-all-add-same-type.cy.js @@ -1,7 +1,7 @@ import permissions from '../../../support/dictionary/permissions'; import BulkEditActions from '../../../support/fragments/bulk-edit/bulk-edit-actions'; import BulkEditSearchPane from '../../../support/fragments/bulk-edit/bulk-edit-search-pane'; -import ExportFile from '../../../support/fragments/data-export/exportFile'; +import BulkEditFiles from '../../../support/fragments/bulk-edit/bulk-edit-files'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; @@ -10,7 +10,11 @@ import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; import Users from '../../../support/fragments/users/users'; import FileManager from '../../../support/utils/fileManager'; import getRandomPostfix from '../../../support/utils/stringTools'; -import { ITEM_NOTES, MATERIAL_TYPE_IDS } from '../../../support/constants'; +import { + BULK_EDIT_TABLE_COLUMN_HEADERS, + ITEM_NOTES, + MATERIAL_TYPE_IDS, +} from '../../../support/constants'; let user; @@ -99,11 +103,30 @@ describe('bulk-edit', () => { BulkEditSearchPane.waitFileUploading(); BulkEditSearchPane.verifyMatchedResults(item.barcode); BulkEditActions.downloadMatchedResults(); - ExportFile.verifyFileIncludes(matchedRecordsFileName, [ - `,${notes.admin},dvd,`, - `,${notes.copy},${notes.electronicBookplate}`, - `,${notes.checkIn},${notes.checkOut},`, - ]); + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + matchedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + item.barcode, + [ + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + value: notes.admin, + }, + { header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.COPY_NOTE, value: notes.copy }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ELECTRONIC_BOOKPLATE_NOTE, + value: notes.electronicBookplate, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_IN_NOTE, + value: notes.checkIn, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE, + value: notes.checkOut, + }, + ], + ); BulkEditSearchPane.changeShowColumnCheckboxIfNotYet( 'Administrative note', 'Copy note', @@ -128,11 +151,37 @@ describe('bulk-edit', () => { notes.electronicBookplate, ]); BulkEditActions.downloadPreview(); - ExportFile.verifyFileIncludes(previewFileName, [ - ',,dvd,', - `,${notes.action},,,`, - 'Available,,,', - ]); + + const editedHeaderValues = [ + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + value: '', + }, + { header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.COPY_NOTE, value: '' }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ELECTRONIC_BOOKPLATE_NOTE, + value: notes.electronicBookplate, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_IN_NOTE, + value: '', + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE, + value: '', + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ACTION_NOTE, + value: notes.action, + }, + ]; + + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + previewFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + item.barcode, + editedHeaderValues, + ); BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', ''); @@ -146,11 +195,13 @@ describe('bulk-edit', () => { BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', ''); BulkEditActions.openActions(); BulkEditActions.downloadChangedCSV(); - ExportFile.verifyFileIncludes(changedRecordsFileName, [ - ',,dvd,', - `,${notes.action},,,`, - 'Available,,,', - ]); + + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + changedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + item.barcode, + editedHeaderValues, + ); TopMenuNavigation.navigateToApp('Inventory'); InventorySearchAndFilter.switchToItem(); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-staff-only-for-added-notes.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-staff-only-for-added-notes.cy.js index 4591728062..7804e7fc68 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-staff-only-for-added-notes.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-staff-only-for-added-notes.cy.js @@ -9,8 +9,14 @@ import FileManager from '../../../support/utils/fileManager'; import getRandomPostfix from '../../../support/utils/stringTools'; import ExportFile from '../../../support/fragments/data-export/exportFile'; import ItemRecordView from '../../../support/fragments/inventory/item/itemRecordView'; -import { APPLICATION_NAMES, ITEM_NOTES, MATERIAL_TYPE_IDS } from '../../../support/constants'; +import { + APPLICATION_NAMES, + BULK_EDIT_TABLE_COLUMN_HEADERS, + ITEM_NOTES, + MATERIAL_TYPE_IDS, +} from '../../../support/constants'; import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; +import BulkEditFiles from '../../../support/fragments/bulk-edit/bulk-edit-files'; let user; const item = { @@ -163,12 +169,11 @@ describe('bulk-edit', () => { BulkEditActions.confirmChanges(); BulkEditActions.verifyAreYouSureForm(1, item.itemBarcode); BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin); - // TODO: uncomment after MODBULKOPS-204 - // BulkEditSearchPane.verifyExactChangesUnderColumns( - // 'Check out note', - // `${notes.checkOut} (staff only)`, - // ); - // BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn); + BulkEditSearchPane.verifyExactChangesUnderColumns( + 'Check out note', + `${notes.checkOut} (staff only)`, + ); + BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn); BulkEditSearchPane.verifyExactChangesUnderColumns('Action note', notes.action); BulkEditSearchPane.verifyExactChangesUnderColumns( 'Binding note', @@ -198,12 +203,11 @@ describe('bulk-edit', () => { BulkEditActions.confirmChanges(); BulkEditActions.verifyAreYouSureForm(1, item.itemBarcode); BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin); - // TODO: uncomment after MODBULKOPS-204 - // BulkEditSearchPane.verifyExactChangesUnderColumns( - // 'Check out note', - // `${notes.checkOut} (staff only)`, - // ); - // BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn); + BulkEditSearchPane.verifyExactChangesUnderColumns( + 'Check out note', + `${notes.checkOut} (staff only)`, + ); + BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkIn); BulkEditSearchPane.verifyExactChangesUnderColumns('Action note', notes.action); BulkEditSearchPane.verifyExactChangesUnderColumns( 'Binding note', @@ -221,21 +225,66 @@ describe('bulk-edit', () => { `${notes.reproduction} (staff only)`, ); BulkEditActions.downloadPreview(); - ExportFile.verifyFileIncludes(previewFileName, [ - `${notes.action},${notes.binding} (staff only),${notes.copy} (staff only),,${notes.note} (staff only),${notes.provenance},${notes.reproduction} (staff only)`, - `Available,${notes.checkIn},${notes.checkOut} (staff only),`, - `,${notes.admin},dvd,`, - ]); + + const addedNoteHeaderValues = [ + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + value: notes.admin, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.PROVENANCE_NOTE, + value: notes.provenance, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.REPRODUCTION_NOTE, + value: `${notes.reproduction} (staff only)`, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.NOTE, + value: `${notes.note} (staff only)`, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ACTION_NOTE, + value: notes.action, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BINDING_NOTE, + value: `${notes.binding} (staff only)`, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.COPY_NOTE, + value: `${notes.copy} (staff only)`, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ELECTRONIC_BOOKPLATE_NOTE, + value: '', + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_IN_NOTE, + value: notes.checkIn, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE, + value: `${notes.checkOut} (staff only)`, + }, + ]; + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + previewFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + item.itemBarcode, + addedNoteHeaderValues, + ); BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); BulkEditActions.openActions(); BulkEditSearchPane.changeShowColumnCheckboxIfNotYet('Check out note', 'Check in note'); BulkEditActions.downloadChangedCSV(); - ExportFile.verifyFileIncludes(changedRecordsFileName, [ - `${notes.action},${notes.binding} (staff only),${notes.copy} (staff only),,${notes.note} (staff only),${notes.provenance},${notes.reproduction} (staff only)`, - `Available,${notes.checkIn},${notes.checkOut} (staff only),`, - `,${notes.admin},dvd,`, - ]); + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + changedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + item.itemBarcode, + addedNoteHeaderValues, + ); BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin); BulkEditSearchPane.verifyExactChangesUnderColumns( 'Check out note', diff --git a/cypress/e2e/consortia/bulk-edit/in-app/bulk-edit-in-app-holdings-find-replace-notes-action-in-central-tenant.cy.js b/cypress/e2e/consortia/bulk-edit/in-app/bulk-edit-in-app-holdings-find-replace-notes-action-in-central-tenant.cy.js new file mode 100644 index 0000000000..773aeac2e3 --- /dev/null +++ b/cypress/e2e/consortia/bulk-edit/in-app/bulk-edit-in-app-holdings-find-replace-notes-action-in-central-tenant.cy.js @@ -0,0 +1,558 @@ +import permissions from '../../../../support/dictionary/permissions'; +import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditSearchPane from '../../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; +import TopMenu from '../../../../support/fragments/topMenu'; +import Users from '../../../../support/fragments/users/users'; +import FileManager from '../../../../support/utils/fileManager'; +import getRandomPostfix from '../../../../support/utils/stringTools'; +import ExportFile from '../../../../support/fragments/data-export/exportFile'; +import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryHoldings from '../../../../support/fragments/inventory/holdings/inventoryHoldings'; +import HoldingsRecordView from '../../../../support/fragments/inventory/holdingsRecordView'; +import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; +import HoldingsNoteTypesConsortiumManager from '../../../../support/fragments/consortium-manager/inventory/holdings/holdingsNoteTypesConsortiumManager'; +import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; +import DateTools from '../../../../support/utils/dateTools'; +import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; +import { APPLICATION_NAMES, BULK_EDIT_TABLE_COLUMN_HEADERS } from '../../../../support/constants'; +import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation'; + +let user; +let instanceTypeId; +let locationId; +let sourceId; +let centralSharedHoldingNoteTypeData; +const collegeHoldingIds = []; +const collegeHoldingHrids = []; +const universityHoldingIds = []; +const universityHoldingHrids = []; +const folioInstance = { + title: `C478258 folio instance testBulkEdit_${getRandomPostfix()}`, +}; +const marcInstance = { + title: `C478258 marc instance testBulkEdit_${getRandomPostfix()}`, +}; +const centralSharedHoldingNoteType = { + payload: { + name: `C478258 shared note type ${getRandomPostfix()}`, + }, +}; +const collegeHoldingNoteType = { + name: `C478258 College NoteType ${getRandomPostfix()}`, +}; +const notes = { + adminUpperCase: 'Test [administrative] note', + adminLowerCase: 'test [administrative] note', + sharedUpperCase: 'Test item shared note', + sharedLowerCase: 'test item shared note', + collegeUpperCase: 'Test item college note', + collegeLowerCase: 'test item college note', +}; +const collegeHoldingNoteTypeNameWithAffiliation = `${collegeHoldingNoteType.name} (${Affiliations.College})`; +const instances = [folioInstance, marcInstance]; +const todayDate = DateTools.getFormattedDate({ date: new Date() }, 'YYYY-MM-DD'); +const holdingUUIDsFileName = `holdingUUIdsFileName_${getRandomPostfix()}.csv`; +const matchedRecordsFileName = `${todayDate}-Matched-Records-${holdingUUIDsFileName}`; +const previewFileName = `${todayDate}-Updates-Preview-${holdingUUIDsFileName}`; +const changedRecordsFileName = `${todayDate}-Changed-Records-${holdingUUIDsFileName}`; +const errorsFromCommittingFileName = `${todayDate}-Committing-changes-Errors-${holdingUUIDsFileName}`; +const getReasonForError = (itemId, tenantName) => { + return `${itemId} cannot be updated because the record is associated with ${tenantName} and note type is not associated with this tenant.`; +}; + +describe('Bulk-edit', () => { + describe('In-app approach', () => { + describe('Consortia', () => { + before('create test data', () => { + cy.clearLocalStorage(); + cy.getAdminToken(); + cy.createTempUser([ + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditHoldings.gui, + ]).then((userProperties) => { + user = userProperties; + + cy.assignAffiliationToUser(Affiliations.College, user.userId); + cy.setTenant(Affiliations.College); + cy.assignPermissionsToExistingUser(user.userId, [ + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditHoldings.gui, + ]); + cy.resetTenant(); + cy.assignAffiliationToUser(Affiliations.University, user.userId); + cy.setTenant(Affiliations.University); + cy.assignPermissionsToExistingUser(user.userId, [ + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditHoldings.gui, + ]); + cy.resetTenant(); + cy.getInstanceTypes({ limit: 1 }).then((instanceTypeData) => { + instanceTypeId = instanceTypeData[0].id; + }); + cy.getLocations({ query: 'name="DCB"' }).then((res) => { + locationId = res.id; + }); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + sourceId = folioSource.id; + }); + // create shared holding note type in Central + HoldingsNoteTypesConsortiumManager.createViaApi(centralSharedHoldingNoteType) + .then((newIHoldingNoteType) => { + centralSharedHoldingNoteTypeData = newIHoldingNoteType; + }) + .then(() => { + // create shared folio instance + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId, + title: folioInstance.title, + }, + }); + }) + .then((createdInstanceData) => { + folioInstance.uuid = createdInstanceData.instanceId; + }) + .then(() => { + // create shared marc instance + cy.createSimpleMarcBibViaAPI(marcInstance.title).then((instanceId) => { + marcInstance.uuid = instanceId; + }); + }) + .then(() => { + cy.setTenant(Affiliations.College); + // create local holding note type in College tenant + InventoryInstances.createHoldingsNoteTypeViaApi(collegeHoldingNoteType.name) + .then((noteId) => { + collegeHoldingNoteType.id = noteId; + }) + .then(() => { + // create holdings in College tenant + instances.forEach((instance) => { + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: instance.uuid, + permanentLocationId: locationId, + administrativeNotes: [notes.adminUpperCase, notes.adminLowerCase], + sourceId, + notes: [ + { + holdingsNoteTypeId: centralSharedHoldingNoteTypeData.settingId, + note: notes.sharedUpperCase, + staffOnly: true, + }, + { + holdingsNoteTypeId: centralSharedHoldingNoteTypeData.settingId, + note: notes.sharedLowerCase, + staffOnly: false, + }, + { + holdingsNoteTypeId: collegeHoldingNoteType.id, + note: notes.collegeUpperCase, + staffOnly: true, + }, + { + holdingsNoteTypeId: collegeHoldingNoteType.id, + note: notes.collegeLowerCase, + staffOnly: false, + }, + ], + }).then((holding) => { + collegeHoldingIds.push(holding.id); + collegeHoldingHrids.push(holding.hrid); + }); + cy.wait(1000); + }); + }); + }) + .then(() => { + cy.setTenant(Affiliations.University); + // create holdings in University tenant + instances.forEach((instance) => { + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: instance.uuid, + permanentLocationId: locationId, + administrativeNotes: [notes.adminUpperCase, notes.adminLowerCase], + sourceId, + notes: [ + { + holdingsNoteTypeId: centralSharedHoldingNoteTypeData.settingId, + note: notes.sharedUpperCase, + staffOnly: true, + }, + { + holdingsNoteTypeId: centralSharedHoldingNoteTypeData.settingId, + note: notes.sharedLowerCase, + staffOnly: false, + }, + ], + }).then((holding) => { + universityHoldingIds.push(holding.id); + universityHoldingHrids.push(holding.hrid); + }); + cy.wait(1000); + }); + }) + .then(() => { + FileManager.createFile( + `cypress/fixtures/${holdingUUIDsFileName}`, + `${collegeHoldingIds.join('\n')}\n${universityHoldingIds.join('\n')}`, + ); + }); + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading, + }); + ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); + }); + }); + + after('delete test data', () => { + cy.resetTenant(); + cy.getAdminToken(); + cy.setTenant(Affiliations.College); + InventoryInstances.deleteHoldingsNoteTypeViaApi(collegeHoldingNoteType.id); + + collegeHoldingIds.forEach((id) => { + cy.deleteHoldingRecordViaApi(id); + }); + + cy.setTenant(Affiliations.University); + + universityHoldingIds.forEach((id) => { + cy.deleteHoldingRecordViaApi(id); + }); + + cy.resetTenant(); + cy.getAdminToken(); + + instances.forEach((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.uuid); + }); + + HoldingsNoteTypesConsortiumManager.deleteViaApi(centralSharedHoldingNoteTypeData); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${holdingUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask( + matchedRecordsFileName, + previewFileName, + changedRecordsFileName, + errorsFromCommittingFileName, + ); + }); + + it( + 'C478258 Verify "Find & replace" action for Holdings notes in Central tenant (consortia) (firebird)', + { tags: ['smokeECS', 'firebird', 'C478258'] }, + () => { + BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Holdings', 'Holdings UUIDs'); + BulkEditSearchPane.uploadFile(holdingUUIDsFileName); + BulkEditSearchPane.verifyPaneTitleFileName(holdingUUIDsFileName); + BulkEditSearchPane.verifyPaneRecordsCount('4 holding'); + BulkEditSearchPane.verifyFileNameHeadLine(holdingUUIDsFileName); + + const holdingHrids = [...collegeHoldingHrids, ...universityHoldingHrids]; + + holdingHrids.forEach((hrid) => { + BulkEditSearchPane.verifyExactChangesUnderColumnsByIdentifierInResultsAccordion( + hrid, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + hrid, + ); + }); + + BulkEditSearchPane.verifyPreviousPaginationButtonDisabled(); + BulkEditSearchPane.verifyNextPaginationButtonDisabled(); + BulkEditActions.openActions(); + BulkEditSearchPane.verifyCheckboxesInActionsDropdownMenuChecked( + false, + centralSharedHoldingNoteType.payload.name, + collegeHoldingNoteTypeNameWithAffiliation, + ); + BulkEditSearchPane.changeShowColumnCheckbox( + centralSharedHoldingNoteType.payload.name, + collegeHoldingNoteTypeNameWithAffiliation, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + ); + BulkEditSearchPane.verifyCheckboxesInActionsDropdownMenuChecked( + true, + centralSharedHoldingNoteType.payload.name, + collegeHoldingNoteTypeNameWithAffiliation, + ); + + const initialHeaderValues = [ + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + value: `${notes.adminUpperCase};${notes.adminLowerCase}`, + }, + { + header: centralSharedHoldingNoteType.payload.name, + value: `${notes.sharedUpperCase} (staff only) | ${notes.sharedLowerCase}`, + }, + ]; + const collegeInitialHeaderValues = [ + { + header: collegeHoldingNoteTypeNameWithAffiliation, + value: `${notes.collegeUpperCase} (staff only) | ${notes.collegeLowerCase}`, + }, + ]; + + holdingHrids.forEach((hrid) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInResultsAccordion( + hrid, + initialHeaderValues, + ); + }); + collegeHoldingHrids.forEach((hrid) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInResultsAccordion( + hrid, + collegeInitialHeaderValues, + ); + }); + + BulkEditSearchPane.changeShowColumnCheckbox( + centralSharedHoldingNoteType.payload.name, + collegeHoldingNoteTypeNameWithAffiliation, + ); + BulkEditSearchPane.verifyCheckboxesInActionsDropdownMenuChecked( + false, + centralSharedHoldingNoteType.payload.name, + collegeHoldingNoteTypeNameWithAffiliation, + ); + BulkEditSearchPane.verifyResultColumnTitlesDoNotIncludeTitles( + centralSharedHoldingNoteType.payload.name, + collegeHoldingNoteTypeNameWithAffiliation, + ); + BulkEditActions.openActions(); + BulkEditActions.downloadMatchedResults(); + + holdingHrids.forEach((hrid) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + matchedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + hrid, + initialHeaderValues, + ); + }); + collegeHoldingHrids.forEach((hrid) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + matchedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + hrid, + collegeInitialHeaderValues, + ); + }); + + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditSearchPane.verifyBulkEditsAccordionExists(); + BulkEditActions.verifyOptionsDropdown(); + BulkEditActions.verifyRowIcons(); + BulkEditActions.verifyCancelButtonDisabled(false); + BulkEditSearchPane.isConfirmButtonDisabled(true); + BulkEditActions.clickOptionsSelection(); + BulkEditActions.verifyOptionExistsInSelectOptionDropdown( + centralSharedHoldingNoteType.payload.name, + ); + BulkEditActions.verifyOptionExistsInSelectOptionDropdown( + collegeHoldingNoteTypeNameWithAffiliation, + ); + BulkEditActions.clickOptionsSelection(); + BulkEditActions.noteReplaceWith( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.ADMINISTRATIVE_NOTE, + notes.adminUpperCase, + notes.adminLowerCase, + ); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(1); + BulkEditActions.noteReplaceWith( + centralSharedHoldingNoteType.payload.name, + notes.sharedUpperCase, + notes.sharedLowerCase, + 1, + ); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(2); + BulkEditActions.noteReplaceWith( + collegeHoldingNoteTypeNameWithAffiliation, + notes.collegeUpperCase, + notes.collegeLowerCase, + 2, + ); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.confirmChanges(); + BulkEditActions.verifyMessageBannerInAreYouSureForm(4); + + const editedHeaderValues = [ + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + value: `${notes.adminLowerCase};${notes.adminLowerCase}`, + }, + { + header: centralSharedHoldingNoteType.payload.name, + value: `${notes.sharedLowerCase} (staff only) | ${notes.sharedLowerCase}`, + }, + ]; + const collegeEditedHeaderValues = [ + { + header: collegeHoldingNoteTypeNameWithAffiliation, + value: `${notes.collegeLowerCase} (staff only) | ${notes.collegeLowerCase}`, + }, + ]; + + holdingHrids.forEach((hrid) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInAreYouSureForm( + hrid, + editedHeaderValues, + ); + }); + collegeHoldingHrids.forEach((hrid) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInAreYouSureForm( + hrid, + collegeEditedHeaderValues, + ); + }); + + BulkEditActions.verifyAreYouSureForm(4); + BulkEditActions.downloadPreview(); + + holdingHrids.forEach((hrid) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + previewFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + hrid, + editedHeaderValues, + ); + }); + collegeHoldingHrids.forEach((hrid) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + previewFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + hrid, + collegeEditedHeaderValues, + ); + }); + + BulkEditActions.commitChanges(); + BulkEditActions.verifySuccessBanner(4); + + holdingHrids.forEach((hrid) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInChangesAccordion( + hrid, + editedHeaderValues, + ); + }); + collegeHoldingHrids.forEach((hrid) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInChangesAccordion( + hrid, + collegeEditedHeaderValues, + ); + }); + + BulkEditSearchPane.verifyErrorLabel(2); + + universityHoldingIds.forEach((id) => { + BulkEditSearchPane.verifyErrorByIdentifier( + id, + getReasonForError(id, Affiliations.University), + ); + }); + + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); + + holdingHrids.forEach((hrid) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + changedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + hrid, + editedHeaderValues, + ); + }); + collegeHoldingHrids.forEach((hrid) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + changedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_HOLDINGS.HOLDINGS_HRID, + hrid, + collegeEditedHeaderValues, + ); + }); + + BulkEditActions.downloadErrors(); + + universityHoldingIds.forEach((id) => { + ExportFile.verifyFileIncludes(errorsFromCommittingFileName, [ + `${id},${getReasonForError(id, Affiliations.University)}`, + ]); + }); + + BulkEditFiles.verifyCSVFileRecordsNumber(errorsFromCommittingFileName, 2); + + ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); + + collegeHoldingHrids.forEach((hrid) => { + TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.searchHoldingsByHRID(hrid); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.waitLoading(); + HoldingsRecordView.checkExactContentInAdministrativeNote(notes.adminLowerCase); + HoldingsRecordView.checkExactContentInAdministrativeNote(notes.adminLowerCase, 1); + HoldingsRecordView.checkNotesByType( + 0, + collegeHoldingNoteType.name, + notes.collegeLowerCase, + 'Yes', + ); + HoldingsRecordView.checkNotesByType( + 0, + collegeHoldingNoteType.name, + notes.collegeLowerCase, + 'No', + 1, + ); + HoldingsRecordView.checkNotesByType( + 1, + centralSharedHoldingNoteType.payload.name, + notes.sharedLowerCase, + 'Yes', + ); + HoldingsRecordView.checkNotesByType( + 1, + centralSharedHoldingNoteType.payload.name, + notes.sharedLowerCase, + 'No', + 1, + ); + }); + + ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.university); + + universityHoldingHrids.forEach((hrid) => { + TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); + InventorySearchAndFilter.switchToHoldings(); + InventorySearchAndFilter.searchHoldingsByHRID(hrid); + InventorySearchAndFilter.selectViewHoldings(); + HoldingsRecordView.waitLoading(); + HoldingsRecordView.checkExactContentInAdministrativeNote(notes.adminLowerCase); + HoldingsRecordView.checkExactContentInAdministrativeNote(notes.adminLowerCase, 1); + HoldingsRecordView.checkNotesByType( + 0, + centralSharedHoldingNoteType.payload.name, + notes.sharedLowerCase, + 'Yes', + ); + HoldingsRecordView.checkNotesByType( + 0, + centralSharedHoldingNoteType.payload.name, + notes.sharedLowerCase, + 'No', + 1, + ); + }); + }, + ); + }); + }); +}); diff --git a/cypress/e2e/consortia/bulk-edit/in-app/bulk-edit-in-app-items-find-replace-item-notes-in-central-tenant.cy.js b/cypress/e2e/consortia/bulk-edit/in-app/bulk-edit-in-app-items-find-replace-item-notes-in-central-tenant.cy.js new file mode 100644 index 0000000000..e0d2d14fa6 --- /dev/null +++ b/cypress/e2e/consortia/bulk-edit/in-app/bulk-edit-in-app-items-find-replace-item-notes-in-central-tenant.cy.js @@ -0,0 +1,637 @@ +import permissions from '../../../../support/dictionary/permissions'; +import BulkEditActions from '../../../../support/fragments/bulk-edit/bulk-edit-actions'; +import BulkEditSearchPane from '../../../../support/fragments/bulk-edit/bulk-edit-search-pane'; +import BulkEditFiles from '../../../../support/fragments/bulk-edit/bulk-edit-files'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; +import TopMenu from '../../../../support/fragments/topMenu'; +import Users from '../../../../support/fragments/users/users'; +import FileManager from '../../../../support/utils/fileManager'; +import getRandomPostfix from '../../../../support/utils/stringTools'; +import ExportFile from '../../../../support/fragments/data-export/exportFile'; +import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryHoldings from '../../../../support/fragments/inventory/holdings/inventoryHoldings'; +import ItemRecordView from '../../../../support/fragments/inventory/item/itemRecordView'; +import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; +import InventoryItems from '../../../../support/fragments/inventory/item/inventoryItems'; +import ItemNoteTypes from '../../../../support/fragments/settings/inventory/items/itemNoteTypes'; +import ItemNoteTypesConsortiumManager from '../../../../support/fragments/consortium-manager/inventory/items/itemNoteTypesConsortiumManager'; +import ConsortiumManager from '../../../../support/fragments/settings/consortium-manager/consortium-manager'; +import Affiliations, { tenantNames } from '../../../../support/dictionary/affiliations'; +import { + APPLICATION_NAMES, + BULK_EDIT_TABLE_COLUMN_HEADERS, + ITEM_STATUS_NAMES, +} from '../../../../support/constants'; +import TopMenuNavigation from '../../../../support/fragments/topMenuNavigation'; + +let user; +let instanceTypeId; +let locationId; +let loanTypeId; +let materialTypeId; +let sourceId; +let centralSharedNoteTypeData; +const folioInstance = { + title: `C478262 folio instance testBulkEdit_${getRandomPostfix()}`, + barcodeInCollege: `Item_College${getRandomPostfix()}`, + barcodeInUniversity: `Item_University${getRandomPostfix()}`, + itemIds: [], + holdingIds: [], +}; +const marcInstance = { + title: `C478262 marc instance testBulkEdit_${getRandomPostfix()}`, + barcodeInCollege: `Item_College${getRandomPostfix()}`, + barcodeInUniversity: `Item_University${getRandomPostfix()}`, + itemIds: [], + holdingIds: [], +}; +const notes = { + adminUpperCase: 'Test [administrative] note', + adminLowerCase: 'test [administrative] note', + sharedUpperCase: 'Test item shared note', + sharedLowerCase: 'test item shared note', + collegeUpperCase: 'Test item college note', + collegeLowerCase: 'test item college note', + checkOutUpperCase: 'Test item check out note', + checkOutLowerCase: 'test item check out note', +}; +const centralSharedItemNoteType = { + payload: { + name: `C478262 shared note type ${getRandomPostfix()}`, + }, +}; +const collegeItemNoteType = { + name: `C478262 College NoteType ${getRandomPostfix()}`, +}; +const collegeItemNoteTypeNameWithAffiliation = `${collegeItemNoteType.name} (${Affiliations.College})`; +const instances = [folioInstance, marcInstance]; +const getReasonForError = (itemId) => { + return `${itemId} cannot be updated because the record is associated with ${Affiliations.University} and note type is not associated with this tenant. `; +}; +const itemUUIDsFileName = `itemUUIdsFileName_${getRandomPostfix()}.csv`; +const matchedRecordsFileName = `*-Matched-Records-${itemUUIDsFileName}`; +const previewFileName = `*-Updates-Preview-${itemUUIDsFileName}`; +const changedRecordsFileName = `*-Changed-Records-${itemUUIDsFileName}`; +const errorsFromCommittingFileName = `*-Committing-changes-Errors-${itemUUIDsFileName}`; + +describe('Bulk-edit', () => { + describe('In-app approach', () => { + describe('Consortia', () => { + before('create test data', () => { + cy.clearLocalStorage(); + cy.getAdminToken(); + cy.createTempUser([ + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui, + ]).then((userProperties) => { + user = userProperties; + + cy.assignAffiliationToUser(Affiliations.College, user.userId); + cy.setTenant(Affiliations.College); + cy.assignPermissionsToExistingUser(user.userId, [ + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui, + ]); + + cy.resetTenant(); + cy.assignAffiliationToUser(Affiliations.University, user.userId); + cy.setTenant(Affiliations.University); + cy.assignPermissionsToExistingUser(user.userId, [ + permissions.bulkEditEdit.gui, + permissions.uiInventoryViewCreateEditItems.gui, + ]); + + cy.resetTenant(); + cy.getInstanceTypes({ limit: 1 }).then((instanceTypeData) => { + instanceTypeId = instanceTypeData[0].id; + }); + cy.getLocations({ query: 'name="DCB"' }).then((res) => { + locationId = res.id; + }); + cy.getLoanTypes({ limit: 1 }).then((res) => { + loanTypeId = res[0].id; + }); + cy.getMaterialTypes({ limit: 1 }).then((res) => { + materialTypeId = res.id; + }); + InventoryHoldings.getHoldingsFolioSource().then((folioSource) => { + sourceId = folioSource.id; + }); + ItemNoteTypesConsortiumManager.createViaApi(centralSharedItemNoteType).then( + (newItemNoteType) => { + centralSharedNoteTypeData = newItemNoteType; + }, + ); + cy.setTenant(Affiliations.College); + // create local item note type in College + ItemNoteTypes.createItemNoteTypeViaApi(collegeItemNoteType.name) + .then((noteId) => { + collegeItemNoteType.id = noteId; + }) + .then(() => { + cy.resetTenant(); + // create shared folio instance + InventoryInstances.createFolioInstanceViaApi({ + instance: { + instanceTypeId, + title: folioInstance.title, + }, + }).then((createdInstanceData) => { + folioInstance.uuid = createdInstanceData.instanceId; + }); + }) + .then(() => { + // create shared marc instance + cy.createSimpleMarcBibViaAPI(marcInstance.title).then((instanceId) => { + marcInstance.uuid = instanceId; + }); + }) + .then(() => { + // create holdings in College tenant + cy.setTenant(Affiliations.College); + + instances.forEach((instance) => { + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: instance.uuid, + permanentLocationId: locationId, + sourceId, + }).then((holding) => { + instance.holdingIds.push(holding.id); + }); + cy.wait(1000); + }); + }) + .then(() => { + // create items in College tenant + instances.forEach((instance) => { + InventoryItems.createItemViaApi({ + barcode: instance.barcodeInCollege, + holdingsRecordId: instance.holdingIds[0], + materialType: { id: materialTypeId }, + permanentLoanType: { id: loanTypeId }, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + administrativeNotes: [notes.adminUpperCase, notes.adminLowerCase], + notes: [ + { + itemNoteTypeId: centralSharedNoteTypeData.settingId, + note: notes.sharedUpperCase, + staffOnly: true, + }, + { + itemNoteTypeId: centralSharedNoteTypeData.settingId, + note: notes.sharedLowerCase, + staffOnly: false, + }, + { + itemNoteTypeId: collegeItemNoteType.id, + note: notes.collegeUpperCase, + staffOnly: true, + }, + { + itemNoteTypeId: collegeItemNoteType.id, + note: notes.collegeLowerCase, + staffOnly: false, + }, + ], + circulationNotes: [ + { note: notes.checkOutUpperCase, noteType: 'Check out', staffOnly: true }, + { note: notes.checkOutLowerCase, noteType: 'Check out', staffOnly: false }, + ], + }).then((item) => { + instance.itemIds.push(item.id); + }); + cy.wait(1000); + }); + }) + .then(() => { + // create holdings in University tenant + cy.setTenant(Affiliations.University); + + instances.forEach((instance) => { + InventoryHoldings.createHoldingRecordViaApi({ + instanceId: instance.uuid, + permanentLocationId: locationId, + sourceId, + }).then((holding) => { + instance.holdingIds.push(holding.id); + }); + cy.wait(1000); + }); + }) + .then(() => { + // create items in University tenant + instances.forEach((instance) => { + InventoryItems.createItemViaApi({ + barcode: instance.barcodeInUniversity, + holdingsRecordId: instance.holdingIds[1], + materialType: { id: materialTypeId }, + permanentLoanType: { id: loanTypeId }, + status: { name: ITEM_STATUS_NAMES.AVAILABLE }, + administrativeNotes: [notes.adminUpperCase, notes.adminLowerCase], + notes: [ + { + itemNoteTypeId: centralSharedNoteTypeData.settingId, + note: notes.sharedUpperCase, + staffOnly: true, + }, + { + itemNoteTypeId: centralSharedNoteTypeData.settingId, + note: notes.sharedLowerCase, + staffOnly: false, + }, + ], + circulationNotes: [ + { note: notes.checkOutUpperCase, noteType: 'Check out', staffOnly: true }, + { note: notes.checkOutLowerCase, noteType: 'Check out', staffOnly: false }, + ], + }).then((item) => { + instance.itemIds.push(item.id); + }); + cy.wait(1000); + }); + }) + .then(() => { + FileManager.createFile( + `cypress/fixtures/${itemUUIDsFileName}`, + `${folioInstance.itemIds.join('\n')}\n${marcInstance.itemIds.join('\n')}`, + ); + }); + + cy.login(user.username, user.password, { + path: TopMenu.bulkEditPath, + waiter: BulkEditSearchPane.waitLoading, + }); + ConsortiumManager.checkCurrentTenantInTopMenu(tenantNames.central); + }); + }); + + after('delete test data', () => { + cy.resetTenant(); + cy.getAdminToken(); + cy.setTenant(Affiliations.College); + ItemNoteTypes.deleteItemNoteTypeViaApi(collegeItemNoteType.id); + + instances.forEach((instance) => { + cy.deleteItemViaApi(instance.itemIds[0]); + cy.deleteHoldingRecordViaApi(instance.holdingIds[0]); + }); + + cy.setTenant(Affiliations.University); + + instances.forEach((instance) => { + cy.deleteItemViaApi(instance.itemIds[1]); + cy.deleteHoldingRecordViaApi(instance.holdingIds[1]); + }); + + cy.resetTenant(); + cy.getAdminToken(); + + instances.forEach((instance) => { + InventoryInstance.deleteInstanceViaApi(instance.uuid); + }); + + ItemNoteTypesConsortiumManager.deleteViaApi(centralSharedNoteTypeData); + Users.deleteViaApi(user.userId); + FileManager.deleteFile(`cypress/fixtures/${itemUUIDsFileName}`); + FileManager.deleteFileFromDownloadsByMask( + matchedRecordsFileName, + previewFileName, + changedRecordsFileName, + errorsFromCommittingFileName, + ); + }); + + it( + 'C478262 Verify "Find & replace" action for Items notes in Central tenant (consortia) (firebird)', + { tags: ['smokeECS', 'firebird', 'C478262'] }, + () => { + BulkEditSearchPane.verifyDragNDropRecordTypeIdentifierArea('Items', 'Item UUIDs'); + BulkEditSearchPane.uploadFile(itemUUIDsFileName); + BulkEditSearchPane.verifyPaneTitleFileName(itemUUIDsFileName); + BulkEditSearchPane.verifyPaneRecordsCount('4 item'); + BulkEditSearchPane.verifyFileNameHeadLine(itemUUIDsFileName); + + const itemBarcodes = [ + folioInstance.barcodeInCollege, + folioInstance.barcodeInUniversity, + marcInstance.barcodeInCollege, + marcInstance.barcodeInUniversity, + ]; + const collegeItemBarcodes = [ + folioInstance.barcodeInCollege, + marcInstance.barcodeInCollege, + ]; + + itemBarcodes.forEach((barcode) => { + BulkEditSearchPane.verifyExactChangesUnderColumnsByIdentifierInResultsAccordion( + barcode, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + barcode, + ); + }); + + BulkEditSearchPane.verifyPreviousPaginationButtonDisabled(); + BulkEditSearchPane.verifyNextPaginationButtonDisabled(); + BulkEditActions.openActions(); + BulkEditSearchPane.verifyCheckboxesInActionsDropdownMenuChecked( + false, + centralSharedItemNoteType.payload.name, + collegeItemNoteTypeNameWithAffiliation, + ); + BulkEditSearchPane.changeShowColumnCheckbox( + centralSharedItemNoteType.payload.name, + collegeItemNoteTypeNameWithAffiliation, + ); + BulkEditSearchPane.verifyCheckboxesInActionsDropdownMenuChecked( + true, + centralSharedItemNoteType.payload.name, + collegeItemNoteTypeNameWithAffiliation, + ); + + const initialHeaderValues = [ + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + value: `${notes.adminUpperCase};${notes.adminLowerCase}`, + }, + { + header: centralSharedItemNoteType.payload.name, + value: `${notes.sharedUpperCase} (staff only) | ${notes.sharedLowerCase}`, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE, + value: `${notes.checkOutUpperCase} (staff only) | ${notes.checkOutLowerCase}`, + }, + ]; + const collegeInitialHeaderValues = [ + { + header: collegeItemNoteTypeNameWithAffiliation, + value: `${notes.collegeUpperCase} (staff only) | ${notes.collegeLowerCase}`, + }, + ]; + + itemBarcodes.forEach((barcode) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInResultsAccordion( + barcode, + [initialHeaderValues[1]], + ); + }); + collegeItemBarcodes.forEach((barcode) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInResultsAccordion( + barcode, + collegeInitialHeaderValues, + ); + }); + + BulkEditSearchPane.changeShowColumnCheckbox( + centralSharedItemNoteType.payload.name, + collegeItemNoteTypeNameWithAffiliation, + ); + BulkEditSearchPane.verifyCheckboxesInActionsDropdownMenuChecked( + false, + centralSharedItemNoteType.payload.name, + collegeItemNoteTypeNameWithAffiliation, + ); + BulkEditSearchPane.verifyResultColumnTitlesDoNotIncludeTitles( + centralSharedItemNoteType.payload.name, + collegeItemNoteTypeNameWithAffiliation, + ); + BulkEditActions.openActions(); + BulkEditActions.downloadMatchedResults(); + + itemBarcodes.forEach((barcode) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + matchedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + barcode, + initialHeaderValues, + ); + }); + collegeItemBarcodes.forEach((barcode) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + matchedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + barcode, + collegeInitialHeaderValues, + ); + }); + + BulkEditActions.openInAppStartBulkEditFrom(); + BulkEditSearchPane.verifyBulkEditsAccordionExists(); + BulkEditActions.verifyOptionsDropdown(); + BulkEditActions.verifyRowIcons(); + BulkEditActions.verifyCancelButtonDisabled(false); + BulkEditSearchPane.isConfirmButtonDisabled(true); + BulkEditActions.clickOptionsSelection(); + BulkEditActions.verifyOptionExistsInSelectOptionDropdown( + centralSharedItemNoteType.payload.name, + ); + BulkEditActions.verifyOptionExistsInSelectOptionDropdown( + collegeItemNoteTypeNameWithAffiliation, + ); + BulkEditActions.clickOptionsSelection(); + BulkEditActions.noteReplaceWith( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + notes.adminUpperCase, + notes.adminLowerCase, + ); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(1); + BulkEditActions.noteReplaceWith( + centralSharedItemNoteType.payload.name, + notes.sharedUpperCase, + notes.sharedLowerCase, + 1, + ); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(2); + BulkEditActions.noteReplaceWith( + collegeItemNoteTypeNameWithAffiliation, + notes.collegeUpperCase, + notes.collegeLowerCase, + 2, + ); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.addNewBulkEditFilterString(); + BulkEditActions.verifyNewBulkEditRow(3); + BulkEditActions.noteReplaceWith( + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE, + notes.checkOutUpperCase, + notes.checkOutLowerCase, + 3, + ); + BulkEditSearchPane.isConfirmButtonDisabled(false); + BulkEditActions.confirmChanges(); + BulkEditActions.verifyMessageBannerInAreYouSureForm(4); + + const editedHeaderValues = [ + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.ADMINISTRATIVE_NOTE, + value: `${notes.adminLowerCase};${notes.adminLowerCase}`, + }, + { + header: centralSharedItemNoteType.payload.name, + value: `${notes.sharedLowerCase} (staff only) | ${notes.sharedLowerCase}`, + }, + { + header: BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.CHECK_OUT_NOTE, + value: `${notes.checkOutLowerCase} (staff only) | ${notes.checkOutLowerCase}`, + }, + ]; + const collegeEditedHeaderValues = [ + { + header: collegeItemNoteTypeNameWithAffiliation, + value: `${notes.collegeLowerCase} (staff only) | ${notes.collegeLowerCase}`, + }, + ]; + + itemBarcodes.forEach((barcode) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInAreYouSureForm( + barcode, + editedHeaderValues, + ); + }); + collegeItemBarcodes.forEach((barcode) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInAreYouSureForm( + barcode, + collegeEditedHeaderValues, + ); + }); + + BulkEditActions.verifyAreYouSureForm(4); + BulkEditActions.downloadPreview(); + + itemBarcodes.forEach((barcode) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + previewFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + barcode, + editedHeaderValues, + ); + }); + collegeItemBarcodes.forEach((barcode) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + previewFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + barcode, + collegeEditedHeaderValues, + ); + }); + + BulkEditActions.commitChanges(); + BulkEditActions.verifySuccessBanner(4); + + itemBarcodes.forEach((barcode) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInChangesAccordion( + barcode, + editedHeaderValues, + ); + }); + collegeItemBarcodes.forEach((barcode) => { + BulkEditSearchPane.verifyExactChangesInMultipleColumnsByIdentifierInChangesAccordion( + barcode, + collegeEditedHeaderValues, + ); + }); + + BulkEditSearchPane.verifyErrorLabel(2); + + instances.forEach((instance) => { + BulkEditSearchPane.verifyErrorByIdentifier( + instance.itemIds[1], + getReasonForError(instance.itemIds[1]), + ); + }); + + BulkEditActions.openActions(); + BulkEditActions.downloadChangedCSV(); + + itemBarcodes.forEach((barcode) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + changedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + barcode, + editedHeaderValues, + ); + }); + collegeItemBarcodes.forEach((barcode) => { + BulkEditFiles.verifyHeaderValueInRowByIdentifier( + changedRecordsFileName, + BULK_EDIT_TABLE_COLUMN_HEADERS.INVENTORY_ITEMS.BARCODE, + barcode, + collegeEditedHeaderValues, + ); + }); + + BulkEditActions.downloadErrors(); + + instances.forEach((instance) => { + ExportFile.verifyFileIncludes(errorsFromCommittingFileName, [ + `${instance.itemIds[1]},${getReasonForError(instance.itemIds[1]).trim()}`, + ]); + }); + + BulkEditFiles.verifyCSVFileRecordsNumber(errorsFromCommittingFileName, 2); + + ConsortiumManager.switchActiveAffiliation(tenantNames.central, tenantNames.college); + + instances.forEach((instance) => { + TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); + InventorySearchAndFilter.byKeywords(instance.title); + InventoryInstance.openHoldings(['']); + InventoryInstance.openItemByBarcode(instance.barcodeInCollege); + ItemRecordView.waitLoading(); + ItemRecordView.checkItemAdministrativeNote( + `${notes.adminLowerCase}\n${notes.adminLowerCase}`, + ); + ItemRecordView.checkMultipleItemNotesWithStaffOnly( + 0, + 'YesNo', + collegeItemNoteType.name, + `${notes.collegeLowerCase}${notes.collegeLowerCase}`, + ); + ItemRecordView.checkMultipleItemNotesWithStaffOnly( + 1, + 'YesNo', + centralSharedItemNoteType.payload.name, + `${notes.sharedLowerCase}${notes.sharedLowerCase}`, + ); + ItemRecordView.checkCirculationNotesWithStaffOnly( + 3, + 'YesNo', + 'Check out note', + `${notes.checkOutLowerCase}${notes.checkOutLowerCase}`, + ); + }); + + ConsortiumManager.switchActiveAffiliation(tenantNames.college, tenantNames.university); + + instances.forEach((instance) => { + TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); + InventorySearchAndFilter.byKeywords(instance.title); + InventoryInstance.openHoldings(['']); + InventoryInstance.openItemByBarcode(instance.barcodeInUniversity); + ItemRecordView.waitLoading(); + ItemRecordView.checkItemAdministrativeNote( + `${notes.adminLowerCase}\n${notes.adminLowerCase}`, + ); + ItemRecordView.checkMultipleItemNotesWithStaffOnly( + 0, + 'YesNo', + centralSharedItemNoteType.payload.name, + `${notes.sharedLowerCase}${notes.sharedLowerCase}`, + ); + ItemRecordView.checkCirculationNotesWithStaffOnly( + 3, + 'YesNo', + 'Check out note', + `${notes.checkOutLowerCase}${notes.checkOutLowerCase}`, + ); + ItemRecordView.checkItemNoteAbsent(collegeItemNoteType.name); + }); + }, + ); + }); + }); +}); diff --git a/cypress/e2e/fees-&-fines/fee-fine-history.cy.js b/cypress/e2e/fees-&-fines/fee-fine-history.cy.js index a8303dd89e..706d4e7df0 100644 --- a/cypress/e2e/fees-&-fines/fee-fine-history.cy.js +++ b/cypress/e2e/fees-&-fines/fee-fine-history.cy.js @@ -77,6 +77,8 @@ describe('Fees&Fines', () => { cy.createTempUser([ permissions.uiUsersView.gui, permissions.uiUsersfeefinesCRUD.gui, + permissions.feesfinesCheckPay.gui, + permissions.feesfinesPay.gui, permissions.uiUsersViewServicePoints.gui, permissions.uiUsersfeefinesView.gui, permissions.uiFeeFinesActions.gui, diff --git a/cypress/e2e/fees-&-fines/patron-groups.cy.js b/cypress/e2e/fees-&-fines/patron-groups.cy.js index e42df8cede..a546763c2a 100644 --- a/cypress/e2e/fees-&-fines/patron-groups.cy.js +++ b/cypress/e2e/fees-&-fines/patron-groups.cy.js @@ -31,7 +31,7 @@ describe('Fees&Fines', () => { testData.username = userProperties.username; Conditions.getConditionsViaApi().then((patronBlockConditions) => { const testCondition = - Conditions.defaultConditions.defaultMaximumOustandingFeeFineBalance; + Conditions.defaultConditions.defaultMaximumOutstandingFeeFineBalance; testData.testConditionId = patronBlockConditions.filter( (conditionProperty) => conditionProperty.name === testCondition.name, )[0].id; diff --git a/cypress/e2e/inventory/contributors-browse/browse-contributors-non-exact.cy.js b/cypress/e2e/inventory/contributors-browse/browse-contributors-non-exact.cy.js index a3a4dde8b8..63e33726c6 100644 --- a/cypress/e2e/inventory/contributors-browse/browse-contributors-non-exact.cy.js +++ b/cypress/e2e/inventory/contributors-browse/browse-contributors-non-exact.cy.js @@ -31,7 +31,7 @@ describe('Inventory', () => { BrowseContributors.createInstanceWithContributorViaApi(instanceA); BrowseContributors.createInstanceWithContributorViaApi(instanceZ); - + BrowseContributors.waitForContributorToAppear(instanceA.contributors[0].name); cy.getInstanceById(instanceA.id).then((res) => { testData.instanceAProps = res; }); diff --git a/cypress/e2e/linked-data/check-view-and-search.cy.js b/cypress/e2e/linked-data/check-view-and-search.cy.js index cfcc4935b1..092ecdd536 100644 --- a/cypress/e2e/linked-data/check-view-and-search.cy.js +++ b/cypress/e2e/linked-data/check-view-and-search.cy.js @@ -78,7 +78,7 @@ describe('Citation: check navigation', () => { }); it( - 'C491276 Linked Data Editor: Verify user is navigated to Linked data editor home page when Application header icon is clicked', + 'C491276 Linked Data Editor: Verify user is navigated to Linked data editor home page when Application header icon is clicked (citation)', { tags: ['citation', 'linked-data-editor', 'sanity', 'shiftLeft'] }, () => { // check search is displayed with lccn option diff --git a/cypress/e2e/linked-data/create-work.cy.js b/cypress/e2e/linked-data/create-work.cy.js index ab6c5c5cce..66a1afdfe9 100644 --- a/cypress/e2e/linked-data/create-work.cy.js +++ b/cypress/e2e/linked-data/create-work.cy.js @@ -29,7 +29,7 @@ describe('Citation: create work', () => { }); it( - 'C624167 [User journey] LDE - Create new work only from blank workform', + 'C624167 [User journey] LDE - Create new work only from blank workform (citation)', { tags: ['draft', 'citation', 'linked-data-editor', 'shiftLeft'] }, () => { // open new resource form diff --git a/cypress/e2e/linked-data/duplicate-instance.cy.js b/cypress/e2e/linked-data/duplicate-instance.cy.js index 808e72cba0..6259d5e091 100644 --- a/cypress/e2e/linked-data/duplicate-instance.cy.js +++ b/cypress/e2e/linked-data/duplicate-instance.cy.js @@ -3,7 +3,11 @@ import TopMenu from '../../support/fragments/topMenu'; import LinkedDataEditor from '../../support/fragments/linked-data/linkedDataEditor'; import EditResource from '../../support/fragments/linked-data/editResource'; import SearchAndFilter from '../../support/fragments/linked-data/searchAndFilter'; -import { APPLICATION_NAMES, LOCATION_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants'; +import { + APPLICATION_NAMES, + LOCATION_NAMES, + DEFAULT_JOB_PROFILE_NAMES, +} from '../../support/constants'; import TopMenuNavigation from '../../support/fragments/topMenuNavigation'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; @@ -90,7 +94,7 @@ describe('Citation: duplicate instance', () => { }); it( - 'C624280 [User journey] LDE - Create new instance by duplicating existing Instance plus holdings', + 'C624280 [User journey] LDE - Create new instance by duplicating existing Instance plus holdings (citation)', { tags: ['draft', 'citation', 'linked-data-editor', 'shiftLeft'] }, () => { // search by any isbn diff --git a/cypress/e2e/linked-data/duplicate-work.cy.js b/cypress/e2e/linked-data/duplicate-work.cy.js index 7b30d7be99..353781becb 100644 --- a/cypress/e2e/linked-data/duplicate-work.cy.js +++ b/cypress/e2e/linked-data/duplicate-work.cy.js @@ -96,7 +96,7 @@ describe('Citation: duplicate existing work', () => { }); it( - 'C624234 [User journey] LDE - Duplicate existing work', + 'C624234 [User journey] LDE - Duplicate existing work (citation)', { tags: ['draft', 'citation', 'linked-data-editor', 'shiftLeft'] }, () => { // search by any title diff --git a/cypress/e2e/linked-data/edit-resource-marc-record.cy.js b/cypress/e2e/linked-data/edit-resource-marc-record.cy.js index ce3d656e0f..b6d5233ca9 100644 --- a/cypress/e2e/linked-data/edit-resource-marc-record.cy.js +++ b/cypress/e2e/linked-data/edit-resource-marc-record.cy.js @@ -2,7 +2,11 @@ import TopMenu from '../../support/fragments/topMenu'; import getRandomPostfix, { getRandomLetters } from '../../support/utils/stringTools'; import InventoryInstances from '../../support/fragments/inventory/inventoryInstances'; import InventoryInstance from '../../support/fragments/inventory/inventoryInstance'; -import { INSTANCE_SOURCE_NAMES, APPLICATION_NAMES, DEFAULT_JOB_PROFILE_NAMES } from '../../support/constants'; +import { + INSTANCE_SOURCE_NAMES, + APPLICATION_NAMES, + DEFAULT_JOB_PROFILE_NAMES, +} from '../../support/constants'; import EditResource from '../../support/fragments/linked-data/editResource'; import ViewMarc from '../../support/fragments/linked-data/viewMarc'; import LinkedDataEditor from '../../support/fragments/linked-data/linkedDataEditor'; @@ -94,7 +98,7 @@ describe('Citation: edit existing instance', () => { }); it( - 'C627245 [User journey] LDE - Edit existing resource | create MARC derived record', + 'C627245 [User journey] LDE - Edit existing resource | create MARC derived record (citation)', { tags: ['draft', 'citation', 'linked-data-editor', 'shiftLeft'] }, () => { // prepare inventory instance created by LDE @@ -115,7 +119,7 @@ describe('Citation: edit existing instance', () => { InventoryInstance.editInstanceInLde(); // edit edition EditResource.waitLoading(); - cy.wait(5000); + cy.wait(6000); EditResource.setEdition(testData.edition); EditResource.saveAndKeepEditing(); EditResource.viewMarc(); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic.cy.js index 0703809d55..3a72d0a929 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/marc-bibliographic.cy.js @@ -2,7 +2,7 @@ import Permissions from '../../../../support/dictionary/permissions'; import InstanceRecordEdit from '../../../../support/fragments/inventory/instanceRecordEdit'; import InventoryActions from '../../../../support/fragments/inventory/inventoryActions'; import InventoryInstance from '../../../../support/fragments/inventory/inventoryInstance'; -import InventorySearchAndFilter from '../../../../support/fragments/inventory/inventorySearchAndFilter'; +import InventoryInstances from '../../../../support/fragments/inventory/inventoryInstances'; import InventoryViewSource from '../../../../support/fragments/inventory/inventoryViewSource'; import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; import Z3950TargetProfiles from '../../../../support/fragments/settings/inventory/integrations/z39.50TargetProfiles'; @@ -34,9 +34,23 @@ describe('MARC', () => { Permissions.inventoryAll.gui, Permissions.uiInventorySingleRecordImport.gui, Permissions.converterStorageAll.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; - }); + ]) + .then((createdUserProperties) => { + testData.userProperties = createdUserProperties; + cy.getUserToken(testData.userProperties.username, testData.userProperties.password); + InventoryInstances.importWithOclcViaApi(InventoryInstance.validOCLC.id).then( + ({ body: { internalIdentifier } }) => { + testData.instanceID = internalIdentifier; + }, + ); + }) + .then(() => { + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + InventoryInstances.searchByTitle(testData.instanceID); + }); }); afterEach(() => { @@ -49,15 +63,6 @@ describe('MARC', () => { 'C10950 Edit and save a MARC record in quickMARC (spitfire)', { tags: ['smoke', 'spitfire', 'shiftLeft', 'C10950'] }, () => { - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventorySearchAndFilter.waitLoading, - }); - InventoryActions.import(); - InventoryInstance.getId().then((id) => { - testData.instanceID = id; - }); - InventoryInstance.goToEditMARCBiblRecord(); QuickMarcEditor.waitLoading(); const expectedInSourceRow = QuickMarcEditor.addNewField( @@ -87,15 +92,6 @@ describe('MARC', () => { 'C10924 Add a field to a record using quickMARC (spitfire)', { tags: ['smoke', 'spitfire', 'shiftLeftBroken', 'C10924'] }, () => { - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventorySearchAndFilter.waitLoading, - }); - InventoryActions.import(); - InventoryInstance.getId().then((id) => { - testData.instanceID = id; - }); - InventoryInstance.goToEditMARCBiblRecord(); QuickMarcEditor.waitLoading(); QuickMarcEditor.addRow(); @@ -122,15 +118,6 @@ describe('MARC', () => { 'C10928 Delete a field(s) from a record in quickMARC (spitfire)', { tags: ['smoke', 'spitfire', 'shiftLeft', 'C10928'] }, () => { - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventorySearchAndFilter.waitLoading, - }); - InventoryActions.import(); - InventoryInstance.getId().then((id) => { - testData.instanceID = id; - }); - InventoryInstance.goToEditMARCBiblRecord(); QuickMarcEditor.waitLoading(); cy.reload(); @@ -154,15 +141,6 @@ describe('MARC', () => { 'C10957 Attempt to delete a required field (spitfire)', { tags: ['smoke', 'spitfire', 'shiftLeft', 'C10957'] }, () => { - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventorySearchAndFilter.waitLoading, - }); - InventoryActions.import(); - InventoryInstance.getId().then((id) => { - testData.instanceID = id; - }); - InventoryInstance.goToEditMARCBiblRecord(); QuickMarcEditor.waitLoading(); QuickMarcEditor.checkRequiredFields(); @@ -173,15 +151,6 @@ describe('MARC', () => { 'C10951 Add a 5XX field to a marc record in quickMARC (spitfire)', { tags: ['smoke', 'spitfire', 'shiftLeftBroken', 'C10951'] }, () => { - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventorySearchAndFilter.waitLoading, - }); - InventoryActions.import(); - InventoryInstance.getId().then((id) => { - testData.instanceID = id; - }); - InventoryInstance.startOverlaySourceBibRecord(); InventoryActions.fillImportFields(InventoryInstance.validOCLC.id); InventoryActions.pressImportInModal(); @@ -224,15 +193,6 @@ describe('MARC', () => { 'C345388 Derive a MARC bib record (spitfire)', { tags: ['smokeBroken', 'spitfire', 'C345388'] }, () => { - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventorySearchAndFilter.waitLoading, - }); - InventoryActions.import(); - InventoryInstance.getId().then((id) => { - testData.instanceID = id; - }); - InventoryInstance.getAssignedHRID().then((instanceHRID) => { InventoryInstance.deriveNewMarcBib(); const expectedCreatedValue = QuickMarcEditor.addNewField(); diff --git a/cypress/e2e/patron-notices/overdue-fine-renewed-triggers.cy.js b/cypress/e2e/patron-notices/overdue-fine-renewed-triggers.cy.js index fccf3f67fe..72788be50d 100644 --- a/cypress/e2e/patron-notices/overdue-fine-renewed-triggers.cy.js +++ b/cypress/e2e/patron-notices/overdue-fine-renewed-triggers.cy.js @@ -243,6 +243,8 @@ describe('Patron notices', () => { Permissions.uiCirculationSettingsNoticePolicies.gui, Permissions.uiUsersfeefinesCRUD.gui, Permissions.uiUserAccounts.gui, + Permissions.feesfinesCheckPay.gui, + Permissions.feesfinesPay.gui, ], patronGroup.name, ) diff --git a/cypress/e2e/patron-notices/overdue-fine-returned-triggers.cy.js b/cypress/e2e/patron-notices/overdue-fine-returned-triggers.cy.js index d19729fc44..5e42414871 100644 --- a/cypress/e2e/patron-notices/overdue-fine-returned-triggers.cy.js +++ b/cypress/e2e/patron-notices/overdue-fine-returned-triggers.cy.js @@ -233,6 +233,8 @@ describe('Patron notices', () => { permissions.uiCirculationSettingsNoticePolicies.gui, permissions.uiUsersfeefinesCRUD.gui, permissions.uiUserAccounts.gui, + permissions.feesfinesCheckPay.gui, + permissions.feesfinesPay.gui, ], patronGroup.name, ) diff --git a/cypress/support/constants.js b/cypress/support/constants.js index de055b325c..c8a03127f6 100644 --- a/cypress/support/constants.js +++ b/cypress/support/constants.js @@ -997,6 +997,9 @@ export const BULK_EDIT_TABLE_COLUMN_HEADERS = { SUPPRESS_FROM_DISCOVERY: 'Suppress from discovery', PERMANENT_LOAN_TYPE: 'Permanent loan type', TEMPORARY_LOAN_TYPE: 'Temporary loan type', + COPY_NOTE: 'Copy note', + REPRODUCTION_NOTE: 'Reproduction note', + NOTE: 'Note', }, }; diff --git a/cypress/support/dictionary/permissions.js b/cypress/support/dictionary/permissions.js index 0b9cfb66cd..573ebf397f 100644 --- a/cypress/support/dictionary/permissions.js +++ b/cypress/support/dictionary/permissions.js @@ -469,6 +469,14 @@ export default { internal: 'ui-users.feesfines.actions.all', gui: 'Users: Can create, edit and remove fees/fines', }, + feesfinesCheckPay: { + internal: 'feesfines.accounts.check-pay.post', + gui: 'accounts payment check post', + }, + feesfinesPay: { + internal: 'feesfines.accounts.pay.post', + gui: 'accounts payment post', + }, uiUsersPatronBlocks: { internal: 'ui-users.patron-blocks.all', gui: 'Users: Can create, edit and remove patron blocks', diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js index f7d53fdaa9..8a0c78d8f5 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-actions.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-actions.js @@ -34,7 +34,7 @@ const plusBtn = Button({ icon: 'plus-sign' }); const deleteBtn = Button({ icon: 'trash' }); const keepEditingBtn = Button('Keep editing'); const areYouSureForm = Modal('Are you sure?'); -const downloadPreviewBtn = Button('Download preview'); +const downloadPreviewInCSVFormatBtn = Button('Download preview in CSV format'); const newBulkEditButton = Button('New bulk edit'); const startBulkEditLocalButton = Button('Start bulk edit (Local)'); const startBulkEditButton = Button('Start bulk edit'); @@ -185,7 +185,7 @@ export default { cy.expect([ areYouSureForm.find(HTML(including(`${count} records will be changed`))).exists(), areYouSureForm.find(keepEditingBtn).exists(), - areYouSureForm.find(downloadPreviewBtn).exists(), + areYouSureForm.find(downloadPreviewInCSVFormatBtn).exists(), areYouSureForm.find(commitChanges).exists(), ]); if (cellContent) { @@ -241,13 +241,13 @@ export default { }, downloadPreview() { - cy.do(downloadPreviewBtn.click()); + cy.do(downloadPreviewInCSVFormatBtn.click()); // Wait for file to download cy.wait(3000); }, verifyDownloadPreviewButtonDisabled(isDisabled = true) { - cy.expect(areYouSureForm.find(downloadPreviewBtn).has({ disabled: isDisabled })); + cy.expect(areYouSureForm.find(downloadPreviewInCSVFormatBtn).has({ disabled: isDisabled })); }, clickKeepEditingBtn() { diff --git a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js index 21c365f7e1..5c3d9e48b3 100644 --- a/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js +++ b/cypress/support/fragments/bulk-edit/bulk-edit-search-pane.js @@ -598,16 +598,20 @@ export default { }); }, - verifyErrorByIdentifier(identifier, errorText) { + verifyErrorByIdentifier(identifier, reasonMessage, status = 'Error') { cy.then(() => errorsAccordion.find(MultiColumnListCell(identifier)).row()).then((index) => { cy.expect([ errorsAccordion .find(MultiColumnListRow({ indexRow: `row-${index}` })) - .find(MultiColumnListCell({ content: identifier })) + .find(MultiColumnListCell({ content: identifier, column: 'Record identifier' })) .exists(), errorsAccordion .find(MultiColumnListRow({ indexRow: `row-${index}` })) - .find(HTML(including(errorText))) + .find(MultiColumnListCell({ content: status, column: 'Status' })) + .exists(), + errorsAccordion + .find(MultiColumnListRow({ indexRow: `row-${index}` })) + .find(MultiColumnListCell({ column: 'Reason', content: `${reasonMessage} ` })) .exists(), ]); }); diff --git a/cypress/support/fragments/inventory/holdingsRecordView.js b/cypress/support/fragments/inventory/holdingsRecordView.js index 24b4c8b3ec..d903d64d77 100644 --- a/cypress/support/fragments/inventory/holdingsRecordView.js +++ b/cypress/support/fragments/inventory/holdingsRecordView.js @@ -153,9 +153,9 @@ export default { .find(HTML(including(note))) .exists(), ), - checkExactContentInAdministrativeNote: (note) => cy.expect( + checkExactContentInAdministrativeNote: (note, row = 0) => cy.expect( MultiColumnList({ id: 'administrative-note-list' }) - .find(MultiColumnListCell({ content: note })) + .find(MultiColumnListCell({ row, content: note })) .exists(), ), checkHoldingsStatement: (statement) => cy.expect( diff --git a/cypress/support/fragments/inventory/inventoryInstances.js b/cypress/support/fragments/inventory/inventoryInstances.js index 3b4df9fbc8..f17b32cd3f 100644 --- a/cypress/support/fragments/inventory/inventoryInstances.js +++ b/cypress/support/fragments/inventory/inventoryInstances.js @@ -1072,7 +1072,7 @@ export default { }, importWithOclcViaApi: (oclcNumber) => { - cy.okapiRequest({ + return cy.okapiRequest({ method: 'POST', path: 'copycat/imports', body: { diff --git a/cypress/support/fragments/linked-data/linkedDataEditor.js b/cypress/support/fragments/linked-data/linkedDataEditor.js index 47ba899feb..0ef7b44745 100644 --- a/cypress/support/fragments/linked-data/linkedDataEditor.js +++ b/cypress/support/fragments/linked-data/linkedDataEditor.js @@ -51,7 +51,7 @@ export default { }, editWork: () => { - cy.xpath("//div[@class='full-display-container']//button[text()='Edit work']").click(); + cy.xpath("//div[@class='full-display-control-panel']//button[text()='Edit work']").click(); EditResource.waitLoading(); }, diff --git a/cypress/support/fragments/settings/users/conditions.js b/cypress/support/fragments/settings/users/conditions.js index 5c93114abb..84984d0b93 100644 --- a/cypress/support/fragments/settings/users/conditions.js +++ b/cypress/support/fragments/settings/users/conditions.js @@ -14,7 +14,7 @@ const resetCondition = (conditionValue) => { }; const defaultConditions = { - defaultMaximumOustandingFeeFineBalance: { + defaultMaximumOutstandingFeeFineBalance: { // required field id: undefined, name: 'Maximum outstanding fee/fine balance', diff --git a/cypress/support/fragments/users/payFeeFaine.js b/cypress/support/fragments/users/payFeeFaine.js index 04ecb33668..209e17887b 100644 --- a/cypress/support/fragments/users/payFeeFaine.js +++ b/cypress/support/fragments/users/payFeeFaine.js @@ -17,7 +17,10 @@ export default { cy.expect(rootModal.exists()); }, checkAmount: (amount) => cy.expect(amountTextfield.has({ value: amount.toFixed(2) })), - setPaymentMethod: ({ name: paymentMethodName }) => cy.get('div[class^=modal-] select[name=method]').select(paymentMethodName), + setPaymentMethod: ({ name: paymentMethodName }) => { + cy.get('div[class^=modal-] select[name=method]').select(paymentMethodName); + cy.wait(500); + }, fillInAdditionalInformation: (comment) => { cy.do(rootModal.find(TextArea({ name: 'comment' })).fillIn(comment)); }, @@ -33,7 +36,10 @@ export default { ); }, checkPartialPayConfirmation: () => cy.expect(confirmationModal.find(HTML(including('will be partially paid'))).exists), - setAmount: (amount) => cy.do(amountTextfield.fillIn(amount.toString())), + setAmount(amount) { + cy.do(amountTextfield.fillIn(amount.toString())); + cy.wait(500); + }, back: () => cy.do( confirmationModal .find(Button({ id: matching('clickable-confirmation-[0-9]+-cancel') })) diff --git a/cypress/support/fragments/users/userCharge.js b/cypress/support/fragments/users/userCharge.js index 85aeecfc89..6c12bdb178 100644 --- a/cypress/support/fragments/users/userCharge.js +++ b/cypress/support/fragments/users/userCharge.js @@ -9,13 +9,17 @@ export default { cy.expect(rootModal.exists()); }, fillRequiredFields: (ownerId, feeFineType, feeFineAmount) => { + cy.wait(500); cy.do(rootModal.find(Select({ id: 'ownerId' })).choose(ownerId)); + cy.wait(500); cy.do(rootModal.find(Select({ id: 'feeFineType' })).choose(feeFineType)); + cy.wait(500); if (!feeFineAmount) { cy.expect(rootModal.find(TextField('Fee/fine amount*')).has({ text: not('') })); } }, chargeOnly: () => { + cy.wait(500); cy.do(rootModal.find(Button({ id: 'chargeOnly' })).click()); UsersCard.waitLoading(); }, diff --git a/cypress/support/fragments/users/usersCard.js b/cypress/support/fragments/users/usersCard.js index 73088c952c..289ab619a3 100644 --- a/cypress/support/fragments/users/usersCard.js +++ b/cypress/support/fragments/users/usersCard.js @@ -469,8 +469,10 @@ export default { waitLoading: () => cy.expect(rootSection.exists()), startFeeFine: () => { + cy.wait(500); cy.do(actionsButton.click()); cy.do(Button('Create fee/fine').click()); + cy.wait(500); }, startRequest: () => {