diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-locations-clear.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-locations-clear.cy.js index 9c187787bd..c1e9d7af17 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-locations-clear.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-locations-clear.cy.js @@ -77,8 +77,8 @@ describe('bulk-edit', () => { InventorySearchAndFilter.switchToItem(); InventorySearchAndFilter.searchByParameter('Barcode', item.itemBarcode); ItemRecordView.waitLoading(); - ItemRecordView.verifyPermanentLocation('-'); - ItemRecordView.verifyTemporaryLocation('-'); + ItemRecordView.verifyPermanentLocation('No value set-'); + ItemRecordView.verifyTemporaryLocation('No value set-'); }, ); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-updated-columns.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-updated-columns.cy.js index 4acc17c419..2c13d41672 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-updated-columns.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items-updated-columns.cy.js @@ -135,9 +135,8 @@ describe('bulk-edit', () => { ]); BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin); - // TODO: uncomment after MODBULKOPS-204 - // BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkOutNote); - // BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkOutNote); + BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkInNote); + BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkInNote); BulkEditSearchPane.verifyExactChangesUnderColumns('Note', `${notes.noteNote} (staff only)`); BulkEditSearchPane.verifyExactChangesUnderColumns('Status', 'Available'); BulkEditSearchPane.verifyExactChangesUnderColumns('Permanent loan type', 'Reading room'); @@ -148,8 +147,8 @@ describe('bulk-edit', () => { BulkEditActions.commitChanges(); BulkEditSearchPane.waitFileUploading(); BulkEditSearchPane.verifyExactChangesUnderColumns('Administrative note', notes.admin); - // BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkOutNote); - // BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkOutNote); + BulkEditSearchPane.verifyExactChangesUnderColumns('Check out note', notes.checkInNote); + BulkEditSearchPane.verifyExactChangesUnderColumns('Check in note', notes.checkInNote); BulkEditSearchPane.verifyExactChangesUnderColumns('Note', `${notes.noteNote} (staff only)`); BulkEditSearchPane.verifyExactChangesUnderColumns('Status', 'Available'); BulkEditSearchPane.verifyExactChangesUnderColumns('Permanent loan type', 'Reading room'); @@ -174,9 +173,9 @@ describe('bulk-edit', () => { ItemRecordView.checkItemNote(notes.noteNote); ItemRecordView.verifyItemStatus('Available'); ItemRecordView.verifyPermanentLoanType('Reading room'); - ItemRecordView.verifyTemporaryLoanType('-'); + ItemRecordView.verifyTemporaryLoanType('No value set-'); ItemRecordView.verifyPermanentLocation('Online'); - ItemRecordView.verifyTemporaryLocation('-'); + ItemRecordView.verifyTemporaryLocation('No value set-'); }, ); }); diff --git a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js index b91812eefe..18a7b73fb6 100644 --- a/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js +++ b/cypress/e2e/bulk-edit/in-app/bulk-edit-in-app-items.cy.js @@ -77,7 +77,7 @@ describe('bulk-edit', () => { // try to upload empty file BulkEditSearchPane.uploadFile('empty.csv'); - InteractorsTools.checkCalloutMessage('Fail to upload file', calloutTypes.error); + InteractorsTools.checkCalloutMessage('The uploaded file is empty.', calloutTypes.error); InteractorsTools.closeCalloutMessage(); const invalidFileWarning = 'Invalid file'; diff --git a/cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-creating.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-creating.cy.js new file mode 100644 index 0000000000..0d344b35cc --- /dev/null +++ b/cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-creating.cy.js @@ -0,0 +1,145 @@ +import { + ACCEPTED_DATA_TYPE_NAMES, + FOLIO_RECORD_TYPE, + JOB_STATUS_NAMES, +} from '../../../support/constants'; +import { Permissions } from '../../../support/dictionary'; +import ActionProfiles from '../../../support/fragments/data_import/action_profiles/actionProfiles'; +import DataImport from '../../../support/fragments/data_import/dataImport'; +import JobProfiles from '../../../support/fragments/data_import/job_profiles/jobProfiles'; +import NewJobProfile from '../../../support/fragments/data_import/job_profiles/newJobProfile'; +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 InstanceRecordEdit from '../../../support/fragments/inventory/instanceRecordEdit'; +import InstanceRecordView from '../../../support/fragments/inventory/instanceRecordView'; +import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; +import { + ActionProfiles as SettingsActionProfiles, + FieldMappingProfiles as SettingsFieldMappingProfiles, + JobProfiles as SettingsJobProfiles, +} from '../../../support/fragments/settings/dataImport'; +import FieldMappingProfileView from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfileView'; +import FieldMappingProfiles from '../../../support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles'; +import NewFieldMappingProfile from '../../../support/fragments/settings/dataImport/fieldMappingProfile/newFieldMappingProfile'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; + +describe('Data Import', () => { + describe('Importing MARC Bib files', () => { + let user; + let instanceHrid; + const checked = true; + const instanceTitle = + "101 things I wish I'd known when I started using hypnosis / Dabney Ewin."; + const filePathToUpload = 'marcBibFileForC11087.mrc'; + const marcFileName = `C11087 autotestFile${getRandomPostfix()}.mrc`; + const mappingProfile = { + name: `C11087 autotestMappingProfile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + suppressFromDiscavery: 'Mark for all affected records', + staffSuppress: 'Unmark for all affected records', + previouslyHeld: 'Keep the existing value for all affected records', + }; + const actionProfile = { + name: `C11087 autotestActionProfile_${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + }; + const jobProfile = { + profileName: `C11087 autotestJobProfile_${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, + }; + + before('Create test data', () => { + cy.loginAsAdmin({ + path: SettingsMenu.mappingProfilePath, + waiter: FieldMappingProfiles.waitLoading, + }); + // create profiles + FieldMappingProfiles.openNewMappingProfileForm(); + NewFieldMappingProfile.fillSummaryInMappingProfile(mappingProfile); + NewFieldMappingProfile.addStaffSuppress(mappingProfile.staffSuppress); + NewFieldMappingProfile.addSuppressFromDiscovery(mappingProfile.suppressFromDiscavery); + NewFieldMappingProfile.addPreviouslyHeld(mappingProfile.previouslyHeld); + NewFieldMappingProfile.save(); + FieldMappingProfileView.closeViewMode(mappingProfile.name); + FieldMappingProfiles.checkMappingProfilePresented(mappingProfile.name); + + cy.visit(SettingsMenu.actionProfilePath); + ActionProfiles.create(actionProfile, mappingProfile.name); + ActionProfiles.checkActionProfilePresented(actionProfile.name); + + cy.visit(SettingsMenu.jobProfilePath); + JobProfiles.createJobProfile(jobProfile); + NewJobProfile.linkActionProfile(actionProfile); + NewJobProfile.saveAndClose(); + JobProfiles.checkJobProfilePresented(jobProfile.profileName); + + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.settingsDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.enableStaffSuppressFacet.gui, + ]).then((userProperties) => { + user = userProperties; + + cy.login(user.username, user.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading, + }); + }); + }); + + after('Delete test data', () => { + cy.getAdminToken().then(() => { + Users.deleteViaApi(user.userId); + SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); + SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); + SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }).then( + (instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }, + ); + }); + }); + + it( + 'C11087 Instance field mapping: Confirm the "suppress" checkboxes when creating (folijet) (TaaS)', + { tags: ['extendedPath', 'folijet'] }, + () => { + // upload a marc file + DataImport.verifyUploadState(); + DataImport.uploadFile(filePathToUpload, marcFileName); + JobProfiles.waitFileIsUploaded(); + JobProfiles.search(jobProfile.profileName); + JobProfiles.runImportFile(); + Logs.waitFileIsImported(marcFileName); + Logs.checkJobStatus(marcFileName, JOB_STATUS_NAMES.COMPLETED); + Logs.openFileDetails(marcFileName); + FileDetails.verifyLogDetailsPageIsOpened(marcFileName); + FileDetails.openJsonScreen(instanceTitle); + JsonScreenView.verifyJsonScreenIsOpened(); + JsonScreenView.openMarcSrsTab(); + JsonScreenView.getInstanceHrid().then((initialInstanceHrId) => { + instanceHrid = initialInstanceHrId; + + cy.visit(TopMenu.inventoryPath); + InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); + InstanceRecordView.verifyInstancePaneExists(); + InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); + InstanceRecordView.verifyNotMarkAsStaffSuppressed(); + InstanceRecordView.verifyNotMarkAsPreviouslyHeld(); + InstanceRecordView.edit(); + InstanceRecordEdit.waitLoading(); + InstanceRecordEdit.verifyDiscoverySuppressCheckbox(checked); + InstanceRecordEdit.verifyStaffSuppressCheckbox(); + InstanceRecordEdit.verifyPreviouslyHeldCheckbox(); + }); + }, + ); + }); +}); diff --git a/cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-creating-updating.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-updating.cy.js similarity index 69% rename from cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-creating-updating.cy.js rename to cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-updating.cy.js index eb0c6f8491..9ae0bfb698 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-creating-updating.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/instance-field-mapping-confirm-suppress-checkboxes-when-updating.cy.js @@ -38,38 +38,59 @@ import getRandomPostfix from '../../../support/utils/stringTools'; describe('Data Import', () => { describe('Importing MARC Bib files', () => { let user; - const instanceHrids = []; + let instanceHrid; const checked = true; const instanceTitle = "101 things I wish I'd known when I started using hypnosis / Dabney Ewin."; const filePathToUpload = 'marcBibFileForC11087.mrc'; const mappingProfile = { - name: `autotestMappingProfile_${getRandomPostfix()}`, + name: `C11088 autotestMappingProfile_${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE, suppressFromDiscavery: 'Mark for all affected records', staffSuppress: 'Unmark for all affected records', previouslyHeld: 'Keep the existing value for all affected records', }; const actionProfile = { - name: `autotestActionProfile_${getRandomPostfix()}`, + name: `C11088 autotestActionProfile_${getRandomPostfix()}`, typeValue: FOLIO_RECORD_TYPE.INSTANCE, }; const jobProfile = { - profileName: `autotestJobProfile_${getRandomPostfix()}`, + profileName: `C11088 autotestJobProfile_${getRandomPostfix()}`, acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, }; + const marcFileName = `C11088 autotestFile${getRandomPostfix()}.mrc`; + const editedFileName = `C11088 editedAutotestFile_${getRandomPostfix()}.mrc`; + const fileNameForUpdate = `C11088 autotestFile_${getRandomPostfix()}.mrc`; + const mappingProfileUpdate = { + name: `C11088 autotest update MappingProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + suppressFromDiscavery: 'Unmark for all affected records', + staffSuppress: 'Keep the existing value for all affected records', + previouslyHeld: 'Mark for all affected records', + }; - before('Create test data', () => { - cy.getAdminToken(); - cy.createTempUser([ - Permissions.moduleDataImportEnabled.gui, - Permissions.settingsDataImportEnabled.gui, - Permissions.inventoryAll.gui, - Permissions.enableStaffSuppressFacet.gui, - ]).then((userProperties) => { - user = userProperties; - }); + const actionProfileUpdate = { + name: `C11088 autotest update ActionProf${getRandomPostfix()}`, + typeValue: FOLIO_RECORD_TYPE.INSTANCE, + action: ACTION_NAMES_IN_ACTION_PROFILE.UPDATE, + }; + + const matchProfile = { + profileName: `C11088 autotest MatchProf${getRandomPostfix()}`, + incomingRecordFields: { + field: '001', + }, + matchCriterion: 'Exactly matches', + existingRecordType: EXISTING_RECORD_NAMES.INSTANCE, + instanceOption: NewMatchProfile.optionsList.instanceHrid, + }; + + const jobProfileUpdate = { + profileName: `C11088 autotest update JobProf${getRandomPostfix()}`, + acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, + }; + before('Create test data', () => { cy.loginAsAdmin({ path: SettingsMenu.mappingProfilePath, waiter: FieldMappingProfiles.waitLoading, @@ -93,105 +114,45 @@ describe('Data Import', () => { NewJobProfile.linkActionProfile(actionProfile); NewJobProfile.saveAndClose(); JobProfiles.checkJobProfilePresented(jobProfile.profileName); - }); - beforeEach('Login', () => { - cy.login(user.username, user.password, { - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading, + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.settingsDataImportEnabled.gui, + Permissions.inventoryAll.gui, + Permissions.enableStaffSuppressFacet.gui, + ]).then((userProperties) => { + user = userProperties; + + cy.login(user.username, user.password, { + path: TopMenu.dataImportPath, + waiter: DataImport.waitLoading, + }); }); }); after('Delete test data', () => { + FileManager.deleteFile(`cypress/fixtures/${editedFileName}`); cy.getAdminToken().then(() => { Users.deleteViaApi(user.userId); SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfile.profileName); SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfile.name); SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfile.name); - cy.wrap(instanceHrids).each((hrid) => { - cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${hrid}"` }).then( - (instance) => { - InventoryInstance.deleteInstanceViaApi(instance.id); - }, - ); - }); + SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfileUpdate.profileName); + SettingsMatchProfiles.deleteMatchProfileByNameViaApi(matchProfile.profileName); + SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfileUpdate.name); + SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfileUpdate.name); + cy.getInstance({ limit: 1, expandAll: true, query: `"hrid"=="${instanceHrid}"` }).then( + (instance) => { + InventoryInstance.deleteInstanceViaApi(instance.id); + }, + ); }); }); - it( - 'C11087 Instance field mapping: Confirm the "suppress" checkboxes when creating (folijet) (TaaS)', - { tags: ['extendedPath', 'folijet'] }, - () => { - const marcFileName = `C11087 autotestFile${getRandomPostfix()}.mrc`; - - // upload a marc file - DataImport.verifyUploadState(); - DataImport.uploadFile(filePathToUpload, marcFileName); - JobProfiles.waitFileIsUploaded(); - JobProfiles.search(jobProfile.profileName); - JobProfiles.runImportFile(); - Logs.waitFileIsImported(marcFileName); - Logs.checkJobStatus(marcFileName, JOB_STATUS_NAMES.COMPLETED); - Logs.openFileDetails(marcFileName); - FileDetails.verifyLogDetailsPageIsOpened(marcFileName); - FileDetails.openJsonScreen(instanceTitle); - JsonScreenView.verifyJsonScreenIsOpened(); - JsonScreenView.openMarcSrsTab(); - JsonScreenView.getInstanceHrid().then((initialInstanceHrId) => { - const instanceHrid = initialInstanceHrId; - instanceHrids.push(instanceHrid); - - cy.visit(TopMenu.inventoryPath); - InventorySearchAndFilter.searchInstanceByHRID(instanceHrid); - InstanceRecordView.verifyInstancePaneExists(); - InstanceRecordView.verifyMarkAsSuppressedFromDiscovery(); - InstanceRecordView.verifyNotMarkAsStaffSuppressed(); - InstanceRecordView.verifyNotMarkAsPreviouslyHeld(); - InstanceRecordView.edit(); - InstanceRecordEdit.waitLoading(); - InstanceRecordEdit.verifyDiscoverySuppressCheckbox(checked); - InstanceRecordEdit.verifyStaffSuppressCheckbox(); - InstanceRecordEdit.verifyPreviouslyHeldCheckbox(); - }); - }, - ); - it( 'C11088 Instance field mapping: Confirm the "suppress" checkboxes when updating (folijet) (TaaS)', { tags: ['extendedPath', 'folijet'] }, () => { - const marcFileName = `C11088 autotestFile${getRandomPostfix()}.mrc`; - const editedFileName = `C11088 editedAutotestFile_${getRandomPostfix()}.mrc`; - const fileNameForUpdate = `C11088 autotestFile_${getRandomPostfix()}.mrc`; - const mappingProfileUpdate = { - name: `C11088 autotest update MappingProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - suppressFromDiscavery: 'Unmark for all affected records', - staffSuppress: 'Keep the existing value for all affected records', - previouslyHeld: 'Mark for all affected records', - }; - - const actionProfileUpdate = { - name: `C11088 autotest update ActionProf${getRandomPostfix()}`, - typeValue: FOLIO_RECORD_TYPE.INSTANCE, - action: ACTION_NAMES_IN_ACTION_PROFILE.UPDATE, - }; - - const matchProfile = { - profileName: `C11088 autotest MatchProf${getRandomPostfix()}`, - incomingRecordFields: { - field: '001', - }, - matchCriterion: 'Exactly matches', - existingRecordType: EXISTING_RECORD_NAMES.INSTANCE, - instanceOption: NewMatchProfile.optionsList.instanceHrid, - }; - - const jobProfileUpdate = { - profileName: `C11088 autotest update JobProf${getRandomPostfix()}`, - acceptedType: ACCEPTED_DATA_TYPE_NAMES.MARC, - }; - // upload a marc file DataImport.verifyUploadState(); DataImport.uploadFile(filePathToUpload, marcFileName); @@ -204,8 +165,7 @@ describe('Data Import', () => { FileDetails.openInstanceInInventory(RECORD_STATUSES.CREATED); InstanceRecordView.verifyInstancePaneExists(); InventoryInstance.getAssignedHRID().then((initialInstanceHrId) => { - const instanceHrid = initialInstanceHrId; - instanceHrids.push(instanceHrid); + instanceHrid = initialInstanceHrId; DataImport.editMarcFile(filePathToUpload, editedFileName, ['303845'], [instanceHrid]); InstanceRecordView.edit(); @@ -257,9 +217,9 @@ describe('Data Import', () => { FileDetails.openJsonScreen(instanceTitle); JsonScreenView.verifyJsonScreenIsOpened(); JsonScreenView.openMarcSrsTab(); - JsonScreenView.getInstanceHrid().then((instanceHrid) => { - const hrid = instanceHrid; + JsonScreenView.getInstanceHrid().then((initialHrid) => { + const hrid = initialHrid; cy.visit(TopMenu.inventoryPath); InventorySearchAndFilter.selectYesfilterStaffSuppress(); InventorySearchAndFilter.searchInstanceByHRID(hrid); @@ -272,13 +232,6 @@ describe('Data Import', () => { InstanceRecordEdit.verifyStaffSuppressCheckbox(checked); InstanceRecordEdit.verifyPreviouslyHeldCheckbox(checked); }); - - // delete profiles - SettingsJobProfiles.deleteJobProfileByNameViaApi(jobProfileUpdate.profileName); - SettingsMatchProfiles.deleteMatchProfileByNameViaApi(matchProfile.profileName); - SettingsActionProfiles.deleteActionProfileByNameViaApi(actionProfileUpdate.name); - SettingsFieldMappingProfiles.deleteMappingProfileByNameViaApi(mappingProfileUpdate.name); - FileManager.deleteFile(`cypress/fixtures/${editedFileName}`); }, ); }); 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 17b00072ed..f9b3f6c4c8 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,9 +465,9 @@ describe('Data Import', () => { .permanentLocationInHoldingsAccordion, ); InventoryInstance.openItemByBarcode(itemBarcode); - ItemRecordView.checkAccessionNumber('-'); - ItemRecordView.verifyNumberOfPieces('-'); - ItemRecordView.verifyTemporaryLoanType('-'); + ItemRecordView.checkAccessionNumber('No value set-'); + ItemRecordView.verifyNumberOfPieces('No value set-'); + ItemRecordView.verifyTemporaryLoanType('No value set-'); }); }); }, diff --git a/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js b/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js index b501e63941..2c002cfd2c 100644 --- a/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js +++ b/cypress/e2e/data-import/importing-marc-bib-files/update-linked-marc-bib-record-with-multiple-$0.cy.js @@ -112,14 +112,14 @@ describe('Data Import', () => { const marcFiles = [ { marc: 'marcBibFileForC377006.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `C377006 testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, numOfRecords: 1, propertyName: 'instance', }, { marc: 'marcAuthFileForC377006.mrc', - fileName: `testMarcFile.${getRandomPostfix()}.mrc`, + fileName: `C377006 testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, numOfRecords: 2, propertyName: 'authority', @@ -141,9 +141,78 @@ describe('Data Import', () => { const createdAuthorityIDs = []; before('Creating user and test data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C377006*'); + cy.createTempUser([ + Permissions.moduleDataImportEnabled.gui, + Permissions.settingsDataImportEnabled.gui, + ]) + .then((createdUserProperties) => { + testData.preconditionUserId = createdUserProperties.userId; + + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C377006*'); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdAuthorityIDs.push(record[marcFile.propertyName].id); + }); + }); + cy.wait(2000); + }); + + // create Match profile + NewMatchProfile.createMatchProfileWithIncomingAndExistingRecordsViaApi(matchProfile) + .then((matchProfileResponse) => { + matchProfile.id = matchProfileResponse.body.id; + }) + .then(() => { + // create Field mapping profile + NewFieldMappingProfile.createMappingProfileForUpdateMarcBibViaApi( + mappingProfile, + ).then((mappingProfileResponse) => { + mappingProfile.id = mappingProfileResponse.body.id; + }); + }) + .then(() => { + // create Action profile and link it to Field mapping profile + NewActionProfile.createActionProfileViaApi(actionProfile, mappingProfile.id).then( + (actionProfileResponse) => { + actionProfile.id = actionProfileResponse.body.id; + }, + ); + }) + .then(() => { + // create Job profile + NewJobProfile.createJobProfileWithLinkedMatchAndActionProfilesViaApi( + jobProfile.profileName, + matchProfile.id, + actionProfile.id, + ); + }); + }) + .then(() => { + cy.loginAsAdmin(); + cy.visit(TopMenu.inventoryPath); + InventoryInstances.searchByTitle(createdAuthorityIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + linkingTagAndValues.forEach((fields) => { + QuickMarcEditor.clickLinkIconInTagField(fields.rowIndex); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(fields.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex); + }); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); + QuickMarcEditor.checkAfterSaveAndClose(); + }); cy.createTempUser([ Permissions.moduleDataImportEnabled.gui, @@ -156,81 +225,18 @@ describe('Data Import', () => { Permissions.dataExportViewAddUpdateProfiles.gui, ]).then((createdUserProperties) => { testData.userProperties = createdUserProperties; - cy.loginAsAdmin() - .then(() => { - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdAuthorityIDs.push(record[marcFile.propertyName].id); - }); - }); - }); - }) - .then(() => { - cy.visit(TopMenu.inventoryPath); - InventoryInstances.searchByTitle(createdAuthorityIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - linkingTagAndValues.forEach((fields) => { - QuickMarcEditor.clickLinkIconInTagField(fields.rowIndex); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(fields.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingUsingRowIndex(fields.tag, fields.rowIndex); - }); - QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); - QuickMarcEditor.checkAfterSaveAndClose(); - }); - }); - // create Match profile - NewMatchProfile.createMatchProfileWithIncomingAndExistingRecordsViaApi(matchProfile) - .then((matchProfileResponse) => { - matchProfile.id = matchProfileResponse.body.id; - }) - .then(() => { - // create Field mapping profile - NewFieldMappingProfile.createMappingProfileForUpdateMarcBibViaApi(mappingProfile).then( - (mappingProfileResponse) => { - mappingProfile.id = mappingProfileResponse.body.id; - }, - ); - }) - .then(() => { - // create Action profile and link it to Field mapping profile - NewActionProfile.createActionProfileViaApi(actionProfile, mappingProfile.id).then( - (actionProfileResponse) => { - actionProfile.id = actionProfileResponse.body.id; - }, - ); - }) - .then(() => { - // create Job profile - NewJobProfile.createJobProfileWithLinkedMatchAndActionProfilesViaApi( - jobProfile.profileName, - matchProfile.id, - actionProfile.id, - ); - }) - .then(() => { - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, }); + }); }); after('Delete user and test data', () => { cy.getAdminToken(); Users.deleteViaApi(testData.userProperties.userId); + Users.deleteViaApi(testData.preconditionUserId); if (createdAuthorityIDs[0]) InventoryInstance.deleteInstanceViaApi(createdAuthorityIDs[0]); createdAuthorityIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); diff --git a/cypress/e2e/eholdings/package/eholdings-packages-remove-tags.cy.js b/cypress/e2e/eholdings/package/eholdings-packages-remove-tags.cy.js new file mode 100644 index 0000000000..eac1e897d2 --- /dev/null +++ b/cypress/e2e/eholdings/package/eholdings-packages-remove-tags.cy.js @@ -0,0 +1,65 @@ +import { Permissions } from '../../../support/dictionary'; +import EHoldingsPackage from '../../../support/fragments/eholdings/eHoldingsPackage'; +import EHoldingsPackages from '../../../support/fragments/eholdings/eHoldingsPackages'; +import EHoldingsPackagesSearch from '../../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import EHoldingSearch from '../../../support/fragments/eholdings/eHoldingsSearch'; +import EHoldingsTitlesSearch from '../../../support/fragments/eholdings/eHoldingsTitlesSearch'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; + +describe('eHoldings', () => { + describe('Package', () => { + let user; + let testPackage; + before(() => { + cy.getAdminToken(); + EHoldingsPackages.createPackageViaAPI(EHoldingsPackages.getdefaultPackage()) + .then((newPackage) => { + testPackage = newPackage; + }) + .then(() => { + cy.createTempUser([ + Permissions.uieHoldingsRecordsEdit.gui, + Permissions.uiTagsPermissionAll.gui, + Permissions.uieHoldingsTitlesPackagesCreateDelete.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.eholdingsPath, + waiter: EHoldingsTitlesSearch.waitLoading, + }); + }); + }); + }); + + after(() => { + cy.getAdminToken(); + EHoldingsPackages.deletePackageViaAPI(testPackage.data.attributes.name); + Users.deleteViaApi(user.userId); + }); + + it( + 'C756 Remove a tag from a package record (spitfire)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + let addedTag; + EHoldingSearch.switchToPackages(); + EHoldingsPackagesSearch.byName(testPackage.data.attributes.name); + EHoldingsPackages.openPackage() + .then(() => { + addedTag = EHoldingsPackage.addTag(); + }) + .then(() => { + cy.wait(500); // wait for tag adding is reflected in database + EHoldingsPackage.closePackage(); + EHoldingsPackagesSearch.byTag(addedTag); + EHoldingsPackages.openPackage(); + EHoldingsPackage.verifyExistingTags(addedTag); + EHoldingsPackage.removeExistingTags(); + EHoldingsPackage.closePackage(); + EHoldingsPackagesSearch.verifyTagAbsent(addedTag); + }); + }, + ); + }); +}); diff --git a/cypress/e2e/eholdings/package/eholdings-packages.cy.js b/cypress/e2e/eholdings/package/eholdings-packages.cy.js index 2e2d798535..32e143f30f 100644 --- a/cypress/e2e/eholdings/package/eholdings-packages.cy.js +++ b/cypress/e2e/eholdings/package/eholdings-packages.cy.js @@ -21,38 +21,6 @@ describe('eHoldings', () => { Users.deleteViaApi(userId); }); - it( - 'C688 Add all titles in a package to your holdings (spitfire)', - { tags: ['smoke', 'spitfire'] }, - () => { - cy.createTempUser([ - Permissions.uieHoldingsRecordsEdit.gui, - Permissions.uieHoldingsPackageTitleSelectUnselect.gui, - Permissions.moduleeHoldingsEnabled.gui, - ]).then((userProperties) => { - userId = userProperties.userId; - - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.eholdingsPath, - waiter: EHoldingsTitlesSearch.waitLoading, - }); - EHoldingSearch.switchToPackages(); - EHoldingsPackagesSearch.byName('Examstutor'); - EHoldingsPackages.openPackage(); - cy.wait(3000); - EHoldingsPackage.addToHoldings(); - cy.wait(3000); - EHoldingsPackage.verifyHoldingStatus(); - cy.wait(3000); - EHoldingsPackage.filterTitles(); - EHoldingsPackage.checkEmptyTitlesList(); - // reset test data - EHoldingsPackage.removeFromHoldings(); - cy.wait(5000); - }); - }, - ); - it( 'C3463 Add two tags to package [Edinburgh Scholarship Online] (spitfire)', { tags: ['smoke', 'spitfire', 'shiftLeft'] }, @@ -176,38 +144,6 @@ describe('eHoldings', () => { EHoldingsPackages.deletePackageViaAPI(defaultPackage.data.attributes.name); }); - it( - 'C756 Remove a tag from a package record (spitfire)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - cy.createTempUser([ - Permissions.uieHoldingsRecordsEdit.gui, - Permissions.uiTagsPermissionAll.gui, - Permissions.uieHoldingsTitlesPackagesCreateDelete.gui, - ]).then((userProperties) => { - userId = userProperties.userId; - cy.login(userProperties.username, userProperties.password, { - path: TopMenu.eholdingsPath, - waiter: EHoldingsTitlesSearch.waitLoading, - }); - EHoldingSearch.switchToPackages(); - EHoldingsPackagesSearch.byName(); - EHoldingsPackages.openPackage().then(() => { - // existing test data clearing - EHoldingsPackage.removeExistingTags(); - const addedTag = EHoldingsPackage.addTag(); - EHoldingsPackage.closePackage(); - EHoldingsPackagesSearch.byTag(addedTag); - EHoldingsPackages.openPackage(); - EHoldingsPackage.verifyExistingTags(addedTag); - EHoldingsPackage.removeExistingTags(); - cy.reload(); - EHoldingsPackage.verifyExistingTags(); - }); - }); - }, - ); - it( 'C699 Add or edit package custom coverage (spitfire)', { tags: ['extendedPath', 'spitfire'] }, diff --git a/cypress/e2e/eholdings/package/eholdins-packages-addtitles-to-holdings.cy.js b/cypress/e2e/eholdings/package/eholdins-packages-addtitles-to-holdings.cy.js new file mode 100644 index 0000000000..ae495f4a58 --- /dev/null +++ b/cypress/e2e/eholdings/package/eholdins-packages-addtitles-to-holdings.cy.js @@ -0,0 +1,58 @@ +import { Permissions } from '../../../support/dictionary'; +import EHoldingsPackage from '../../../support/fragments/eholdings/eHoldingsPackage'; +import EHoldingsPackages from '../../../support/fragments/eholdings/eHoldingsPackages'; +import EHoldingsPackagesSearch from '../../../support/fragments/eholdings/eHoldingsPackagesSearch'; +import EHoldingSearch from '../../../support/fragments/eholdings/eHoldingsSearch'; +import EHoldingsTitlesSearch from '../../../support/fragments/eholdings/eHoldingsTitlesSearch'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; + +describe('eHoldings', () => { + describe('Package', () => { + let user; + const testData = { + packageName: 'Examstutor', + }; + + beforeEach(() => { + cy.createTempUser([ + Permissions.uieHoldingsRecordsEdit.gui, + Permissions.uieHoldingsPackageTitleSelectUnselect.gui, + Permissions.moduleeHoldingsEnabled.gui, + ]).then((userProperties) => { + user = userProperties; + cy.getUserToken(userProperties.username, userProperties.password); + EHoldingsPackages.unassignPackageViaAPI(testData.packageName); + }); + }); + + afterEach(() => { + cy.getAdminToken(); + Users.deleteViaApi(user.userId); + }); + + it( + 'C688 Add all titles in a package to your holdings (spitfire)', + { tags: ['smoke', 'spitfire'] }, + () => { + cy.login(user.username, user.password, { + path: TopMenu.eholdingsPath, + waiter: EHoldingsTitlesSearch.waitLoading, + }); + EHoldingSearch.switchToPackages(); + EHoldingsPackagesSearch.byName(testData.packageName); + EHoldingsPackages.openPackage(); + cy.wait(3000); + EHoldingsPackage.addToHoldings(); + cy.wait(3000); + EHoldingsPackage.verifyHoldingStatus(); + cy.wait(3000); + EHoldingsPackage.filterTitles(); + EHoldingsPackage.checkEmptyTitlesList(); + // reset test data + EHoldingsPackage.removeFromHoldings(); + cy.wait(5000); + }, + ); + }); +}); diff --git a/cypress/e2e/export-manager/check-view-jobs.cy.js b/cypress/e2e/export-manager/check-view-jobs.cy.js index ee066170ac..458c08945c 100644 --- a/cypress/e2e/export-manager/check-view-jobs.cy.js +++ b/cypress/e2e/export-manager/check-view-jobs.cy.js @@ -12,161 +12,165 @@ import Users from '../../support/fragments/users/users'; import DateTools from '../../support/utils/dateTools'; import getRandomPostfix from '../../support/utils/stringTools'; -describe('orders: export', () => { - const order = { - ...NewOrder.defaultOneTimeOrder, - orderType: 'Ongoing', - ongoing: { isSubscription: false, manualRenewal: false }, - approved: true, - }; - const organization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout2', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const firstIntegrationName = `FirstIntegrationName${getRandomPostfix()}`; - const secondIntegrationName = `SecondIntegrationName${getRandomPostfix()}`; - const integartionDescription1 = 'Test Integation descripton1'; - const integartionDescription2 = 'Test Integation descripton2'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); - const vendorEDICodeFor2Integration = getRandomPostfix(); - const libraryEDICodeFor2Integration = getRandomPostfix(); - const UTCTime = DateTools.getUTCDateForScheduling(); - let user; - let location; - let servicePointId; - let orderNumber; +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const order = { + ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true, + }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout2', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const firstIntegrationName = `FirstIntegrationName${getRandomPostfix()}`; + const secondIntegrationName = `SecondIntegrationName${getRandomPostfix()}`; + const integartionDescription1 = 'Test Integation descripton1'; + const integartionDescription2 = 'Test Integation descripton2'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + const vendorEDICodeFor2Integration = getRandomPostfix(); + const libraryEDICodeFor2Integration = getRandomPostfix(); + const UTCTime = DateTools.getUTCDateForScheduling(); + let user; + let location; + let servicePointId; + let orderNumber; - before(() => { - cy.getAdminToken(); + before(() => { + cy.getAdminToken(); - ServicePoints.getViaApi().then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { - location = res; - }); - }); - Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { - organization.id = organizationsResponse; - order.vendor = organizationsResponse; - }); - cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); - Organizations.searchByParameters('Name', organization.name); - Organizations.checkSearchResults(organization); - Organizations.selectOrganization(organization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformation( - firstIntegrationName, - integartionDescription1, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - organization.accounts[0].accountNo, - 'Purchase', - UTCTime, - ); - Organizations.addIntegration(); - cy.wait(2000); - Organizations.fillIntegrationInformation( - secondIntegrationName, - integartionDescription2, - vendorEDICodeFor2Integration, - libraryEDICodeFor2Integration, - organization.accounts[1].accountNo, - 'Purchase At Vendor System', - UTCTime, - ); + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { + location = res; + }); + }); + Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { + organization.id = organizationsResponse; + order.vendor = organizationsResponse; + }); + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformation( + firstIntegrationName, + integartionDescription1, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + organization.accounts[0].accountNo, + 'Purchase', + UTCTime, + ); + Organizations.addIntegration(); + cy.wait(2000); + Organizations.fillIntegrationInformation( + secondIntegrationName, + integartionDescription2, + vendorEDICodeFor2Integration, + libraryEDICodeFor2Integration, + organization.accounts[1].accountNo, + 'Purchase At Vendor System', + UTCTime, + ); - cy.createOrderApi(order).then((response) => { - orderNumber = response.body.poNumber; - }); - // Need to wait while first job will be runing - cy.wait(60000); - cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrganizationsViewEditCreate.gui, - permissions.uiOrganizationsView.gui, - permissions.uiExportOrders.gui, - permissions.exportManagerAll.gui, - permissions.exportManagerDownloadAndResendFiles.gui, - ]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.ordersPath, - waiter: Orders.waitLoading, + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + }); + // Need to wait while first job will be runing + cy.wait(60000); + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrganizationsViewEditCreate.gui, + permissions.uiOrganizationsView.gui, + permissions.uiExportOrders.gui, + permissions.exportManagerAll.gui, + permissions.exportManagerDownloadAndResendFiles.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + }); }); - }); - }); - after(() => { - cy.loginAsAdmin({ path: TopMenu.ordersPath, waiter: Orders.waitLoading }); - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - Orders.unOpenOrder(); - // Need to wait until the order is opened before deleting it - cy.wait(2000); - Orders.deleteOrderViaApi(order.id); + after(() => { + cy.loginAsAdmin({ path: TopMenu.ordersPath, waiter: Orders.waitLoading }); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + Orders.unOpenOrder(); + // Need to wait until the order is opened before deleting it + cy.wait(2000); + Orders.deleteOrderViaApi(order.id); - Organizations.deleteOrganizationViaApi(organization.id); - NewLocation.deleteInstitutionCampusLibraryLocationViaApi( - location.institutionId, - location.campusId, - location.libraryId, - location.id, - ); - Users.deleteViaApi(user.userId); - }); + Organizations.deleteOrganizationViaApi(organization.id); + NewLocation.deleteInstitutionCampusLibraryLocationViaApi( + location.institutionId, + location.campusId, + location.libraryId, + location.id, + ); + Users.deleteViaApi(user.userId); + }); - it( - 'C347885: Check view for jobs on Export Manager page (thunderjet)', - { tags: ['smoke', 'thunderjet'] }, - () => { - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 5); - OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); - OrderLines.backToEditingOrder(); - Orders.openOrder(); - cy.visit(TopMenu.exportManagerOrganizationsPath); - ExportManagerSearchPane.selectOrganizationsSearch(); - ExportManagerSearchPane.searchByFailed(); - ExportManagerSearchPane.selectJobByIntegrationInList(firstIntegrationName); - ExportManagerSearchPane.verifyThirdPaneExportJobExist(); - ExportManagerSearchPane.rerunJob(); - ExportManagerSearchPane.closeExportJobPane(); - ExportManagerSearchPane.resetAll(); - cy.reload(); - ExportManagerSearchPane.searchBySuccessful(); - ExportManagerSearchPane.selectJobByIntegrationInList(firstIntegrationName); - ExportManagerSearchPane.verifyThirdPaneExportJobExist(); - }, - ); + it( + 'C347885: Check view for jobs on Export Manager page (thunderjet)', + { tags: ['smoke', 'thunderjet'] }, + () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 5); + OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.exportManagerOrganizationsPath); + ExportManagerSearchPane.selectOrganizationsSearch(); + ExportManagerSearchPane.searchByFailed(); + ExportManagerSearchPane.selectJobByIntegrationInList(firstIntegrationName); + ExportManagerSearchPane.verifyThirdPaneExportJobExist(); + ExportManagerSearchPane.rerunJob(); + ExportManagerSearchPane.closeExportJobPane(); + ExportManagerSearchPane.resetAll(); + cy.reload(); + ExportManagerSearchPane.searchBySuccessful(); + ExportManagerSearchPane.selectJobByIntegrationInList(firstIntegrationName); + ExportManagerSearchPane.verifyThirdPaneExportJobExist(); + }, + ); + }); + }); }); diff --git a/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js b/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js index 7dfe1a3a7d..a05d9379a6 100644 --- a/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js +++ b/cypress/e2e/export-manager/export-orders-in-edifact-format/sorting-by-export-method-does-not-reset-search-results.cy.js @@ -13,176 +13,182 @@ import Users from '../../../support/fragments/users/users'; import DateTools from '../../../support/utils/dateTools'; import getRandomPostfix from '../../../support/utils/stringTools'; -describe('orders: export', () => { - const orderForFirstOrganization = { ...NewOrder.defaultOneTimeOrder }; - const orderForSecondOrganization = { - id: uuid(), - vendor: '', - orderType: 'One-Time', - }; +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const orderForFirstOrganization = { ...NewOrder.defaultOneTimeOrder }; + const orderForSecondOrganization = { + id: uuid(), + vendor: '', + orderType: 'One-Time', + }; - const firstOrganization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const secondOrganization = { - name: `autotest_name_${getRandomPostfix()}`, - status: 'Active', - code: `autotest_code_${getRandomPostfix()}`, - isVendor: true, - erpCode: `ERP-${getRandomPostfix()}`, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const integrationNameForFirstOrganization = `FirstIntegrationName${getRandomPostfix()}`; - const integrationNameForSecondOrganization = `SecondIntegrationName${getRandomPostfix()}`; - const integartionDescription1 = 'Test Integation descripton1'; - const integartionDescription2 = 'Test Integation descripton2'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); - const vendorEDICodeFor2Integration = getRandomPostfix(); - const libraryEDICodeFor2Integration = getRandomPostfix(); - let user; - let location; - let servicePointId; - const UTCTime = DateTools.getUTCDateForScheduling(); - const UTCTimeForSecond = DateTools.getUTCDateFor2Scheduling(); + const firstOrganization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const secondOrganization = { + name: `autotest_name_${getRandomPostfix()}`, + status: 'Active', + code: `autotest_code_${getRandomPostfix()}`, + isVendor: true, + erpCode: `ERP-${getRandomPostfix()}`, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const integrationNameForFirstOrganization = `FirstIntegrationName${getRandomPostfix()}`; + const integrationNameForSecondOrganization = `SecondIntegrationName${getRandomPostfix()}`; + const integartionDescription1 = 'Test Integation descripton1'; + const integartionDescription2 = 'Test Integation descripton2'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + const vendorEDICodeFor2Integration = getRandomPostfix(); + const libraryEDICodeFor2Integration = getRandomPostfix(); + let user; + let location; + let servicePointId; + const UTCTime = DateTools.getUTCDateForScheduling(); + const UTCTimeForSecond = DateTools.getUTCDateFor2Scheduling(); - before(() => { - cy.getAdminToken(); + before(() => { + cy.getAdminToken(); - ServicePoints.getViaApi().then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { - location = res; - }); - }); - - Organizations.createOrganizationViaApi(firstOrganization).then((organizationsResponse) => { - firstOrganization.id = organizationsResponse; - orderForFirstOrganization.vendor = firstOrganization.name; - orderForFirstOrganization.orderType = 'One-time'; - - cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); - Organizations.searchByParameters('Name', firstOrganization.name); - Organizations.checkSearchResults(firstOrganization); - Organizations.selectOrganization(firstOrganization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformation( - integrationNameForFirstOrganization, - integartionDescription1, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - firstOrganization.accounts[0].accountNo, - 'Purchase', - UTCTime, - ); + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { + location = res; + }); + }); - Organizations.createOrganizationViaApi(secondOrganization).then( - (secondOrganizationsResponse) => { - secondOrganization.id = secondOrganizationsResponse; - orderForSecondOrganization.vendor = secondOrganization.name; - orderForSecondOrganization.orderType = 'One-time'; + Organizations.createOrganizationViaApi(firstOrganization).then((organizationsResponse) => { + firstOrganization.id = organizationsResponse; + orderForFirstOrganization.vendor = firstOrganization.name; + orderForFirstOrganization.orderType = 'One-time'; - cy.visit(TopMenu.organizationsPath); - Organizations.searchByParameters('Name', secondOrganization.name); - Organizations.checkSearchResults(secondOrganization); - Organizations.selectOrganization(secondOrganization.name); + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', firstOrganization.name); + Organizations.checkSearchResults(firstOrganization); + Organizations.selectOrganization(firstOrganization.name); Organizations.addIntegration(); Organizations.fillIntegrationInformation( - integrationNameForSecondOrganization, - integartionDescription2, - vendorEDICodeFor2Integration, - libraryEDICodeFor2Integration, - secondOrganization.accounts[0].accountNo, + integrationNameForFirstOrganization, + integartionDescription1, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + firstOrganization.accounts[0].accountNo, 'Purchase', - UTCTimeForSecond, + UTCTime, + ); + + Organizations.createOrganizationViaApi(secondOrganization).then( + (secondOrganizationsResponse) => { + secondOrganization.id = secondOrganizationsResponse; + orderForSecondOrganization.vendor = secondOrganization.name; + orderForSecondOrganization.orderType = 'One-time'; + + cy.visit(TopMenu.organizationsPath); + Organizations.searchByParameters('Name', secondOrganization.name); + Organizations.checkSearchResults(secondOrganization); + Organizations.selectOrganization(secondOrganization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformation( + integrationNameForSecondOrganization, + integartionDescription2, + vendorEDICodeFor2Integration, + libraryEDICodeFor2Integration, + secondOrganization.accounts[0].accountNo, + 'Purchase', + UTCTimeForSecond, + ); + + cy.visit(TopMenu.ordersPath); + Orders.createOrder(orderForSecondOrganization, true, false).then((secondOrderId) => { + orderForSecondOrganization.id = secondOrderId; + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 3); + OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); + OrderLines.backToEditingOrder(); + }); + }, ); cy.visit(TopMenu.ordersPath); - Orders.createOrder(orderForSecondOrganization, true, false).then((secondOrderId) => { - orderForSecondOrganization.id = secondOrderId; + Orders.createOrder(orderForFirstOrganization, true, false).then((firstOrderId) => { + orderForFirstOrganization.id = firstOrderId; Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 3); + OrderLines.selectRandomInstanceInTitleLookUP('*', 10); OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); OrderLines.backToEditingOrder(); }); - }, - ); + }); - cy.visit(TopMenu.ordersPath); - Orders.createOrder(orderForFirstOrganization, true, false).then((firstOrderId) => { - orderForFirstOrganization.id = firstOrderId; - Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 10); - OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); - OrderLines.backToEditingOrder(); + cy.createTempUser([permissions.exportManagerAll.gui]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.exportManagerOrganizationsPath, + waiter: ExportManagerSearchPane.waitLoading, + }); + }); }); - }); - cy.createTempUser([permissions.exportManagerAll.gui]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.exportManagerOrganizationsPath, - waiter: ExportManagerSearchPane.waitLoading, + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderForFirstOrganization.id); + Orders.deleteOrderViaApi(orderForSecondOrganization.id); + Organizations.deleteOrganizationViaApi(firstOrganization.id); + Organizations.deleteOrganizationViaApi(secondOrganization.id); + NewLocation.deleteInstitutionCampusLibraryLocationViaApi( + location.institutionId, + location.campusId, + location.libraryId, + location.id, + ); + Users.deleteViaApi(user.userId); }); - }); - }); - after(() => { - cy.getAdminToken(); - Orders.deleteOrderViaApi(orderForFirstOrganization.id); - Orders.deleteOrderViaApi(orderForSecondOrganization.id); - Organizations.deleteOrganizationViaApi(firstOrganization.id); - Organizations.deleteOrganizationViaApi(secondOrganization.id); - NewLocation.deleteInstitutionCampusLibraryLocationViaApi( - location.institutionId, - location.campusId, - location.libraryId, - location.id, - ); - Users.deleteViaApi(user.userId); + it( + 'C377045: Sorting by export method does not reset search results (thunderjet) (TaaS)', + { tags: ['extendedPath', 'thunderjet'] }, + () => { + ExportManagerSearchPane.selectOrganizationsSearch(); + ExportManagerSearchPane.searchBySuccessful(); + ExportManagerSearchPane.searchByFailed(); + ExportManagerSearchPane.sortByJobID(); + ExportManagerSearchPane.selectJobByIntegrationInList(integrationNameForFirstOrganization); + ExportManagerSearchPane.resetAll(); + ExportManagerSearchPane.searchBySuccessful(); + ExportManagerSearchPane.searchByFailed(); + ExportManagerSearchPane.sortByJobID(); + ExportManagerSearchPane.selectJobByIntegrationInList( + integrationNameForSecondOrganization, + ); + }, + ); + }); }); - - it( - 'C377045: Sorting by export method does not reset search results (thunderjet) (TaaS)', - { tags: ['extendedPath', 'thunderjet'] }, - () => { - ExportManagerSearchPane.selectOrganizationsSearch(); - ExportManagerSearchPane.searchBySuccessful(); - ExportManagerSearchPane.searchByFailed(); - ExportManagerSearchPane.sortByJobID(); - ExportManagerSearchPane.selectJobByIntegrationInList(integrationNameForFirstOrganization); - ExportManagerSearchPane.resetAll(); - ExportManagerSearchPane.searchBySuccessful(); - ExportManagerSearchPane.searchByFailed(); - ExportManagerSearchPane.sortByJobID(); - ExportManagerSearchPane.selectJobByIntegrationInList(integrationNameForSecondOrganization); - }, - ); }); diff --git a/cypress/e2e/export-manager/job-for-order-with-acquisition-unit.cy.js b/cypress/e2e/export-manager/job-for-order-with-acquisition-unit.cy.js index 9431527594..e25c8f87e4 100644 --- a/cypress/e2e/export-manager/job-for-order-with-acquisition-unit.cy.js +++ b/cypress/e2e/export-manager/job-for-order-with-acquisition-unit.cy.js @@ -13,113 +13,117 @@ import TopMenu from '../../support/fragments/topMenu'; import DateTools from '../../support/utils/dateTools'; import getRandomPostfix from '../../support/utils/stringTools'; -describe('orders: export', () => { - const defaultAcquisitionUnit = { ...AcquisitionUnits.defaultAcquisitionUnit }; - const order = { - ...NewOrder.defaultOneTimeOrder, - approved: true, - }; - const organization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const integrationName = `FirstIntegrationName${getRandomPostfix()}`; - const integartionDescription = 'Test Integation descripton1'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); - let user; - let location; - let servicePointId; - let orderNumber; - const UTCTime = DateTools.getUTCDateForScheduling(); +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const defaultAcquisitionUnit = { ...AcquisitionUnits.defaultAcquisitionUnit }; + const order = { + ...NewOrder.defaultOneTimeOrder, + approved: true, + }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const integrationName = `FirstIntegrationName${getRandomPostfix()}`; + const integartionDescription = 'Test Integation descripton1'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + let user; + let location; + let servicePointId; + let orderNumber; + const UTCTime = DateTools.getUTCDateForScheduling(); - before(() => { - cy.getAdminToken(); - cy.createTempUser([ - permissions.exportManagerAll.gui, - permissions.uiOrdersView.gui, - permissions.uiOrganizationsIntegrationUsernamesAndPasswordsViewEdit.gui, - permissions.uiOrganizationsViewEdit.gui, - ]).then((userProperties) => { - user = userProperties; - cy.loginAsAdmin({ - path: SettingsMenu.acquisitionUnitsPath, - waiter: AcquisitionUnits.waitLoading, - }); - AcquisitionUnits.newAcquisitionUnit(); - AcquisitionUnits.fillInAUInfo(defaultAcquisitionUnit.name); - AcquisitionUnits.assignAdmin(); - AcquisitionUnits.assignUser(user.username); - }); - ServicePoints.getViaApi().then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { - location = res; + before(() => { + cy.getAdminToken(); + cy.createTempUser([ + permissions.exportManagerAll.gui, + permissions.uiOrdersView.gui, + permissions.uiOrganizationsIntegrationUsernamesAndPasswordsViewEdit.gui, + permissions.uiOrganizationsViewEdit.gui, + ]).then((userProperties) => { + user = userProperties; + cy.loginAsAdmin({ + path: SettingsMenu.acquisitionUnitsPath, + waiter: AcquisitionUnits.waitLoading, + }); + AcquisitionUnits.newAcquisitionUnit(); + AcquisitionUnits.fillInAUInfo(defaultAcquisitionUnit.name); + AcquisitionUnits.assignAdmin(); + AcquisitionUnits.assignUser(user.username); + }); + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { + location = res; + }); + }); + Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { + organization.id = organizationsResponse; + order.vendor = organizationsResponse; + }); + cy.visit(TopMenu.organizationsPath); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformation( + integrationName, + integartionDescription, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + organization.accounts[0].accountNo, + 'Purchase', + UTCTime, + ); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + cy.visit(TopMenu.ordersPath); + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 20); + OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + }); }); - }); - Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { - organization.id = organizationsResponse; - order.vendor = organizationsResponse; - }); - cy.visit(TopMenu.organizationsPath); - Organizations.searchByParameters('Name', organization.name); - Organizations.checkSearchResults(organization); - Organizations.selectOrganization(organization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformation( - integrationName, - integartionDescription, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - organization.accounts[0].accountNo, - 'Purchase', - UTCTime, - ); - cy.createOrderApi(order).then((response) => { - orderNumber = response.body.poNumber; - cy.visit(TopMenu.ordersPath); - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 20); - OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); - OrderLines.backToEditingOrder(); - Orders.openOrder(); + it( + 'C380640: Schedule export job for order with Acquisition unit (thunderjet) (TaaS)', + { tags: ['extendedPath', 'thunderjet'] }, + () => { + cy.login(user.username, user.password, { + path: TopMenu.exportManagerOrganizationsPath, + waiter: ExportManagerSearchPane.waitLoading, + }); + ExportManagerSearchPane.selectOrganizationsSearch(); + ExportManagerSearchPane.selectExportMethod(integrationName); + ExportManagerSearchPane.selectJobByIntegrationInList(integrationName); + ExportManagerSearchPane.rerunJob(); + cy.reload(); + ExportManagerSearchPane.verifyResult('Successful'); + ExportManagerSearchPane.selectJob('Successful'); + ExportManagerSearchPane.verifyJobStatusInDetailView('Successful'); + ExportManagerSearchPane.verifyJobOrganizationInDetailView(organization); + ExportManagerSearchPane.verifyJobExportMethodInDetailView(integrationName); + }, + ); }); }); - - it( - 'C380640: Schedule export job for order with Acquisition unit (thunderjet) (TaaS)', - { tags: ['extendedPath', 'thunderjet'] }, - () => { - cy.login(user.username, user.password, { - path: TopMenu.exportManagerOrganizationsPath, - waiter: ExportManagerSearchPane.waitLoading, - }); - ExportManagerSearchPane.selectOrganizationsSearch(); - ExportManagerSearchPane.selectExportMethod(integrationName); - ExportManagerSearchPane.selectJobByIntegrationInList(integrationName); - ExportManagerSearchPane.rerunJob(); - cy.reload(); - ExportManagerSearchPane.verifyResult('Successful'); - ExportManagerSearchPane.selectJob('Successful'); - ExportManagerSearchPane.verifyJobStatusInDetailView('Successful'); - ExportManagerSearchPane.verifyJobOrganizationInDetailView(organization); - ExportManagerSearchPane.verifyJobExportMethodInDetailView(integrationName); - }, - ); }); diff --git a/cypress/e2e/finance/transactions/invoice-can-not-be-paid-when-invoice-amount-exceeding-remaining-allowed-expenditures-separate-credit-invoice-exists-in-paid-status.cy.js b/cypress/e2e/finance/transactions/invoice-can-not-be-paid-when-invoice-amount-exceeding-remaining-allowed-expenditures-separate-credit-invoice-exists-in-paid-status.cy.js new file mode 100644 index 0000000000..11b0ac3a8c --- /dev/null +++ b/cypress/e2e/finance/transactions/invoice-can-not-be-paid-when-invoice-amount-exceeding-remaining-allowed-expenditures-separate-credit-invoice-exists-in-paid-status.cy.js @@ -0,0 +1,298 @@ +import uuid from 'uuid'; +import permissions from '../../../support/dictionary/permissions'; +import FiscalYears from '../../../support/fragments/finance/fiscalYears/fiscalYears'; +import Funds from '../../../support/fragments/finance/funds/funds'; +import Ledgers from '../../../support/fragments/finance/ledgers/ledgers'; +import Invoices from '../../../support/fragments/invoices/invoices'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import NewLocation from '../../../support/fragments/settings/tenant/locations/newLocation'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import Budgets from '../../../support/fragments/finance/budgets/budgets'; +import { + ACQUISITION_METHOD_NAMES_IN_PROFILE, + INVOICE_STATUSES, + ORDER_STATUSES, +} from '../../../support/constants'; +import BasicOrderLine from '../../../support/fragments/orders/basicOrderLine'; +import MaterialTypes from '../../../support/fragments/settings/inventory/materialTypes'; +import FinanceHelp from '../../../support/fragments/finance/financeHelper'; +import InteractorsTools from '../../../support/utils/interactorsTools'; +import Approvals from '../../../support/fragments/settings/invoices/approvals'; +import NewInvoice from '../../../support/fragments/invoices/newInvoice'; + +describe('Finance: Transactions', () => { + const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; + const firstLedger = { + ...Ledgers.defaultUiLedger, + restrictEncumbrance: false, + restrictExpenditures: true, + }; + const firstFund = { ...Funds.defaultUiFund }; + const secondFund = { + name: `autotest_fund2_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: getRandomPostfix(), + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + const firstOrder = { + id: uuid(), + vendor: '', + orderType: 'One-Time', + approved: true, + reEncumber: true, + }; + const secondOrder = { + id: uuid(), + vendor: '', + orderType: 'One-Time', + approved: true, + reEncumber: true, + }; + const firstBudget = { + ...Budgets.getDefaultBudget(), + allocated: 100, + allowableEncumbrance: 100, + allowableExpenditure: 100, + }; + const secondBudget = { + ...Budgets.getDefaultBudget(), + allocated: 100, + allowableEncumbrance: 110, + allowableExpenditure: 110, + }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const thirdInvoice = { ...NewInvoice.defaultUiInvoice }; + const isApprovePayEnabled = true; + const isApprovePayDisabled = false; + let firstInvoice; + let secondInvoice; + let user; + let servicePointId; + let location; + let secondOrderNumber; + + before(() => { + cy.getAdminToken(); + // create first Fiscal Year and prepere 2 Funds for Rollover + FiscalYears.createViaApi(defaultFiscalYear).then((firstFiscalYearResponse) => { + defaultFiscalYear.id = firstFiscalYearResponse.id; + firstBudget.fiscalYearId = firstFiscalYearResponse.id; + secondBudget.fiscalYearId = firstFiscalYearResponse.id; + firstLedger.fiscalYearOneId = defaultFiscalYear.id; + Ledgers.createViaApi(firstLedger).then((ledgerResponse) => { + firstLedger.id = ledgerResponse.id; + firstFund.ledgerId = firstLedger.id; + secondFund.ledgerId = firstLedger.id; + + Funds.createViaApi(firstFund).then((fundResponse) => { + firstFund.id = fundResponse.fund.id; + firstBudget.fundId = fundResponse.fund.id; + Budgets.createViaApi(firstBudget); + + Funds.createViaApi(secondFund).then((secondFundResponse) => { + secondFund.id = secondFundResponse.fund.id; + secondBudget.fundId = secondFundResponse.fund.id; + Budgets.createViaApi(secondBudget); + cy.loginAsAdmin({ path: TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.selectBudgetDetails(); + Funds.transfer(secondFund, firstFund); + InteractorsTools.checkCalloutMessage( + `$10.00 was successfully transferred to the budget ${secondBudget.name}`, + ); + Funds.closeBudgetDetails(); + cy.logout(); + cy.getAdminToken(); + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then( + (res) => { + location = res; + + MaterialTypes.createMaterialTypeViaApi( + MaterialTypes.getDefaultMaterialType(), + ).then((mtypes) => { + cy.getAcquisitionMethodsApi({ + query: `value="${ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM}"`, + }).then((params) => { + // Prepare 2 Open Orders for Rollover + Organizations.createOrganizationViaApi(organization).then( + (responseOrganizations) => { + organization.id = responseOrganizations; + firstOrder.vendor = organization.id; + secondOrder.vendor = organization.id; + cy.getBatchGroups().then((batchGroup) => { + thirdInvoice.batchGroup = batchGroup.name; + }); + const firstOrderLine = { + ...BasicOrderLine.defaultOrderLine, + cost: { + listUnitPrice: 10, + currency: 'USD', + discountType: 'percentage', + quantityPhysical: 1, + poLineEstimatedPrice: 10, + }, + fundDistribution: [ + { code: secondFund.code, fundId: secondFund.id, value: 100 }, + ], + locations: [ + { locationId: location.id, quantity: 1, quantityPhysical: 1 }, + ], + acquisitionMethod: params.body.acquisitionMethods[0].id, + physical: { + createInventory: 'Instance, Holding, Item', + materialType: mtypes.body.id, + materialSupplier: responseOrganizations, + volumes: [], + }, + }; + const secondOrderLine = { + ...BasicOrderLine.defaultOrderLine, + id: uuid(), + cost: { + listUnitPrice: 127.0, + currency: 'USD', + discountType: 'percentage', + quantityPhysical: 1, + poLineEstimatedPrice: 127.0, + }, + fundDistribution: [ + { code: secondFund.code, fundId: secondFund.id, value: 100 }, + ], + locations: [ + { locationId: location.id, quantity: 1, quantityPhysical: 1 }, + ], + acquisitionMethod: params.body.acquisitionMethods[0].id, + physical: { + createInventory: 'Instance, Holding, Item', + materialType: mtypes.body.id, + materialSupplier: responseOrganizations, + volumes: [], + }, + }; + Orders.createOrderViaApi(firstOrder).then((firstOrderResponse) => { + firstOrder.id = firstOrderResponse.id; + firstOrderLine.purchaseOrderId = firstOrderResponse.id; + + OrderLines.createOrderLineViaApi(firstOrderLine); + Orders.updateOrderViaApi({ + ...firstOrderResponse, + workflowStatus: ORDER_STATUSES.OPEN, + }); + }); + Invoices.createInvoiceWithInvoiceLineViaApi({ + vendorId: organization.id, + fiscalYearId: defaultFiscalYear.id, + fundDistributions: firstOrderLine.fundDistribution, + accountingCode: organization.erpCode, + releaseEncumbrance: true, + subTotal: 15, + }).then((invoiceResponse) => { + firstInvoice = invoiceResponse; + + Invoices.changeInvoiceStatusViaApi({ + invoice: firstInvoice, + status: INVOICE_STATUSES.APPROVED, + }); + }); + + Invoices.createInvoiceWithInvoiceLineViaApi({ + vendorId: organization.id, + fiscalYearId: defaultFiscalYear.id, + fundDistributions: firstOrderLine.fundDistribution, + accountingCode: organization.erpCode, + releaseEncumbrance: true, + subTotal: -20, + }).then((secondInvoiceResponse) => { + secondInvoice = secondInvoiceResponse; + + Invoices.changeInvoiceStatusViaApi({ + invoice: secondInvoice, + status: INVOICE_STATUSES.PAID, + }); + }); + Orders.createOrderViaApi(secondOrder).then((secondOrderResponse) => { + secondOrder.id = secondOrderResponse.id; + secondOrderLine.purchaseOrderId = secondOrderResponse.id; + secondOrderNumber = secondOrderResponse.poNumber; + + OrderLines.createOrderLineViaApi(secondOrderLine); + Orders.updateOrderViaApi({ + ...secondOrderResponse, + workflowStatus: ORDER_STATUSES.OPEN, + }); + cy.wait(10000); + cy.loginAsAdmin({ + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + Orders.searchByParameter('PO number', secondOrderNumber); + Orders.selectFromResultsList(secondOrderNumber); + Orders.newInvoiceFromOrder(); + Invoices.createInvoiceFromOrder(thirdInvoice, defaultFiscalYear.code); + Approvals.setApprovePayValue(isApprovePayEnabled); + }); + }, + ); + }); + }); + }, + ); + }); + }); + }); + }); + }); + + cy.createTempUser([ + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiInvoicesApproveInvoices.gui, + permissions.uiInvoicesPayInvoices.gui, + permissions.uiInvoicesCanViewAndEditInvoicesAndInvoiceLines.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.invoicesPath, + waiter: Invoices.waitLoading, + }); + }); + }); + + after(() => { + cy.getAdminToken(); + Approvals.setApprovePayValue(isApprovePayDisabled); + Users.deleteViaApi(user.userId); + }); + + it( + 'C496166 Invoice can NOT be paid when invoice amount exceeding remaining allowed expenditures (separate credit invoice exists in "Paid" status) (thunderjet)', + { tags: ['criticalPath', 'thunderjet'] }, + () => { + Invoices.searchByNumber(thirdInvoice.invoiceNumber); + Invoices.selectInvoice(thirdInvoice.invoiceNumber); + Invoices.canNotApproveAndPayInvoice( + `One or more Fund distributions on this invoice can not be paid, because there is not enough money in [${secondFund.code}].`, + ); + Invoices.selectInvoiceLine(); + Invoices.openPageCurrentEncumbrance('$127.00'); + Funds.varifyDetailsInTransaction( + defaultFiscalYear.code, + '($127.00)', + `${secondOrderNumber}-1`, + 'Encumbrance', + `${secondFund.name} (${secondFund.code})`, + ); + Funds.checkStatusInTransactionDetails('Unreleased'); + Funds.checkAbsentTransaction('Payment'); + }, + ); +}); diff --git a/cypress/e2e/finance/transactions/invoice-can-not-be-paid-when-invoice-amount-exceeding-remaining-allowed-expenditures.cy.js b/cypress/e2e/finance/transactions/invoice-can-not-be-paid-when-invoice-amount-exceeding-remaining-allowed-expenditures.cy.js new file mode 100644 index 0000000000..aac2412eab --- /dev/null +++ b/cypress/e2e/finance/transactions/invoice-can-not-be-paid-when-invoice-amount-exceeding-remaining-allowed-expenditures.cy.js @@ -0,0 +1,296 @@ +import uuid from 'uuid'; +import permissions from '../../../support/dictionary/permissions'; +import FiscalYears from '../../../support/fragments/finance/fiscalYears/fiscalYears'; +import Funds from '../../../support/fragments/finance/funds/funds'; +import Ledgers from '../../../support/fragments/finance/ledgers/ledgers'; +import Invoices from '../../../support/fragments/invoices'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import NewLocation from '../../../support/fragments/settings/tenant/locations/newLocation'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; +import Budgets from '../../../support/fragments/finance/budgets/budgets'; +import { + ACQUISITION_METHOD_NAMES_IN_PROFILE, + INVOICE_STATUSES, + ORDER_STATUSES, +} from '../../../support/constants'; +import BasicOrderLine from '../../../support/fragments/orders/basicOrderLine'; +import MaterialTypes from '../../../support/fragments/settings/inventory/materialTypes'; +import FinanceHelp from '../../../support/fragments/finance/financeHelper'; +import InteractorsTools from '../../../support/utils/interactorsTools'; +import Approvals from '../../../support/fragments/settings/invoices/approvals'; + +describe('Finance: Transactions', () => { + const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; + const firstLedger = { + ...Ledgers.defaultUiLedger, + restrictEncumbrance: false, + restrictExpenditures: true, + }; + const firstFund = { ...Funds.defaultUiFund }; + const secondFund = { + name: `autotest_fund2_${getRandomPostfix()}`, + code: getRandomPostfix(), + externalAccountNo: getRandomPostfix(), + fundStatus: 'Active', + description: `This is fund created by E2E test automation script_${getRandomPostfix()}`, + }; + const firstOrder = { + id: uuid(), + vendor: '', + orderType: 'One-Time', + approved: true, + reEncumber: true, + }; + const secondOrder = { + id: uuid(), + vendor: '', + orderType: 'One-Time', + approved: true, + reEncumber: true, + }; + const firstBudget = { + ...Budgets.getDefaultBudget(), + allocated: 100, + allowableEncumbrance: 100, + allowableExpenditure: 100, + }; + const secondBudget = { + ...Budgets.getDefaultBudget(), + allocated: 100, + allowableEncumbrance: 110, + allowableExpenditure: 110, + }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const isApprovePayEnabled = true; + const isApprovePayDisabled = false; + let firstInvoice; + let secondInvoice; + let thirdInvoice; + let user; + let servicePointId; + let location; + let secondOrderNumber; + + before(() => { + cy.getAdminToken(); + // create first Fiscal Year and prepere 2 Funds for Rollover + FiscalYears.createViaApi(defaultFiscalYear).then((firstFiscalYearResponse) => { + defaultFiscalYear.id = firstFiscalYearResponse.id; + firstBudget.fiscalYearId = firstFiscalYearResponse.id; + secondBudget.fiscalYearId = firstFiscalYearResponse.id; + firstLedger.fiscalYearOneId = defaultFiscalYear.id; + Ledgers.createViaApi(firstLedger).then((ledgerResponse) => { + firstLedger.id = ledgerResponse.id; + firstFund.ledgerId = firstLedger.id; + secondFund.ledgerId = firstLedger.id; + + Funds.createViaApi(firstFund).then((fundResponse) => { + firstFund.id = fundResponse.fund.id; + firstBudget.fundId = fundResponse.fund.id; + Budgets.createViaApi(firstBudget); + + Funds.createViaApi(secondFund).then((secondFundResponse) => { + secondFund.id = secondFundResponse.fund.id; + secondBudget.fundId = secondFundResponse.fund.id; + Budgets.createViaApi(secondBudget); + cy.loginAsAdmin({ path: TopMenu.fundPath, waiter: Funds.waitLoading }); + FinanceHelp.searchByName(secondFund.name); + Funds.selectFund(secondFund.name); + Funds.selectBudgetDetails(); + Funds.transfer(secondFund, firstFund); + InteractorsTools.checkCalloutMessage( + `$10.00 was successfully transferred to the budget ${secondBudget.name}`, + ); + Funds.closeBudgetDetails(); + cy.logout(); + cy.getAdminToken(); + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then( + (res) => { + location = res; + + MaterialTypes.createMaterialTypeViaApi( + MaterialTypes.getDefaultMaterialType(), + ).then((mtypes) => { + cy.getAcquisitionMethodsApi({ + query: `value="${ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM}"`, + }).then((params) => { + // Prepare 2 Open Orders for Rollover + Organizations.createOrganizationViaApi(organization).then( + (responseOrganizations) => { + organization.id = responseOrganizations; + firstOrder.vendor = organization.id; + secondOrder.vendor = organization.id; + const firstOrderLine = { + ...BasicOrderLine.defaultOrderLine, + cost: { + listUnitPrice: 10, + currency: 'USD', + discountType: 'percentage', + quantityPhysical: 1, + poLineEstimatedPrice: 10, + }, + fundDistribution: [ + { code: secondFund.code, fundId: secondFund.id, value: 100 }, + ], + locations: [ + { locationId: location.id, quantity: 1, quantityPhysical: 1 }, + ], + acquisitionMethod: params.body.acquisitionMethods[0].id, + physical: { + createInventory: 'Instance, Holding, Item', + materialType: mtypes.body.id, + materialSupplier: responseOrganizations, + volumes: [], + }, + }; + const secondOrderLine = { + ...BasicOrderLine.defaultOrderLine, + id: uuid(), + cost: { + listUnitPrice: 87.0, + currency: 'USD', + discountType: 'percentage', + quantityPhysical: 1, + poLineEstimatedPrice: 87.0, + }, + fundDistribution: [ + { code: secondFund.code, fundId: secondFund.id, value: 100 }, + ], + locations: [ + { locationId: location.id, quantity: 1, quantityPhysical: 1 }, + ], + acquisitionMethod: params.body.acquisitionMethods[0].id, + physical: { + createInventory: 'Instance, Holding, Item', + materialType: mtypes.body.id, + materialSupplier: responseOrganizations, + volumes: [], + }, + }; + Orders.createOrderViaApi(firstOrder).then((firstOrderResponse) => { + firstOrder.id = firstOrderResponse.id; + firstOrderLine.purchaseOrderId = firstOrderResponse.id; + + OrderLines.createOrderLineViaApi(firstOrderLine); + Orders.updateOrderViaApi({ + ...firstOrderResponse, + workflowStatus: ORDER_STATUSES.OPEN, + }); + }); + Invoices.createInvoiceWithInvoiceLineViaApi({ + vendorId: organization.id, + fiscalYearId: defaultFiscalYear.id, + fundDistributions: firstOrderLine.fundDistribution, + accountingCode: organization.erpCode, + releaseEncumbrance: true, + subTotal: 15, + }).then((invoiceResponse) => { + firstInvoice = invoiceResponse; + + Invoices.changeInvoiceStatusViaApi({ + invoice: firstInvoice, + status: INVOICE_STATUSES.APPROVED, + }); + }); + + Invoices.createInvoiceWithInvoiceLineViaApi({ + vendorId: organization.id, + fiscalYearId: defaultFiscalYear.id, + fundDistributions: firstOrderLine.fundDistribution, + accountingCode: organization.erpCode, + releaseEncumbrance: true, + subTotal: 20, + }).then((secondInvoiceResponse) => { + secondInvoice = secondInvoiceResponse; + + Invoices.changeInvoiceStatusViaApi({ + invoice: secondInvoice, + status: INVOICE_STATUSES.PAID, + }); + }); + Orders.createOrderViaApi(secondOrder).then((secondOrderResponse) => { + secondOrder.id = secondOrderResponse.id; + secondOrderLine.purchaseOrderId = secondOrderResponse.id; + secondOrderNumber = secondOrderResponse.poNumber; + + OrderLines.createOrderLineViaApi(secondOrderLine); + Orders.updateOrderViaApi({ + ...secondOrderResponse, + workflowStatus: ORDER_STATUSES.OPEN, + }); + cy.wait(10000); + Invoices.createInvoiceWithInvoiceLineViaApi({ + vendorId: organization.id, + fiscalYearId: defaultFiscalYear.id, + poLineId: secondOrderLine.id, + fundDistributions: secondOrderLine.fundDistribution, + accountingCode: organization.erpCode, + releaseEncumbrance: true, + subTotal: 87, + }).then((thirdInvoiceResponse) => { + thirdInvoice = thirdInvoiceResponse; + Approvals.setApprovePayValue(isApprovePayEnabled); + }); + }); + }, + ); + }); + }); + }, + ); + }); + }); + }); + }); + }); + + cy.createTempUser([ + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiInvoicesApproveInvoices.gui, + permissions.uiInvoicesPayInvoices.gui, + permissions.uiInvoicesCanViewAndEditInvoicesAndInvoiceLines.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.invoicesPath, + waiter: Invoices.waitLoading, + }); + }); + }); + + after(() => { + cy.getAdminToken(); + Approvals.setApprovePayValue(isApprovePayDisabled); + Users.deleteViaApi(user.userId); + }); + + it( + 'C449368 Invoice can NOT be paid when invoice amount exceeding remaining allowed expenditures (thunderjet)', + { tags: ['criticalPath', 'thunderjet'] }, + () => { + Invoices.searchByNumber(thirdInvoice.vendorInvoiceNo); + Invoices.selectInvoice(thirdInvoice.vendorInvoiceNo); + Invoices.canNotApproveAndPayInvoice( + `One or more Fund distributions on this invoice can not be paid, because there is not enough money in [${secondFund.code}].`, + ); + Invoices.selectInvoiceLine(); + Invoices.openPageCurrentEncumbrance('$87.00'); + Funds.varifyDetailsInTransaction( + defaultFiscalYear.code, + '($87.00)', + `${secondOrderNumber}-1`, + 'Encumbrance', + `${secondFund.name} (${secondFund.code})`, + ); + Funds.checkStatusInTransactionDetails('Unreleased'); + }, + ); +}); diff --git a/cypress/e2e/finance/transactions/invoice-with-three-invoice-lines-can-not-be-paid-when-available-expenditure-balance-is-less-that-invoice-total.cy.js b/cypress/e2e/finance/transactions/invoice-with-three-invoice-lines-can-not-be-paid-when-available-expenditure-balance-is-less-that-invoice-total.cy.js new file mode 100644 index 0000000000..0a2d7697a7 --- /dev/null +++ b/cypress/e2e/finance/transactions/invoice-with-three-invoice-lines-can-not-be-paid-when-available-expenditure-balance-is-less-that-invoice-total.cy.js @@ -0,0 +1,252 @@ +import uuid from 'uuid'; +import permissions from '../../../support/dictionary/permissions'; +import FiscalYears from '../../../support/fragments/finance/fiscalYears/fiscalYears'; +import Funds from '../../../support/fragments/finance/funds/funds'; +import Ledgers from '../../../support/fragments/finance/ledgers/ledgers'; +import OrderLines from '../../../support/fragments/orders/orderLines'; +import Orders from '../../../support/fragments/orders/orders'; +import NewOrganization from '../../../support/fragments/organizations/newOrganization'; +import Organizations from '../../../support/fragments/organizations/organizations'; +import NewLocation from '../../../support/fragments/settings/tenant/locations/newLocation'; +import ServicePoints from '../../../support/fragments/settings/tenant/servicePoints/servicePoints'; +import TopMenu from '../../../support/fragments/topMenu'; +import Users from '../../../support/fragments/users/users'; +import Budgets from '../../../support/fragments/finance/budgets/budgets'; +import { ACQUISITION_METHOD_NAMES_IN_PROFILE, ORDER_STATUSES } from '../../../support/constants'; +import BasicOrderLine from '../../../support/fragments/orders/basicOrderLine'; +import MaterialTypes from '../../../support/fragments/settings/inventory/materialTypes'; +import SettingsOrders from '../../../support/fragments/settings/orders/settingsOrders'; +import SettingsMenu from '../../../support/fragments/settingsMenu'; +// import TopMenuNavigation from '../../../support/fragments/topMenuNavigation'; +import Invoices from '../../../support/fragments/invoices/invoices'; +import NewInvoice from '../../../support/fragments/invoices/newInvoice'; +import Approvals from '../../../support/fragments/settings/invoices/approvals'; +import InvoiceLineDetails from '../../../support/fragments/invoices/invoiceLineDetails'; + +describe('Finance: Transactions', () => { + const defaultFiscalYear = { ...FiscalYears.defaultUiFiscalYear }; + const firstLedger = { + ...Ledgers.defaultUiLedger, + restrictEncumbrance: false, + restrictExpenditures: true, + }; + const firstFund = { ...Funds.defaultUiFund }; + + const firstOrder = { + id: uuid(), + vendor: '', + orderType: 'One-Time', + approved: true, + reEncumber: true, + }; + + const firstBudget = { + ...Budgets.getDefaultBudget(), + allocated: 100, + allowableEncumbrance: 100, + allowableExpenditure: 100, + }; + const organization = { ...NewOrganization.defaultUiOrganizations }; + const invoice = { ...NewInvoice.defaultUiInvoice }; + const isApprovePayEnabled = true; + const isApprovePayDisabled = false; + let user; + let servicePointId; + let location; + let firstOrderNumber; + + before(() => { + cy.getAdminToken(); + // create first Fiscal Year and prepere 2 Funds for Rollover + FiscalYears.createViaApi(defaultFiscalYear).then((firstFiscalYearResponse) => { + defaultFiscalYear.id = firstFiscalYearResponse.id; + firstBudget.fiscalYearId = firstFiscalYearResponse.id; + firstLedger.fiscalYearOneId = defaultFiscalYear.id; + Ledgers.createViaApi(firstLedger).then((ledgerResponse) => { + firstLedger.id = ledgerResponse.id; + firstFund.ledgerId = firstLedger.id; + + Funds.createViaApi(firstFund).then((fundResponse) => { + firstFund.id = fundResponse.fund.id; + firstBudget.fundId = fundResponse.fund.id; + Budgets.createViaApi(firstBudget); + + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { + location = res; + + MaterialTypes.createMaterialTypeViaApi(MaterialTypes.getDefaultMaterialType()).then( + (mtypes) => { + cy.getAcquisitionMethodsApi({ + query: `value="${ACQUISITION_METHOD_NAMES_IN_PROFILE.PURCHASE_AT_VENDOR_SYSTEM}"`, + }).then((params) => { + // Prepare 2 Open Orders for Rollover + Organizations.createOrganizationViaApi(organization).then( + (responseOrganizations) => { + organization.id = responseOrganizations; + firstOrder.vendor = organization.id; + cy.getBatchGroups().then((batchGroup) => { + invoice.batchGroup = batchGroup.name; + }); + cy.loginAsAdmin({ + path: SettingsMenu.ordersPurchaseOrderLinesLimit, + waiter: SettingsOrders.waitLoadingPurchaseOrderLinesLimit, + }); + SettingsOrders.setPurchaseOrderLinesLimit(3); + const firstOrderLine = { + ...BasicOrderLine.defaultOrderLine, + cost: { + listUnitPrice: 95, + currency: 'USD', + discountType: 'percentage', + quantityPhysical: 1, + poLineEstimatedPrice: 95, + }, + fundDistribution: [ + { code: firstFund.code, fundId: firstFund.id, value: 100 }, + ], + locations: [ + { locationId: location.id, quantity: 1, quantityPhysical: 1 }, + ], + acquisitionMethod: params.body.acquisitionMethods[0].id, + physical: { + createInventory: 'Instance, Holding, Item', + materialType: mtypes.body.id, + materialSupplier: responseOrganizations, + volumes: [], + }, + }; + const secondOrderLine = { + ...BasicOrderLine.defaultOrderLine, + id: uuid(), + cost: { + listUnitPrice: 10.0, + currency: 'USD', + discountType: 'percentage', + quantityPhysical: 1, + poLineEstimatedPrice: 10.0, + }, + fundDistribution: [ + { code: firstFund.code, fundId: firstFund.id, value: 100 }, + ], + locations: [ + { locationId: location.id, quantity: 1, quantityPhysical: 1 }, + ], + acquisitionMethod: params.body.acquisitionMethods[0].id, + physical: { + createInventory: 'Instance, Holding, Item', + materialType: mtypes.body.id, + materialSupplier: responseOrganizations, + volumes: [], + }, + }; + const thirdOrderLine = { + ...BasicOrderLine.defaultOrderLine, + id: uuid(), + cost: { + listUnitPrice: 5.0, + currency: 'USD', + discountType: 'percentage', + quantityPhysical: 1, + poLineEstimatedPrice: 5.0, + }, + fundDistribution: [ + { code: firstFund.code, fundId: firstFund.id, value: 100 }, + ], + locations: [ + { locationId: location.id, quantity: 1, quantityPhysical: 1 }, + ], + acquisitionMethod: params.body.acquisitionMethods[0].id, + physical: { + createInventory: 'Instance, Holding, Item', + materialType: mtypes.body.id, + materialSupplier: responseOrganizations, + volumes: [], + }, + }; + Orders.createOrderViaApi(firstOrder).then((firstOrderResponse) => { + firstOrder.id = firstOrderResponse.id; + firstOrderLine.purchaseOrderId = firstOrderResponse.id; + secondOrderLine.purchaseOrderId = firstOrderResponse.id; + thirdOrderLine.purchaseOrderId = firstOrderResponse.id; + firstOrderNumber = firstOrderResponse.poNumber; + OrderLines.createOrderLineViaApi(firstOrderLine); + OrderLines.createOrderLineViaApi(secondOrderLine); + OrderLines.createOrderLineViaApi(thirdOrderLine); + + Orders.updateOrderViaApi({ + ...firstOrderResponse, + workflowStatus: ORDER_STATUSES.OPEN, + }); + cy.visit(TopMenu.ordersPath); + Orders.searchByParameter('PO number', firstOrderNumber); + Orders.selectFromResultsList(firstOrderNumber); + Orders.newInvoiceFromOrder(); + Invoices.createInvoiceFromOrderWithMultiLines( + invoice, + defaultFiscalYear.code, + ); + Invoices.closeInvoiceDetailsPane(); + Approvals.setApprovePayValue(isApprovePayEnabled); + }); + }, + ); + }); + }, + ); + }); + }); + }); + }); + }); + + cy.createTempUser([ + permissions.uiFinanceViewFundAndBudget.gui, + permissions.uiInvoicesApproveInvoices.gui, + permissions.uiInvoicesCanViewAndEditInvoicesAndInvoiceLines.gui, + permissions.uiInvoicesPayInvoices.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(userProperties.username, userProperties.password, { + path: TopMenu.invoicesPath, + waiter: Invoices.waitLoading, + }); + }); + }); + + after(() => { + cy.loginAsAdmin({ + path: SettingsMenu.ordersPurchaseOrderLinesLimit, + waiter: SettingsOrders.waitLoadingPurchaseOrderLinesLimit, + }); + SettingsOrders.setPurchaseOrderLinesLimit(1); + Approvals.setApprovePayValue(isApprovePayDisabled); + Users.deleteViaApi(user.userId); + }); + + it( + 'C449373 Invoice with three invoice lines can NOT be paid when available expenditure balance is less that invoice total (thunderjet)', + { tags: ['criticalPath', 'thunderjet'] }, + () => { + Invoices.searchByNumber(invoice.invoiceNumber); + Invoices.selectInvoice(invoice.invoiceNumber); + Invoices.canNotApproveAndPayInvoice( + `One or more Fund distributions on this invoice can not be paid, because there is not enough money in [${firstFund.code}].`, + ); + Invoices.selectInvoiceLineByNumber('$95.00'); + Invoices.verifyCurrentEncumbrance('$95.00'); + Invoices.closeInvoiceLineDetailsPane(); + Invoices.selectInvoiceLineByNumber('$10.00'); + Invoices.verifyCurrentEncumbrance('$10.00'); + Invoices.closeInvoiceLineDetailsPane(); + Invoices.selectInvoiceLineByNumber('$5.00'); + Invoices.verifyCurrentEncumbrance('$5.00'); + InvoiceLineDetails.openFundDetailsPane(firstFund.name); + Funds.selectBudgetDetails(); + Funds.viewTransactions(); + Funds.checkAbsentTransaction('Pending payment'); + Funds.checkAbsentTransaction('Payment'); + }, + ); +}); diff --git a/cypress/e2e/inventory/search-in-inventory/search-instance-by-issn-with-x-at-the-end-in-item-tab.cy.js b/cypress/e2e/inventory/search-in-inventory/search-instance-by-issn-with-x-at-the-end-in-item-tab.cy.js index ddaafb814a..ed3884a597 100644 --- a/cypress/e2e/inventory/search-in-inventory/search-instance-by-issn-with-x-at-the-end-in-item-tab.cy.js +++ b/cypress/e2e/inventory/search-in-inventory/search-instance-by-issn-with-x-at-the-end-in-item-tab.cy.js @@ -1,9 +1,12 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; import Permissions from '../../../support/dictionary/permissions'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; +import DataImport from '../../../support/fragments/data_import/dataImport'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import TopMenu from '../../../support/fragments/topMenu'; import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; describe('Inventory', () => { describe('Search in Inventory', () => { @@ -21,8 +24,12 @@ describe('Inventory', () => { 'C451459 (MSEARCH672 test linking ISSN lower case, record 6) Time.', ], }; - // create an array of file names - const mrkFiles = Array.from({ length: 6 }, (_, i) => `marcBibFileForC451459_${i + 1}.mrk`); + const marcFile = { + marc: 'marcBibFileForC451459.mrc', + fileName: `testMarcFileC451459.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; const createdRecordIDs = []; before(() => { @@ -33,12 +40,15 @@ describe('Inventory', () => { testData.user = userProperties; cy.getUserToken(testData.user.username, testData.user.password); - mrkFiles.forEach((mrkFile) => { - InventoryInstances.createMarcBibliographicRecordViaApiByReadingFromMrkFile(mrkFile).then( - (createdMarcBibliographicId) => { - createdRecordIDs.push(createdMarcBibliographicId); - }, - ); + + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); cy.login(testData.user.username, testData.user.password, { diff --git a/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-asteriks.cy.js b/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-asteriks.cy.js index 95edea9e46..87106f3128 100644 --- a/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-asteriks.cy.js +++ b/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-asteriks.cy.js @@ -1,9 +1,12 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; +import DataImport from '../../../support/fragments/data_import/dataImport'; import Permissions from '../../../support/dictionary/permissions'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import TopMenu from '../../../support/fragments/topMenu'; import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; describe('Inventory', () => { describe('Search in Inventory', () => { @@ -22,8 +25,12 @@ describe('Inventory', () => { 'C440128 Test LCCN normalized record 9 (no spaces)', ], }; - // create an array of file names - const mrkFiles = Array.from({ length: 9 }, (_, i) => `marcBibFileForC440128_${i + 1}.mrk`); + const marcFile = { + marc: 'marcBibFileForC440128.mrc', + fileName: `testMarcFileC440128.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; const createdRecordIDs = []; before(() => { @@ -34,12 +41,14 @@ describe('Inventory', () => { testData.user = userProperties; cy.getUserToken(testData.user.username, testData.user.password); - mrkFiles.forEach((mrkFile) => { - InventoryInstances.createMarcBibliographicRecordViaApiByReadingFromMrkFile(mrkFile).then( - (createdMarcBibliographicId) => { - createdRecordIDs.push(createdMarcBibliographicId); - }, - ); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); cy.login(testData.user.username, testData.user.password, { diff --git a/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-lower-upper-case.cy.js b/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-lower-upper-case.cy.js index 674cd7c5cb..1acc86b4d3 100644 --- a/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-lower-upper-case.cy.js +++ b/cypress/e2e/inventory/search-in-inventory/search-marBib-by-lccn-normolized-option-using-query-with-lower-upper-case.cy.js @@ -1,9 +1,12 @@ +import { DEFAULT_JOB_PROFILE_NAMES } from '../../../support/constants'; import Permissions from '../../../support/dictionary/permissions'; +import DataImport from '../../../support/fragments/data_import/dataImport'; import InventoryInstance from '../../../support/fragments/inventory/inventoryInstance'; import InventoryInstances from '../../../support/fragments/inventory/inventoryInstances'; import InventorySearchAndFilter from '../../../support/fragments/inventory/inventorySearchAndFilter'; import TopMenu from '../../../support/fragments/topMenu'; import Users from '../../../support/fragments/users/users'; +import getRandomPostfix from '../../../support/utils/stringTools'; describe('Inventory', () => { describe('Search in Inventory', () => { @@ -32,8 +35,12 @@ describe('Inventory', () => { 'C442820 Test lower case LCCN normalized Sz record 6 (no spaces)', ], }; - // create an array of file names - const mrkFiles = Array.from({ length: 12 }, (_, i) => `marcBibFileForC442820_${i + 1}.mrk`); + const marcFile = { + marc: 'marcBibFileForC442820.mrc', + fileName: `testMarcFileC442820.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }; const createdRecordIDs = []; before(() => { @@ -44,12 +51,14 @@ describe('Inventory', () => { testData.user = userProperties; cy.getUserToken(testData.user.username, testData.user.password); - mrkFiles.forEach((mrkFile) => { - InventoryInstances.createMarcBibliographicRecordViaApiByReadingFromMrkFile(mrkFile).then( - (createdMarcBibliographicId) => { - createdRecordIDs.push(createdMarcBibliographicId); - }, - ); + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); }); cy.login(testData.user.username, testData.user.password, { diff --git a/cypress/e2e/lists/create-list/lists-all-permissions.cy.js b/cypress/e2e/lists/create-list/lists-all-permissions.cy.js index ca50d70840..4157ecce3f 100644 --- a/cypress/e2e/lists/create-list/lists-all-permissions.cy.js +++ b/cypress/e2e/lists/create-list/lists-all-permissions.cy.js @@ -73,6 +73,7 @@ describe('lists', () => { Lists.openActions(); Lists.verifyRefreshListButtonIsActive(); Lists.verifyEditListButtonIsActive(); + Lists.verifyDuplicateListButtonIsActive(); Lists.verifyDeleteListButtonIsActive(); Lists.verifyExportListButtonIsActive(); diff --git a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-linked-unable-to-add-multiple-010-fields.cy.js b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-linked-unable-to-add-multiple-010-fields.cy.js index 70ec370da4..440ed2c002 100644 --- a/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-linked-unable-to-add-multiple-010-fields.cy.js +++ b/cypress/e2e/marc/marc-authority/edit-linked-authority-record/marc-authority-edit-linked-unable-to-add-multiple-010-fields.cy.js @@ -9,6 +9,7 @@ import QuickMarcEditor from '../../../../support/fragments/quickMarcEditor'; import TopMenu from '../../../../support/fragments/topMenu'; import Users from '../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../support/utils/stringTools'; +import MarcAuthoritiesSearch from '../../../../support/fragments/marcAuthority/marcAuthoritiesSearch'; describe('MARC', () => { describe('MARC Authority', () => { @@ -19,7 +20,8 @@ describe('MARC', () => { tag240: '240', authority100FieldValue: 'C375100 Beethoven, Ludwig van', searchOption: 'Keyword', - searchValue: 'Beethoven, Ludwig van, 1770-1827. 14 variations sur un thème original', + searchValue: + 'C375100 Beethoven, Ludwig van, 1770-1827. 14 variations sur un thème original', fieldForAdding: { tag: '010', content: '$a n 94000339' }, errorMultiple010MarcTags: 'Field is non-repeatable.', }; @@ -29,14 +31,14 @@ describe('MARC', () => { const marcFiles = [ { marc: 'marcBibFileForC375100.mrc', - fileName: `testMarcFileC375100.${getRandomPostfix()}.mrc`, + fileName: `C375100 testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, numOfRecords: 1, propertyName: 'instance', }, { marc: 'marcAuthFileForC375100.mrc', - fileName: `testMarcFileC375100.${getRandomPostfix()}.mrc`, + fileName: `C375100 testMarcFile.${getRandomPostfix()}.mrc`, jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, authorityHeading: 'Variations / Ludwig Van Beethoven.', numOfRecords: 1, @@ -45,53 +47,58 @@ describe('MARC', () => { ]; before('Create test data', () => { - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.createTempUser([Permissions.moduleDataImportEnabled.gui]) + .then((createdUserProperties) => { + testData.preconditionUserId = createdUserProperties.userId; + + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C375100*'); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + cy.wait(2000); }); + }) + .then(() => { + cy.loginAsAdmin(); + cy.visit(TopMenu.inventoryPath); + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + InventoryInstance.verifyAndClickLinkIcon(testData.tag240); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySelectMarcAuthorityModal(); + InventoryInstance.verifySearchOptions(); + InventoryInstance.searchResults(testData.authority100FieldValue); + MarcAuthoritiesSearch.selectExcludeReferencesFilter(); + MarcAuthorities.checkFieldAndContentExistence( + testData.tag100, + `$a ${testData.authority100FieldValue}`, + ); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag240); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); }); - }); - - cy.loginAsAdmin({ - path: TopMenu.dataImportPath, - waiter: DataImport.waitLoading, - }); - cy.visit(TopMenu.inventoryPath).then(() => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - InventoryInstance.verifyAndClickLinkIcon(testData.tag240); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySelectMarcAuthorityModal(); - InventoryInstance.verifySearchOptions(); - InventoryInstance.searchResults(testData.authority100FieldValue); - MarcAuthorities.checkFieldAndContentExistence( - testData.tag100, - `$a ${testData.authority100FieldValue}`, - ); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag240); - QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); + cy.createTempUser([ + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.createTempUser([ - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, - Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.marcAuthorities, - waiter: MarcAuthorities.waitLoading, - }); + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.marcAuthorities, + waiter: MarcAuthorities.waitLoading, }); }); }); @@ -99,6 +106,7 @@ describe('MARC', () => { after('Delete test data', () => { cy.getAdminToken(); Users.deleteViaApi(testData.userProperties.userId); + Users.deleteViaApi(testData.preconditionUserId); InventoryInstance.deleteInstanceViaApi(createdRecordIDs[0]); MarcAuthority.deleteViaAPI(createdRecordIDs[1]); }); diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js index 6499fbdb04..9a3841a709 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/automated-linking/auto-linking-fields-with-$9.cy.js @@ -174,6 +174,8 @@ describe('MARC', () => { QuickMarcEditor.checkContent(newFields[3].contentWithout$9, 8); QuickMarcEditor.checkContent(testData.fieldContents.tag245Content, 4); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1000); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { testData.createdInstanceID = id; diff --git a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js index a8e831ca7c..263db1290c 100644 --- a/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/create-new-marc-bib/ldr-length-tag-validation-when-creating-new-marcBib.cy.js @@ -114,6 +114,8 @@ describe('MARC', () => { QuickMarcEditor.updateExistingTagValue(5, testData.tags.tag100); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1000); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.getId().then((id) => { createdInstanceRecordId = id; diff --git a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/derive-new-marc-bib-unlink-marc-bib-fields-using-remove-linking-button.cy.js b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/derive-new-marc-bib-unlink-marc-bib-fields-using-remove-linking-button.cy.js index a984acc28e..ccb4f636cb 100644 --- a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/derive-new-marc-bib-unlink-marc-bib-fields-using-remove-linking-button.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/derive-new-marc-bib-unlink-marc-bib-fields-using-remove-linking-button.cy.js @@ -68,37 +68,26 @@ describe('MARC', () => { const createdRecordIDs = []; before(() => { - cy.getAdminToken(); - // make sure there are no duplicate authority records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C366115*'); + cy.createTempUser([Permissions.moduleDataImportEnabled.gui]) + .then((createdUserProperties) => { + testData.preconditionUserId = createdUserProperties.userId; + // make sure there are no duplicate authority records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C366115*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.user = createdUserProperties; - - marcFiles.forEach((marcFile) => { - cy.loginAsAdmin({ path: TopMenu.dataImportPath, waiter: DataImport.waitLoading }).then( - () => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); - }); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); }); - }, - ); - }); - - cy.visit(TopMenu.inventoryPath).then(() => { + }); + }); + }) + .then(() => { + cy.visit(TopMenu.inventoryPath); InventoryInstances.searchByTitle(createdRecordIDs[0]); InventoryInstances.selectInstance(); InventoryInstance.editMarcBibliographicRecord(); @@ -112,9 +101,21 @@ describe('MARC', () => { QuickMarcEditor.verifyAfterLinkingUsingRowIndex(linking.tag, linking.rowIndex); }); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }); + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcAuthoritiesEditorAll.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcEditorDuplicate.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.user = createdUserProperties; + cy.login(testData.user.username, testData.user.password, { path: TopMenu.inventoryPath, waiter: InventoryInstances.waitContentLoading, @@ -125,6 +126,7 @@ describe('MARC', () => { after('Deleting created user and data', () => { cy.getAdminToken(); Users.deleteViaApi(testData.user.userId); + Users.deleteViaApi(testData.preconditionUserId); InventoryInstance.deleteInstanceViaApi(createdRecordIDs[0]); createdRecordIDs.forEach((id, index) => { if (index) MarcAuthority.deleteViaAPI(id); @@ -148,6 +150,8 @@ describe('MARC', () => { QuickMarcEditor.verifyTagFieldAfterUnlinking(...testData.secondTag700Values); QuickMarcEditor.checkLinkButtonToolTipTextByIndex(linkingTagAndValues[1].rowIndex); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndCloseDerive(); InventoryInstance.verifyContributor(2, 1, linkingTagAndValues[0].value); InventoryInstance.checkMarcAppIconAbsent(2); diff --git a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/verify-opening-derived-marcBib-with-user-permissions.cy.js b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/verify-opening-derived-marcBib-with-user-permissions.cy.js index 74a6117b44..04cd5f76b0 100644 --- a/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/verify-opening-derived-marcBib-with-user-permissions.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/derive-marc-bib/manual-linking/verify-opening-derived-marcBib-with-user-permissions.cy.js @@ -94,6 +94,8 @@ describe('MARC', () => { linkingTagAndValues.rowIndex, ); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1000); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); }); }); @@ -122,6 +124,8 @@ describe('MARC', () => { QuickMarcEditor.clickKeepLinkingButton(); QuickMarcEditor.updateExistingField(testData.tag245, testData.tag245Content); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1000); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.verifyAfterDerivedMarcBibSave(); InventoryInstance.checkPresentedText(testData.instanceTitleAfterUpdate); InventoryInstance.verifyRecordAndMarcAuthIcon( diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField710-to-authority110.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField710-to-authority110.cy.js index 7a3025684a..ea2210643b 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField710-to-authority110.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/linking-bibField710-to-authority110.cy.js @@ -122,6 +122,8 @@ describe('MARC', () => { QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag710); QuickMarcEditor.verifyTagFieldAfterLinking(...bib710AfterLinkingToAuth110); QuickMarcEditor.pressSaveAndClose(); + cy.wait(1000); + QuickMarcEditor.pressSaveAndClose(); QuickMarcEditor.checkAfterSaveAndClose(); InventoryInstance.verifyRecordAndMarcAuthIcon( testData.accordion, diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/unlink-bib-record-with-save-and-keep-editing-in-editing-window.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/unlink-bib-record-with-save-and-keep-editing-in-editing-window.cy.js index 1a69c9ca1b..eb4e2f268d 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/unlink-bib-record-with-save-and-keep-editing-in-editing-window.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/unlink-bib-record-with-save-and-keep-editing-in-editing-window.cy.js @@ -12,161 +12,173 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - let userData = {}; - const testData = { - tag100: '100', - tag100RowIndex: 11, - field100Value: '$a Chin, Staceyann, $d 1972-', - authorityTitle: 'Chin, Staceyann, 1972-', - instanceTitle: - 'Crossfire : a litany for survival : poems 1998-2019 / Staceyann Chin ; foreword by Jacqueline Woodson.', - linked100Field: [ - 11, - '100', - '1', - '\\', - '$a Chin, Staceyann, $d 1972-', - '$e Author $e Narrator', - '$0 http://id.loc.gov/authorities/names/n2008052404', - '$1 http://viaf.org/viaf/24074052', - ], - bib100AfterUnlinking: [ - 11, - '100', - '1', - '\\', - '$a Chin, Staceyann, $d 1972- $e Author $e Narrator $0 http://id.loc.gov/authorities/names/n2008052404 $1 http://viaf.org/viaf/24074052', - ], - linkedIconText: 'Linked to MARC authority', - unlinkIconText: 'Unlink from MARC Authority record', - }; - - const marcFiles = [ - { - marc: 'marcBibFileForC365599.mrc', - fileName: `testMarcFileC365599.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC365599.mrc', - fileName: `testMarcFileC365599.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - propertyName: 'authority', - }, - ]; - - const createdRecordIDs = []; - - before('Create test data', () => { - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - userData = createdUserProperties; - - MarcAuthorities.getMarcAuthoritiesViaApi({ - limit: 100, - query: `keyword="${testData.authorityTitle}" and (authRefType==("Authorized" or "Auth/Ref"))`, - }).then((authorities) => { - if (authorities) { - authorities.forEach(({ id }) => { - MarcAuthority.deleteViaAPI(id); - }); - } - }); +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + let userData = {}; + const testData = { + tag100: '100', + tag100RowIndex: 11, + field100Value: '$a Chin, Staceyann, $d 1972-', + authorityTitle: 'Chin, Staceyann, 1972-', + instanceTitle: + 'Crossfire : a litany for survival : poems 1998-2019 / Staceyann Chin ; foreword by Jacqueline Woodson.', + linked100Field: [ + 11, + '100', + '1', + '\\', + '$a Chin, Staceyann, $d 1972-', + '$e Author $e Narrator', + '$0 http://id.loc.gov/authorities/names/n2008052404', + '$1 http://viaf.org/viaf/24074052', + ], + bib100AfterUnlinking: [ + 11, + '100', + '1', + '\\', + '$a Chin, Staceyann, $d 1972- $e Author $e Narrator $0 http://id.loc.gov/authorities/names/n2008052404 $1 http://viaf.org/viaf/24074052', + ], + linkedIconText: 'Linked to MARC authority', + unlinkIconText: 'Unlink from MARC Authority record', + }; + + const marcFiles = [ + { + marc: 'marcBibFileForC365599.mrc', + fileName: `testMarcFileC365599.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC365599.mrc', + fileName: `testMarcFileC365599.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + propertyName: 'authority', + }, + ]; + + const createdRecordIDs = []; + + before('Create test data', () => { + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordEdit.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + userData = createdUserProperties; + + MarcAuthorities.getMarcAuthoritiesViaApi({ + limit: 100, + query: `keyword="${testData.authorityTitle}" and (authRefType==("Authorized" or "Auth/Ref"))`, + }).then((authorities) => { + if (authorities) { + authorities.forEach(({ id }) => { + MarcAuthority.deleteViaAPI(id); + }); + } + }); - cy.loginAsAdmin().then(() => { - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.loginAsAdmin().then(() => { + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + }); + + cy.visit(TopMenu.inventoryPath).then(() => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + + InventoryInstance.verifyAndClickLinkIcon(testData.tag100); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.switchToSearch(); + InventoryInstance.searchResults(testData.authorityTitle); + MarcAuthorities.checkFieldAndContentExistence( + testData.tag100, + testData.field100Value, + ); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag100); + QuickMarcEditor.closeCallout(); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1500); + QuickMarcEditor.pressSaveAndClose(); + cy.wait(1000); + + cy.login(userData.username, userData.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); }); }); }); - }); - - cy.visit(TopMenu.inventoryPath).then(() => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - - InventoryInstance.verifyAndClickLinkIcon(testData.tag100); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.switchToSearch(); - InventoryInstance.searchResults(testData.authorityTitle); - MarcAuthorities.checkFieldAndContentExistence(testData.tag100, testData.field100Value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag100); - QuickMarcEditor.closeCallout(); - QuickMarcEditor.pressSaveAndClose(); - cy.wait(1500); - QuickMarcEditor.pressSaveAndClose(); - cy.wait(1000); - - cy.login(userData.username, userData.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, + after('Delete test data', () => { + cy.getAdminToken(); + Users.deleteViaApi(userData.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); }); - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); + + it( + 'C365599 Unlink "MARC Bibliographic" field from "MARC Authority" record and use the "Save & keep editing" button in editing window (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyUnlinkAndViewAuthorityButtons(testData.tag100RowIndex); + QuickMarcEditor.verifySaveAndKeepEditingButtonDisabled(); + + QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked100Field); + + QuickMarcEditor.checkUnlinkTooltipText( + testData.tag100RowIndex, + testData.unlinkIconText, + ); + + QuickMarcEditor.clickUnlinkIconInTagField(testData.tag100RowIndex); + QuickMarcEditor.checkUnlinkModal(testData.tag100); + + QuickMarcEditor.confirmUnlinkingField(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...testData.bib100AfterUnlinking); + QuickMarcEditor.checkLinkButtonExist(testData.tag100); + QuickMarcEditor.verifySaveAndKeepEditingButtonEnabled(); + QuickMarcEditor.clickSaveAndKeepEditingButton(); + cy.wait(1500); + QuickMarcEditor.clickSaveAndKeepEditing(); + QuickMarcEditor.closeCallout(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...testData.bib100AfterUnlinking); + + QuickMarcEditor.clickLinkIconInTagField(testData.tag100RowIndex); + InventoryInstance.verifySelectMarcAuthorityModal(); + + InventoryInstance.closeFindAuthorityModal(); + QuickMarcEditor.pressCancel(); + InstanceRecordView.verifyInstancePaneExists(); + + InstanceRecordView.verifyContributorNameWithoutMarcAppIcon(0, testData.authorityTitle); + + InstanceRecordView.viewSource(); + InventoryViewSource.waitLoading(); + InventoryViewSource.notContains(testData.linkedIconText); + }, + ); }); }); }); - after('Delete test data', () => { - cy.getAdminToken(); - Users.deleteViaApi(userData.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); - - it( - 'C365599 Unlink "MARC Bibliographic" field from "MARC Authority" record and use the "Save & keep editing" button in editing window (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyUnlinkAndViewAuthorityButtons(testData.tag100RowIndex); - QuickMarcEditor.verifySaveAndKeepEditingButtonDisabled(); - - QuickMarcEditor.verifyTagFieldAfterLinking(...testData.linked100Field); - - QuickMarcEditor.checkUnlinkTooltipText(testData.tag100RowIndex, testData.unlinkIconText); - - QuickMarcEditor.clickUnlinkIconInTagField(testData.tag100RowIndex); - QuickMarcEditor.checkUnlinkModal(testData.tag100); - - QuickMarcEditor.confirmUnlinkingField(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...testData.bib100AfterUnlinking); - QuickMarcEditor.checkLinkButtonExist(testData.tag100); - QuickMarcEditor.verifySaveAndKeepEditingButtonEnabled(); - QuickMarcEditor.clickSaveAndKeepEditingButton(); - cy.wait(1500); - QuickMarcEditor.clickSaveAndKeepEditing(); - QuickMarcEditor.closeCallout(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...testData.bib100AfterUnlinking); - - QuickMarcEditor.clickLinkIconInTagField(testData.tag100RowIndex); - InventoryInstance.verifySelectMarcAuthorityModal(); - - InventoryInstance.closeFindAuthorityModal(); - QuickMarcEditor.pressCancel(); - InstanceRecordView.verifyInstancePaneExists(); - - InstanceRecordView.verifyContributorNameWithoutMarcAppIcon(0, testData.authorityTitle); - - InstanceRecordView.viewSource(); - InventoryViewSource.waitLoading(); - InventoryViewSource.notContains(testData.linkedIconText); - }, - ); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField110-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField110-with-wrong-record.cy.js index 2e35bef405..2f471dddd0 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField110-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField110-with-wrong-record.cy.js @@ -11,164 +11,170 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag110: '110', - instanceField110Value: 'C380450 Beatles.', - authorized: 'Authorized', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - searchOption: 'Corporate/Conference name', - linkableValue: 'C380450 Catalonia (Spain). Mozos de Escuadra', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag110: '110', + instanceField110Value: 'C380450 Beatles.', + authorized: 'Authorized', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + searchOption: 'Corporate/Conference name', + linkableValue: 'C380450 Catalonia (Spain). Mozos de Escuadra', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380450 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380450 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380450 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380450 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380450 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - { - value: 'C380450 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380450 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380450 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380450 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380450 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380450 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + { + value: 'C380450 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380450 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380450 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380450 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380450 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380450 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380450 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380450.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380450.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380450.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380450.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib110FieldValues = [33, testData.tag110, '2', '\\', '$a C380450 Beatles. $4 prf']; + const bib110FieldValues = [33, testData.tag110, '2', '\\', '$a C380450 Beatles. $4 prf']; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380450*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380450*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + it( + 'C380450 Verify that user cant link "110" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib110FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag110); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField110Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - it( - 'C380450 Verify that user cant link "110" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib110FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag110); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField110Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + MarcAuthorityBrowse.searchBy(testData.searchOption, testData.linkableValue); + MarcAuthorities.checkRow(testData.linkableValue); + MarcAuthorities.selectTitle(testData.linkableValue); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag110); + }, + ); }); - - MarcAuthorityBrowse.searchBy(testData.searchOption, testData.linkableValue); - MarcAuthorities.checkRow(testData.linkableValue); - MarcAuthorities.selectTitle(testData.linkableValue); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingAuthority(testData.tag110); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField111-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField111-with-wrong-record.cy.js index 1cc63a2852..b40337ac63 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField111-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField111-with-wrong-record.cy.js @@ -11,155 +11,161 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag111: '111', - instanceField111Value: '1995-1996', - authorized: 'Authorized', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag111: '111', + instanceField111Value: '1995-1996', + authorized: 'Authorized', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380451 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380451 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380451 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380451 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: - 'C380451 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - { - value: 'C380451 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380451 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380451 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380451 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380451 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: + 'C380451 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + { + value: 'C380451 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380451 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380451 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380451 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380451 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380451 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380451 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380451.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380451.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380451.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380451.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib111FieldValues = [14, testData.tag111, '2', '\\', '$d 1995-1996']; + const bib111FieldValues = [14, testData.tag111, '2', '\\', '$d 1995-1996']; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380451*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380451*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + }); + }); - it( - 'C380451 Verify that user cant link "111" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib111FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag111); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField111Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380451 Verify that user cant link "111" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib111FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag111); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField111Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField130-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField130-with-wrong-record.cy.js index 1aeb8df94b..2f4b2a50b7 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField130-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField130-with-wrong-record.cy.js @@ -11,162 +11,168 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag130: '130', - instanceField130Value: 'C380452 King Kong (1933) Skull Island', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - searchOption: 'Uniform title', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag130: '130', + instanceField130Value: 'C380452 King Kong (1933) Skull Island', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + searchOption: 'Uniform title', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380452 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380452 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380452 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380452 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380452 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380452 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380452 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380452 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380452 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380452 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380452 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380452 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380452 Montessori method of education', - searchOption: 'Subject', - authoritySource: "LC Children's Subject Headings", - }, - { - value: 'C380452 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380452 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380452 Montessori method of education', + searchOption: 'Subject', + authoritySource: "LC Children's Subject Headings", + }, + { + value: 'C380452 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380452 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380452.mrc', - fileName: `testMarcFileC380452.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380452.mrc', - fileName: `testMarcFileC380452.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380452.mrc', + fileName: `testMarcFileC380452.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380452.mrc', + fileName: `testMarcFileC380452.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib130FieldValues = [ - 9, - testData.tag130, - '1', - '\\', - '$a C380452 King Kong (1933) $t Skull Island $f 1900 $g trt', - ]; + const bib130FieldValues = [ + 9, + testData.tag130, + '1', + '\\', + '$a C380452 King Kong (1933) $t Skull Island $f 1900 $g trt', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380452*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380452*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380452 Verify that user cant link "130" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib130FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag130); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('uniformTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField130Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380452 Verify that user cant link "130" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib130FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag130); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('uniformTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField130Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField240-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField240-with-wrong-record.cy.js index 7f2aabe45b..82283ea127 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField240-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField240-with-wrong-record.cy.js @@ -11,153 +11,159 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag240: '240', - instanceField240Value: 'C380453 Laws, etc. 1995 Fish and Game Code', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag240: '240', + instanceField240Value: 'C380453 Laws, etc. 1995 Fish and Game Code', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380453 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380453 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380453 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380453 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380453 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380453 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380453 Marvel comics', - searchOption: 'Uniform title', - authoritySource: 'LC Name Authority file (LCNAF)', - }, - { - value: 'C380453 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380453 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380453 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380453 Marvel comics', + searchOption: 'Uniform title', + authoritySource: 'LC Name Authority file (LCNAF)', + }, + { + value: 'C380453 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380453 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380453 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380453.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForCC380453.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380453.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForCC380453.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib240FieldValues = [ - 11, - testData.tag240, - '1', - '0', - '$a C380453 Laws, etc. $d 1995 $t Fish and Game Code $p test $2 ptf', - ]; + const bib240FieldValues = [ + 11, + testData.tag240, + '1', + '0', + '$a C380453 Laws, etc. $d 1995 $t Fish and Game Code $p test $2 ptf', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380453*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380453*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380453 Verify that user cant link "240" MARC Bib field with wrong record. (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib240FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag240); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('nameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField240Value); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySearchOptions(); - MarcAuthorities.checkSearchOption('nameTitle'); - MarcAuthorities.checkSearchInput(''); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380453 Verify that user cant link "240" MARC Bib field with wrong record. (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib240FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag240); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('nameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField240Value); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySearchOptions(); + MarcAuthorities.checkSearchOption('nameTitle'); + MarcAuthorities.checkSearchInput(''); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField600-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField600-with-wrong-record.cy.js index 04ba604a4a..82cd07754e 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField600-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField600-with-wrong-record.cy.js @@ -11,177 +11,186 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag600: '600', - instanceField600Value: '1909-1998. (Barry Morris),', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag600: '600', + instanceField600Value: '1909-1998. (Barry Morris),', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380454 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380454 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380454 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380454 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380454 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380454 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380454 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380454 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380454 Marvel comics', - searchOption: 'Uniform title', - authoritySource: 'LC Name Authority file (LCNAF)', - }, - { - value: 'C380454 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380454 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380454 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380454 Marvel comics', + searchOption: 'Uniform title', + authoritySource: 'LC Name Authority file (LCNAF)', + }, + { + value: 'C380454 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380454 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380454 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const linkableValue = { - value: 'C380454 Stone, Robert B.', - searchOption: 'Personal name', - }; + const linkableValue = { + value: 'C380454 Stone, Robert B.', + searchOption: 'Personal name', + }; - const marcFiles = [ - { - marc: 'marcBibFileForC380454.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380454.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380454.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380454.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib600FieldValues = [ - 21, - testData.tag600, - '1', - '0', - '$b C380454 Goldwater, Barry M. $t (Barry Morris), $d 1909-1998.', - ]; + const bib600FieldValues = [ + 21, + testData.tag600, + '1', + '0', + '$b C380454 Goldwater, Barry M. $t (Barry Morris), $d 1909-1998.', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380454*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380454*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + it( + 'C380454 Verify that user cant link "600" MARC Bib field with wrong record. (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib600FieldValues); + InventoryInstance.verifyAndClickLinkIconByIndex(bib600FieldValues[0]); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('personalNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField600Value); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySearchOptions(); + MarcAuthorities.checkSearchOption('personalNameTitle'); + MarcAuthorities.checkSearchInput(''); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - it( - 'C380454 Verify that user cant link "600" MARC Bib field with wrong record. (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib600FieldValues); - InventoryInstance.verifyAndClickLinkIconByIndex(bib600FieldValues[0]); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('personalNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField600Value); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySearchOptions(); - MarcAuthorities.checkSearchOption('personalNameTitle'); - MarcAuthorities.checkSearchInput(''); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + MarcAuthorityBrowse.searchBy(linkableValue.searchOption, linkableValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex( + bib600FieldValues[1], + bib600FieldValues[0], + ); + QuickMarcEditor.verifyTagFieldAfterLinking( + bib600FieldValues[0], + bib600FieldValues[1], + bib600FieldValues[2], + bib600FieldValues[3], + '$a C380454 Stone, Robert B.', + '', + '$0 http://id.loc.gov/authorities/names/n79061096', + '', + ); + }, + ); }); - - MarcAuthorityBrowse.searchBy(linkableValue.searchOption, linkableValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingUsingRowIndex(bib600FieldValues[1], bib600FieldValues[0]); - QuickMarcEditor.verifyTagFieldAfterLinking( - bib600FieldValues[0], - bib600FieldValues[1], - bib600FieldValues[2], - bib600FieldValues[3], - '$a C380454 Stone, Robert B.', - '', - '$0 http://id.loc.gov/authorities/names/n79061096', - '', - ); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField610-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField610-with-wrong-record.cy.js index 0684e31ba2..037cb8ef1c 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField610-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField610-with-wrong-record.cy.js @@ -11,157 +11,169 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag610: '610', - instanceField610Value: 'Radio Vaticana', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag610: '610', + instanceField610Value: 'Radio Vaticana', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380455 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380455 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380455 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380455 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - { - value: - 'C380455 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380455 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380455 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380455 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380455 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + { + value: + 'C380455 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380455 Marvel comics', - searchOption: 'Uniform title', - authoritySource: 'LC Name Authority file (LCNAF)', - }, - { - value: 'C380455 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380455 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380455 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380455 Marvel comics', + searchOption: 'Uniform title', + authoritySource: 'LC Name Authority file (LCNAF)', + }, + { + value: 'C380455 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380455 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380455 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380455.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380455.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380455.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380455.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib610FieldValues = [18, testData.tag610, '2', '0', '$a Radio Vaticana $v Congresses.']; + const bib610FieldValues = [ + 18, + testData.tag610, + '2', + '0', + '$a Radio Vaticana $v Congresses.', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380455*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380455*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380455 Verify that user cant link "610" MARC Bib field with wrong record. (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib610FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag610); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField610Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380455 Verify that user cant link "610" MARC Bib field with wrong record. (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib610FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag610); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField610Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField611-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField611-with-wrong-record.cy.js index 47c61293a6..f3844808e7 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField611-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField611-with-wrong-record.cy.js @@ -11,157 +11,163 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag611: '611', - instanceField611Value: 'C380456 Vatican Council', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag611: '611', + instanceField611Value: 'C380456 Vatican Council', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380456 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380456 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380456 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380456 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380456 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380456 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380456 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380456 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380456 Marvel comics', - searchOption: 'Uniform title', - authoritySource: 'LC Name Authority file (LCNAF)', - }, - { - value: 'C380456 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380456 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380456 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380456 Marvel comics', + searchOption: 'Uniform title', + authoritySource: 'LC Name Authority file (LCNAF)', + }, + { + value: 'C380456 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380456 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380456 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380456.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380456.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380456.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380456.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib611FieldValues = [ - 15, - testData.tag611, - '2', - '0', - '$t C380456 Vatican Council $n (2nd : $c Basilica di San Pietro in Vaticano $1 http://viaf.org/viaf/133636573/', - ]; + const bib611FieldValues = [ + 15, + testData.tag611, + '2', + '0', + '$t C380456 Vatican Council $n (2nd : $c Basilica di San Pietro in Vaticano $1 http://viaf.org/viaf/133636573/', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380456*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380456*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380456 Verify that user cant link "611" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib611FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag611); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField611Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380456 Verify that user cant link "611" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib611FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag611); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField611Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField630-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField630-with-wrong-record.cy.js index 12621b3c74..e83b8cf67e 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField630-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField630-with-wrong-record.cy.js @@ -11,161 +11,167 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag630: '630', - instanceField630Value: 'C380457 Farnese hours.', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag630: '630', + instanceField630Value: 'C380457 Farnese hours.', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380457 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380457 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380457 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380457 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380457 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380457 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380457 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380457 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380457 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380457 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380457 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380457 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380457 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380457 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380457 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380457 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380457 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380457 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380457.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380457.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380457.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380457.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib630FieldValues = [ - 29, - testData.tag630, - '0', - '0', - '$t C380457 Farnese hours. $2 fast $c books', - ]; + const bib630FieldValues = [ + 29, + testData.tag630, + '0', + '0', + '$t C380457 Farnese hours. $2 fast $c books', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380457*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380457*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380457 Verify that user cant link "630" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib630FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag630); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('uniformTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField630Value); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySearchOptions(); - MarcAuthorities.checkSearchOption('uniformTitle'); - MarcAuthorities.checkSearchInput(''); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380457 Verify that user cant link "630" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib630FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag630); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('uniformTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField630Value); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySearchOptions(); + MarcAuthorities.checkSearchOption('uniformTitle'); + MarcAuthorities.checkSearchInput(''); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField650-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField650-with-wrong-record.cy.js index 865f6bc694..05c74d82c8 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField650-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField650-with-wrong-record.cy.js @@ -11,160 +11,166 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag650: '650', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag650: '650', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380458 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380458 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380458 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380458 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380458 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380458 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380458 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380458 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380458 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380458 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380458 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380458 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380458 Marvel comics', - searchOption: 'Uniform title', - authoritySource: 'LC Name Authority file (LCNAF)', - }, - { - value: 'C380458 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380458 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380458 Marvel comics', + searchOption: 'Uniform title', + authoritySource: 'LC Name Authority file (LCNAF)', + }, + { + value: 'C380458 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380458 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380458.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380458.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380458.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380458.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib650FieldValues = [ - 15, - testData.tag650, - '\\', - '7', - '$a C380458 Oratory. $2 fast $0 http://id.worldcat.org/fast/fst01047214', - ]; + const bib650FieldValues = [ + 15, + testData.tag650, + '\\', + '7', + '$a C380458 Oratory. $2 fast $0 http://id.worldcat.org/fast/fst01047214', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380458*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380458*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380458 Verify that user cant link "650" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib650FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag650); - MarcAuthorities.switchToBrowse(); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('subject'); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380458 Verify that user cant link "650" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib650FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag650); + MarcAuthorities.switchToBrowse(); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('subject'); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField651-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField651-with-wrong-record.cy.js index ba02d3e1d4..29cdc0ded3 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField651-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField651-with-wrong-record.cy.js @@ -11,175 +11,190 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag651: '651', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag651: '651', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380459 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380459 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380459 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380459 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380459 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380459 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380459 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380459 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380459 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380459 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380459 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380459 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380459 Marvel comics', - searchOption: 'Uniform title', - authoritySource: 'LC Name Authority file (LCNAF)', - }, - { - value: 'C380459 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380459 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380459 Marvel comics', + searchOption: 'Uniform title', + authoritySource: 'LC Name Authority file (LCNAF)', + }, + { + value: 'C380459 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380459 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const linkableValue = { - value: 'C380459 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }; + const linkableValue = { + value: 'C380459 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }; - const marcFiles = [ - { - marc: 'marcBibFileForC380459.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380459.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380459.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380459.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib651FieldValues = [20, testData.tag651, '\\', '0', '$e C380459 Clear Creek $4 (Tex.)']; + const bib651FieldValues = [ + 20, + testData.tag651, + '\\', + '0', + '$e C380459 Clear Creek $4 (Tex.)', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380459*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380459*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + it( + 'C380459 Verify that user cant link "651" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib651FieldValues); + InventoryInstance.verifyAndClickLinkIconByIndex(bib651FieldValues[0]); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('geographicName'); + MarcAuthorities.checkSearchInput(''); + MarcAuthorities.switchToSearch(); + InventoryInstance.verifySearchOptions(); + MarcAuthorities.checkSearchOption('geographicName'); + MarcAuthorities.checkSearchInput(''); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - it( - 'C380459 Verify that user cant link "651" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib651FieldValues); - InventoryInstance.verifyAndClickLinkIconByIndex(bib651FieldValues[0]); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('geographicName'); - MarcAuthorities.checkSearchInput(''); - MarcAuthorities.switchToSearch(); - InventoryInstance.verifySearchOptions(); - MarcAuthorities.checkSearchOption('geographicName'); - MarcAuthorities.checkSearchInput(''); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + MarcAuthorityBrowse.searchBy(linkableValue.searchOption, linkableValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkableValue.authoritySource); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex( + bib651FieldValues[1], + bib651FieldValues[0], + ); + QuickMarcEditor.verifyTagFieldAfterLinking( + bib651FieldValues[0], + bib651FieldValues[1], + bib651FieldValues[2], + bib651FieldValues[3], + '$a C380459 Gulf Stream', + '$e C380459 Clear Creek', + '$0 http://id.loc.gov/authorities/subjects/sh85057894', + '$4 (Tex.)', + ); + }, + ); }); - - MarcAuthorityBrowse.searchBy(linkableValue.searchOption, linkableValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkableValue.authoritySource); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingUsingRowIndex(bib651FieldValues[1], bib651FieldValues[0]); - QuickMarcEditor.verifyTagFieldAfterLinking( - bib651FieldValues[0], - bib651FieldValues[1], - bib651FieldValues[2], - bib651FieldValues[3], - '$a C380459 Gulf Stream', - '$e C380459 Clear Creek', - '$0 http://id.loc.gov/authorities/subjects/sh85057894', - '$4 (Tex.)', - ); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField700-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField700-with-wrong-record.cy.js index 358f21b157..7667ce5830 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField700-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField700-with-wrong-record.cy.js @@ -11,157 +11,163 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag700: '700', - instanceField700Value: 'C380461 Stelfreeze, Brian 2nd, 1901 2100 Panther Black', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag700: '700', + instanceField700Value: 'C380461 Stelfreeze, Brian 2nd, 1901 2100 Panther Black', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380461 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380461 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380461 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380461 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - { - value: 'C380461 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380461 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380461 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380461 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380461 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + { + value: 'C380461 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380461 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380461 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380461 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380461 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380461 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380461 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380461.mrc', - fileName: `testMarcFileC380461.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380461.mrc', - fileName: `testMarcFileC380461.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380461.mrc', + fileName: `testMarcFileC380461.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380461.mrc', + fileName: `testMarcFileC380461.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib700FieldValues = [ - 74, - testData.tag700, - '1', - '\\', - '$a C380461 Stelfreeze, $a Brian 2nd, $d 1901 $d 2100 $t Panther $t Black $e artist.', - ]; + const bib700FieldValues = [ + 74, + testData.tag700, + '1', + '\\', + '$a C380461 Stelfreeze, $a Brian 2nd, $d 1901 $d 2100 $t Panther $t Black $e artist.', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380461*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380461*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380461 Verify that user cant link "700" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib700FieldValues); - InventoryInstance.verifyAndClickLinkIconByIndex(bib700FieldValues[0]); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('personalNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField700Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380461 Verify that user cant link "700" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib700FieldValues); + InventoryInstance.verifyAndClickLinkIconByIndex(bib700FieldValues[0]); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('personalNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField700Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField710-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField710-with-wrong-record.cy.js index 0702e5877f..ed40de4dce 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField710-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField710-with-wrong-record.cy.js @@ -11,157 +11,163 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag710: '710', - instanceField710Value: 'C380462 Carleton University. School of Social Work.', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag710: '710', + instanceField710Value: 'C380462 Carleton University. School of Social Work.', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380462 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380462 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380462 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380462 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - { - value: 'C380462 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380462 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380462 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380462 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380462 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + { + value: 'C380462 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380462 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380462 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380462 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380462 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380462 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380462 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380462.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380462.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380462.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380462.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib710FieldValues = [ - 26, - testData.tag710, - '2', - '0', - '$a C380462 Carleton University. $a School of Social Work. $b School', - ]; + const bib710FieldValues = [ + 26, + testData.tag710, + '2', + '0', + '$a C380462 Carleton University. $a School of Social Work. $b School', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380462*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380462*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380462 Verify that user cant link "710" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib710FieldValues); - InventoryInstance.verifyAndClickLinkIconByIndex(bib710FieldValues[0]); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField710Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380462 Verify that user cant link "710" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib710FieldValues); + InventoryInstance.verifyAndClickLinkIconByIndex(bib710FieldValues[0]); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField710Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField711-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField711-with-wrong-record.cy.js index dc4a4b73d1..703e939ce8 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField711-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField711-with-wrong-record.cy.js @@ -11,156 +11,162 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag711: '711', - instanceField711Value: 'C380463 2001- 2002', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag711: '711', + instanceField711Value: 'C380463 2001- 2002', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380463 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380463 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380463 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380463 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380463 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380463 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380463 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380463 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380463 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380463 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380463 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380463 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380463 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380463 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380463 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380463 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380463.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380463.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380463.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380463.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib711FieldValues = [ - 29, - testData.tag711, - '2', - '\\', - '$d C380463 2001- $d 2002 $e Orchestra. $4 prf', - ]; + const bib711FieldValues = [ + 29, + testData.tag711, + '2', + '\\', + '$d C380463 2001- $d 2002 $e Orchestra. $4 prf', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380463*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380463*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380463 Verify that user cant link "711" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib711FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag711); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField711Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380463 Verify that user cant link "711" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib711FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag711); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField711Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField730-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField730-with-wrong-record.cy.js index e4a2841a02..408c17cc5d 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField730-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField730-with-wrong-record.cy.js @@ -11,182 +11,191 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag730: '730', - instanceField730Value: 'The Gone with the Wind', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag730: '730', + instanceField730Value: 'The Gone with the Wind', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380464 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380464 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380464 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380464 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380464 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380464 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380464 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380464 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380464 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380464 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380464 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380464 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380464 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380464 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380464 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380464 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380464 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380464 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const linkableValue = { - value: 'C380464 Marvel comics', - searchOption: 'Uniform title', - }; + const linkableValue = { + value: 'C380464 Marvel comics', + searchOption: 'Uniform title', + }; - const marcFiles = [ - { - marc: 'marcBibFileForC380464.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380464.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380464.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380464.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib730FieldValues = [ - 66, - testData.tag730, - '\\', - '\\', - '$t The Gone with $t the Wind $g test $h how $k key', - ]; + const bib730FieldValues = [ + 66, + testData.tag730, + '\\', + '\\', + '$t The Gone with $t the Wind $g test $h how $k key', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380464*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380464*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + it( + 'C380464 Verify that user cant link "730" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib730FieldValues); + InventoryInstance.verifyAndClickLinkIconByIndex(bib730FieldValues[0]); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('uniformTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField730Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - it( - 'C380464 Verify that user cant link "730" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib730FieldValues); - InventoryInstance.verifyAndClickLinkIconByIndex(bib730FieldValues[0]); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('uniformTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField730Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + MarcAuthorityBrowse.searchBy(linkableValue.searchOption, linkableValue.value); + MarcAuthorities.checkRow(linkableValue.value); + MarcAuthorities.selectTitle(linkableValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.verifyAfterLinkingUsingRowIndex( + bib730FieldValues[1], + bib730FieldValues[0], + ); + QuickMarcEditor.verifyTagFieldAfterLinking( + bib730FieldValues[0], + bib730FieldValues[1], + bib730FieldValues[2], + bib730FieldValues[3], + '$a C380464 Marvel comics', + '', + '$0 http://id.loc.gov/authorities/names/n80026980', + '', + ); + }, + ); }); - - MarcAuthorityBrowse.searchBy(linkableValue.searchOption, linkableValue.value); - MarcAuthorities.checkRow(linkableValue.value); - MarcAuthorities.selectTitle(linkableValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.verifyAfterLinkingUsingRowIndex(bib730FieldValues[1], bib730FieldValues[0]); - QuickMarcEditor.verifyTagFieldAfterLinking( - bib730FieldValues[0], - bib730FieldValues[1], - bib730FieldValues[2], - bib730FieldValues[3], - '$a C380464 Marvel comics', - '', - '$0 http://id.loc.gov/authorities/names/n80026980', - '', - ); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField800-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField800-with-wrong-record.cy.js index 9ed446ee3d..47f2cee13d 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField800-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField800-with-wrong-record.cy.js @@ -11,157 +11,163 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag800: '800', - instanceField800Value: 'C380465 Robinson, Peter, 1950- Inspector Banks series ;', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag800: '800', + instanceField800Value: 'C380465 Robinson, Peter, 1950- Inspector Banks series ;', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380465 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380465 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380465 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380465 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - { - value: 'C380465 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380465 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380465 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380465 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380465 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + { + value: 'C380465 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380465 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380465 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380465 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380465 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380465 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380465 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380465.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380465.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380465.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380465.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib800FieldValues = [ - 35, - testData.tag800, - '1', - '\\', - '$a C380465 Robinson, Peter, $d 1950- $t Inspector Banks series ; $v 24.', - ]; + const bib800FieldValues = [ + 35, + testData.tag800, + '1', + '\\', + '$a C380465 Robinson, Peter, $d 1950- $t Inspector Banks series ; $v 24.', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380465*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380465*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380465 Verify that user cant link "800" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib800FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag800); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('personalNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField800Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380465 Verify that user cant link "800" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib800FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag800); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('personalNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField800Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField810-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField810-with-wrong-record.cy.js index 110128bc89..cd229245f9 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField810-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField810-with-wrong-record.cy.js @@ -11,157 +11,164 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag810: '810', - instanceField810Value: 'C380466 John Bartholomew and Son. Bartholomew world travel series.', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag810: '810', + instanceField810Value: + 'C380466 John Bartholomew and Son. Bartholomew world travel series.', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380466 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380466 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380466 Western Region Research Conference in Agricultural Education', - searchOption: 'Corporate/Conference name', - }, - { - value: - 'C380466 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', - searchOption: 'Name-title', - }, - { - value: 'C380466 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380466 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380466 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380466 Western Region Research Conference in Agricultural Education', + searchOption: 'Corporate/Conference name', + }, + { + value: + 'C380466 Geophysical Symposium (21st : 1976 : Leipzig, Germany) Proceedings. Selections', + searchOption: 'Name-title', + }, + { + value: 'C380466 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380466 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380466 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380466 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380466 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380466 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380466 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380466.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380466.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380466.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380466.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib810FieldValues = [ - 25, - testData.tag810, - '2', - '\\', - '$a C380466 John Bartholomew and Son. $t Bartholomew world travel series.', - ]; + const bib810FieldValues = [ + 25, + testData.tag810, + '2', + '\\', + '$a C380466 John Bartholomew and Son. $t Bartholomew world travel series.', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380466*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380466*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380466 Verify that user cant link "810" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib810FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag810); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField810Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380466 Verify that user cant link "810" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib810FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag810); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField810Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField811-with-wrong-record.cy.js b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField811-with-wrong-record.cy.js index 8646a7a009..ffcc3d6d4e 100644 --- a/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField811-with-wrong-record.cy.js +++ b/cypress/e2e/marc/marc-bibliographic/edit-marc-bib/manual-linking/user-can't-link-bibField811-with-wrong-record.cy.js @@ -11,156 +11,162 @@ import TopMenu from '../../../../../support/fragments/topMenu'; import Users from '../../../../../support/fragments/users/users'; import getRandomPostfix from '../../../../../support/utils/stringTools'; -describe('MARC -> MARC Bibliographic -> Edit MARC bib -> Manual linking', () => { - const testData = { - tag811: '811', - instanceField811Value: 'C380467 1982 :', - errorMessage: - 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', - }; +describe('MARC', () => { + describe('MARC Bibliographic', () => { + describe('Edit MARC bib', () => { + describe('Manual linking', () => { + const testData = { + tag811: '811', + instanceField811Value: 'C380467 1982 :', + errorMessage: + 'You have selected an invalid heading based on the bibliographic field you want controlled. Please revise your selection.', + }; - const linkValuesWithoutAuthoritySource = [ - { - value: 'C380467 Stone, Robert B.', - searchOption: 'Personal name', - }, - { - value: 'C380467 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', - searchOption: 'Name-title', - }, - { - value: 'C380467 Catalonia (Spain). Mozos de Escuadra', - searchOption: 'Corporate/Conference name', - }, - { - value: 'C380467 United States. Truth in Lending Act', - searchOption: 'Name-title', - }, - { - value: 'C380467 Marvel comics', - searchOption: 'Uniform title', - }, - ]; + const linkValuesWithoutAuthoritySource = [ + { + value: 'C380467 Stone, Robert B.', + searchOption: 'Personal name', + }, + { + value: 'C380467 Twain, Mark, 1835-1910. Adventures of Huckleberry Finn', + searchOption: 'Name-title', + }, + { + value: 'C380467 Catalonia (Spain). Mozos de Escuadra', + searchOption: 'Corporate/Conference name', + }, + { + value: 'C380467 United States. Truth in Lending Act', + searchOption: 'Name-title', + }, + { + value: 'C380467 Marvel comics', + searchOption: 'Uniform title', + }, + ]; - const linkValuesWithAuthoritySource = [ - { - value: 'C380467 Montessori method of education', - searchOption: 'Subject', - authoritySource: String.raw`LC Children's Subject Headings`, - }, - { - value: 'C380467 Gulf Stream', - searchOption: 'Geographic name', - authoritySource: 'LC Subject Headings (LCSH)', - }, - { - value: 'C380467 Peplum films', - searchOption: 'Genre', - authoritySource: 'LC Genre/Form Terms (LCGFT)', - }, - ]; + const linkValuesWithAuthoritySource = [ + { + value: 'C380467 Montessori method of education', + searchOption: 'Subject', + authoritySource: String.raw`LC Children's Subject Headings`, + }, + { + value: 'C380467 Gulf Stream', + searchOption: 'Geographic name', + authoritySource: 'LC Subject Headings (LCSH)', + }, + { + value: 'C380467 Peplum films', + searchOption: 'Genre', + authoritySource: 'LC Genre/Form Terms (LCGFT)', + }, + ]; - const marcFiles = [ - { - marc: 'marcBibFileForC380467.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, - numOfRecords: 1, - propertyName: 'instance', - }, - { - marc: 'marcAuthFileForC380467.mrc', - fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, - jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, - numOfRecords: 10, - propertyName: 'authority', - }, - ]; + const marcFiles = [ + { + marc: 'marcBibFileForC380467.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_INSTANCE_AND_SRS, + numOfRecords: 1, + propertyName: 'instance', + }, + { + marc: 'marcAuthFileForC380467.mrc', + fileName: `testMarcFileC375070.${getRandomPostfix()}.mrc`, + jobProfileToRun: DEFAULT_JOB_PROFILE_NAMES.CREATE_AUTHORITY, + numOfRecords: 10, + propertyName: 'authority', + }, + ]; - const bib811FieldValues = [ - 25, - testData.tag811, - '2', - '\\', - '$d C380467 1982 : $c University of Delaware $v 4.', - ]; + const bib811FieldValues = [ + 25, + testData.tag811, + '2', + '\\', + '$d C380467 1982 : $c University of Delaware $v 4.', + ]; - const createdRecordIDs = []; + const createdRecordIDs = []; - before('Creating user and data', () => { - cy.getAdminToken(); - // make sure there are no duplicate records in the system - MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380467*'); + before('Creating user and data', () => { + cy.getAdminToken(); + // make sure there are no duplicate records in the system + MarcAuthorities.deleteMarcAuthorityByTitleViaAPI('C380467*'); - cy.createTempUser([ - Permissions.inventoryAll.gui, - Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, - Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, - Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, - ]).then((createdUserProperties) => { - testData.userProperties = createdUserProperties; + cy.createTempUser([ + Permissions.inventoryAll.gui, + Permissions.uiMarcAuthoritiesAuthorityRecordView.gui, + Permissions.uiQuickMarcQuickMarcBibliographicEditorAll.gui, + Permissions.uiQuickMarcQuickMarcAuthorityLinkUnlink.gui, + ]).then((createdUserProperties) => { + testData.userProperties = createdUserProperties; - cy.getAdminToken(); - marcFiles.forEach((marcFile) => { - DataImport.uploadFileViaApi( - marcFile.marc, - marcFile.fileName, - marcFile.jobProfileToRun, - ).then((response) => { - response.forEach((record) => { - createdRecordIDs.push(record[marcFile.propertyName].id); + cy.getAdminToken(); + marcFiles.forEach((marcFile) => { + DataImport.uploadFileViaApi( + marcFile.marc, + marcFile.fileName, + marcFile.jobProfileToRun, + ).then((response) => { + response.forEach((record) => { + createdRecordIDs.push(record[marcFile.propertyName].id); + }); + }); + }); + + cy.login(testData.userProperties.username, testData.userProperties.password, { + path: TopMenu.inventoryPath, + waiter: InventoryInstances.waitContentLoading, + }); }); }); - }); - cy.login(testData.userProperties.username, testData.userProperties.password, { - path: TopMenu.inventoryPath, - waiter: InventoryInstances.waitContentLoading, - }); - }); - }); - - after('Deleting created user and data', () => { - cy.getAdminToken(); - Users.deleteViaApi(testData.userProperties.userId); - createdRecordIDs.forEach((id, index) => { - if (index) MarcAuthority.deleteViaAPI(id); - else InventoryInstance.deleteInstanceViaApi(id); - }); - }); + after('Deleting created user and data', () => { + cy.getAdminToken(); + Users.deleteViaApi(testData.userProperties.userId); + createdRecordIDs.forEach((id, index) => { + if (index) MarcAuthority.deleteViaAPI(id); + else InventoryInstance.deleteInstanceViaApi(id); + }); + }); - it( - 'C380467 Verify that user cant link "811" MARC Bib field with wrong record (spitfire) (TaaS)', - { tags: ['extendedPath', 'spitfire'] }, - () => { - InventoryInstances.searchByTitle(createdRecordIDs[0]); - InventoryInstances.selectInstance(); - InventoryInstance.editMarcBibliographicRecord(); - QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib811FieldValues); - InventoryInstance.verifyAndClickLinkIcon(testData.tag811); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.checkSearchOption('corporateNameTitle'); - MarcAuthorities.checkSearchInput(testData.instanceField811Value); - MarcAuthorities.verifyEmptyAuthorityField(); - linkValuesWithoutAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.checkRow(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - }); + it( + 'C380467 Verify that user cant link "811" MARC Bib field with wrong record (spitfire) (TaaS)', + { tags: ['extendedPath', 'spitfire'] }, + () => { + InventoryInstances.searchByTitle(createdRecordIDs[0]); + InventoryInstances.selectInstance(); + InventoryInstance.editMarcBibliographicRecord(); + QuickMarcEditor.verifyTagFieldAfterUnlinking(...bib811FieldValues); + InventoryInstance.verifyAndClickLinkIcon(testData.tag811); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.checkSearchOption('corporateNameTitle'); + MarcAuthorities.checkSearchInput(testData.instanceField811Value); + MarcAuthorities.verifyEmptyAuthorityField(); + linkValuesWithoutAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.checkRow(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + }); - linkValuesWithAuthoritySource.forEach((linkValue) => { - MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); - MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); - MarcAuthorities.selectTitle(linkValue.value); - MarcAuthorities.selectTitle(linkValue.value); - InventoryInstance.clickLinkButton(); - QuickMarcEditor.checkCallout(testData.errorMessage); - InventoryInstance.verifySelectMarcAuthorityModal(); - MarcAuthorities.closeAuthoritySourceOption(); + linkValuesWithAuthoritySource.forEach((linkValue) => { + MarcAuthorityBrowse.searchBy(linkValue.searchOption, linkValue.value); + MarcAuthorities.chooseAuthoritySourceOption(linkValue.authoritySource); + MarcAuthorities.selectTitle(linkValue.value); + MarcAuthorities.selectTitle(linkValue.value); + InventoryInstance.clickLinkButton(); + QuickMarcEditor.checkCallout(testData.errorMessage); + InventoryInstance.verifySelectMarcAuthorityModal(); + MarcAuthorities.closeAuthoritySourceOption(); + }); + }, + ); }); - }, - ); + }); + }); }); diff --git a/cypress/e2e/marc/marc-holdings/call-number-fields-are-cleared-after-user-deletes-mapped-values-from-marc-holdings-record.cy.js b/cypress/e2e/marc/marc-holdings/call-number-fields-are-cleared-after-user-deletes-mapped-values-from-marc-holdings-record.cy.js index b5a5021913..eb5758fd44 100644 --- a/cypress/e2e/marc/marc-holdings/call-number-fields-are-cleared-after-user-deletes-mapped-values-from-marc-holdings-record.cy.js +++ b/cypress/e2e/marc/marc-holdings/call-number-fields-are-cleared-after-user-deletes-mapped-values-from-marc-holdings-record.cy.js @@ -120,8 +120,8 @@ describe('MARC', () => { InventoryInstance.openHoldings(['']); InventoryInstance.openItemByBarcode(testData.itemBarcode); ItemRecordView.waitLoading(); - ItemRecordView.verifyShelvingOrder('-'); - ItemRecordView.verifyCallNumber('-'); + ItemRecordView.verifyShelvingOrder('No value set-'); + ItemRecordView.verifyCallNumber('No value set-'); ItemRecordView.closeDetailView(); InventoryInstance.waitInventoryLoading(); InventorySearchAndFilter.selectBrowseCallNumbers(); diff --git a/cypress/e2e/orders/connected-pol.cy.js b/cypress/e2e/orders/connected-pol.cy.js index bf55f57082..7b4cf61ec5 100644 --- a/cypress/e2e/orders/connected-pol.cy.js +++ b/cypress/e2e/orders/connected-pol.cy.js @@ -7,7 +7,7 @@ import Organizations from '../../support/fragments/organizations/organizations'; import TopMenu from '../../support/fragments/topMenu'; import Users from '../../support/fragments/users/users'; -describe('orders: create an order', () => { +describe('Orders', () => { const order = { ...NewOrder.defaultOneTimeOrder }; const organization = { ...NewOrganization.defaultUiOrganizations }; let user; diff --git a/cypress/e2e/orders/create-ongoing-order.cy.js b/cypress/e2e/orders/create-ongoing-order.cy.js index 3b642ebe10..adef94c73b 100644 --- a/cypress/e2e/orders/create-ongoing-order.cy.js +++ b/cypress/e2e/orders/create-ongoing-order.cy.js @@ -8,7 +8,7 @@ import TopMenu from '../../support/fragments/topMenu'; import Users from '../../support/fragments/users/users'; import InteractorsTools from '../../support/utils/interactorsTools'; -describe('orders: create an order', () => { +describe('Orders', () => { const order = { ...NewOrder.defaultOneTimeOrder, orderType: 'Ongoing', diff --git a/cypress/e2e/orders/create-order.cy.js b/cypress/e2e/orders/create-order.cy.js index 06d2a689a9..5ede3492f7 100644 --- a/cypress/e2e/orders/create-order.cy.js +++ b/cypress/e2e/orders/create-order.cy.js @@ -4,7 +4,7 @@ import NewOrganization from '../../support/fragments/organizations/newOrganizati import Organizations from '../../support/fragments/organizations/organizations'; import TopMenu from '../../support/fragments/topMenu'; -describe('orders: create an order', () => { +describe('Orders', () => { const order = { ...NewOrder.defaultOneTimeOrder }; const organization = { ...NewOrganization.defaultUiOrganizations }; diff --git a/cypress/e2e/orders/duplicate-order.cy.js b/cypress/e2e/orders/duplicate-order.cy.js index 744e098701..1341bee3e4 100644 --- a/cypress/e2e/orders/duplicate-order.cy.js +++ b/cypress/e2e/orders/duplicate-order.cy.js @@ -11,7 +11,7 @@ import Users from '../../support/fragments/users/users'; import InteractorsTools from '../../support/utils/interactorsTools'; import getRandomPostfix from '../../support/utils/stringTools'; -describe('orders: duplicate', () => { +describe('Orders', () => { const order = { ...NewOrder.defaultOneTimeOrder, orderType: 'Ongoing', diff --git a/cypress/e2e/orders/edifact-export-to-a-vendor.cy.js b/cypress/e2e/orders/edifact-export-to-a-vendor.cy.js index 38847a62f3..ce575f3a88 100644 --- a/cypress/e2e/orders/edifact-export-to-a-vendor.cy.js +++ b/cypress/e2e/orders/edifact-export-to-a-vendor.cy.js @@ -12,151 +12,155 @@ import Users from '../../support/fragments/users/users'; import DateTools from '../../support/utils/dateTools'; import getRandomPostfix from '../../support/utils/stringTools'; -describe('orders: export', () => { - const order = { - ...NewOrder.defaultOneTimeOrder, - orderType: 'Ongoing', - ongoing: { isSubscription: false, manualRenewal: false }, - approved: true, - }; - const organization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout2', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const integrationName1 = `FirstIntegrationName${getRandomPostfix()}`; - const integrationName2 = `SecondIntegrationName${getRandomPostfix()}`; - const integartionDescription1 = 'Test Integation descripton1'; - const integartionDescription2 = 'Test Integation descripton2'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); - const vendorEDICodeFor2Integration = getRandomPostfix(); - const libraryEDICodeFor2Integration = getRandomPostfix(); - let user; - let location; - let servicePointId; - let orderNumber; - const UTCTime = DateTools.getUTCDateForScheduling(); +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const order = { + ...NewOrder.defaultOneTimeOrder, + orderType: 'Ongoing', + ongoing: { isSubscription: false, manualRenewal: false }, + approved: true, + }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout2', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const integrationName1 = `FirstIntegrationName${getRandomPostfix()}`; + const integrationName2 = `SecondIntegrationName${getRandomPostfix()}`; + const integartionDescription1 = 'Test Integation descripton1'; + const integartionDescription2 = 'Test Integation descripton2'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + const vendorEDICodeFor2Integration = getRandomPostfix(); + const libraryEDICodeFor2Integration = getRandomPostfix(); + let user; + let location; + let servicePointId; + let orderNumber; + const UTCTime = DateTools.getUTCDateForScheduling(); - before(() => { - cy.getAdminToken(); + before(() => { + cy.getAdminToken(); - ServicePoints.getViaApi().then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { - location = res; + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { + location = res; + }); + }); + Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { + organization.id = organizationsResponse; + order.vendor = organizationsResponse; + }); + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformation( + integrationName1, + integartionDescription1, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + organization.accounts[0].accountNo, + 'Purchase', + UTCTime, + ); + Organizations.addIntegration(); + cy.wait(2000); + Organizations.fillIntegrationInformation( + integrationName2, + integartionDescription2, + vendorEDICodeFor2Integration, + libraryEDICodeFor2Integration, + organization.accounts[1].accountNo, + 'Purchase At Vendor System', + UTCTime, + ); + + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + }); + // Need to wait while first job will be runing + cy.wait(70000); + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrganizationsViewEditCreate.gui, + permissions.uiOrganizationsView.gui, + permissions.uiExportOrders.gui, + permissions.exportManagerAll.gui, + permissions.exportManagerDownloadAndResendFiles.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + }); }); - }); - Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { - organization.id = organizationsResponse; - order.vendor = organizationsResponse; - }); - cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); - Organizations.searchByParameters('Name', organization.name); - Organizations.checkSearchResults(organization); - Organizations.selectOrganization(organization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformation( - integrationName1, - integartionDescription1, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - organization.accounts[0].accountNo, - 'Purchase', - UTCTime, - ); - Organizations.addIntegration(); - cy.wait(2000); - Organizations.fillIntegrationInformation( - integrationName2, - integartionDescription2, - vendorEDICodeFor2Integration, - libraryEDICodeFor2Integration, - organization.accounts[1].accountNo, - 'Purchase At Vendor System', - UTCTime, - ); - cy.createOrderApi(order).then((response) => { - orderNumber = response.body.poNumber; - }); - // Need to wait while first job will be runing - cy.wait(70000); - cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrganizationsViewEditCreate.gui, - permissions.uiOrganizationsView.gui, - permissions.uiExportOrders.gui, - permissions.exportManagerAll.gui, - permissions.exportManagerDownloadAndResendFiles.gui, - ]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.ordersPath, - waiter: Orders.waitLoading, + after(() => { + cy.getAdminToken(); + Users.deleteViaApi(user.userId); }); - }); - }); - after(() => { - cy.getAdminToken(); - Users.deleteViaApi(user.userId); + it( + 'C350402: Verify that an Order is exported to a definite Vendors Account specified in one of several Integration configurations (thunderjet)', + { tags: ['smoke', 'thunderjet'] }, + () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 5); + OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.exportManagerOrganizationsPath); + ExportManagerSearchPane.selectOrganizationsSearch(); + ExportManagerSearchPane.selectExportMethod(integrationName1); + ExportManagerSearchPane.selectJobByIntegrationInList(integrationName1); + ExportManagerSearchPane.rerunJob(); + cy.reload(); + ExportManagerSearchPane.verifyResult('Successful'); + ExportManagerSearchPane.selectJob('Successful'); + ExportManagerSearchPane.downloadJob(); + ExportManagerSearchPane.resetAll(); + ExportManagerSearchPane.selectOrganizationsSearch(); + ExportManagerSearchPane.selectExportMethod(integrationName2); + ExportManagerSearchPane.selectJobByIntegrationInList(integrationName2); + ExportManagerSearchPane.rerunJob(); + cy.reload(); + ExportManagerSearchPane.verifyResult('Failed'); + }, + ); + }); }); - - it( - 'C350402: Verify that an Order is exported to a definite Vendors Account specified in one of several Integration configurations (thunderjet)', - { tags: ['smoke', 'thunderjet'] }, - () => { - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 5); - OrderLines.fillInPOLineInfoForExportWithLocation('Purchase', location.name); - OrderLines.backToEditingOrder(); - Orders.openOrder(); - cy.visit(TopMenu.exportManagerOrganizationsPath); - ExportManagerSearchPane.selectOrganizationsSearch(); - ExportManagerSearchPane.selectExportMethod(integrationName1); - ExportManagerSearchPane.selectJobByIntegrationInList(integrationName1); - ExportManagerSearchPane.rerunJob(); - cy.reload(); - ExportManagerSearchPane.verifyResult('Successful'); - ExportManagerSearchPane.selectJob('Successful'); - ExportManagerSearchPane.downloadJob(); - ExportManagerSearchPane.resetAll(); - ExportManagerSearchPane.selectOrganizationsSearch(); - ExportManagerSearchPane.selectExportMethod(integrationName2); - ExportManagerSearchPane.selectJobByIntegrationInList(integrationName2); - ExportManagerSearchPane.rerunJob(); - cy.reload(); - ExportManagerSearchPane.verifyResult('Failed'); - }, - ); }); diff --git a/cypress/e2e/orders/edifact-exports/create-order-to-edifact-export.cy.js b/cypress/e2e/orders/edifact-exports/create-order-to-edifact-export.cy.js index 74335189fa..9e6e5e840a 100644 --- a/cypress/e2e/orders/edifact-exports/create-order-to-edifact-export.cy.js +++ b/cypress/e2e/orders/edifact-exports/create-order-to-edifact-export.cy.js @@ -11,113 +11,117 @@ import Users from '../../../support/fragments/users/users'; import DateTools from '../../../support/utils/dateTools'; import getRandomPostfix from '../../../support/utils/stringTools'; -describe('orders: export', () => { - const order = { ...NewOrder.defaultOneTimeOrder }; - const organization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const integrationName1 = `FirstIntegrationName${getRandomPostfix()}`; - const integartionDescription1 = 'Test Integation descripton1'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const order = { ...NewOrder.defaultOneTimeOrder }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const integrationName1 = `FirstIntegrationName${getRandomPostfix()}`; + const integartionDescription1 = 'Test Integation descripton1'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); - let user; - let location; - let servicePointId; - const UTCTime = DateTools.getUTCDateForScheduling(); + let user; + let location; + let servicePointId; + const UTCTime = DateTools.getUTCDateForScheduling(); - before(() => { - cy.getAdminToken(); + before(() => { + cy.getAdminToken(); - ServicePoints.getViaApi().then((servicePoint) => { - servicePointId = servicePoint[0].id; - NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { - location = res; - }); - }); + ServicePoints.getViaApi().then((servicePoint) => { + servicePointId = servicePoint[0].id; + NewLocation.createViaApi(NewLocation.getDefaultLocation(servicePointId)).then((res) => { + location = res; + }); + }); - Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { - organization.id = organizationsResponse; - order.vendor = organization.name; - order.orderType = 'One-time'; - }); - cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); - Organizations.searchByParameters('Name', organization.name); - Organizations.checkSearchResults(organization); - Organizations.selectOrganization(organization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformation( - integrationName1, - integartionDescription1, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - organization.accounts[0].accountNo, - 'Purchase', - UTCTime, - ); + Organizations.createOrganizationViaApi(organization).then((organizationsResponse) => { + organization.id = organizationsResponse; + order.vendor = organization.name; + order.orderType = 'One-time'; + }); + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformation( + integrationName1, + integartionDescription1, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + organization.accounts[0].accountNo, + 'Purchase', + UTCTime, + ); - cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrganizationsViewEditCreate.gui, - permissions.uiOrganizationsView.gui, - permissions.uiExportOrders.gui, - permissions.exportManagerAll.gui, - permissions.exportManagerDownloadAndResendFiles.gui, - ]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.ordersPath, - waiter: Orders.waitLoading, + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrganizationsViewEditCreate.gui, + permissions.uiOrganizationsView.gui, + permissions.uiExportOrders.gui, + permissions.exportManagerAll.gui, + permissions.exportManagerDownloadAndResendFiles.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + }); }); - }); - }); - after(() => { - cy.getAdminToken(); - Orders.deleteOrderViaApi(order.id); - Organizations.deleteOrganizationViaApi(organization.id); - NewLocation.deleteInstitutionCampusLibraryLocationViaApi( - location.institutionId, - location.campusId, - location.libraryId, - location.id, - ); - Users.deleteViaApi(user.userId); - }); - - it( - 'C350395: Verify that Orders can be created for the selected Vendors EDIFACT export (thunderjet)', - { tags: ['smoke', 'thunderjet'] }, - () => { - cy.visit(TopMenu.ordersPath); - Orders.createOrder(order, true, false).then((orderId) => { - order.id = orderId; - Orders.createPOLineViaActions(); - OrderLines.selectRandomInstanceInTitleLookUP('*', 15); - OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource( - 'Purchase', - location.name, - '3', + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(order.id); + Organizations.deleteOrganizationViaApi(organization.id); + NewLocation.deleteInstitutionCampusLibraryLocationViaApi( + location.institutionId, + location.campusId, + location.libraryId, + location.id, ); - OrderLines.backToEditingOrder(); + Users.deleteViaApi(user.userId); }); - }, - ); + + it( + 'C350395: Verify that Orders can be created for the selected Vendors EDIFACT export (thunderjet)', + { tags: ['smoke', 'thunderjet'] }, + () => { + cy.visit(TopMenu.ordersPath); + Orders.createOrder(order, true, false).then((orderId) => { + order.id = orderId; + Orders.createPOLineViaActions(); + OrderLines.selectRandomInstanceInTitleLookUP('*', 15); + OrderLines.fillInPOLineInfoForExportWithLocationForPhysicalResource( + 'Purchase', + location.name, + '3', + ); + OrderLines.backToEditingOrder(); + }); + }, + ); + }); + }); }); diff --git a/cypress/e2e/orders/open-order-for-physical-material.cy.js b/cypress/e2e/orders/open-order-for-physical-material.cy.js index 22251c1a92..270cfe9c10 100644 --- a/cypress/e2e/orders/open-order-for-physical-material.cy.js +++ b/cypress/e2e/orders/open-order-for-physical-material.cy.js @@ -7,7 +7,7 @@ import newOrganization from '../../support/fragments/organizations/newOrganizati import basicOrderLine from '../../support/fragments/orders/basicOrderLine'; import Organizations from '../../support/fragments/organizations/organizations'; -describe('orders: create an order', () => { +describe('Orders', () => { const organization = { ...newOrganization.defaultUiOrganizations }; const order = { ...NewOrder.defaultOneTimeOrder }; const orderLineTitle = basicOrderLine.defaultOrderLine.titleOrPackage; diff --git a/cypress/e2e/orders/orders-export-to-a-vendor-with-open-order.cy.js b/cypress/e2e/orders/orders-export-to-a-vendor-with-open-order.cy.js index 92def68c50..dc987d2d54 100644 --- a/cypress/e2e/orders/orders-export-to-a-vendor-with-open-order.cy.js +++ b/cypress/e2e/orders/orders-export-to-a-vendor-with-open-order.cy.js @@ -10,90 +10,94 @@ import Users from '../../support/fragments/users/users'; import InteractorsTools from '../../support/utils/interactorsTools'; import getRandomPostfix from '../../support/utils/stringTools'; -describe('orders: export', () => { - const order = { ...NewOrder.defaultOneTimeOrder }; - const organization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const integrationName = `FirstIntegrationName${getRandomPostfix()}`; - const integartionDescription = 'Test Integation descripton1'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); - let user; +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const order = { ...NewOrder.defaultOneTimeOrder }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const integrationName = `FirstIntegrationName${getRandomPostfix()}`; + const integartionDescription = 'Test Integation descripton1'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + let user; - before(() => { - cy.getAdminToken(); - Organizations.createOrganizationViaApi(organization).then((response) => { - organization.id = response; - order.vendor = organization.name; - order.orderType = 'One-time'; - }); - cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); - Organizations.searchByParameters('Name', organization.name); - Organizations.checkSearchResults(organization); - Organizations.selectOrganization(organization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformationWithoutScheduling( - integrationName, - integartionDescription, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - organization.accounts[0].accountNo, - 'Purchase', - ); - InteractorsTools.checkCalloutMessage('Integration was saved'); - cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrganizationsViewEditCreate.gui, - permissions.uiOrganizationsView.gui, - permissions.uiExportOrders.gui, - permissions.exportManagerAll.gui, - ]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.ordersPath, - waiter: Orders.waitLoading, + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = organization.name; + order.orderType = 'One-time'; + }); + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformationWithoutScheduling( + integrationName, + integartionDescription, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + organization.accounts[0].accountNo, + 'Purchase', + ); + InteractorsTools.checkCalloutMessage('Integration was saved'); + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrganizationsViewEditCreate.gui, + permissions.uiOrganizationsView.gui, + permissions.uiExportOrders.gui, + permissions.exportManagerAll.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + }); }); - }); - }); - - after(() => { - cy.getAdminToken(); - Orders.deleteOrderViaApi(order.id); - Organizations.deleteOrganizationViaApi(organization.id); - Users.deleteViaApi(user.userId); - }); - it( - 'C350398: Verify that Order is not exported to a definite Vendor if Automatic export option in Order PO Line is disabled (thunderjet)', - { tags: ['smoke', 'thunderjet'] }, - () => { - Orders.createOrder(order, true, true).then((orderId) => { - order.id = orderId; - Orders.createPOLineViaActions(); - OrderLines.fillInPOLineInfoForExport('Purchase'); - OrderLines.backToEditingOrder(); - Orders.openOrder(); - cy.visit(TopMenu.exportManagerPath); - ExportManagerSearchPane.searchById('Gobi Library Solutions'); + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(order.id); + Organizations.deleteOrganizationViaApi(organization.id); + Users.deleteViaApi(user.userId); }); - }, - ); + + it( + 'C350398: Verify that Order is not exported to a definite Vendor if Automatic export option in Order PO Line is disabled (thunderjet)', + { tags: ['smoke', 'thunderjet'] }, + () => { + Orders.createOrder(order, true, true).then((orderId) => { + order.id = orderId; + Orders.createPOLineViaActions(); + OrderLines.fillInPOLineInfoForExport('Purchase'); + OrderLines.backToEditingOrder(); + Orders.openOrder(); + cy.visit(TopMenu.exportManagerPath); + ExportManagerSearchPane.searchById('Gobi Library Solutions'); + }); + }, + ); + }); + }); }); diff --git a/cypress/e2e/orders/orders-export-to-a-vendor.cy.js b/cypress/e2e/orders/orders-export-to-a-vendor.cy.js index 88e2e38748..ff6a4d079b 100644 --- a/cypress/e2e/orders/orders-export-to-a-vendor.cy.js +++ b/cypress/e2e/orders/orders-export-to-a-vendor.cy.js @@ -9,87 +9,91 @@ import Users from '../../support/fragments/users/users'; import InteractorsTools from '../../support/utils/interactorsTools'; import getRandomPostfix from '../../support/utils/stringTools'; -describe('orders: export', () => { - const order = { ...NewOrder.defaultOneTimeOrder }; - const organization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const integrationName = `FirstIntegrationName${getRandomPostfix()}`; - const integartionDescription = 'Test Integation descripton1'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); - let user; +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const order = { ...NewOrder.defaultOneTimeOrder }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const integrationName = `FirstIntegrationName${getRandomPostfix()}`; + const integartionDescription = 'Test Integation descripton1'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + let user; - before(() => { - cy.getAdminToken(); - Organizations.createOrganizationViaApi(organization).then((response) => { - organization.id = response; - order.vendor = organization.name; - order.orderType = 'One-time'; - }); - cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); - Organizations.searchByParameters('Name', organization.name); - Organizations.checkSearchResults(organization); - Organizations.selectOrganization(organization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformationWithoutScheduling( - integrationName, - integartionDescription, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - organization.accounts[0].accountNo, - 'Purchase', - ); - InteractorsTools.checkCalloutMessage('Integration was saved'); - cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrganizationsViewEditCreate.gui, - permissions.uiOrganizationsView.gui, - permissions.uiExportOrders.gui, - permissions.exportManagerAll.gui, - ]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.ordersPath, - waiter: Orders.waitLoading, + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = organization.name; + order.orderType = 'One-time'; + }); + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformationWithoutScheduling( + integrationName, + integartionDescription, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + organization.accounts[0].accountNo, + 'Purchase', + ); + InteractorsTools.checkCalloutMessage('Integration was saved'); + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrganizationsViewEditCreate.gui, + permissions.uiOrganizationsView.gui, + permissions.uiExportOrders.gui, + permissions.exportManagerAll.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + }); }); - }); - }); - - after(() => { - cy.getAdminToken(); - Orders.deleteOrderViaApi(order.id); - Organizations.deleteOrganizationViaApi(organization.id); - Users.deleteViaApi(user.userId); - }); - it( - 'C350396: Verify that Order is not exported to a definite Vendor if Acquisition method selected in the Order line DOES NOT match Organization Integration configs (thunderjet)', - { tags: ['smoke', 'thunderjet'] }, - () => { - Orders.createOrder(order, true, false).then((orderId) => { - order.id = orderId; - Orders.createPOLineViaActions(); - OrderLines.fillInPOLineInfoForExport('Purchase'); - OrderLines.backToEditingOrder(); + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(order.id); + Organizations.deleteOrganizationViaApi(organization.id); + Users.deleteViaApi(user.userId); }); - }, - ); + + it( + 'C350396: Verify that Order is not exported to a definite Vendor if Acquisition method selected in the Order line DOES NOT match Organization Integration configs (thunderjet)', + { tags: ['smoke', 'thunderjet'] }, + () => { + Orders.createOrder(order, true, false).then((orderId) => { + order.id = orderId; + Orders.createPOLineViaActions(); + OrderLines.fillInPOLineInfoForExport('Purchase'); + OrderLines.backToEditingOrder(); + }); + }, + ); + }); + }); }); diff --git a/cypress/e2e/orders/pol-search-am-filter.cy.js b/cypress/e2e/orders/pol-search-am-filter.cy.js index 268878f594..109076218b 100644 --- a/cypress/e2e/orders/pol-search-am-filter.cy.js +++ b/cypress/e2e/orders/pol-search-am-filter.cy.js @@ -13,114 +13,118 @@ import getRandomPostfix from '../../support/utils/stringTools'; Cypress.on('uncaught:exception', () => false); -describe('orders: export', () => { - const order = { ...NewOrder.defaultOneTimeOrder }; - const organization = { - ...NewOrganization.defaultUiOrganizations, - accounts: [ - { - accountNo: getRandomPostfix(), - accountStatus: 'Active', - acqUnitIds: [], - appSystemNo: '', - description: 'Main library account', - libraryCode: 'COB', - libraryEdiCode: getRandomPostfix(), - name: 'TestAccout1', - notes: '', - paymentMethod: 'Cash', - }, - ], - }; - const integrationName = `FirstIntegrationName${getRandomPostfix()}`; - const integartionDescription = 'Test Integation descripton1'; - const vendorEDICodeFor1Integration = getRandomPostfix(); - const libraryEDICodeFor1Integration = getRandomPostfix(); - let user; - let orderNumber = null; +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const order = { ...NewOrder.defaultOneTimeOrder }; + const organization = { + ...NewOrganization.defaultUiOrganizations, + accounts: [ + { + accountNo: getRandomPostfix(), + accountStatus: 'Active', + acqUnitIds: [], + appSystemNo: '', + description: 'Main library account', + libraryCode: 'COB', + libraryEdiCode: getRandomPostfix(), + name: 'TestAccout1', + notes: '', + paymentMethod: 'Cash', + }, + ], + }; + const integrationName = `FirstIntegrationName${getRandomPostfix()}`; + const integartionDescription = 'Test Integation descripton1'; + const vendorEDICodeFor1Integration = getRandomPostfix(); + const libraryEDICodeFor1Integration = getRandomPostfix(); + let user; + let orderNumber = null; - before(() => { - cy.getAdminToken(); - Organizations.createOrganizationViaApi(organization).then((organizationResponse) => { - organization.id = organizationResponse; - order.vendor = organization.name; - order.orderType = 'One-time'; - cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); - Organizations.searchByParameters('Name', organization.name); - Organizations.checkSearchResults(organization); - Organizations.selectOrganization(organization.name); - Organizations.addIntegration(); - Organizations.fillIntegrationInformationWithoutScheduling( - integrationName, - integartionDescription, - vendorEDICodeFor1Integration, - libraryEDICodeFor1Integration, - organization.accounts[0].accountNo, - 'Purchase', - ); - InteractorsTools.checkCalloutMessage('Integration was saved'); - cy.visit(SettingsMenu.ordersPurchaseOrderLinesLimit); - SettingsOrders.waitLoadingPurchaseOrderLinesLimit(); - SettingsOrders.setPurchaseOrderLinesLimit(3); - cy.visit(TopMenu.ordersPath); - order.orderType = 'Ongoing'; - Orders.createOrder(order, true, false).then((orderId) => { - order.id = orderId; - Orders.createPOLineViaActions(); - OrderLines.fillInPOLineInfoForExport('Purchase'); - OrderLines.backToEditingOrder(); - Orders.createPOLineViaActions(); - OrderLines.fillInPOLineInfoForExport('Purchase at vendor system'); - OrderLines.backToEditingOrder(); - Orders.createPOLineViaActions(); - OrderLines.fillInPOLineInfoForExport('Depository'); - Orders.getOrdersApi({ limit: 1, query: `"id"=="${orderId}"` }).then((response) => { - orderNumber = response[0].poNumber; + before(() => { + cy.getAdminToken(); + Organizations.createOrganizationViaApi(organization).then((organizationResponse) => { + organization.id = organizationResponse; + order.vendor = organization.name; + order.orderType = 'One-time'; + cy.loginAsAdmin({ path: TopMenu.organizationsPath, waiter: Organizations.waitLoading }); + Organizations.searchByParameters('Name', organization.name); + Organizations.checkSearchResults(organization); + Organizations.selectOrganization(organization.name); + Organizations.addIntegration(); + Organizations.fillIntegrationInformationWithoutScheduling( + integrationName, + integartionDescription, + vendorEDICodeFor1Integration, + libraryEDICodeFor1Integration, + organization.accounts[0].accountNo, + 'Purchase', + ); + InteractorsTools.checkCalloutMessage('Integration was saved'); + cy.visit(SettingsMenu.ordersPurchaseOrderLinesLimit); + SettingsOrders.waitLoadingPurchaseOrderLinesLimit(); + SettingsOrders.setPurchaseOrderLinesLimit(3); + cy.visit(TopMenu.ordersPath); + order.orderType = 'Ongoing'; + Orders.createOrder(order, true, false).then((orderId) => { + order.id = orderId; + Orders.createPOLineViaActions(); + OrderLines.fillInPOLineInfoForExport('Purchase'); + OrderLines.backToEditingOrder(); + Orders.createPOLineViaActions(); + OrderLines.fillInPOLineInfoForExport('Purchase at vendor system'); + OrderLines.backToEditingOrder(); + Orders.createPOLineViaActions(); + OrderLines.fillInPOLineInfoForExport('Depository'); + Orders.getOrdersApi({ limit: 1, query: `"id"=="${orderId}"` }).then((response) => { + orderNumber = response[0].poNumber; + }); + }); + }); + + cy.createTempUser([ + permissions.uiOrdersView.gui, + permissions.uiOrdersCreate.gui, + permissions.uiOrdersEdit.gui, + permissions.uiOrdersApprovePurchaseOrders.gui, + permissions.uiOrganizationsViewEditCreate.gui, + permissions.uiOrganizationsView.gui, + permissions.uiExportOrders.gui, + permissions.exportManagerAll.gui, + ]).then((userProperties) => { + user = userProperties; + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); }); }); - }); - cy.createTempUser([ - permissions.uiOrdersView.gui, - permissions.uiOrdersCreate.gui, - permissions.uiOrdersEdit.gui, - permissions.uiOrdersApprovePurchaseOrders.gui, - permissions.uiOrganizationsViewEditCreate.gui, - permissions.uiOrganizationsView.gui, - permissions.uiExportOrders.gui, - permissions.exportManagerAll.gui, - ]).then((userProperties) => { - user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.ordersPath, - waiter: Orders.waitLoading, + after(() => { + cy.loginAsAdmin(); + cy.visit(SettingsMenu.ordersPurchaseOrderLinesLimit); + SettingsOrders.setPurchaseOrderLinesLimit(1); + Orders.deleteOrderViaApi(order.id); + Organizations.deleteOrganizationViaApi(organization.id); + Users.deleteViaApi(user.userId); }); - }); - }); - after(() => { - cy.loginAsAdmin(); - cy.visit(SettingsMenu.ordersPurchaseOrderLinesLimit); - SettingsOrders.setPurchaseOrderLinesLimit(1); - Orders.deleteOrderViaApi(order.id); - Organizations.deleteOrganizationViaApi(organization.id); - Users.deleteViaApi(user.userId); + it( + 'C350603: Searching POL by specifying acquisition method (thunderjet)', + { tags: ['smoke', 'thunderjet'] }, + () => { + Orders.selectOrderLines(); + Orders.selectFilterAcquisitionMethod('Purchase'); + Orders.checkOrderlineSearchResults(`${orderNumber}-1`); + Orders.resetFilters(); + Orders.selectFilterAcquisitionMethod('Purchase at vendor system'); + Orders.checkOrderlineSearchResults(`${orderNumber}-2`); + Orders.resetFilters(); + Orders.selectFilterAcquisitionMethod('Depository'); + Orders.checkOrderlineSearchResults(`${orderNumber}-3`); + Orders.resetFilters(); + }, + ); + }); }); - - it( - 'C350603: Searching POL by specifying acquisition method (thunderjet)', - { tags: ['smoke', 'thunderjet'] }, - () => { - Orders.selectOrderLines(); - Orders.selectFilterAcquisitionMethod('Purchase'); - Orders.checkOrderlineSearchResults(`${orderNumber}-1`); - Orders.resetFilters(); - Orders.selectFilterAcquisitionMethod('Purchase at vendor system'); - Orders.checkOrderlineSearchResults(`${orderNumber}-2`); - Orders.resetFilters(); - Orders.selectFilterAcquisitionMethod('Depository'); - Orders.checkOrderlineSearchResults(`${orderNumber}-3`); - Orders.resetFilters(); - }, - ); }); diff --git a/cypress/e2e/orders/select-acquisition-method-from-POL.cy.js b/cypress/e2e/orders/select-acquisition-method-from-POL.cy.js index 317d699cd8..9ac22f7bd4 100644 --- a/cypress/e2e/orders/select-acquisition-method-from-POL.cy.js +++ b/cypress/e2e/orders/select-acquisition-method-from-POL.cy.js @@ -9,64 +9,68 @@ import Users from '../../support/fragments/users/users'; import generateItemBarcode from '../../support/utils/generateItemBarcode'; import InteractorsTools from '../../support/utils/interactorsTools'; -describe('orders: Export', () => { - const organization = { - ...NewOrganization.defaultUiOrganizations, - paymentMethod: 'EFT', - }; - const order = { - ...NewOrder.defaultOneTimeOrder, - poNumberPrefix: 'pref', - poNumberSuffix: 'suf', - poNumber: `pref${generateItemBarcode()}suf`, - manualPo: false, - approved: true, - }; - let orderNumber; - let user; - let orderID; +describe('Export Manager', () => { + describe('Export Orders in EDIFACT format', () => { + describe('Orders Export to a Vendor', () => { + const organization = { + ...NewOrganization.defaultUiOrganizations, + paymentMethod: 'EFT', + }; + const order = { + ...NewOrder.defaultOneTimeOrder, + poNumberPrefix: 'pref', + poNumberSuffix: 'suf', + poNumber: `pref${generateItemBarcode()}suf`, + manualPo: false, + approved: true, + }; + let orderNumber; + let user; + let orderID; - before(() => { - cy.getAdminToken(); + before(() => { + cy.getAdminToken(); - Organizations.createOrganizationViaApi(organization).then((response) => { - organization.id = response; - order.vendor = response; - }); - cy.createOrderApi(order).then((response) => { - orderNumber = response.body.poNumber; - orderID = response.body.id; - }); - cy.createTempUser([ - permissions.uiOrdersCreate.gui, - permissions.uiOrdersView.gui, - permissions.uiOrdersEdit.gui, - ]).then((userProperties) => { - user = userProperties; + Organizations.createOrganizationViaApi(organization).then((response) => { + organization.id = response; + order.vendor = response; + }); + cy.createOrderApi(order).then((response) => { + orderNumber = response.body.poNumber; + orderID = response.body.id; + }); + cy.createTempUser([ + permissions.uiOrdersCreate.gui, + permissions.uiOrdersView.gui, + permissions.uiOrdersEdit.gui, + ]).then((userProperties) => { + user = userProperties; - cy.login(user.username, user.password, { - path: TopMenu.ordersPath, - waiter: Orders.waitLoading, + cy.login(user.username, user.password, { + path: TopMenu.ordersPath, + waiter: Orders.waitLoading, + }); + }); }); - }); - }); - after(() => { - cy.getAdminToken(); - Orders.deleteOrderViaApi(orderID); - Organizations.deleteOrganizationViaApi(organization.id); - Users.deleteViaApi(user.userId); - }); + after(() => { + cy.getAdminToken(); + Orders.deleteOrderViaApi(orderID); + Organizations.deleteOrganizationViaApi(organization.id); + Users.deleteViaApi(user.userId); + }); - it( - 'C350601 Select Acquisition method from controlled vocabulary list [except tags] (thunderjet)', - { tags: ['criticalPath', 'thunderjet'] }, - () => { - Orders.searchByParameter('PO number', orderNumber); - Orders.selectFromResultsList(orderNumber); - OrderLines.addPOLine(); - OrderLines.fillInPOLineInfoViaUi(); - InteractorsTools.checkCalloutMessage('The purchase order line was successfully created'); - }, - ); + it( + 'C350601 Select Acquisition method from controlled vocabulary list [except tags] (thunderjet)', + { tags: ['criticalPath', 'thunderjet'] }, + () => { + Orders.searchByParameter('PO number', orderNumber); + Orders.selectFromResultsList(orderNumber); + OrderLines.addPOLine(); + OrderLines.fillInPOLineInfoViaUi(); + InteractorsTools.checkCalloutMessage('The purchase order line was successfully created'); + }, + ); + }); + }); }); diff --git a/cypress/e2e/orders/select-random-currancy-in-order.cy.js b/cypress/e2e/orders/select-random-currancy-in-order.cy.js index 5a53860f02..79210ea71a 100644 --- a/cypress/e2e/orders/select-random-currancy-in-order.cy.js +++ b/cypress/e2e/orders/select-random-currancy-in-order.cy.js @@ -15,7 +15,7 @@ import SettingsMenu from '../../support/fragments/settingsMenu'; import TopMenu from '../../support/fragments/topMenu'; import Users from '../../support/fragments/users/users'; -describe('orders: create an order', () => { +describe('Orders', () => { const order = { ...NewOrder.defaultOneTimeOrder }; const organization = { ...NewOrganization.defaultUiOrganizations }; const defaultFund = { ...Funds.defaultUiFund }; diff --git a/cypress/e2e/settings/tenant/service-points-view.cy.js b/cypress/e2e/settings/tenant/service-points-view.cy.js index f22285513f..d8ef729c41 100644 --- a/cypress/e2e/settings/tenant/service-points-view.cy.js +++ b/cypress/e2e/settings/tenant/service-points-view.cy.js @@ -81,6 +81,7 @@ describe('Settings: Tenant', () => { servicePoint: testData.servicePoints[1].name, }); LocationDetails.checkLocationDetails({ servicePoints: testData.servicePoints[1].name }); + cy.wait(1000); // Select the secondlocation, Open Edit form, Check "Service point" dropdown LocationDetails.openEditLocationForm(); diff --git a/cypress/fixtures/marcAuthFileForC375100.mrc b/cypress/fixtures/marcAuthFileForC375100.mrc index c43fd9fe5d..3455b10121 100644 --- a/cypress/fixtures/marcAuthFileForC375100.mrc +++ b/cypress/fixtures/marcAuthFileForC375100.mrc @@ -1 +1 @@ -01857cz a2200325n 4500001000800000005001700008008004100025010001700066035002300083040004600106100009600152380002100248382004400269383001100313384001500324400008000339400007500419400007800494400008100572400008400653400009900737400010000836400009500936400009201031400009801123400008601221670014501307670006401452953001501516428451820141218122416.0830825n| azannaabn |a aaa  an 83130832  a(OCoLC)oca00964013 aDLCbengerdacDLCdDLCdOOCdIEN-MudDLC1 aBeethoven, Ludwig van,d1770-1827.tVariations,mpiano, violin, cello,nop. 44,rE♭ major aVariations2lcsh0 apianon1aviolinn1acellon1s32lcmpt bop. 440 aE♭ major1 aBeethoven, Ludwig van,d1770-1827.t14 Variationen über ein Originalthema1 aBeethoven, Ludwig van,d1770-1827.t14 variations on an original theme1 aBeethoven, Ludwig van,d1770-1827.t14 variations sur un thème original1 aBeethoven, Ludwig van,d1770-1827.tFourteen variations on an original theme1 aBeethoven, Ludwig van,d1770-1827.tQuatorze variations sur un thème original1 aBeethoven, Ludwig van,d1770-1827.tTrios,mpiano, violin, cello,nno. 10, op. 44,rE♭ major1 aBeethoven, Ludwig van,d1770-1827.tVariationen über ein Originalthema,mpiano, violin, cello1 aBeethoven, Ludwig van,d1770-1827.tVariations on an original theme,mpiano, violin, cello1 wnneaaBeethoven, Ludwig van,d1770-1827.tVariations,mpiano trio,nop. 44,rE♭ major1 aC375100 Beethoven, Ludwig van,d1770-1827.tVariations sur un thème original,mpiano, violin, cello1 aBeethoven, Ludwig van,d1770-1827.tVierzehn Variationen über ein Originalthema aBeethoven, L. van. Werke für Klaviertrio [SR] c1982 (a.e.)bcontainer (piano trio, op. 44, E♭ major: 14 variations on an original theme) aKinskyb(op. 44: 14 Variationen (Es-Dur) für Klaviertrio) avk01bvk07 \ No newline at end of file +01881cz a2200325n 4500001000800000005001700008008004100025010001700066035002300083040004600106100010400152380002100256382004400277383001100321384001500332400008000347400007500427400008600502400008100588400008400669400009900753400010000852400009500952400009201047400010601139400008601245670014501331670006401476953001501540428451820141218122416.0830825n| azannaabn |a aaa  an 83130832  a(OCoLC)oca00964013 aDLCbengerdacDLCdDLCdOOCdIEN-MudDLC1 aC375100 Beethoven, Ludwig van,d1770-1827.tVariations,mpiano, violin, cello,nop. 44,rE♭ major aVariations2lcsh0 apianon1aviolinn1acellon1s32lcmpt bop. 440 aE♭ major1 aBeethoven, Ludwig van,d1770-1827.t14 Variationen über ein Originalthema1 aBeethoven, Ludwig van,d1770-1827.t14 variations on an original theme1 aC375100 Beethoven, Ludwig van,d1770-1827.t14 variations sur un thème original1 aBeethoven, Ludwig van,d1770-1827.tFourteen variations on an original theme1 aBeethoven, Ludwig van,d1770-1827.tQuatorze variations sur un thème original1 aBeethoven, Ludwig van,d1770-1827.tTrios,mpiano, violin, cello,nno. 10, op. 44,rE♭ major1 aBeethoven, Ludwig van,d1770-1827.tVariationen über ein Originalthema,mpiano, violin, cello1 aBeethoven, Ludwig van,d1770-1827.tVariations on an original theme,mpiano, violin, cello1 wnneaaBeethoven, Ludwig van,d1770-1827.tVariations,mpiano trio,nop. 44,rE♭ major1 aC375100 Beethoven, Ludwig van,d1770-1827.tVariations sur un thème original,mpiano, violin, cello1 aBeethoven, Ludwig van,d1770-1827.tVierzehn Variationen über ein Originalthema aBeethoven, L. van. Werke für Klaviertrio [SR] c1982 (a.e.)bcontainer (piano trio, op. 44, E♭ major: 14 variations on an original theme) aKinskyb(op. 44: 14 Variationen (Es-Dur) für Klaviertrio) avk01bvk07 \ No newline at end of file diff --git a/cypress/fixtures/marcFileForC387460.mrc b/cypress/fixtures/marcFileForC387460.mrc index aa5b0b63c3..31354e2783 100644 --- a/cypress/fixtures/marcFileForC387460.mrc +++ b/cypress/fixtures/marcFileForC387460.mrc @@ -1 +1 @@ -03779cz a2200493n 450000100070000000500170000700800410002401000310006502400620009602400630015802400560022102400440027702401170032102400550043803500230049304000430051604600150055910000680057437001100064238000760075238000800082838000950090838000840100338000790108738000680116638000770123438600820131138600760139340000910146940000640156040000540162440000780167850001650175650001640192153001880208553001870227366700970246067001340255767000790269167000420277067003980281267000600321095300150327050080420200229074540.0791115n| azannaabn |a aaa  an 79132705 zn 79125030 7 aQ2154102wikidata1http://www.wikidata.org/entity/Q2154108 1http://dbpedia.org/resource/Adventures_of_Huckleberry_Finn7 a1788061362viaf1http://www.viaf.org/viaf/1788061368 1http://worldcat.org/entity/work/id/61327 acdd30e78-a598-45b0-b2ec-6f72c5b41a3c2musicb1http://musicbrainz.org/work/cdd30e78-a598-45b0-b2ec-6f72c5b41a3c#_7 a13561102fast0http://id.worldcat.org/fast/1356110 a(OCoLC)oca00364098 aDLCbengerdacDLCdDLCdOrUdDLCdWaU k18842edtf1 aC387460Twain, Mark,d1835-1910.tAdventures of Huckleberry Finn gUnited States2naf0http://id.loc.gov/authorities/names/n780953301http://id.loc.gov/rwo/agents/n78095330 aC387460Fiction2lcsh0http://id.loc.gov/authorities/subjects/sh85048050 aC387460Novels2lcgft0http://id.loc.gov/authorities/genreForms/gf2015026020 aAction and adventure fiction2lcgft0http://id.loc.gov/authorities/genreForms/gf2014026217 aSatirical fiction2lcgft0http://id.loc.gov/authorities/genreForms/gf2018026115 aAdventure stories2lcsh0http://id.loc.gov/authorities/subjects/sh85001072 aSatire2lcsh0http://id.loc.gov/authorities/subjects/sh85117645 aSocial satire2lcsh0http://id.loc.gov/authorities/subjects/sh2008009879 aAmericans2lcdgt0http://id.loc.gov/authorities/demographicTerms/dg2015060001 aMen2lcdgt0http://id.loc.gov/authorities/demographicTerms/dg20150603591 aC387460Twain, Mark,d1835-1910.tAdventures of Huckleberry Finn (Tom Sawyer's comrade)1 aC387460Twain, Mark,d1835-1910.tAnnotated Huckleberry Finn1 aC387460Twain, Mark,d1835-1910.tHuckleberry Finn1 aTwain, Mark,d1835-1910.tMark Twain's The adventures of Huckleberry Finn1 wriAuthor:aTwain, Mark,d1835-19100http://id.loc.gov/authorities/names/n790211641http://id.loc.gov/rwo/agents/n790211641http://www.wikidata.org/entity/Q72451 wriSequel to:aC387460Twain, Mark,d1835-1910.tAdventures of Tom Sawyer0http://id.loc.gov/authorities/names/n791327041http://www.wikidata.org/entity/Q326914 0wriAdapted as motion picture (work):aAdventures of Huckleberry Finn (Motion picture : 1939)0http://id.loc.gov/authorities/names/no20141119841http://www.wikidata.org/entity/Q2472318 0wriAdapted as motion picture (work):aAdventures of Huckleberry Finn (Motion picture : 1960)0http://id.loc.gov/authorities/names/no20141115351http://www.wikidata.org/entity/Q319115 aURIs added to this record for the PCC URI MARC Pilot. Please do not remove or edit the URIs. aHis Tom Sawyer and Huckleberry Finn, 1979, c1980:bt.p. (containing the complete texts of ... The adventures of Huckleberry Finn) aTwain, M. The adventures of Huckleberry Finn (Tom Sawyer's comrade), 1884. aThe annotated Huckleberry Finn, 1981. aWikipedia, August 22, 2014b(Adventures of Huckleberry Finn (or, in more recent editions, The Adventures of Huckleberry Finn) is a novel by Mark Twain, first published in the United Kingdom in December 1884 and in the United States in February 1885; a direct sequel to The Adventures of Tom Sawyer; genre: Satirical novel; an often scathing satire on entrenched attitudes, particularly racism) aMark Twain's The adventures of Huckleberry Finn, c1975. abe20blk19 \ No newline at end of file +03752cz a2200481n 450000100070000000500170000700800410002401000310006502400620009602400630015802400560022102400440027702401170032102400550043803500230049304000430051604600150055910000680057437001100064238000760075238000800082838000950090838000840100338000790108738000680116638000770123438600820131138600760139340000910146940000640156040000540162440000780167850001650175650001640192153001880208553001870227366700970246067001340255767000790269167000420277067003980281267000600321050080420200229074540.0791115n| azannaabn |a aaa  an 79132705 zn 79125030 7 aQ2154102wikidata1http://www.wikidata.org/entity/Q2154108 1http://dbpedia.org/resource/Adventures_of_Huckleberry_Finn7 a1788061362viaf1http://www.viaf.org/viaf/1788061368 1http://worldcat.org/entity/work/id/61327 acdd30e78-a598-45b0-b2ec-6f72c5b41a3c2musicb1http://musicbrainz.org/work/cdd30e78-a598-45b0-b2ec-6f72c5b41a3c#_7 a13561102fast0http://id.worldcat.org/fast/1356110 a(OCoLC)oca00364098 aDLCbengerdacDLCdDLCdOrUdDLCdWaU k18842edtf1 aC387460Twain, Mark,d1835-1910.tAdventures of Huckleberry Finn gUnited States2naf0http://id.loc.gov/authorities/names/n780953301http://id.loc.gov/rwo/agents/n78095330 aC387460Fiction2lcsh0http://id.loc.gov/authorities/subjects/sh85048050 aC387460Novels2lcgft0http://id.loc.gov/authorities/genreForms/gf2015026020 aAction and adventure fiction2lcgft0http://id.loc.gov/authorities/genreForms/gf2014026217 aSatirical fiction2lcgft0http://id.loc.gov/authorities/genreForms/gf2018026115 aAdventure stories2lcsh0http://id.loc.gov/authorities/subjects/sh85001072 aSatire2lcsh0http://id.loc.gov/authorities/subjects/sh85117645 aSocial satire2lcsh0http://id.loc.gov/authorities/subjects/sh2008009879 aAmericans2lcdgt0http://id.loc.gov/authorities/demographicTerms/dg2015060001 aMen2lcdgt0http://id.loc.gov/authorities/demographicTerms/dg20150603591 aC387460Twain, Mark,d1835-1910.tAdventures of Huckleberry Finn (Tom Sawyer's comrade)1 aC387460Twain, Mark,d1835-1910.tAnnotated Huckleberry Finn1 aC387460Twain, Mark,d1835-1910.tHuckleberry Finn1 aTwain, Mark,d1835-1910.tMark Twain's The adventures of Huckleberry Finn1 wriAuthor:aTwain, Mark,d1835-19100http://id.loc.gov/authorities/names/n790211641http://id.loc.gov/rwo/agents/n790211641http://www.wikidata.org/entity/Q72451 wriSequel to:aC387460Twain, Mark,d1835-1910.tAdventures of Tom Sawyer0http://id.loc.gov/authorities/names/n791327041http://www.wikidata.org/entity/Q326914 0wriAdapted as motion picture (work):aAdventures of Huckleberry Finn (Motion picture : 1939)0http://id.loc.gov/authorities/names/no20141119841http://www.wikidata.org/entity/Q2472318 0wriAdapted as motion picture (work):aAdventures of Huckleberry Finn (Motion picture : 1960)0http://id.loc.gov/authorities/names/no20141115351http://www.wikidata.org/entity/Q319115 aURIs added to this record for the PCC URI MARC Pilot. Please do not remove or edit the URIs. aHis Tom Sawyer and Huckleberry Finn, 1979, c1980:bt.p. (containing the complete texts of ... The adventures of Huckleberry Finn) aTwain, M. The adventures of Huckleberry Finn (Tom Sawyer's comrade), 1884. aThe annotated Huckleberry Finn, 1981. aWikipedia, August 22, 2014b(Adventures of Huckleberry Finn (or, in more recent editions, The Adventures of Huckleberry Finn) is a novel by Mark Twain, first published in the United Kingdom in December 1884 and in the United States in February 1885; a direct sequel to The Adventures of Tom Sawyer; genre: Satirical novel; an often scathing satire on entrenched attitudes, particularly racism) aMark Twain's The adventures of Huckleberry Finn, c1975. \ No newline at end of file diff --git a/cypress/support/fragments/data_import/logs/logsViewAll.js b/cypress/support/fragments/data_import/logs/logsViewAll.js index 1108c45231..024aa92907 100644 --- a/cypress/support/fragments/data_import/logs/logsViewAll.js +++ b/cypress/support/fragments/data_import/logs/logsViewAll.js @@ -409,7 +409,7 @@ export default { .get('#list-data-import') .find('div[data-row-inner="0"]') .find('div[role=gridcell]') - .eq(9) + .eq(8) .invoke('text') .then((text) => { return text; diff --git a/cypress/support/fragments/eholdings/eHoldingsPackages.js b/cypress/support/fragments/eholdings/eHoldingsPackages.js index 6a1f3e2899..01e7d6725a 100644 --- a/cypress/support/fragments/eholdings/eHoldingsPackages.js +++ b/cypress/support/fragments/eholdings/eHoldingsPackages.js @@ -1,3 +1,4 @@ +import { recurse } from 'cypress-recurse'; import { Button, HTML, @@ -244,6 +245,58 @@ export default { }); }, + getPackageViaApi: (packageName) => { + return cy.okapiRequest({ + method: 'GET', + path: 'eholdings/packages', + searchParams: { q: packageName }, + isDefaultSearchParamsRequired: false, + }); + }, + + unassignPackageViaAPI(packageName) { + cy.okapiRequest({ + path: 'eholdings/packages', + searchParams: { q: packageName }, + isDefaultSearchParamsRequired: false, + }).then(({ body: { data } }) => { + const packageData = data[0]; + const { attributes } = packageData; + attributes.isSelected = false; + cy.okapiRequest({ + method: 'PUT', + path: `eholdings/packages/${packageData.id}`, + contentTypeHeader: 'application/vnd.api+json', + body: { + data: { + id: packageData.id, + type: packageData.type, + attributes: { + name: attributes.name, + isSelected: attributes.isSelected, + allowKbToAddTitles: false, + contentType: attributes.contentType, + customCoverage: {}, + visibilityData: { + isHidden: false, + reason: '', + }, + isCustom: attributes.isCustom, + proxy: { + id: 'ezproxy', + inherited: true, + }, + packageToken: {}, + isFullPackage: false, + accessTypeId: null, + }, + }, + }, + isDefaultSearchParamsRequired: false, + }); + }); + }, + createPackageViaAPI(packageBody = defaultPackage) { return cy .okapiRequest({ @@ -253,7 +306,18 @@ export default { body: packageBody, isDefaultSearchParamsRequired: false, }) - .then((response) => response.body); + .then((response) => { + return recurse( + () => this.getPackageViaApi(packageBody.data.attributes.name), + (getPackageResponse) => getPackageResponse.body.data.length > 0, + { + timeout: 60_000, + delay: 1_000, + }, + ).then(() => { + return response.body; + }); + }); }, updateProxy() { diff --git a/cypress/support/fragments/inventory/instanceRecordEdit.js b/cypress/support/fragments/inventory/instanceRecordEdit.js index ba1811c69f..f8ed785395 100644 --- a/cypress/support/fragments/inventory/instanceRecordEdit.js +++ b/cypress/support/fragments/inventory/instanceRecordEdit.js @@ -1,3 +1,4 @@ +import { including, matching, or } from '@interactors/html'; import { Accordion, Button, @@ -11,9 +12,7 @@ import { SelectionList, TextArea, TextField, - including, - matching, - or, + Pane, } from '../../../../interactors'; import InteractorsTools from '../../utils/interactorsTools'; import InventoryInstanceModal from './holdingsMove/inventoryInstanceSelectInstanceModal'; @@ -22,7 +21,7 @@ import InstanceStates from './instanceStates'; const closeButton = Button({ icon: 'times' }); const saveAndCloseButton = Button('Save & close'); const rootSection = Section({ id: 'instance-form' }); -const classificationSection = Section({ label: 'Classification (instance)' }); +const classificationSection = Section({ label: 'Classification' }); const addClassificationButton = classificationSection.find(Button('Add classification')); const actionsButton = Button('Actions'); const identifierAccordion = Accordion('Identifier'); @@ -71,10 +70,10 @@ export default { close: () => cy.do(closeButton.click()), waitLoading: () => { cy.expect([ - Section({ id: 'instance-form' }).exists(), + Pane({ id: 'instance-form' }).exists(), or( - PaneHeader(including('Edit instance')).exists(), - PaneHeader(including('Edit shared instance')).exists(), + Pane({ titleLabel: including('Edit instance') }).exists(), + Pane({ titleLabel: including('Edit shared instance') }).exists(), ), ]); }, @@ -387,7 +386,6 @@ export default { }, getClassificationOptionsList() { cy.do(addClassificationButton.click()); - return cy.then(() => classificationSection .find(Select({ name: 'classifications[0].classificationTypeId' })) .optionsText()); diff --git a/cypress/support/fragments/inventory/inventoryInstance.js b/cypress/support/fragments/inventory/inventoryInstance.js index c1dde01801..92de0cde80 100644 --- a/cypress/support/fragments/inventory/inventoryInstance.js +++ b/cypress/support/fragments/inventory/inventoryInstance.js @@ -492,7 +492,7 @@ export default { editInstance: () => { cy.do(actionsButton.click()); cy.do(editInstanceButton.click()); - InstanceRecordEdit.waitLoading(); + cy.expect(Pane({ id: 'instance-form' }).exists()); return InstanceRecordEdit; }, diff --git a/cypress/support/fragments/invoices/invoices.js b/cypress/support/fragments/invoices/invoices.js index d367241e3f..8848f94236 100644 --- a/cypress/support/fragments/invoices/invoices.js +++ b/cypress/support/fragments/invoices/invoices.js @@ -254,6 +254,40 @@ export default { }); return cy.get('@invoice'); }, + + createInvoiceWithInvoiceLineWithoutOrderViaApi({ + vendorId, + fiscalYearId, + batchGroupId, + invoiceStatus, + fundDistributions, + accountingCode, + subTotal, + releaseEncumbrance, + exportToAccounting, + }) { + this.createInvoiceViaApi({ + vendorId, + accountingCode, + fiscalYearId, + batchGroupId, + invoiceStatus, + exportToAccounting, + }).then((resp) => { + cy.wrap(resp).as('invoice'); + const { id: invoiceId, status: invoiceLineStatus } = resp; + const invoiceLine = getDefaultInvoiceLine({ + invoiceId, + invoiceLineStatus, + fundDistributions, + subTotal, + accountingCode, + releaseEncumbrance, + }); + this.createInvoiceLineViaApi(invoiceLine); + }); + return cy.get('@invoice'); + }, selectFolio() { cy.do([ Button({ id: 'accordion-toggle-button-status' }).click(), @@ -380,6 +414,27 @@ export default { InteractorsTools.checkCalloutMessage(InvoiceStates.invoiceCreatedMessage); }, + createInvoiceFromOrderWithMultiLines(invoice, fiscalYear) { + cy.wait(4000); + cy.do(Button({ id: 'invoice-fiscal-year' }).click()); + cy.wait(4000); + cy.do([ + SelectionOption(fiscalYear).click(), + invoiceDateField.fillIn(invoice.invoiceDate), + vendorInvoiceNumberField.fillIn(invoice.invoiceNumber), + ]); + cy.do([ + batchGroupSelection.open(), + SelectionList().select(invoice.batchGroup), + invoicePaymentMethodSelect.choose('EFT'), + ]); + cy.wait(4000); + cy.do(Button('Save & continue').click()); + cy.wait(4000); + cy.do(saveAndClose.click()); + cy.wait(4000); + }, + createInvoiceFromOrderWithoutFY(invoice) { cy.do([ invoiceDateField.fillIn(invoice.invoiceDate), @@ -797,6 +852,23 @@ export default { InteractorsTools.checkCalloutErrorMessage(errorMessage); }, + canNotApproveAndPayInvoice: (errorMessage) => { + cy.do([ + invoiceDetailsPaneHeader.find(actionsButton).click(), + Button('Approve & pay').click(), + submitButton.click(), + ]); + InteractorsTools.checkCalloutErrorMessage(errorMessage); + }, + + approveAndPayInvoice: () => { + cy.do([ + invoiceDetailsPaneHeader.find(actionsButton).click(), + Button('Approve & pay').click(), + submitButton.click(), + ]); + }, + searchByNumber: (invoiceNumber) => { cy.do([ SearchField({ id: searchInputId }).selectIndex('Vendor invoice number'), @@ -950,6 +1022,10 @@ export default { ); }, + selectInvoiceLineByNumber(total) { + cy.contains(total).click(); + }, + checkFundInInvoiceLine: (fund) => { cy.expect( Section({ id: 'invoiceLineFundDistribution' }) @@ -1003,6 +1079,11 @@ export default { cy.wait(2000); }, + closeInvoiceLineDetailsPane: () => { + cy.do(invoiceLineDetailsPane.find(Button({ icon: 'times' })).click()); + cy.wait(2000); + }, + resetFilters: () => { cy.do(resetButton.click()); cy.expect(resetButton.is({ disabled: true })); @@ -1194,6 +1275,16 @@ export default { .click(); }, + verifyCurrentEncumbrance: (expectedValue) => { + cy.get('#invoiceLineFundDistribution') + .find('div[role="gridcell"]') + .filter(':nth-child(6)') + .each(($el) => { + const text = $el.text().trim(); + expect(text).to.eq(expectedValue); + }); + }, + openPOLFromInvoiceLineInCurrentPage: (polNumber) => { cy.get('#invoiceLineInformation') .find('a') diff --git a/cypress/support/fragments/invoices/modal/approveInvoiceModal.js b/cypress/support/fragments/invoices/modal/approveInvoiceModal.js index 590b3c4b84..19397d6531 100644 --- a/cypress/support/fragments/invoices/modal/approveInvoiceModal.js +++ b/cypress/support/fragments/invoices/modal/approveInvoiceModal.js @@ -64,4 +64,8 @@ export default { : InvoiceStates.invoiceApprovedMessage, ); }, + clickOnlySubmitButton() { + cy.do(submitButton.click()); + cy.expect(approveInvoiceConfirmationModal.absent()); + }, }; diff --git a/cypress/support/fragments/lists/lists.js b/cypress/support/fragments/lists/lists.js index 8f44b4301a..2416ac1055 100644 --- a/cypress/support/fragments/lists/lists.js +++ b/cypress/support/fragments/lists/lists.js @@ -31,6 +31,7 @@ const keepEditingButton = closeModal.find(Button('Keep editing')); const actions = Button('Actions'); const refreshList = Button('Refresh list'); const editList = Button('Edit list'); +const duplicateList = Button('Duplicate list'); const deleteList = Button('Delete list'); const exportList = Button('Export all columns (CSV)'); const testQuery = Button('Test query'); @@ -58,6 +59,19 @@ export default { cy.get('[class^="spinner"]').should('not.exist'); }, + waitForCompilingToComplete() { + cy.wait(1000); + cy.get('[class^=compilerWrapper]').should('not.exist'); + cy.wait(1000); + cy.get('body').then(($body) => { + if ($body.find('div[data-test-message-banner]').length > 0) { + this.viewUpdatedList(); + } else { + cy.log('"View updated list" didn\'t appear'); + } + }); + }, + queryBuilderActions() { this.queryBuilderActionsWithParameters('Users — User — Active', '==', 'True'); }, @@ -90,11 +104,11 @@ export default { }, verifyRefreshListButtonIsDisabled() { - cy.contains('Refresh list').should('be.disabled'); + cy.expect(refreshList.has({ disabled: true })); }, verifyRefreshListButtonDoesNotExist() { - cy.contains('Refresh list').should('not.exist'); + cy.expect(refreshList.absent()); }, confirmDelete() { @@ -122,11 +136,34 @@ export default { cy.wait(2000); }, + duplicateList() { + cy.do(duplicateList.click()); + cy.wait(1000); + }, + + verifyDuplicateListButtonIsActive() { + cy.expect(duplicateList.exists()); + cy.expect(duplicateList.has({ disabled: false })); + }, + + verifyDuplicateListButtonIsDisabled() { + cy.expect(duplicateList.has({ disabled: true })); + }, + deleteList() { cy.do(deleteList.click()); cy.wait(1000); }, + verifyDeleteListButtonIsActive() { + cy.expect(deleteList.exists()); + cy.expect(deleteList.has({ disabled: false })); + }, + + verifyDeleteListButtonIsDisabled() { + cy.expect(deleteList.has({ disabled: true })); + }, + verifyEditListButtonIsDisabled() { cy.expect(editList.has({ disabled: true })); }, @@ -247,6 +284,8 @@ export default { .find(Button(listName)) .click(), ); + cy.wait(1000); + this.waitForCompilingToComplete(); }, verifyListsPaneIsEmpty() { @@ -408,15 +447,6 @@ export default { cy.contains(`List ${listName} saved.`); }, - verifyDeleteListButtonIsActive() { - cy.expect(deleteList.exists()); - cy.expect(deleteList.has({ disabled: false })); - }, - - verifyDeleteListButtonIsDisabled() { - cy.expect(deleteList.has({ disabled: true })); - }, - viewUpdatedList() { cy.wait(1000); cy.contains('View updated list', { timeout: 30000 }).click(); diff --git a/cypress/support/fragments/marcAuthority/marcAuthority.js b/cypress/support/fragments/marcAuthority/marcAuthority.js index 754e85bc24..6df27540f0 100644 --- a/cypress/support/fragments/marcAuthority/marcAuthority.js +++ b/cypress/support/fragments/marcAuthority/marcAuthority.js @@ -274,8 +274,6 @@ export default { .has({ disabled: true }), ); cy.do(saveAndCloseButton.click()); - cy.wait(1500); - cy.do(saveAndCloseButton.click()); cy.expect( Callout( 'This record has successfully saved and is in process. Changes may not appear immediately.', diff --git a/cypress/support/fragments/quickMarcEditor.js b/cypress/support/fragments/quickMarcEditor.js index f45b743fe8..115d0a78cd 100644 --- a/cypress/support/fragments/quickMarcEditor.js +++ b/cypress/support/fragments/quickMarcEditor.js @@ -411,7 +411,7 @@ const holdingsLocationLibrarySelect = holdingsLocationModal.find(Select('Library const holdingsLocationSelectDisabled = holdingsLocationModal.find( Button({ name: 'locationId', disabled: true }), ); -const holdingsLocationSaveButton = holdingsLocationModal.find(Button('Save and close')); +const holdingsLocationSaveButton = holdingsLocationModal.find(Button('Save & close')); const defaultValidLdr = '00000naa\\a2200000uu\\4500'; const defaultValidHoldingsLdr = '00000nu\\\\\\2200000un\\4500'; const defaultValid008Values = { diff --git a/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js b/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js index 2119eacbb5..6fbffbbe22 100644 --- a/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js +++ b/cypress/support/fragments/settings/dataImport/fieldMappingProfile/fieldMappingProfiles.js @@ -41,7 +41,7 @@ const marcAuthorityUpdateMappingProfile = { deletedRelations: [], }; const openNewMappingProfileForm = () => { - cy.wait(1000); + cy.wait(2000); cy.do([actionsButton.click(), Button('New field mapping profile').click()]); }; const mappingProfileForDuplicate = {