diff --git a/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-instance-on-member.cy.js b/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-instance-on-member.cy.js index 95dd5a9f58..59dfadd523 100644 --- a/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-instance-on-member.cy.js +++ b/cypress/e2e/consortia/inventory/instance/limited-edit-permissions-for-shared-marc-instance-on-member.cy.js @@ -61,14 +61,12 @@ describe('Inventory', () => { 'C402335 (CONSORTIA) Verify limited Edit permissions for Shared MARC instance on Member tenant (consortia) (folijet)', { tags: ['criticalPathECS', 'folijet', 'C402335'] }, () => { - cy.intercept('POST', '/authn/refresh').as('/authn/refresh'); InventorySearchAndFilter.verifySearchAndFilterPane(); InventorySearchAndFilter.bySource(testData.instanceSource); cy.wait(1500); InventorySearchAndFilter.byShared('Yes'); cy.wait(1500); InventorySearchAndFilter.searchInstanceByTitle(testData.instanceId); - cy.wait('@/authn/refresh', { timeout: 5000 }); InventorySearchAndFilter.verifyInstanceDetailsView(); InstanceRecordView.verifyInstanceSource(testData.instanceSource); InstanceRecordView.verifyEditInstanceButtonAbsent(); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js index 89bdb611b0..01cef62829 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/matching-on-newly-created-035-does-not-work.cy.js @@ -113,7 +113,7 @@ describe('Data Import', () => { Permissions.moduleDataImportEnabled.gui, Permissions.settingsDataImportEnabled.gui, Permissions.inventoryAll.gui, - Permissions.uiInventorySingleRecordImport, + Permissions.uiInventorySingleRecordImport.gui, Permissions.uiQuickMarcQuickMarcBibliographicEditorView.gui, ]).then((userProperties) => { user = userProperties; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js index 9a52bbd5f6..6d460d6cc9 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/test-remove-field-mapping-option.cy.js @@ -465,6 +465,7 @@ describe('Data Import', () => { FileDetails.checkItemQuantityInSummaryTable(quantityOfItems, 1); TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); + ItemRecordView.closeDetailView(); InventorySearchAndFilter.searchInstanceByHRID(initialInstanceHrId); InventoryInstance.openHoldingView(); HoldingsRecordView.checkTemporaryLocation('-'); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js index 1c66a37762..42793b2b1b 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-holdings-via-static-value-submatch.cy.js @@ -393,9 +393,6 @@ describe('Data Import', () => { FileDetails.checkHoldingsQuantityInSummaryTable(quantityOfItems, 1); TopMenuNavigation.navigateToApp(APPLICATION_NAMES.INVENTORY); - InventorySearchAndFilter.selectYesfilterStaffSuppress(); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.openHoldingView(); HoldingsRecordView.checkFormerHoldingsId( holdingsMappingProfileForUpdate.formerHoldingsId, ); diff --git a/cypress/e2e/data-import/log-details/view-all-page-change-from-load-more-to-paginated.cy.js b/cypress/e2e/data-import/log-details/view-all-page-change-from-load-more-to-paginated.cy.js index 0f26ff6e3a..3cf91a4dd3 100644 --- a/cypress/e2e/data-import/log-details/view-all-page-change-from-load-more-to-paginated.cy.js +++ b/cypress/e2e/data-import/log-details/view-all-page-change-from-load-more-to-paginated.cy.js @@ -21,7 +21,7 @@ describe('Data Import', () => { ]).then((userProperties) => { user = userProperties; - for (let i = 0; i < 27; i++) { + for (let i = 0; i < 2; i++) { const fileName = `C353589 autotestFileName${getRandomPostfix()}.mrc`; DataImport.uploadFileViaApi( diff --git a/cypress/e2e/data-import/permissions/can-see-json-tab-for-imported-orders-with-data-import-can-upload-files-import-and-view-logs-permission.cy.js b/cypress/e2e/data-import/permissions/can-see-json-tab-for-imported-orders-with-data-import-can-upload-files-import-and-view-logs-permission.cy.js index 6808e58749..ecb56e7eeb 100644 --- a/cypress/e2e/data-import/permissions/can-see-json-tab-for-imported-orders-with-data-import-can-upload-files-import-and-view-logs-permission.cy.js +++ b/cypress/e2e/data-import/permissions/can-see-json-tab-for-imported-orders-with-data-import-can-upload-files-import-and-view-logs-permission.cy.js @@ -16,7 +16,6 @@ import NewJobProfile from '../../../support/fragments/data_import/job_profiles/n import FileDetails from '../../../support/fragments/data_import/logs/fileDetails'; import JsonScreenView from '../../../support/fragments/data_import/logs/jsonScreenView'; import Logs from '../../../support/fragments/data_import/logs/logs'; -import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import OrderLines from '../../../support/fragments/orders/orderLines'; import { ActionProfiles as SettingsActionProfiles, @@ -36,7 +35,6 @@ import getRandomPostfix from '../../../support/utils/stringTools'; describe('Data Import', () => { describe('Permissions', () => { let user; - let instanceId; const filePath = 'marcBibFileForC377023.mrc'; const marcFileName = `C377023 autotestFileName${getRandomPostfix()}.mrc`; const title = 'ROALD DAHL : TELLER OF THE UNEXPECTED : A BIOGRAPHY.'; @@ -135,7 +133,6 @@ describe('Data Import', () => { SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); - InventoryInstance.deleteInstanceViaApi(instanceId); }); }); @@ -151,7 +148,6 @@ describe('Data Import', () => { JsonScreenView.openOrderTab(); JsonScreenView.verifyContentInTab(message); TopMenuNavigation.navigateToApp(APPLICATION_NAMES.DATA_IMPORT); - FileDetails.close(); Logs.openFileDetails(marcFileName); FileDetails.openOrder(RECORD_STATUSES.CREATED); OrderLines.waitLoading(); diff --git a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js index 2873099caa..67fa408718 100644 --- a/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js +++ b/cypress/e2e/inventory/single-record-import/import-by-oclc-source-folio.cy.js @@ -79,7 +79,6 @@ describe('Inventory', () => { `Record ${oclcRecordData.oclc} updated. Results may take a few moments to become visible in Inventory`, ); cy.wait(15000); - cy.reload(); InventoryInstance.waitInstanceRecordViewOpened(oclcRecordData.title); InventoryInstance.verifyLastUpdatedDate(); InstanceRecordView.verifyInstanceSource(INSTANCE_SOURCE_NAMES.MARC); @@ -91,9 +90,12 @@ describe('Inventory', () => { date: oclcRecordData.publicationDate, }); InventoryInstance.verifyInstancePhysicalcyDescription(oclcRecordData.physicalDescription); + InventoryInstance.openIdentifiersAccordion(); InventoryInstance.verifyResourceIdentifier('ISBN', oclcRecordData.isbn1, 6); InventoryInstance.verifyResourceIdentifier('ISBN', oclcRecordData.isbn2, 7); + InventoryInstance.openSubjectAccordion(); InventoryInstance.verifyInstanceSubject(0, 0, oclcRecordData.subject); + InventoryInstance.openInstanceNotesAccordion(); InventoryInstance.checkInstanceNotes( oclcRecordData.notes.noteType, oclcRecordData.notes.noteContent, diff --git a/cypress/e2e/settings/data-import/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles-after-duplicating.cy.js b/cypress/e2e/settings/data-import/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles-after-duplicating.cy.js index 30231465dc..0a2258f4d7 100644 --- a/cypress/e2e/settings/data-import/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles-after-duplicating.cy.js +++ b/cypress/e2e/settings/data-import/no-duplicates-profiles-appears-in-job-profile-with-repeatable-profiles-after-duplicating.cy.js @@ -227,11 +227,13 @@ describe('Data Import', () => { cy.wait(2000); JobProfileView.duplicate(); NewJobProfile.fillProfileName(jobProfileNameForChanging); - cy.wait(7000); + cy.wait(3000); NewJobProfile.unlinkProfile(1); + cy.wait(3000); NewJobProfile.saveAndClose(); JobProfileView.verifyCalloutMessage(calloutMessage); JobProfileView.verifyJobProfileOpened(); + cy.wait(7000); JobProfileView.verifyJobProfileName(jobProfileNameForChanging); JobProfileView.verifyLinkedProfiles(linkedProfileNames, linkedProfileNames.length); }, diff --git a/cypress/support/fragments/data_import/job_profiles/jobProfiles.js b/cypress/support/fragments/data_import/job_profiles/jobProfiles.js index 7da43a6a12..a717312ec5 100644 --- a/cypress/support/fragments/data_import/job_profiles/jobProfiles.js +++ b/cypress/support/fragments/data_import/job_profiles/jobProfiles.js @@ -83,7 +83,7 @@ export default { selectJobProfile: () => { // need to wait until file upload - cy.wait(1000); + cy.wait(1500); cy.expect(paneResults.find(MultiColumnListRow({ index: 0 })).exists()); cy.do(paneResults.find(MultiColumnListRow({ index: 0 })).click()); cy.expect(waitSelector.exists()); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index d126a27178..746eda2eae 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -394,6 +394,7 @@ export default { }, openSubjectAccordion: () => cy.do(subjectAccordion.clickHeader()), + openIdentifiersAccordion: () => cy.do(identifiersAccordion.clickHeader()), openInstanceNotesAccordion: () => cy.do(Button({ id: 'accordion-toggle-button-instance-details-notes' }).click()), checkAuthorityAppIconInSection: (sectionId, value, isPresent) => { if (isPresent) { diff --git a/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js b/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js index 6fbffbbe22..cba01464b9 100644 --- a/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js +++ b/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js @@ -195,7 +195,10 @@ export default { cells.push(cellValue); }); }) - .then(() => cy.expect(ArrayUtils.checkIsSortedAlphabetically({ array: cells })).to.equal(true)); + .then(() => { + const isSorted = ArrayUtils.checkIsSortedAlphabetically({ array: cells }); + cy.expect(isSorted).to.equal(true); + }); }, ...ResultsPane, clickCreateNewFieldMappingProfile() { diff --git a/cypress/support/utils/arrays.js b/cypress/support/utils/arrays.js index 088aa6b4ae..1a9aee236c 100644 --- a/cypress/support/utils/arrays.js +++ b/cypress/support/utils/arrays.js @@ -32,19 +32,27 @@ export default { }, checkIsSortedAlphabetically({ array = [], accuracy = 1 } = {}) { - const result = array.reduce((acc, it) => { - if (acc.length) { - const prev = acc[acc.length - 1].value; - const current = it.toLowerCase(); - - return [...acc, { value: current, order: prev.localeCompare(current) }]; - } else { - return [{ value: it.toLowerCase(), order: 0 }]; + if (array.length === 0) return true; + + let outOfOrderCount = 0; + + for (let i = 1; i < array.length; i++) { + // Normalize strings for comparison: replace hyphens with spaces and trim + const prev = array[i - 1].trim().toLowerCase().replace(/-/g, ' ').replace(/\s+/g, ' '); + const current = array[i].trim().toLowerCase().replace(/-/g, ' ').replace(/\s+/g, ' '); + + // Compare adjacent elements + if (prev.localeCompare(current) > 0) { + outOfOrderCount++; + + // Early exit if the accuracy threshold is exceeded + if ((outOfOrderCount * 100) / array.length >= accuracy) { + return false; + } } - }, []); + } - const invalidOrder = result.filter(({ order }) => order > 0); - return (invalidOrder.length * 100) / array.length < accuracy; + return true; }, };